Forum Moderators: DixonJones
192.#*$!.83.151 - - [29/Nov/2005:08:13:31 -0700] "GET /thisdoesnotexistahaha.php HTTP/1.1" 301 348 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"
192.xxx.83.151 - - [29/Nov/2005:08:13:32 -0700] "GET /xmlrpc.php HTTP/1.1" 301 333 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"
192.xxx.83.151 - - [29/Nov/2005:08:13:32 -0700] "GET /file/trunk/xmlrpc.php HTTP/1.1" 301 344 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"
192.xxx.83.151 - - [29/Nov/2005:08:13:33 -0700] "GET /log/trunk/xmlrpc.php HTTP/1.1" 301 343 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"
192.xxx.83.151 - - [29/Nov/2005:08:13:37 -0700] "GET /wordpress/xmlrpc.php HTTP/1.1" 301 343 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"
Etc, etc.
Needless to say, these are not my files, and in fact I have no php files on the site. Is anyone here familiar with the exploit that was being demonstrated with this?
[Wed Nov 30 17:35:00 2005] [error] [client 216.abc.def.1] File does not exist: /var/www/html/thisdoesnotexistahaha.php
[30/Nov/2005:17:35:00 -0700] "GET /thisdoesnotexistahaha.php HTTP/1.1" 404 309 "-" "Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.8) Gecko/20051111 Firefox/1.5"
I wondered if it first if the 301 could be from mod_rewrite in htaccess to move non-www to www, but then when I tried it I got a 404 - thus my mystification.
I just checked that search, doh, didn't even try that before, just the /xmlrpc.php and a couple of others. Missed the obvious one. Checking some of them now, so far pretty obscure.
Added: Not much help with those searches, eh? Could it be my server doing it because of the mod_rewrite? It's the standard 301 code recommended here by jc for non-www to www.
And just for the sake of it, I would ensure your tests replicated the originial requests as exactly as possible (use "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)" as the U/A).
Sorry, was just about to add that. No, no errors for when the other IP came in. Also, the last hit after the 301's on the .php pages was a 400 for [29/Nov/2005:08:14:04 -0700] "GET HTTP/1.1" 400 - "-" "-"
There were no pages in the log that were being 301'd to.
>>And just for the sake of it, I would ensure your tests replicated the originial requests as exactly as possible (use "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)" as the U/A).
Just tried that, good thinking, but it still gives a 404.
>The attempts target a limited range of IPs (do you share this IP range?)
No, my site is 69.36.x.x. I've got agile as 204.83.x.x
I don't know if it's some clever hacker looking for vulnerabilities that don't exist on my site (no php), or my server doing something weird with a not-found .php file. If it were returning 404's, I wouldn't mind - I get various hack attempts for windows all the time (I'm on apache).
Added: Of course, at first I thought it was a hijack demonstration on my site, so if it's an attempted php hack, I feel somewhat better.
I'm wondering if it my be a test of whether 404s deliver the correct headers, as if it didn't a 200 response for any page would indicate a vulnerable script, although in reality it wouldn't exist and so there would be no point in the hacker returning to that site, or adding it to the list of potential targets. The fact that it seems to be the first test might confirm that.
The 301 is definitely odd, although I would still suggest this is particular to your website (and very difficult to explain - do you use a custom 404 page?).
Could it be my server doing it because of the mod_rewrite? It's the standard 301 code recommended here by jc for non-www to www.
... most likely.
Just try a "mydomain/thisdoesnotexistahaha.php" with curl and look into your log -- you should see a similar 301.
The 301 is just a status code sent to the client together with another URL. It is up to the client, if it follows the 301 and does another fetch for the 301-ed new URL (as most browsers do) or not (as a bot programmed not to do). This may explain, why you see a single 301 with no following 404, because the bot was simply not following the 301.
Regards,
R.
I'm sure others will see similar entries in their logfiles in the future (the agile hits were recent, might be early-days for it), especially if they're using htaccess mod_rewrite to move non-www to www, or visa-versa. Perhaps, by then, search will again be possible for WW threads and we'll have saved someone some time when they come across this.
The code that is doing it, apparently, follows (examplified):
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST}!^www\.example\.org
RewriteRule (.*) http://www.example.org/$1 [R=301,L]
Request your site by its IP address, and see what you get in your logs, 301 or 404. I see this exploit trying to fetch the same files from my server, accessing it by IP address, e.g. http://128.***.92.***/xmlrpc.php
It gets a 403, though, 'cause I got tired of it... :)
Also, try the WebmasterWorld server headers checker [webmasterworld.com] to see any redirect/error responses one-at-a-time.
[added]
For safety against entering an "infinite" redirect loop if a true HTTP/1.0 client accesses your site, use:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example\.org
RewriteRule (.*) http://www.example.org/$1 [R=301,L]
Jim
Request your site by its IP address, and see what you get in your logs, 301 or 404.
I just tried that. When I entered the URL as IP#//thisdoesnotexistahaha.php.
the server just immediately redirected to www.mysite.org/thisdoesetc.php, with a 404, and the logfile also shows the 404. (My site has a unique/dedicated IP#).
And jd, my apologies for referring to you as "jc" in a previous post - I realized the error soon afterwards - it must be from all the Christmas carols I'm hearing lately ;-) And thanks for the extra line of code - it will be added, merci bien.
(By the way, if anyone wants to experiment, the site it happened to is the one in my profile - don't destroy the thing in the process though ;-)
Added: server headers check on www.mysite.org/thisdoesnotexistahaha.php gives:
HTTP/1.1 404 Not Found
Date: Sat, 03 Dec 2005 04:00:19 GMT
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) PHP/4.3.0
Connection: close
Content-Type: text/html; charset=iso-8859-1
Request http://www.example.com/thisdoesnotexistahaha.php results in 404-Not Found
Request http://example.com/thisdoesnotexistahaha.php results in 301-Moved Permanently redirect
.... to http://www.example.com/thisdoesnotexistahaha.php
Request http://69.36.***.64/thisdoesnotexistahaha.php results in 301-Moved Permanently redirect
.... to http://www.example.com/thisdoesnotexistahaha.php
> the server just immediately redirected to www.mysite.org/thisdoesetc.php, with a 404
... or it appeared to; The 301 response was handled first, followed by a 404 response. It is your browser that must re-request the requested page from the correct domain, so this actually requires two steps. If you want to see accurate results using a browser, you need to do two things: First flush and disable the browser cache, and second, use a VERY slow internet connection. If you don't flush your cache, you won't see the requests in the logs, because your browser will serve them from its local cache instead of fetching them from your server. That's why I suggested using the server headers checker. If you use a reasonably-fast (like 28.8kbps or above) internet connection, the 301 is handled so fast by your browser that all you will be able to see is the 404.
Jim