Forum Moderators: phranque
Error 404 - Page Not Found
Requested URL: [mysite.com...] ? ? ? (forum coding is messing this up, it's .txt with 3 question marks after it with NO spaces)
I believe these are attempted attacks on the server. The URL they reference changes sometimes (matr1mon1o.com is a popular one for these idiots) but, they *always* end with .txt ? ? ? (forum coding is messing this up, it's .txt with 3 question marks after it with NO spaces).
What I'd like to do is have anything accessing ".txt? ? ?" go to an auto ban file (which I have set up and working for other rewriterules). I can't figure out how to make it so that anything with ".txt? ? ?" in it will go to the auto ban, so am asking for help.
I've been googling this for several days. Everything I try either doesn't work or gives me a 500 error. I'm at my wits end so am seeking help from one of you nice guru types.
And Happy New Year BTW.
[edited by: aliceaod at 12:32 pm (utc) on Dec. 31, 2009]
[edited by: jdMorgan at 10:26 pm (utc) on Dec. 31, 2009]
[edit reason] Obscured domains. Please see TOS and Charter. [/edit]
I tried
RewriteRule ^[A-Z]+\ /([^.\ ]*\.)+txt\?\?\?\ [mysite.com...] [NC]
and
RewriteRule ^[A-Z]+\ /([^.\ ]*\.)+txt\?\?\?\ /banme.php [NC]
Then I put in the URL that the attacker was trying to use and I got the usual 404 error instead of being banned.
Thanks for trying to help me tho. Really appreciate it. I think I'll just live with it.
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([^.\ ]*\.)+txt\?\?\?\ HTTP/ [NC]
RewriteRule .* /banme.php [L]
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([^.\ ]*\.)+txt\%3f\%3f\%3f\ HTTP/ [NC]
RewriteRule !^banme\.php$ /banme.php [L]
Jim
I *just* found this while searching the 'net for something un-related and it worked (since the cretins like to also use the expression "=http" in the request). Figures I'd find something, after several days of searching, while trying to find something else!
RewriteCond %{QUERY_STRING} ^.*=(ht¦f)tp\://.*$ [NC]
# Allow yourself, for SMF Forum Package Manager upgrades.
# Set it to your own IP address so you are the only one who won't be blocked.
#RewriteCond %{REMOTE_ADDR} !^111\.222\.333\.444$ [NC]
RewriteRule .* - [F,L]
You can simply ban anything looking for any text file other than robots.txt, or anything that requests any URL with a query string attached, or anything asking for base_folder.php or any combination of those.
The one I found on a page that talks about protecting one's web site was exactly the thing I needed. I was actually looking for how to ban or redirect countries by using geoip when I stumbled upon the article...I saw it mention the =http and realized..eureka! that this is the same thing these cretins use all the time :D The code the author supplied which I posted above works perfectly for the malicious code attempt.
I'm all good to go now, thanks, guys for trying to help. You're living dolls and have a Happy New Year.