# Created by 6Scan plugin
#don't show directory listing and apache information
ServerSignature Off

<IfModule mod_rewrite.c>
RewriteEngine On

#Broad-spectrum protection: User agent/referrer injections. XSS,RFI and SQLI prevention
RewriteCond %{HTTP_USER_AGENT} (<|%3c|>|%3e|'|%27|%00) [NC,OR]
RewriteCond %{HTTP_REFERER} (<|%3c|>|%3e|'|%27|%00) [NC,OR]
RewriteCond %{QUERY_STRING} (<|%3c).*(script|iframe|src).*(>|%3e) [NC,OR]
RewriteCond %{QUERY_STRING} (http(s)?:\/\/|ftp:\/\/|zlib:|bzip2:) [NC,OR]
RewriteCond %{QUERY_STRING} union.*select [NC,OR]
RewriteCond %{QUERY_STRING} (concat|delete|right|ascii|left|mid|version|substring|extractvalue|benchmark|load_file).*\(.*\)	[NC,OR]
RewriteCond %{QUERY_STRING} (into.*outfile) [NC,OR]
RewriteCond %{QUERY_STRING} (having.*--) [NC]
RewriteRule .*  - [E=sixscansecuritylog:1] -

#avoid direct access to the 6scan-gate.php file
RewriteCond %{ENV:REDIRECT_sixscaninternal} !^accessgranted$
RewriteCond %{ENV:sixscaninternal} !^accessgranted$
RewriteCond %{REQUEST_URI} 6scan-gate\.php$
RewriteRule ^(.*)$ - [F]

RewriteRule ^6scan-gate\.php$ - [L]

RewriteCond %{REQUEST_URI} ^/just/a/random/dir/to/avoid/htaccess/mixups\.php$
RewriteRule ^(.*)$ 6scan-gate.php [E=sixscaninternal:accessgranted,L]
</IfModule>
# End of 6Scan plugin