Block/Banned IP

Discussion in 'Programming' started by SoniCute, Mar 22, 2007.

  1. #1
    Anybody know how to block visitor that browse our site using proxy site,I have a lot visitor who come recently but they only spammed and leech the content (download) without give contribution on my site. :mad:
     
    SoniCute, Mar 22, 2007 IP
  2. krzyk

    krzyk Peon

    Messages:
    61
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you can have an htaccess file, then put this in your main .htaccess:
    (Replace the 127.0.0.1 with the ip you wish to block)
    Order allow,deny
    Deny from 127.0.0.1
    Allow from all
     
    krzyk, Mar 22, 2007 IP
  3. koolasia

    koolasia Banned

    Messages:
    1,413
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Best way is too do it by .htacess method or else do it from cpanel
     
    koolasia, Mar 22, 2007 IP
  4. SoniCute

    SoniCute Active Member

    Messages:
    585
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Yes that work,but they come back again with another proxy site :(
     
    SoniCute, Mar 22, 2007 IP
  5. krzyk

    krzyk Peon

    Messages:
    61
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Oh,
    So they use they leech data by providing direct urls to your site or just browse and sometimes download?
     
    krzyk, Mar 22, 2007 IP
  6. SoniCute

    SoniCute Active Member

    Messages:
    585
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    60
    #6
    They come to mysite,give "spam" comments,and download same file everyday more than 4 time,and then after I deleted all spam comment and ban their IP they come back again with different IPs (they browse using proxy site),today I try moving all link download to SSL url,I hope can reduce leecher and spammer,I know out there some proxy site have support SSL page,but not much.
     
    SoniCute, Mar 22, 2007 IP
  7. SoniCute

    SoniCute Active Member

    Messages:
    585
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    60
    #7
    They come to mysite,give "spam" comments,and download same file everyday more than 4 time,and then after I deleted all spam comment and ban their IP they come back again with different IPs (they browse using proxy site),today I try moving all link download to SSL url,I hope can reduce leecher and spammer,I know out there some proxy site have support SSL page,but not much.
     
    SoniCute, Mar 22, 2007 IP
  8. Robert Plank

    Robert Plank Peon

    Messages:
    55
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    The htaccess thing won't work because you're only blocking one IP at a time.

    A quick fix to get rid of the non-anonymous proxies...

    if (isset($_SERVER["HTTP_FORWARDED_FOR"]) || isset($_SERVER["HTTP_X_FORWARDED"])) {
       die("blocked");
    }
    PHP:
    But otherwise all you can do is check for open ports... like...

    $ports = array(80, 81, 8080, 8081);
    
    foreach ($ports as $port) {
       if (fsockopen($_SERVER["REMOTE_ADDR"], $port, $errno, $errstr, 2)) {
          die("blocked: port $port is open");
       }
    }
    PHP:
    You should probably keep a database table keeping track of IP addresses that are free of proxies, to keep your site from slowing down from this.

    If they are spamming you just use a CAPTCHA.
     
    Robert Plank, Mar 22, 2007 IP