Generator for blocking "Bad Traffic"...
Welcome
With this generator you can block nearly every country from accessing your website. Unwanted visitors will be redirected to http://youarebanned.info. It's spezialized in websites programmed with PHP.It's also perfect for Glype, Zelune and PHProxy.
Note: there are problems with the IE8 and this generator. Firefox, older versions of IE, Opera and Safari should do fine.
Advantages:
- You don't need any Database like MySQL or PostgresSQL
- Updates are done by downloading the GeoIP.dat, so you don't need to update a database like MySQL
- You don't need any programming skills
- No complicated RedirectConditions like in .htaccess-files
- You select where to insert the code: people from Germany ;) are spaming your board? Put the code into your login-site.
- People from Saudi Arabia are using your proxy for porn? Put the code on the top of the proxified page. In this case they see your entrysite, perhaps click on advertisment and you block them afterwards.
How it works:
It's based on Maxminds geoip-database. Their database contains the country names and ip ranges. This codegenerator creates a list with the countries you would like to block and redirect.What do I need?
There are two packages you can download:1. Package contains the GeoIP.dat, geoip.inc and the redirect.php with the whole logic. Without the redirect.php this generated code can't work. This package works like a blacklist. Every country you put into the code generator will be block from your page.
Download the package here: Blacklistpackage.zip
GeoIP.dat / geoip.inc License and © by Maxmind
2. Package contains the same file, but works like a whitelist. Every country you put into the code generator will be allowed on your page. Every country, which doesn't match one of the selected countries will be blocked.
Download the package here: Whitelistpackage.zip
GeoIP.dat / geoip.inc License and © by Maxmind
Manual download of the files
1. File (GeoIP.dat ©Maxmind):You can find it on: Click here
Click on "Download the latest GeoLite Country Binary Format" and download the file. Unpack it with Winrar or any other packer.
2. File (geoip.inc ©Maxmind):
The second file is a API for PHP. It contains functions which are making it posible to access the GeoIP.dat-file. Go to: Click here
Click on "Download" under "Pure PHP module" and right-click("Save as...") on "geoip.inc" and download it.
3. File (redirect.php ©youarebanned.info):
And the last file: Redirect.zip
It contains the functions neccessary for checking if the visitor is from one country, which you have banned.
This file does the whole work! So don't forget it! Unpack it with Winrar or any other packer.
[Optional] 4. File (redirect.php ©youarebanned.info):
It is also possible to use this generator as a whitelist. So you just select the countries you want to allow to visit your page. The code of the generator is the same.
You just need this file: Whitelist_Redirect.zip
Now you should upload all files into the SAME DIRECOTRY.
Select the countries you want do block:
Just doubleclick on the country you want to block and the code will be generated. You can select so many countries as you want and it doesn't matter if you clicked on some countries a few times. The blocking will work.Setting the "$pathToNeededFiles"-variable:
1. Example: The file(for example index.php), where you want to insert the code, is in the same directory like the uploaded files, so you don't need to do anything.2. Example: The file(for example index.php), where you want to insert the code, is NOT in the same direcotry like the uploaded files, so we need to change the $pathToNeededFiles.
Example: The uploaded files are in a directory called "functions", so you need to modify the $pathToNeededFiles into $pathToNeededFiles = "/functions/"
Example: The uploaded files are above the directory with your index.php.
Code: $pathToNeededFiles = "../"
Example: The uploaded files are in a directory called "functions" above the directory with your index.php.
Code: $pathToNeededFiles = "../functions/"
Installing the code:
You need to paste the code into the top of your file. For example a index.php:<html>
<head>
<title>yourpage.com</title>
</head>
<body>
<!-- Content of your page -->
</body>
</html>
And here the index.php with the blocking-code:
<?php
$countriesToBlock = array("IR", "IQ", "SA", "CN");
$pathToNeededFiles = "";
include $pathToNeededFiles . "redirect.php";
?>
<html>
<head>
<title>yourpage.com</title>
</head>
<body>
<!-- Content of your page -->
</body>
</html>
VERY IMPORTANT: DO NOT PUT THE CODE AFTER A HTML EXPRESION!
YOU WILL GET AN ERROR! THE CODE HAS TO BE EXECUTED BEFORE THE PAGE SENDS ANY HTML TO THE VISITOR!
Installing the code in Glype (show / hide)
The Glype proxy is using themes. They can be found in the directory "themes".
You need to select the theme you are using. In most cases you will find a file called
"framedForm.inc.php".
Example for the framedForm.inc.php:
Now put the code right behind the php-start-tag in the top of this file.
That's all.
Example for the framedForm.inc.php:
<?php
##############################################
## FRAMED FORM : Displays on proxified pages
##############################################
// Define variables for use in form
$return = urlencode('browse.php?' . $_SERVER['QUERY_STRING']);
?<
Now put the code right behind the php-start-tag in the top of this file.
<?php
$countriesToBlock = array("IR", "IQ", "SA", "CN");
$pathToNeededFiles = "";
include $pathToNeededFiles . "redirect.php";
##############################################
## FRAMED FORM : Displays on proxified pages
##############################################
// Define variables for use in form
$return = urlencode('browse.php?' . $_SERVER['QUERY_STRING']);
?<
That's all.
Installing the code in PHProxy (show / hide)
If you like to install the code in the PHProxy, open the index.php.
Search for the following code (usually line 520):
Insert your code into to do-while-loop:
That should do the trick.
//
// OPEN SOCKET TO SERVER
//
do
{
$_retry = false;
Insert your code into to do-while-loop:
//
// OPEN SOCKET TO SERVER
//
do
{
$countriesToBlock = array("IR", "IQ", "SA", "CN");
$pathToNeededFiles = "";
include $pathToNeededFiles . "redirect.php";
$_retry = false;
That should do the trick.
Installing the code in Zelune (show / hide)
Open the index.php and search for the following expersions (usually line 106):
Put your code directly after the bracket:
function parse_html ($string) {
$parse = array(
Put your code directly after the bracket:
function parse_html ($string) {
$countriesToBlock = array("IR", "IQ", "SA", "CN");
$pathToNeededFiles = "";
include $pathToNeededFiles . "redirect.php";
$parse = array(
Adding new countries manually:
If you like to add more countries, which you want to block, you can use this code generator to create new code. But sometimes you want to add just one or two new countries. This can be done really fast by putting the two-digit country code into the$countriesToBlock = array("IR", "IQ", "SA", "CN");. For example: We want to add Germany
to the blocked countries. The country code for Germany is DE.(See below for more country codes).Now we put the country code into the array:
$countriesToBlock = array("IR", "IQ", "SA", "CN", "DE");It is important to seperate the last entry from the new entry by a comma and to put the country code into quotation marks.
Country code list (show / hide)
| Country code | Country |
|---|---|
| AP | Asia/Pacific Region |
| EU | Europe |
| AD | Andorra |
| AE | United Arab Emirates |
| AF | Afghanistan |
| AG | Antigua and Barbuda |
| AI | Anguilla |
| AL | Albania |
| AM | Armenia |
| AN | Netherlands Antilles |
| AO | Angola |
| AQ | Antarctica |
| AR | Argentina |
| AS | American Samoa |
| AT | Austria |
| AU | Australia |
| AW | Aruba |
| AZ | Azerbaijan |
| BA | Bosnia and Herzegovina |
| BB | Barbados |
| BD | Bangladesh |
| BE | Belgium |
| BF | Burkina Faso |
| BG | Bulgaria |
| BH | Bahrain |
| BI | Burundi |
| BJ | Benin |
| BM | Bermuda |
| BN | Brunei Darussalam |
| BO | Bolivia |
| BR | Brazil |
| BS | Bahamas |
| BT | Bhutan |
| BV | Bouvet Island |
| BW | Botswana |
| BY | Belarus |
| BZ | Belize |
| CA | Canada |
| CC | Cocos (Keeling) Islands |
| CD | Congo, The Democratic Republic of the |
| CF | Central African Republic |
| CG | Congo |
| CH | Switzerland |
| CI | Cote D'Ivoire |
| CK | Cook Islands |
| CL | Chile |
| CM | Cameroon |
| CN | China |
| CO | Colombia |
| CR | Costa Rica |
| CU | Cuba |
| CV | Cape Verde |
| CX | Christmas Island |
| CY | Cyprus |
| CZ | Czech Republic |
| DE | Germany |
| DJ | Djibouti |
| DK | Denmark |
| DM | Dominica |
| DO | Dominican Republic |
| DZ | Algeria |
| EC | Ecuador |
| EE | Estonia |
| EG | Egypt |
| EH | Western Sahara |
| ER | Eritrea |
| ES | Spain |
| ET | Ethiopia |
| FI | Finland |
| FJ | Fiji |
| FK | Falkland Islands (Malvinas) |
| FM | Micronesia, Federated States of |
| FO | Faroe Islands |
| FR | France |
| FX | France, Metropolitan |
| GA | Gabon |
| GB | United Kingdom |
| GD | Grenada |
| GE | Georgia |
| GF | French Guiana |
| GH | Ghana |
| GI | Gibraltar |
| GL | Greenland |
| GM | Gambia |
| GN | Guinea |
| GP | Guadeloupe |
| GQ | Equatorial Guinea |
| GR | Greece |
| GS | South Georgia and the South Sandwich Islands |
| GT | Guatemala |
| GU | Guam |
| GW | Guinea-Bissau |
| GY | Guyana |
| HK | Hong Kong |
| HM | Heard Island and McDonald Islands |
| HN | Honduras |
| HR | Croatia |
| HT | Haiti |
| HU | Hungary |
| ID | Indonesia |
| IE | Ireland |
| IL | Israel |
| IN | India |
| IO | British Indian Ocean Territory |
| IQ | Iraq |
| IR | Iran, Islamic Republic of |
| IS | Iceland |
| IT | Italy |
| JM | Jamaica |
| JO | Jordan |
| JP | Japan |
| KE | Kenya |
| KG | Kyrgyzstan |
| KH | Cambodia |
| KI | Kiribati |
| KM | Comoros |
| KN | Saint Kitts and Nevis |
| KP | Korea, Democratic People's Republic of |
| KR | Korea, Republic of |
| KW | Kuwait |
| KY | Cayman Islands |
| KZ | Kazakhstan |
| LA | Lao People's Democratic Republic |
| LB | Lebanon |
| LC | Saint Lucia |
| LI | Liechtenstein |
| LK | Sri Lanka |
| LR | Liberia |
| LS | Lesotho |
| LT | Lithuania |
| LU | Luxembourg |
| LV | Latvia |
| LY | Libyan Arab Jamahiriya |
| MA | Morocco |
| MC | Monaco |
| MD | Moldova, Republic of |
| MG | Madagascar |
| MH | Marshall Islands |
| MK | Macedonia |
| ML | Mali |
| MM | Myanmar |
| MN | Mongolia |
| MO | Macau |
| MP | Northern Mariana Islands |
| MQ | Martinique |
| MR | Mauritania |
| MS | Montserrat |
| MT | Malta |
| MU | Mauritius |
| MV | Maldives |
| MW | Malawi |
| MX | Mexico |
| MY | Malaysia |
| MZ | Mozambique |
| NA | Namibia |
| NC | New Caledonia |
| NE | Niger |
| NF | Norfolk Island |
| NG | Nigeria |
| NI | Nicaragua |
| NL | Netherlands |
| NO | Norway |
| NP | Nepal |
| NR | Nauru |
| NU | Niue |
| NZ | New Zealand |
| OM | Oman |
| PA | Panama |
| PE | Peru |
| PF | French Polynesia |
| PG | Papua New Guinea |
| PH | Philippines |
| PK | Pakistan |
| PL | Poland |
| PM | Saint Pierre and Miquelon |
| PN | Pitcairn Islands |
| PR | Puerto Rico |
| PS | Palestinian Territory |
| PT | Portugal |
| PW | Palau |
| PY | Paraguay |
| QA | Qatar |
| RE | Reunion |
| RO | Romania |
| RU | Russian Federation |
| RW | Rwanda |
| SA | Saudi Arabia |
| SB | Solomon Islands |
| SC | Seychelles |
| SD | Sudan |
| SE | Sweden |
| SG | Singapore |
| SH | Saint Helena |
| SI | Slovenia |
| SJ | Svalbard and Jan Mayen |
| SK | Slovakia |
| SL | Sierra Leone |
| SM | San Marino |
| SN | Senegal |
| SO | Somalia |
| SR | Suriname |
| ST | Sao Tome and Principe |
| SV | El Salvador |
| SY | Syrian Arab Republic |
| SZ | Swaziland |
| TC | Turks and Caicos Islands |
| TD | Chad |
| TF | French Southern Territories |
| TG | Togo |
| TH | Thailand |
| TJ | Tajikistan |
| TK | Tokelau |
| TM | Turkmenistan |
| TN | Tunisia |
| TO | Tonga |
| TL | Timor-Leste |
| TR | Turkey |
| TT | Trinidad and Tobago |
| TV | Tuvalu |
| TW | Taiwan |
| TZ | Tanzania, United Republic of |
| UA | Ukraine |
| UG | Uganda |
| UM | United States Minor Outlying Islands |
| US | United States |
| UY | Uruguay |
| UZ | Uzbekistan |
| VA | Holy See (Vatican City State) |
| VC | Saint Vincent and the Grenadines |
| VE | Venezuela |
| VG | Virgin Islands, British |
| VI | Virgin Islands, U.S. |
| VN | Vietnam |
| VU | Vanuatu |
| WF | Wallis and Futuna |
| WS | Samoa |
| YE | Yemen |
| YT | Mayotte |
| RS | Serbia |
| ZA | South Africa |
| ZM | Zambia |
| ME | Montenegro |
| ZW | Zimbabwe |
| A1 | Anonymous Proxy |
| A2 | Satellite Provider |
| O1 | Other |
| AX | Aland Islands |
| GG | Guernsey |
| IM | Isle of Man |
| JE | Jersey |
| BL | Saint Barthelemy |
| MF | Saint Martin |