1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

UNWANTED Million+ hits a day on my geolocation script

Discussion in 'Apache' started by hulkster, Nov 14, 2005.

  1. #1
    So years ago I wrote a quick little brower info and geolocation CGI script. The number of hits a day is typically in the hundreds or low thousands ... but it has been dramatically climbing in the last month and is now average a MILLIONS hits/day.

    The source is a wide range of IP address with no referrer/user-agent info ... so my guess is some sort of virus has an embedded "wget" call to my CGI for some misc. info ... and it continues to spread based on the increasing number of IP's and hits I'm seeing. Since I'm fairly certain it is an embedded program calling this page, there really is no point in showing ads/whatever. Read more details on this page

    Any clever ideas on how to handle this short of tossing a 404 back?
     
    hulkster, Nov 14, 2005 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    You try switching to an image base verifier? Wouldn't be hard for someone to part the number you asking for out of the text currently.

    Maybe it's just someone scraping your results.
     
    digitalpoint, Nov 14, 2005 IP
  3. hulkster

    hulkster Peon

    Messages:
    1,705
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I'm actually DROPPING the requests currently (based on no User-Agent) so a 404 is going back to these guys for the last couple of weeks - i.e. there has been nothing for them to scrape! But if my guess is right that it is an embedded virus, it just keeps trying and since it is spreading, the number of inbounds continues.

    I'm using mod_rewrite in the httpd.conf file, so I can't redirect/drop 'em much earlier than that ... just annoying to have all these requests come in.
     
    hulkster, Nov 14, 2005 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    Try 301ing them to a test page. I'm curious if the mechanism follows a redirect or not?
     
    digitalpoint, Nov 14, 2005 IP
  5. hulkster

    hulkster Peon

    Messages:
    1,705
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yep - it follows a 301 ... my guess is there isn't too many "smarts" in this "virus program," so if it is going a curl/wget, it just ends up getting whatever the web server ends up returning.
     
    hulkster, Nov 14, 2005 IP
  6. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #6
    You should play more... if any of the requests come from the same IP address, see if it accepts cookies (and sends it back on a subsequent request).
     
    digitalpoint, Nov 14, 2005 IP
  7. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #7
    One way to fight automated scripts like these is to use this technique:

    1. When you receive a request for the page that has the form to enter the initial data (IP address, etc), calculate the following value:

    random-number, current-timestamp, md5(random-number, current-timestamp, some-secret)

    2. Encode this data as a string and return it with the form as a hidden field

    3. When the form is submitted, a legitimate browser will submit this string and your script will validate the value first by computing the hash and then will make sure that the timestamp is only 1-2 minutes old (whatever time you think is reasonable to fill out and submit the form)

    This should stop all current attempts, until whatever does this smartens up and starts submitting these values.

    J.D.
     
    J.D., Nov 14, 2005 IP
  8. hulkster

    hulkster Peon

    Messages:
    1,705
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I could do all that if this was a "normal human" DDoS ... but it really appears to be machine/program generated ... so what is annoying is that even with the page 404'ed (which I have done), the 1,025,898 (>10/second) incoming requests yesterday generate a lot og log entries - actually two now that it is 404'ed - one in the access_log and one in the error_log ... before, I just 301'ed to a non-existant domain. And since the number of inbound IP's number in the thousands, it would be a challenge to block by IP - heck, the people at those machines probably don't even know this is going on.

    More info and data here where I discuss doing at the host network/firewall level ... or better yet, seeing if my ISP can filter a specific URL at their border router.
     
    hulkster, Nov 15, 2005 IP
  9. RectangleMan

    RectangleMan Notable Member

    Messages:
    2,825
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    210
    #9
    How about killing your site? Change it to another subdomain like safe.yourdomain.com and kill the regular www. Then just redirect your front page to the new site for your regular visitors.
     
    RectangleMan, Nov 20, 2005 IP