Skip to content

Instantly share code, notes, and snippets.

View notfalsedev's full-sized avatar
🤓

Michael v/d Rijt notfalsedev

🤓
View GitHub Profile
@notfalsedev
notfalsedev / .htaccess
Created November 7, 2018 20:06
Block MySQL injections, RFI, base64, etc.
# Block MySQL injections, RFI, base64, etc.
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http:// [OR]
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=(\.\.//?)+ [OR]
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=/([a-z0-9_.]//?)+ [NC,OR]
RewriteCond %{QUERY_STRING} \=PHP[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} [NC,OR]
RewriteCond %{QUERY_STRING} (\.\./|\.\.) [OR]
RewriteCond %{QUERY_STRING} ftp\: [NC,OR]
RewriteCond %{QUERY_STRING} http\: [NC,OR]
RewriteCond %{QUERY_STRING} https\: [NC,OR]
RewriteCond %{QUERY_STRING} \=\|w\| [NC,OR]
@notfalsedev
notfalsedev / .htaccess
Last active March 7, 2018 07:56
Handle Chrome/Firefox cache for CSS and JS files
# Block libwww-perl
SetEnvIfNoCase User-Agent "^libwww-perl*" block_bad_bots
Deny from env=block_bad_bots
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
<Limit GET POST PUT DELETE>
# Required utils
sudo apt-get install apache2-utils
# Run the benchmark
ab -t 10 -c 10 http://webapp.dev/
# Output
This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/