Submit Your Article Forum Rules

Results 1 to 3 of 3

Thread: IP block in .htaccess not working?

  1. #1
    Junior Member
    Join Date
    Dec 2004
    Posts
    5

    IP block in .htaccess not working?

    I sometimes find spammy entries in my error logs - that read something like "GET http://2.2.2.2/cgi-bin/p.35.pl HTTP/1.0" So far I've usually been able to block them in my .htaccess file with this type of entry:

    order allow,deny
    deny from 58.215.87.10
    allow from all

    It has worked well, with one exception - the IP above still appears regularly in my logs with one request every few days. Why can't I block this one, and should I worry about it?

  2. #2
    WebProWorld MVP wige's Avatar
    Join Date
    Jun 2006
    Posts
    3,138

    Re: IP block in .htaccess not working?

    Most likely, there is some other setting that is allowing the bot to circumvent your .htaccess file, and that would be cause for concern. Are you on a shared or dedicated host? Also, can you post an example of the log file entry for the blocked IP?
    The best way to learn anything, is to question everything.
    WigeDev - Freelance web and software development

  3. #3
    Senior Member
    Join Date
    Jan 2008
    Posts
    327

    Re: IP block in .htaccess not working?

    Quote Originally Posted by ragman View Post
    I sometimes find spammy entries in my error logs - that read something like "GET http://2.2.2.2/cgi-bin/p.35.pl HTTP/1.0" So far I've usually been able to block them in my .htaccess file with this type of entry:

    order allow,deny
    deny from 58.215.87.10
    allow from all

    It has worked well, with one exception - the IP above still appears regularly in my logs with one request every few days. Why can't I block this one, and should I worry about it?
    I don't think the problem (yet) is that you have a configuration problem permitting the spammer/bot to bypass your .htaccess file. Generally speaking, if your htaccess file is working properly most of the time it should be working properly all the time.

    The data you posted is a tad incomplete. If you have a couple of complete lines from your error logs and access logs then either post them here or send them to me in a private message. I'll look at them and have a better idea how to resolve the problem.

    Incidentally, if you are not using your cgi-bin you can just as easily block all access to it.

    Without knowing anything about your site and without seeing your server logs I'll just remind you that various hackers, spammers & script kiddies will run scripts searching for specific exploitable directories, files, filetypes, daemons and prepackaged programs running on your server. When they find what they are looking for they will often begin various assaults using proxy servers and/or other IP addresses to mask their identity.

    The best prevention is to make your scripts as bullet proof as possible, limit traffic origins to locations acceptable to you (when possible and practical create rulesets to allow or deny access from certain IP ranges. You can use resources such as Country IP BLocks to create .htaccess files and other access/deny files by country), become as familiar as possible with available logs (on Linux, for example, watch things like your secure, message, access_log & error_log logs on each website you manage and at server level if you are running a dedicated server).

    I'd be more than happy to offer some free assistance or advice.

    Best regards,

    Tech Manager
    I use Country IP Blocks as added security for my networks and servers.

Similar Threads

  1. Block An IP
    By billc in forum IT Discussion Forum
    Replies: 8
    Last Post: 11-15-2007, 03:04 PM
  2. Updated .htaccess to Block spammers / scammers.
    By kgun in forum Internet Security Discussion Forum
    Replies: 5
    Last Post: 02-20-2007, 12:45 PM
  3. Using .htaccess To Block Russia Visitors?
    By TN Todd in forum Graphics & Design Discussion Forum
    Replies: 3
    Last Post: 12-02-2006, 05:15 PM
  4. http://www.superactive.biz what 's working / not working
    By jrobin747 in forum Submit Your Site For Review
    Replies: 3
    Last Post: 02-08-2005, 11:16 PM
  5. .htaccess to block image requests?
    By CLBridges in forum Web Programming Discussion Forum
    Replies: 6
    Last Post: 11-11-2003, 05:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •