How to detect and block all proxy,vpn,tor... visitor on site

AngelG9

Registered Member
Joined
Nov 28, 2018
Messages
98
Reaction score
2
Does anyone have a script that blocks proxy, vpn, tor of visits?
 
There are some copy paste scripts. I have seen here as well. Would be great if someone share plugin solution for this :) .
 
I think you will need a hude list /database of all vpn and proxies. Something that https://www.inboxdollars.com/ uses. Till today, I haven't been able to register in that site because that don't support my country and it u use vpn or proxy, It get banned instantly.
 
I'm currently searching for something similar, I've found a couple of sites, most are paid, and the free ones aren't that great.

Ideally... if theres one site with an API to block all of the above I wouldn't mind paying.
 
You may try to implement getipintel net API, it shows pretty stable good results, but there is always a chance to ban some random real user, so be careful with automatic bans.
 
Yeh also iphub.info which has a free plan of 1000 per day.

You might get some legit users caught up however it depends on your use case and why you want to block those users.
 
Maxmind fraud. Is pay per use and you have like 100k requests for 25usd i think
 
You can just use/query the free maxmind dbs hxxps://dev.maxmind.com/geoip/geoip2/geolite2/ , autoupdate them, and thats all. It flags tor/proxies, but not datacenter IPs.
 
PHP:
<?php
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) || ($_SERVER['HTTP_USER_AGENT']=='') || ($_SERVER['HTTP_VIA']!='')){ die("Proxy server not allowed.");}
$proxy_headers = array('HTTP_VIA','HTTP_X_FORWARDED_FOR','HTTP_FORWARDED_FOR','HTTP_X_FORWARDED','HTTP_FORWARDED','HTTP_CLIENT_IP','HTTP_FORWARDED_FOR_IP','VIA','X_FORWARDED_FOR','FORWARDED_FOR','X_FORWARDED','FORWARDED','CLIENT_IP','FORWARDED_FOR_IP','HTTP_PROXY_CONNECTION');
foreach($proxy_headers AS $x){
if(isset($_SERVER[$x])) die("You're using proxy.");
exit;
}
?>
 
Last edited:
PHP:
<?php
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) || ($_SERVER['HTTP_USER_AGENT']=='') || ($_SERVER['HTTP_VIA']!='')){ die("Proxy server not allowed.");}
$proxy_headers = array('HTTP_VIA','HTTP_X_FORWARDED_FOR','HTTP_FORWARDED_FOR','HTTP_X_FORWARDED','HTTP_FORWARDED','HTTP_CLIENT_IP','HTTP_FORWARDED_FOR_IP','VIA','X_FORWARDED_FOR','FORWARDED_FOR','X_FORWARDED','FORWARDED','CLIENT_IP','FORWARDED_FOR_IP','HTTP_PROXY_CONNECTION');
foreach($proxy_headers AS $x){
if(isset($_SERVER[$x])) die("You're using proxy.");
exit;
}
?>

It doesn't work on anonymous proxy which it does not reveal their forwarding IP address.
 
PHP:
<?php
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) || ($_SERVER['HTTP_USER_AGENT']=='') || ($_SERVER['HTTP_VIA']!='')){ die("Proxy server not allowed.");}
$proxy_headers = array('HTTP_VIA','HTTP_X_FORWARDED_FOR','HTTP_FORWARDED_FOR','HTTP_X_FORWARDED','HTTP_FORWARDED','HTTP_CLIENT_IP','HTTP_FORWARDED_FOR_IP','VIA','X_FORWARDED_FOR','FORWARDED_FOR','X_FORWARDED','FORWARDED','CLIENT_IP','FORWARDED_FOR_IP','HTTP_PROXY_CONNECTION');
foreach($proxy_headers AS $x){
if(isset($_SERVER[$x])) die("You're using proxy.");
exit;
}
?>
[/pThis work!, Thanks so much man
[/QUOTE]
 
Back
Top