PDA

View Full Version : Mini Mods - Prevent guests/users from using proxies at your forum


borbole
02-10-2010, 10:00 PM
This hack will allow you to prevent guests/users from using proxies at your forum. You can dissallow proxies for the forum as a whole or to prevent only registrations with proxies. You can enable and disable it at the Acp of your forum where you can control the settings for the mod.

Note: As you know there is no such way of preventing proxies 100% but it helps a lot. I tested it with a dozen proxies and it stopped 8 of them.

djbaxter
02-11-2010, 09:29 PM
So does this mean all AOL users are blocked?

vb4newb
02-11-2010, 09:30 PM
Clicked installed, voted and nominated, awesome hack and much needed for ban evaders.

KissOfDeath
02-11-2010, 10:36 PM
will this top search engine spiders? the last on i had on vb3 did

Vaupell
02-11-2010, 10:43 PM
guess i wont be visiting either from work,
entire work lan around 5000 employess wont be able to acces.
Every server and computer from "inside" is run through a few proxy gateways.

and im sure there are many many coorperations who run like this to
control in and outs of their net.

Just thinking you might have good intentions and want to block spam etc,
but you also endup blocking users who have good intentions.

EDIT : a little read, the number 2 on this page.
http://www.google.dk/search?hl=da&lr=&rlz=1G1GGLQ_DADK246&defl=en&q=define:Proxy+server&ei=Y6R0S4bqKMjL-QaI8J2fCA&sa=X&oi=glossary_definition&ct=title&ved=0CAwQkAE

Proxy server :
•A hardware server that acts as an intermediary between a work station user and the Internet so that an enterprise can ensure security

vb4newb
02-11-2010, 10:51 PM
Tested this with a few online proxies and worked both times, big thanks. :D

dacho
02-11-2010, 11:46 PM
If I want only prevent only the users ? not guests

borbole
02-11-2010, 11:47 PM
I don''t think that it should have any effect on search engine spiders. What this hack does, is it checks port 80 and 443 for an open reply which indicates that a user is using proxy. It is meant to block the ban evaders as mentioned above or other uers that might have malicious intents when visiting your forum with a proxy.

@vb4newb and @vb4newb, thanks for your comments and for clicking the Install button.

borbole
02-11-2010, 11:50 PM
It kinda prevents the users as well since they will have to load your forum as guests first in order to log in. I could have made it that it affects once you are logged in but I thought this way was better.

barcena
02-12-2010, 04:37 AM
I will love to have this running on my site but unfortunately I will appear myself as behind a proxy, I do have another mod that tells you when somebody is trying to hide the real IP and turns out I'm on the list, and I know I'm not hiding, so as nice as this mod is it will be a real problem since it will prevent legitimate members to log in.

TheSupportForum
02-12-2010, 04:41 AM
would like to see the idea of adding a proxy to a list so that it blocks proxies on a list you give

instead of blocking all proxies

otherwise when i get to work i cant view my own site due to use using the internet through a proxy provided by our county area

or an option to to add or ignore proxies so that some can visit

argothiusz
02-12-2010, 04:47 AM
Just for everyone information, Singapore visitors usually access the web through a gateway proxy. So, if you are using this you may as well block entire country.

alessai
02-12-2010, 09:06 AM
my whole university is running through a proxy, which is the same for many other uni's

borbole
02-12-2010, 09:34 AM
Adding a proxy list would be not so effective as those proxy lists gets update very often. it si more effective this way. Although it might prevent some legit users as stated above. If you are worried about it then I think it would be better to not install the hack.

lemonadesoda
02-12-2010, 02:41 PM
borbole,

I REALLY like the concept. Could you consider having a track, monitor and control system rather than just "block all".

The way it would work is thus:

1./ It would record all proxy attempts AFTER login name is captures, and log the proxy IP as well as the username
2./ The admin would be able to view this tracking list
3./ At any time, the admin can review proxy use ("monitor") and if the user logged in, which username it was ("track")
4./ The admin can select from the list of proxy addresses, and make specific IP's BLACKlisted or WHITElisted
5./ The admin would have an option to set the default as all (unknown) proxies BLACK or WHITE
6./ There would be an option to allow/block guest proxy access

I think that your programming hook is therefore one step later... let people log in first BEFORE running the blocking.

Yes, this requires some manual intervention by the admin to make it work properly. But this is very important for us, since we run a private vB for staff and clients. Clients may be behind proxies. By tracking, I can see who they are and the IP of the proxy. I can then decide to BLACK or WHITE list them. I cant risk blocking clients. I only want to block hackers.

When we have a new client, I could "shields down" until the client has logged in and I have the monitoring data. Then I could "shields up" again.

With this modified tool I would now have a monitoring system to see if people are trying to access via proxies, especially banned users (ex. staff and ex. clients).

borbole
02-12-2010, 03:59 PM
I have tried that before when I coded it for another forum software and due to the proxies lists getting updated dayily it made next to impossible to track them. Whereas like this it works great.

Now, if you want to block people from logging in with a proxy, change the register_start hook to login_process hook and whenever a user logs in with a proxy, it will revert him/her immediately to their real ip.

djbaxter
02-12-2010, 10:34 PM
I have tried that before when I coded it for another forum software and due to the proxies lists getting updated dayily it made next to impossible to track them. Whereas like this it works great.

Works great at what, though? Blocking entire corporations? Entire campuses? All AOL users? Apparently some countries?

It seems to me this is like using nuclear missiles to kill mosquitoes...

vb4newb
02-12-2010, 10:46 PM
I am very happy with it ,I tested it thoroughly and then again my members are all home users
so I think it depends on your target membership, not all forums cater to Large corporations
that use proxies.

ndut
02-12-2010, 11:25 PM
thank you

barcena
02-13-2010, 06:44 AM
borbole,

I REALLY like the concept. Could you consider having a track, monitor and control system rather than just "block all".

The way it would work is thus:

1./ It would record all proxy attempts AFTER login name is captures, and log the proxy IP as well as the username
2./ The admin would be able to view this tracking list
3./ At any time, the admin can review proxy use ("monitor") and if the user logged in, which username it was ("track")
4./ The admin can select from the list of proxy addresses, and make specific IP's BLACKlisted or WHITElisted
5./ The admin would have an option to set the default as all (unknown) proxies BLACK or WHITE
6./ There would be an option to allow/block guest proxy access

I think that your programming hook is therefore one step later... let people log in first BEFORE running the blocking.

Yes, this requires some manual intervention by the admin to make it work properly. But this is very important for us, since we run a private vB for staff and clients. Clients may be behind proxies. By tracking, I can see who they are and the IP of the proxy. I can then decide to BLACK or WHITE list them. I cant risk blocking clients. I only want to block hackers.

When we have a new client, I could "shields down" until the client has logged in and I have the monitoring data. Then I could "shields up" again.

With this modified tool I would now have a monitoring system to see if people are trying to access via proxies, especially banned users (ex. staff and ex. clients).

I'm all for this!!!!

You'r hack idea is great, you have no idea how badly I/we need something like this, but not so drastic though; and I think if you implement lemonadesoda's ideas this will become MOTM in no time!.

borbole
02-13-2010, 12:21 PM
Works great at what, though? Blocking entire corporations? Entire campuses? All AOL users? Apparently some countries?

It seems to me this is like using nuclear missiles to kill mosquitoes...

I don''t think you read my previous post about what it actually blocks and what not. It blocks only those who use the open ports I mentioned and not AOL users or entire countires. For my needs this works great and for others as well. If you don''t like it don''t use it, very simple. Or modify it yourself as you please for personal use :)

borbole
02-13-2010, 12:23 PM
I am very happy with it ,I tested it thoroughly and then again my members are all home users
so I think it depends on your target membership, not all forums cater to Large corporations
that use proxies.

I have coded this for another forum that I use and I haven''t had a problem with aol users. I agree, not all forums cater to Large corporations that use proxies. And most of my members are home users too.

thank you

You are welcome.

borbole
02-13-2010, 12:30 PM
I'm all for this!!!!

You'r hack idea is great, you have no idea how badly I/we need something like this, but not so drastic though; and I think if you implement lemonadesoda's ideas this will become MOTM in no time!.

I had implemented a similiar thing at a mod I have coded for another forum software and it didn''t work for the reasons I posted in my earlier post.

rajubd
02-13-2010, 10:00 PM
Can you improv it to adslock. Like person who use adblocker addon on firefox can't view forum. It will be great addon maybe best addon of the year.

lemonadesoda
02-14-2010, 12:13 AM
I still think the tool is a bit blunt.

Yes, it might be all you need for your forum, but I think to win nominations from the community it needs a little more capability for their needs. Perhaps find a half-way house to the suggesiton I made earlier in post #15?

Anyway, good luck, and I hope you do consider to develop the mod further. It's got a lot of potential. :)

denman75
02-14-2010, 02:29 PM
i had to un install it ,
its was really slowing down my forums and cms
loading times went from 10 seconds back to normal speed

borbole
02-14-2010, 03:39 PM
My hack doesn''t influence the speed performance in any way btw.

netwind
02-25-2010, 11:15 AM
Did you know about "Resource allocation" ? This hack does influence to speed performance.
Each request allocate memory for php (not for you hack directly) and wait up to 2 seconds for normal users with port 80 closed by firewall.
On typical server this can be increase requested memory for two times or more.

MichaelDance
03-05-2010, 02:23 AM
well done can u make it for 3.8 please so i can use it :)

borbole
03-05-2010, 09:17 AM
well done can u make it for 3.8 please so i can use it :)

It should work on a 3.8 forum. Remove the version from the <dependencies> and you should be all set.

Paul M
03-06-2010, 08:41 PM
What this hack does, is it checks port 80 and 443 for an open reply which indicates that a user is using proxy.

Thats not always true at all. Based on that, this mod would block me, since I have stuff running on both those ports from my home connection. The same would apply if I used my work connection.

borbole
03-06-2010, 09:01 PM
Thats not always true at all. Based on that, this mod would block me, since I have stuff running on both those ports from my home connection. The same would apply if I used my work connection.

It is my understanding that 80 and 443 are regular open proxy ports. And if the IP address of the computer is coming from computer that has those ports open means that the user is behind a proxy. But you are right, this is not always 100% true.

http://www.xroxy.com/proxy-80--US-nossl.htm

http://www.xroxy.com/proxy-port-443.htm

sticky
03-11-2010, 04:23 AM
Would I be able to get this but just for registered users? I don't want to block any guests.

borbole
03-11-2010, 06:26 AM
Would I be able to get this but just for registered users? I don't want to block any guests.

Yes.

I would like this compatible with your rep mods so far, is it possible:

http://www.vbulletin.com/forum/showthread.php?319023-reputation-points-in-postbit&p=1795986&viewfull=1#post1795986

I really want to display the reputation and rep power like that, but use your mods with it.

That has nothing to do with my mod.

sticky
03-11-2010, 06:50 AM
Yes.



That has nothing to do with my mod.
So sorry, wrong thread, I apologize.

borbole
03-11-2010, 07:08 AM
No problem at all :)

bigcurt
03-17-2010, 05:34 PM
Hey, thanks for the mod but will this work with 3.8? Please tell me yes haha.

KURTZ
03-18-2010, 11:59 AM
@ borbole: really interesting hack, but i'm wondering about, have this any effect over the crawlers?

borbole
03-18-2010, 12:05 PM
Hey, thanks for the mod but will this work with 3.8? Please tell me yes haha.

The thing is that I don't use vb 3x and wouldn''t know if it work there or not. But tell you what, try to remove this line from the xml file and give it a go, but at your test forum. If it works then install it at your live forum.

<dependency dependencytype="vbulletin" minversion="4.0.0" maxversion="5.0.0" />


@ borbole: really interesting hack, but i'm wondering about, have this any effect over the crawlers?

I don''t think so.

borbole
05-12-2010, 12:52 PM
The 3x version is reelased here:

https://vborg.vbsupport.ru/showthread.php?t=242357

ProFifaLeagues
05-21-2010, 11:55 PM
thanks :) great mod

stevo_s
05-22-2010, 09:15 AM
Hi - How do I install it? I've never installed a mod before. Is it easy to uninstall without damaging the forum?

ProFifaLeagues
05-22-2010, 10:49 AM
very easy mate just login to admin cp and upload the xml file you download above into the add remove products area then goto main vbull options and configure it!

stevectaylor
05-25-2010, 05:07 AM
Will it be detrimental to Facebook connect?

buurman
06-08-2010, 07:16 PM
with a whitelist it would be very interesting....

thanks for the hard work :)

CyberSultan
06-18-2010, 11:15 PM
Installing this prevented me from accessing my own site from home. Said I was behind a proxy. I use Verizon FiOS service. Had to uninstall. :(

elwachiman
06-21-2010, 11:09 PM
can i use for version vb4.0.3?

ARPRDcom
06-22-2010, 03:00 AM
What are those at work doing online ?? Get to work ...lol Just kidding..

For those that have cpanel and AWSTATS you can block the proxies with cpanel and you can see who is using a proxy from AWSTATS...

James

borbole
06-22-2010, 01:42 PM
can i use for version vb4.0.3?

Yes.

DAMINK
07-10-2010, 09:23 PM
This is very useful for my needs.
I simply ban new registrations with proxy and allow registered users to view under proxy.
Very nice and thanks borbole.

borbole
07-11-2010, 03:19 PM
This is very useful for my needs.
I simply ban new registrations with proxy and allow registered users to view under proxy.
Very nice and thanks borbole.

You are welcome. And thank you as well for your feedback/comment :)

demonfatal
07-12-2010, 08:53 AM
Very nice hack!
But please can you add a function for allow some usergroups to use a proxy?

elwachiman
08-04-2010, 10:33 PM
This is very useful for my needs.
I simply ban new registrations with proxy and allow registered users to view under proxy.
Very nice and thanks borbole.
same here good mod tnks man

Blooded
09-17-2010, 03:09 AM
workin perfect :)

borbole
09-17-2010, 08:58 AM
Thank you for your comment guys, appreciate them :)

Delphiprogrammi
09-17-2010, 10:24 AM
nice one but it won't stop proxies that don't send the 'HTTP_X_FORWARDED_FOR' header but those are hard to find well not so hard if you know where to look :D

SEW810
11-26-2010, 03:17 AM
https://vborg.vbsupport.ru/external/2012/01/11.gif Installed
https://vborg.vbsupport.ru/external/2012/01/11.gif Nominated
https://vborg.vbsupport.ru/external/2012/01/11.gif Working on vb 4.0.8 PL 2

Great mod. Thnx

RichieBoy67
12-22-2010, 07:14 AM
Will this work with 4.1?

Thanks

Mo HaRbI
01-11-2011, 04:25 AM
Good work
Downloaded now to try,

Thank you

clauz
01-17-2011, 03:57 PM
Very nice hack. But can you add a whitelist?

PreciseDemise
01-22-2011, 12:05 AM
Superb, thanks =D

onehost
02-14-2011, 12:30 AM
no more updates? You can not make it better if you do not update....

OldSchoolDSL
02-14-2011, 12:43 AM
Installed

Not sure if its working, but I'm not getting any errors either.

4.1.1 :)

OldSchoolDSL
02-14-2011, 12:58 AM
Installed

Not sure if its working, but I'm not getting any errors either.

4.1.1 :)

Seems to be working. Tried to visit my community using a proxy and was denied.

OldSchoolDSL
02-14-2011, 05:41 AM
Seems to be working. Tried to visit my community using a proxy and was denied.

Un-installed :o

This did add to my load and also seemed to block a few valid users (sometimes even me).

Good idea though.

clauz
02-15-2011, 03:32 AM
If a forum user is connected by a router with external management on 80 port then it is considered as proxy... so access denied.
If a user host a web page on that IP address also it is considered as proxy.

No offense, great job but I consider at least a white list as a must.

borbole
02-15-2011, 02:36 PM
No offense, great job but I consider at least a white list as a must.

No offense taken. I will add shortly a white list but that would be a paid mod.

clauz
02-17-2011, 07:39 AM
What about the new users (connected by a router with 80 port management) that want to register the forum?
White list can only be used with a already know IP.

borbole
02-17-2011, 01:24 PM
What about the new users (connected by a router with 80 port management) that want to register the forum?
White list can only be used with a already know IP.

You can add their IP at the white list option.

clauz
02-23-2011, 12:05 PM
How can I add their IP if I don't know it?
I do not know if a user with some IP, using some 80 port router would like to register on my forum.
Yes, I can add it later to the white list but how anybody (random people) can register on my forum?

ArtakEVN
08-15-2011, 01:21 PM
Uninstalled. Some users without proxy can't enter the forum.

iDHKHCM
01-13-2012, 11:41 PM
You can add their IP at the white list option.

where are you paid mods? i went to your site didnt see any? thanks in advance

SᴩiDᴇЯ
01-22-2012, 02:14 PM
Great Mod i love that you are stopping those missarable spammers.

I have just started an awesome Gamers Community Site here: http://XGamesBB.com and spammers are hitting me hard. I don't know why? Maybe it's my awesome looking skin not sure.

If i paid you to add an Exception rule ie, Exclude user groups by their ID, would you do this for me?

Please PM me asap.

Thank you in advance.

HHelp1
01-23-2012, 10:18 PM
Is it work for 4.1.8 ?

steviewonder44
01-23-2012, 10:54 PM
My forum just slowed right down with this and shows half my visitors with error
message

Nirjonadda
02-24-2012, 03:26 PM
Not Supported for 4.1.10

FinalFantasy
11-25-2012, 09:44 AM
Here is a 100% working proxy detection script, hope you can update your mod :)

<?php
//
// Script php : Detection Proxy
// By : lemoussel - Aout 2009
//
//
//
//@error_reporting(E_ALL | E_NOTICE);
@set_time_limit(0);
@error_reporting(E_ALL ^ E_NOTICE);

function get_ip() {
if($_SERVER) {
if($_SERVER['HTTP_X_FORWARDED_FOR'])
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
elseif($_SERVER['HTTP_CLIENT_IP'])
$ip = $_SERVER['HTTP_CLIENT_IP'];
else
$ip = $_SERVER['REMOTE_ADDR'];
}
else {
if(getenv('HTTP_X_FORWARDED_FOR'))
$ip = getenv('HTTP_X_FORWARDED_FOR');
elseif(getenv('HTTP_CLIENT_IP'))
$ip = getenv('HTTP_CLIENT_IP');
else
$ip = getenv('REMOTE_ADDR');
}

return $ip;
}

function detect_proxy($myIP) {
$scan_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'
);

$flagProxy = false;
$libProxy = 'No';

foreach($scan_headers as $i)
if($_SERVER[$i]) $flagProxy = true;

if ( in_array($_SERVER['REMOTE_PORT'], array(8080,80,6588,8000,3128,553,554))
|| @fsockopen($_SERVER['REMOTE_ADDR'], 80, $errno, $errstr, 1))
$flagProxy = true;

// Proxy LookUp
if ( $flagProxy == true &&
isset($_SERVER['REMOTE_ADDR']) &&
!empty($_SERVER['REMOTE_ADDR']) )
// Transparent Proxy
// REMOTE_ADDR = proxy IP
// HTTP_X_FORWARDED_FOR = your IP
if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) &&
!empty($_SERVER['HTTP_X_FORWARDED_FOR']) &&
$_SERVER['HTTP_X_FORWARDED_FOR'] == $myIP
)
$libProxy = 'Transparent Proxy';
// Simple Anonymous Proxy
// REMOTE_ADDR = proxy IP
// HTTP_X_FORWARDED_FOR = proxy IP
else if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) &&
!empty($_SERVER['HTTP_X_FORWARDED_FOR']) &&
$_SERVER['HTTP_X_FORWARDED_FOR'] == $_SERVER['REMOTE_ADDR']
)
$libProxy = 'Simple Anonymous (Transparent) Proxy';
// Distorting Anonymous Proxy
// REMOTE_ADDR = proxy IP
// HTTP_X_FORWARDED_FOR = random IP address
else if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) &&
!empty($_SERVER['HTTP_X_FORWARDED_FOR']) &&
$_SERVER['HTTP_X_FORWARDED_FOR'] != $_SERVER['REMOTE_ADDR']
)
$libProxy = 'Distorting Anonymous (Transparent) Proxy';
// Anonymous Proxy
// HTTP_X_FORWARDED_FOR = not determined
// HTTP_CLIENT_IP = not determined
// HTTP_VIA = determined
else if ( $_SERVER['HTTP_X_FORWARDED_FOR'] == '' &&
$_SERVER['HTTP_CLIENT_IP'] == '' &&
!empty($_SERVER['HTTP_VIA'])
)
$libProxy = 'Anonymous Proxy';
// High Anonymous Proxy
// REMOTE_ADDR = proxy IP
// HTTP_X_FORWARDED_FOR = not determined
else
$libProxy = 'High Anonymous Proxy';

return $libProxy;

}

$ip = get_ip();

echo 'Proxy Server Detection<br>';
echo '=================<br><br>';
$typeProxy = detect_proxy($ip);
echo 'Use Proxy Server : '.$typeProxy.'<br>';
echo '<br>';
echo 'Brief IP Information'.'<br>';
echo '--------------------'.'<br>';
echo 'Your IP : '.$ip.'<br>';
echo 'Language : '.$_SERVER['HTTP_ACCEPT_LANGUAGE'].'<br>';
echo '<br>';
echo 'Detail IP Information'.'<br>';
echo '---------------------'.'<br>';
echo 'HTTP_ACCEPT : '.$_SERVER['HTTP_ACCEPT'].'<br>';
echo 'HTTP_ACCEPT_ENCODING : '.$_SERVER['HTTP_ACCEPT_ENCODING'].'<br>';
echo 'HTTP_ACCEPT_LANGUAGE : '.$_SERVER['HTTP_ACCEPT_LANGUAGE'].'<br>';
echo 'HTTP_ACCEPT_CHARSET : '.$_SERVER['HTTP_ACCEPT_CHARSET'].'<br>';
echo 'HTTP_CONNECTION : '.$_SERVER['HTTP_CONNECTION'].'<br>';
echo 'HTTP_HOST : '.$_SERVER['HTTP_HOST'].'<br>';
echo 'HTTP_KEEP_ALIVE : '.$_SERVER['HTTP_KEEP_ALIVE'].'<br>';
echo 'HTTP_USER_AGENT : '.$_SERVER['HTTP_USER_AGENT'].'<br>';
echo 'REMOTE_HOST : '.@gethostbyaddr($_SERVER['REMOTE_ADDR']).'<br>';
echo 'REMOTE_PORT : '.$_SERVER['REMOTE_PORT'].'<br>';
echo '<br>';
echo 'REMOTE_ADDR : '.$_SERVER['REMOTE_ADDR'].'<br>';
echo 'HTTP_VIA : '.$_SERVER['HTTP_VIA'].'<br>';
echo 'HTTP_X_FORWARDED_FOR : '.$_SERVER['HTTP_X_FORWARDED_FOR'].'<br>';
echo 'HTTP_PROXY_CONNECTION : '.$_SERVER['HTTP_PROXY_CONNECTION'].'<br>';
echo 'HTTP_CLIENT_IP : '.$_SERVER['HTTP_CLIENT_IP'].'<br>';


?>



This is from your No proxy Allowed.xml
if( @fsockopen( $_SERVER['REMOTE_ADDR'], 80, $errstr, $errno, 1 ) || @fsockopen( $_SERVER['REMOTE_ADDR'], 443, $errstr, $errno, 1 ))
{

What if i change it to
if ( in_array($_SERVER['REMOTE_PORT'], array(8080,80,6588,8000,3128,553,554))
|| @fsockopen($_SERVER['REMOTE_ADDR'], 80, $errno, $errstr, 1))
{

the one
05-17-2015, 05:52 AM
Final Fantasy what file do i add that proxy detection script is it my config.php or my htaccess

many thanks

Also this plugin slowed my website down as well how would i stop that from happening can i tweak my settings in WHM

kh99
05-17-2015, 01:11 PM
Also this plugin slowed my website down as well how would i stop that from happening can i tweak my settings in WHM

I looked at the code and it's very simple, so there's no easy tweak for speeding it up. Well, maybe there's a way to have a shorter timeout for fsockopen, if anyone knows how to do that.

You could also only turn on the registration portion. The "Prevent guests visiting your forum" checks in hook global_start, so basically every request, and there doesn't appear to be any check for guests only (but maybe the description meant 'guest' as anyone using your forum, registered or not). Maybe it could be modified to only check when posting (or maybe just check for an http POST).

I don't really understand how this works in general. I think it's been said before in this thread, but it looks like it checks the user's ip for open ports 80 and 443. Maybe a lot of proxies have those ports open, but they're also the default ports used by web servers, so you'd also be blocking anyone with a web server running from their ip (which as people mentioned earlier, could be your own web site, you company's, your isp's, or could just be the admin port on a router).

the one
05-17-2015, 02:19 PM
Would this code work in my htaccess file http://www.blackhatworld.com/blackhat-seo/proxies/335001-how-block-proxy-registrations-my-forum.html#post3066559

Do i just add that to my httacces file in cpanel

I did something like that before but nothing changed.Does it take time for it to start working

Many thanks kh99

Or is there a script i can use and what file do i put it in

Thanks again

the one
05-17-2015, 06:53 PM
Hello can you have a look at this here and i am really sorry for going on about this. http://www.vbulletin.com/forum/forum/general/managing-your-community/327691-block-99-of-proxy-servers

I have added the code to my httacces file in cpanel then checked with 6 different proxy sites and you can still view my forum

My question is should this work straight away or does it take time

kh99
05-17-2015, 07:26 PM
I don't know a whole lot about htaccess (or proxies for that matter), but it should have worked immediately. So you could double check to make sure that you have it in the right place and the htaccess is taking effect. Maybe there's some test rules that you could put in there to check.

I would kind of guess that a proxy service that is made for people to hide where they're coming from would not set http headers to say it's a proxy request, and in that case there wouldn't be any way to block them except to block every ip they could be coming from. But again, I don't know.

JesWhite
02-19-2016, 01:23 PM
Here is a 100% working proxy detection script, hope you can update your mod :)

<?php
//
// Script php : Detection Proxy
// By : lemoussel - Aout 2009
//
//
//
//@error_reporting(E_ALL | E_NOTICE);
@set_time_limit(0);
@error_reporting(E_ALL ^ E_NOTICE);

function get_ip() {
if($_SERVER) {
if($_SERVER['HTTP_X_FORWARDED_FOR'])
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
elseif($_SERVER['HTTP_CLIENT_IP'])
$ip = $_SERVER['HTTP_CLIENT_IP'];
else
$ip = $_SERVER['REMOTE_ADDR'];
}
else {
if(getenv('HTTP_X_FORWARDED_FOR'))
$ip = getenv('HTTP_X_FORWARDED_FOR');
elseif(getenv('HTTP_CLIENT_IP'))
$ip = getenv('HTTP_CLIENT_IP');
else
$ip = getenv('REMOTE_ADDR');
}

return $ip;
}

function detect_proxy($myIP) {
$scan_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'
);

$flagProxy = false;
$libProxy = 'No';

foreach($scan_headers as $i)
if($_SERVER[$i]) $flagProxy = true;

if ( in_array($_SERVER['REMOTE_PORT'], array(8080,80,6588,8000,3128,553,554))
|| @fsockopen($_SERVER['REMOTE_ADDR'], 80, $errno, $errstr, 1))
$flagProxy = true;

// Proxy LookUp
if ( $flagProxy == true &&
isset($_SERVER['REMOTE_ADDR']) &&
!empty($_SERVER['REMOTE_ADDR']) )
// Transparent Proxy
// REMOTE_ADDR = proxy IP
// HTTP_X_FORWARDED_FOR = your IP
if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) &&
!empty($_SERVER['HTTP_X_FORWARDED_FOR']) &&
$_SERVER['HTTP_X_FORWARDED_FOR'] == $myIP
)
$libProxy = 'Transparent Proxy';
// Simple Anonymous Proxy
// REMOTE_ADDR = proxy IP
// HTTP_X_FORWARDED_FOR = proxy IP
else if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) &&
!empty($_SERVER['HTTP_X_FORWARDED_FOR']) &&
$_SERVER['HTTP_X_FORWARDED_FOR'] == $_SERVER['REMOTE_ADDR']
)
$libProxy = 'Simple Anonymous (Transparent) Proxy';
// Distorting Anonymous Proxy
// REMOTE_ADDR = proxy IP
// HTTP_X_FORWARDED_FOR = random IP address
else if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) &&
!empty($_SERVER['HTTP_X_FORWARDED_FOR']) &&
$_SERVER['HTTP_X_FORWARDED_FOR'] != $_SERVER['REMOTE_ADDR']
)
$libProxy = 'Distorting Anonymous (Transparent) Proxy';
// Anonymous Proxy
// HTTP_X_FORWARDED_FOR = not determined
// HTTP_CLIENT_IP = not determined
// HTTP_VIA = determined
else if ( $_SERVER['HTTP_X_FORWARDED_FOR'] == '' &&
$_SERVER['HTTP_CLIENT_IP'] == '' &&
!empty($_SERVER['HTTP_VIA'])
)
$libProxy = 'Anonymous Proxy';
// High Anonymous Proxy
// REMOTE_ADDR = proxy IP
// HTTP_X_FORWARDED_FOR = not determined
else
$libProxy = 'High Anonymous Proxy';

return $libProxy;

}

$ip = get_ip();

echo 'Proxy Server Detection<br>';
echo '=================<br><br>';
$typeProxy = detect_proxy($ip);
echo 'Use Proxy Server : '.$typeProxy.'<br>';
echo '<br>';
echo 'Brief IP Information'.'<br>';
echo '--------------------'.'<br>';
echo 'Your IP : '.$ip.'<br>';
echo 'Language : '.$_SERVER['HTTP_ACCEPT_LANGUAGE'].'<br>';
echo '<br>';
echo 'Detail IP Information'.'<br>';
echo '---------------------'.'<br>';
echo 'HTTP_ACCEPT : '.$_SERVER['HTTP_ACCEPT'].'<br>';
echo 'HTTP_ACCEPT_ENCODING : '.$_SERVER['HTTP_ACCEPT_ENCODING'].'<br>';
echo 'HTTP_ACCEPT_LANGUAGE : '.$_SERVER['HTTP_ACCEPT_LANGUAGE'].'<br>';
echo 'HTTP_ACCEPT_CHARSET : '.$_SERVER['HTTP_ACCEPT_CHARSET'].'<br>';
echo 'HTTP_CONNECTION : '.$_SERVER['HTTP_CONNECTION'].'<br>';
echo 'HTTP_HOST : '.$_SERVER['HTTP_HOST'].'<br>';
echo 'HTTP_KEEP_ALIVE : '.$_SERVER['HTTP_KEEP_ALIVE'].'<br>';
echo 'HTTP_USER_AGENT : '.$_SERVER['HTTP_USER_AGENT'].'<br>';
echo 'REMOTE_HOST : '.@gethostbyaddr($_SERVER['REMOTE_ADDR']).'<br>';
echo 'REMOTE_PORT : '.$_SERVER['REMOTE_PORT'].'<br>';
echo '<br>';
echo 'REMOTE_ADDR : '.$_SERVER['REMOTE_ADDR'].'<br>';
echo 'HTTP_VIA : '.$_SERVER['HTTP_VIA'].'<br>';
echo 'HTTP_X_FORWARDED_FOR : '.$_SERVER['HTTP_X_FORWARDED_FOR'].'<br>';
echo 'HTTP_PROXY_CONNECTION : '.$_SERVER['HTTP_PROXY_CONNECTION'].'<br>';
echo 'HTTP_CLIENT_IP : '.$_SERVER['HTTP_CLIENT_IP'].'<br>';


?>

This is from your No proxy Allowed.xml
if( @fsockopen( $_SERVER['REMOTE_ADDR'], 80, $errstr, $errno, 1 ) || @fsockopen( $_SERVER['REMOTE_ADDR'], 443, $errstr, $errno, 1 ))
{What if i change it to
if ( in_array($_SERVER['REMOTE_PORT'], array(8080,80,6588,8000,3128,553,554))
|| @fsockopen($_SERVER['REMOTE_ADDR'], 80, $errno, $errstr, 1))
{


thanks but i didnt understand..
what is the name of php script? and others? where will we upload etc..