Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: blocking IP's

  1. #1
    New Coder
    Join Date
    Aug 2005
    Posts
    73
    Thanks
    12
    Thanked 0 Times in 0 Posts

    blocking IP's

    Strange question I know, but is there any way I can block certain IP's from visiting a website (a paid host, not my own machine!).

    On a slightly different angle, most ISP's block certain ports because they are known to be trouble in terms of spreading worms and virii etc. Should web hosts adopt a similar attitude, and if so, is it possible for a host to easilty bloack access to their servers on particular IP's?

    I speak from the perspective of someone who's sick of clearing spam from a guestbook that's been left there by some kind of script (related to freeyaho.com - don't visit the site unless you are NOT still using the MSVM, and are reasonably well protected, including a pop-up blocker. It's dodgy, and I don't know what it's serving up altogether), and have recently found that someones taken to signing up to my phpbb2 forum just to leave a spam website as their profile homepage. I'm sure that someone somewhere knows where this stuff tends to come from.

  • #2
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can use .htaccess to block IP's. You would do something like this -

    order allow,deny
    deny from 127.0.0.1
    allow from all


    Where the IP is their IP of course.

    You can do a range of IP's I think but I've forgotten how to do that. Be careful though, you may block innocent users.

  • #3
    Senior Coder JamieR's Avatar
    Join Date
    Oct 2004
    Location
    United Kingdom
    Posts
    3,161
    Thanks
    0
    Thanked 5 Times in 5 Posts
    You can do it via .htaccess or PHP. Only thing with PHP is you have to include the script on every page.

  • #4
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    did you check they always use the same IP? or are you planing on denying IP-ranges?
    it would surprise me that they'd use a fixed IP.

    and are you trying to prevent these users from accessing your site, or that they can automatically post to your guestbook? automatic posts can be prevented by using a security-image they need o type over. This is fairly simple. trying to prevent people from posting, without using a loginform and strict rules about creating an account (like: they need to post a request by tradidional mail, or they need to be refered by a trusted user or something like that) is a lott harder.

    if they always post the same or similar messages, then you can build some sort of filter to detect and block them, but else, i think your best option is to set up a convinient admin-screen that shows all new entrys with an option to validate or delete them.
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #5
    New Coder
    Join Date
    Aug 2005
    Posts
    73
    Thanks
    12
    Thanked 0 Times in 0 Posts
    I haven't yet checked the IP's on the latest lot of spam recieved if I'm honest. I did check the webstats for referrers just quickly though, one of which was quite literally "xxxx://xxxxxxxx.xxx", which is quite obviously a little suspicious.

    On the previous bout of guestbook spam, it did all seem to come from the same few web pages...

    http://dimattic.com/uni.cgi
    http://umax-search.net/post/uni.cgi
    http://umax-search.net/post/umax.cgi
    http://www.mywebsearch.com/jsp/GGmain.jsp
    http://umax-search.net/post/post.cgi

    ...though they all seem to point to the same thing these days - they used to point to various pages of odd looking submission forms that repeated across the screen.
    (treat these links just as the one gave originally - with caution)

    Oh well. It looks like I may just have to learn php after all (not really got the time for learning php right now, but if needs must...).
    Last edited by rhia; 09-20-2005 at 01:15 AM.


  •  

    Posting Permissions

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