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.
  2. Better Analytics for WordPress Get It Free

Solution:How to block countries/bad traffic from you site with code generator

Discussion in 'Programming' started by mithras, Aug 26, 2009.

  1. #1
    I´ve created a service which should make the life of webmaster easier.

    Everyone has to fight with bad traffic. So I created a generator and some scripts to help all of us.

    This is a easy to use and easy to install solution based on the well known GeoIP database. The point is: you don't need to run
    a SQL database to use this service.

    And YOU choose where to put the code.
    This point is very important, because you can put the code on the proxied page. So the unwanted visitor sees your startpage,
    perhaps clicks on your adds and then goes to the proxied page.
    Here he gets redirected to the infosite http://youarebanned.info and your proxy don't fetch any data from the targeted site.
    So you can get money from adds and you don't have a problem with bad traffic!
    More infos on the site.

    Here is the link to the site, where you can get your code and further instructions:
    http://www.youarebanned.info/webmasters.php

    I´m awaiting some feedback from you and I am hopping it works for your site =)
    Greetings Mithras

    P.S. use Firefox...IE8 has some problems with javascript
     
    mithras, Aug 26, 2009 IP
  2. kblessinggr

    kblessinggr Peon

    Messages:
    539
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #2
    By the way if you just want to stop traffic from say China, Korea and Russia, you can setup your ipTables or .htaccess with the information below, no sense in wasting bandwidth on em.

    Original Site:
    Okean - The Goods

    .htaccess method
    Okean - CNKR htaccess

    iptables method (though what I did was remove all the --dport 25 so it would block all ports)
    China/Korea Blocking with Linux iptables

    There seems to be other lists setup on the site such as Cisco ACL rules. And it seems to be updated regularly for Chinese/Korean blocks.

    And if you really feel the need:

    Russian block list : Block Blog Spammers & Hostile Servers in Russia with a Linux Iptables Blocklist
    and
    Nigerian block list : Block Nigerian Scammers From Your Server, with a Linux Iptables Blocklist

    Your method won't block the chinese and korean hackers from randomly snooping into folders on someone's site, such as trying to find wordpress exploits and so forth, and most people trying to edit their wordpress file will break it.
     
    Last edited: Aug 26, 2009
    kblessinggr, Aug 26, 2009 IP
  3. kblessinggr

    kblessinggr Peon

    Messages:
    539
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Ahh I see what you're doing,

    You're trying to offer a service that will take ineligible traffic and send it somewhere else. It still seems a tad difficult for the people you are targeting, plus redirection to your site means you get to see the campaigns they were running based on the referrer to your site.

    With KBLinker, a user simply has to create a link via the manager (which is hosted on their own site), the redirection occurs in the link itself, so instead of sending them to a single site the user could actually send for example all Canadian users to a canadian offer if they somehow clicked on a US-only link. But can also filter by IP, referer (ie: send facebook reviewers to an easily approved page). Also KBLinker doesn't require the MaxMind Geolite IP database, it can use it as an option, but it can also use geoplugin, infodb and one other geotargeting so that there's no other installation required than the redirect link.

    Your method requires a bit of code editing (especially when you got non-coder affiliates trying to use it), mine just requires pasting a link on a site, or providing the publisher with a direct link.

    Also why turn away bad traffic to a "you're banned" page, when you can turn bad traffic into money by instead sending them to an offer thats elgible.
     
    kblessinggr, Aug 26, 2009 IP
  4. mithras

    mithras Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The point is the following.
    If you use a .htaccess file, this countries can't see your page.

    For example: you are a webmaster of a board like digitalpoint.com...
    And the chinease are spaming it. Instead of blocking the chinease completly, you put the generated code into the loginpage. So, the chinease can visit your site and read the threads without spaming your board.

    As I said: YOU CHOOSE WHERE TO PUT THE CODE!
    So people can visit your site and click on your advertisment. My solution includes the possibility to earn money with unwanted countries.
     
    mithras, Aug 26, 2009 IP
  5. kblessinggr

    kblessinggr Peon

    Messages:
    539
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I've never had 'viewing' traffic from china, 99.99% of the time its hack attemps, 'feeling' around for exploits and such, or spamming port 25.

    Also saying "you choose where to put the code" kind of goes against your statement "no programming knowledge needed".

    Putting a block of code at the top of a landing page is easy enough... its not going to be for your general target to know how to modify wordpress or any other scripts for this.

    And the Geolite code is simply this (with geoip.inc from here and GeoIP.dat from here):

    
    include("geoip.inc");
    $gi = geoip_open("GeoIP.dat",GEOIP_STANDARD);
    $addr = $_SERVER["REMOTE_ADDR"];
    $geo_code = geoip_country_code_by_addr($gi, $addr);	
    
    //country codes seperated by space
    $banned = "CA TW IT";
    
    if(strpos($banned, $geo_code) !== false)
    {
       echo "banned";
       //or you can put header("location: http://www.destination.com"); here
       exit();
    }
    
    PHP:
     
    kblessinggr, Aug 26, 2009 IP
  6. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    46
    Best Answers:
    0
    Trophy Points:
    0
    #6
    If you want to allow people to easily choose where the script should execute, you may want to look at auto_prepending a specific PHP file via .htaccess:

    php_value auto_prepend_file "blocker.php"
    Code (markup):
    In it, you could use a simple list of user defined pages that should be blocked:

    wordpress/*
    bla/signup.php
    
    Code (markup):
    etc, which you then convert to regex format.
     
    premiumscripts, Aug 26, 2009 IP
  7. mithras

    mithras Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    The target are webmasters and not normal users. Especially webproxy webmasters.
    We have realy much traffic from countries we can not monetize.
    Perhaps your right. I should remove the "no programming knowledge needed".
    I don't rush anybody to use my service :)
     
    mithras, Aug 26, 2009 IP
  8. kblessinggr

    kblessinggr Peon

    Messages:
    539
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Most webmasters would know how to do what Premium and I said :D.

    Also the only reason I'm giving you a hard time is that you're spamming from post #1 (of the 3 posts so far), probably no intention to contribute to the community.
     
    kblessinggr, Aug 26, 2009 IP
  9. mithras

    mithras Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Yes I was spaming not intentionaly. I copied this from another forum, where I posted it. And because I'm a new user I couldn't edit my post.
     
    mithras, Aug 26, 2009 IP