ProxyPeeper v0.01a 12-28-2012, 11:36 AM
#1
So ive decided to get back into some more programming/hacking/web development... havent done much in the last couple years at all.
So for my first small simple project ive got this: ProxyPeeper. Basically it checks to see if the user is connecting to your site via common open proxies. More are also added easily.
I dont really have a use for this script myself. But it was something i havent done before nor have i seen in use... so i thought id see how efficient something like this was.
Pretty basic right now... but i was considering the possibility of adding database support, so instead of checking every single connection, it would put a list of previously checked/approved/denied ips in a database (for regular users) and check that first.
Basically it would make it much more difficult for a banned user to use an open proxy to harass you. Might even just enable it after you encounter a problem user.
And here would be an example usage
Let me know what you think. Got a suggestion to improve efficiency?
So for my first small simple project ive got this: ProxyPeeper. Basically it checks to see if the user is connecting to your site via common open proxies. More are also added easily.
I dont really have a use for this script myself. But it was something i havent done before nor have i seen in use... so i thought id see how efficient something like this was.
Pretty basic right now... but i was considering the possibility of adding database support, so instead of checking every single connection, it would put a list of previously checked/approved/denied ips in a database (for regular users) and check that first.
Basically it would make it much more difficult for a banned user to use an open proxy to harass you. Might even just enable it after you encounter a problem user.
PHP Code:
<?php
#
# ProxyPeeper
# Check to see if user is accessing site
# through an open proxy
#
# written by Geoff
# freakyg@undergroundsystems.co
# Dec. 29 / 2012
# Version 0.01a
#
function isproxy() {
$ip = $_SERVER['REMOTE_ADDR'];
$ports = array(80, 1080, 3128, 8080);
$success = 0;
foreach ($ports as $port) {
$attempt = @fsockopen($ip, $port,$errno,$errstr,$timeout=5);
if (is_resource($attempt)) {
$success = $success + 1;
if ($success >= 0) {
return 1;
fclose($attempt);
}
else {
return 0;
fclose($attempt);
}
}
else {
return 0;
fclose($attempt);
}
}
}
?>And here would be an example usage
PHP Code:
<?php
@include 'isproxy.function.php';
if(isproxy() == 1) {
echo "Open Proxy Detected - Banned";
}
else {
echo "Connection Accepted";
}
?>Let me know what you think. Got a suggestion to improve efficiency?

![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)