Forum

> > Off Topic > Proxy Detector
Forums overviewOff Topic overviewLog in to reply

English Proxy Detector

17 replies
To the start Previous 1 Next To the start

old Proxy Detector

Apache uwu
User Off Offline

Quote
--testing is over--

Thanks to everyone who participated.

As said, I will release the source, it's not impressive, but it's nice to filter out most of the open proxies.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
	function is_proxy($ip) {
		if (file_exists("safe/".$ip)) {
			return false;
		} elseif (file_exists("unsafe/".$ip)) {
			return true;
		}
		$raw=file_get_contents("http://en.m.wikipedia.org/wiki/Special:BlockList?limit=1&wpTarget=".$ip,false,stream_context_create(array('http'=>array('method'=>"GET",'header'=>"User-Agent: PHP\r\n"))));
		if (strpos($raw,"The requested IP address or username is not blocked.")) {
			fclose(fopen("safe/".$ip, 'w'));
			return false;
		}
		fclose(fopen("unsafe/".$ip, 'w'));
		return true;
	}
	if (is_proxy($_SERVER["REMOTE_ADDR"])) {
		echo "You have been detected as an open proxy, if you believe this is an error please contact the site administrator.";
	} else {
		echo "Welcome! Site content will be shown here.";
	}
?>

If you are a proxy it should indicate that you aren't allowed to use this website, and if not it should show a welcome message.
edited 1×, last 10.03.12 10:29:23 pm

old Re: Proxy Detector

0a
User Off Offline

Quote
So I guess, you've blacklisted some of proxy servers? Because I can acess it with some lesser-known proxy servers.

old Re: Proxy Detector

Apache uwu
User Off Offline

Quote
Well of course there is no fool-proof method, a proxy server is just a normal computer.

old Re: Proxy Detector

oxytamine
User Off Offline

Quote
But your one is bad.
1
Googlebot/2.1 (+http://www.google.com/bot.html)
Use this.
Spoiler >

old Re: Proxy Detector

Apache uwu
User Off Offline

Quote
I don't see how getting the real ip is relevant, unless you're comparing it to the request.

ex. if real_ip does not equal remote_addr then act as if it were a proxy

As for the user_agent, it doesn't matter either √

old Re: Proxy Detector

oxytamine
User Off Offline

Quote
user Apache uwu has written
As for the user_agent, it doesn't matter either √

It does matter a lot. It's much easier to spam/brute-force using Google's user agent.

old Re: Proxy Detector

Apache uwu
User Off Offline

Quote
They get billions of requests a day, I doubt it matters, besides my php script uses HTTP 1.0, where as google does not.
To the start Previous 1 Next To the start
Log in to replyOff Topic overviewForums overview