Is it possible to ban all ips that attempt to access a specific directory?

Discussion in 'PHP' started by allthewhile, Feb 7, 2006.

  1. #1
    I've had a moveable type blog up for quite a while on my server that I didn't realize was being harvested for comment spam. I removed the blog but now get TONS of hits to the directories that I've deleted. Is it possible to just ban any ip that attempts to access the following directory:

    http://www.mywebsite.com/mt/
     
    allthewhile, Feb 7, 2006 IP
  2. Smyrl

    Smyrl Tomato Republic Staff

    Messages:
    13,740
    Likes Received:
    1,702
    Best Answers:
    78
    Trophy Points:
    510
    #2
    can you password protect the directory? Would that help?

    Shannon
     
    Smyrl, Feb 7, 2006 IP
  3. fsmedia

    fsmedia Prominent Member

    Messages:
    5,163
    Likes Received:
    262
    Best Answers:
    0
    Trophy Points:
    390
    #3
    fsmedia, Feb 7, 2006 IP
  4. FeedBucket

    FeedBucket Well-Known Member

    Messages:
    159
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #4
    Maybe use a custom 40x that writes to htaccess.
     
    FeedBucket, Feb 8, 2006 IP
  5. allthewhile

    allthewhile Peon

    Messages:
    118
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I didn't only want to disallow, but wanted to ban that ip. Thanks for the tips, guys.
     
    allthewhile, Feb 8, 2006 IP
  6. legend2

    legend2 Well-Known Member

    Messages:
    1,537
    Likes Received:
    74
    Best Answers:
    0
    Trophy Points:
    115
    #6
    easy.
    make an index.php page in that directory, get the user ip then shell_exec an iptable rule that drops any packet from that ip.
     
    legend2, Feb 8, 2006 IP