Proxy Blocker

Started by simmaster, December 21, 2009, 04:47:52 AM

Previous topic - Next topic

simmaster

Link to Mod

Proxy Blocker Mod by simmaster07

Compatibility:
SMF 1.1
SMF 2.0

Configuration:
SMF 1.1: Features and Options
SMF 2.0: Configuration > Modification Settings

Killswitch:
If you are blocked from your own forum, add
$kill_proxyblocker = true;
somewhere into your Settings.php file.

The Proxy Blocker mod allows you to disable users on proxies from registering or viewing the entire forum altogether. This helps prevent banned users from trying to re-register, or spambots from trying to use proxies to attack, with the disadvantages of blocking school/corporate connections that use proxies, cell phones and primitive browsers.

Tested on proxies:
* HideMyAss
* ProxEasy
* The-Cloak
* Proxify
* WinkProxy

Tested on browsers:
* Google Chrome
* Mozilla Firefox 3.5
* Microsoft Internet Explorer 8

Changelog

[+] - Added feature
[-] - Removed feature
[*] - Bugfix
[%] - Security patch/new blocked proxy

v1.0
[+] Created mod from core code

v1.0.1
[*] Removed brackets { } to make code more consistent with SMF style
[*] Removed one condition that caused regular clients to be killed off

v1.1
[%] Blocks Tor exit nodes
[+] Now 1.1 compatible
[*] Caching hostname into variable
[*] Prevent run-on language strings by placing new language strings on a new line
[+] Added language strings:
     [++] Spanish (PARTIAL)
     [++] Spanish-UTF8 (PARTIAL)
     [++] English-UTF8
     [++] English_GB
     [++] English_GB-UTF8
[+] Block the entire forum
[+] Setting control

v1.1.1
[*] Condense file edits
[*] Complete Spanish translations (thanks to DrHouse and qtime!)

v1.1.2
[*] Code edits suggested by Arantor for performance

v1.1.3
[*] Stops flooding the error logs in 2.0

v1.1.4
[*] modSetting variables are now checked with empty()
[+] Kill switch in Settings.php file in case you get blocked
[+] Redirect to settings on installation
[+] Include a readme


Translations:

  • English
  • English-UTF8
  • English-GB
  • English-GB-UTF8
  • Spanish-ES
  • Spanish-ES-UTF8

Please translate:

$txt['on_proxy'] = 'Sorry, but the administrator has blocked registration from proxies. Other causes of this error include using an intranet (school connections), registering on a cell phone, or using a browser that does not support compression or does not accept encoding.';
$txt['proxyblock_reg'] = 'Block registration if using proxy';
$txt['proxyblock_index'] = 'Block forum if using proxy';


Planned Features:

  • List captured proxies (Planned for 1.2)

Special Thanks to:

  • Arantor - for practically being my mentor in making this mod
  • qtime - for Spanish-ES translation
  • DrHouse - for Spanish-ES translation
  • lexa90 - for Serbian-Cyrillic translation

This mod makes no template edits and should work on all SMF 1.1/2.0 forums on any themes that aren't modded excessively.

Boby_


Arantor

* The Grinch thinks it probably wouldn't work on Tor because of how Tor works... but hasn't tested it on that. I just tested it on The Cloak and the above two.

BrianVB

This is really a great mod, thanks! ;)

DoctorMalboro

I ♥ U!!!  ;D thank you soo much!!!

spanish translation

$txt['on_proxy'] = 'Lo sentimos, el administrador bloqueo el registro desde este proxy. si usted nunca tuvo acceso a este foro, el problema se debe a una conexión local, uso desde un celular o imcompatibilidad por parte de su navegador.';

Arantor

English-UTF8, English_British and English_British-UTF8 all use the same wording as your existing one, btw.

Vekseid

Quote from: Boby_ on December 21, 2009, 08:03:15 AM
Sounds useful.
Have you tested it on http://www.torproject.org/ ?

You can check for this by looking up tor-exit in the hostname.

Really, between that, this and say, checking for IE 6 or under, you could stop most spam by requiring such users to prove that they are human. I don't really want to block such registrations entirely : /
Adult Role Playing Forums - - Over five million posts - - Elliquiy's LAMP configuration (maybe NSFW)

Blog about Forums and Servers - - Twenty things to make Simple Machines Forum go faster

Private/Instant Message requests for free support will be ignored.

simmaster

#7
Thanks for the translations. They will be added ASAP and will add them into the next patch (1.0.2)

@Vekseid: It's not just the fact that they need to prove that they're human. Some webmasters (like myself) would prefer blocking proxies in their entirety so banned members don't rise from the dead, spambots don't attack continuously, etc.

@The Grinch: I will test it on Tor and post my results. If it fails, I'll try patching it up.

Vekseid

Yes, but if I wanted to block all access I would have done years ago.

Err, just match for tor-exit in the hostname, I mean. You'll want to do a hostname lookup for that though. Tor exit nodes don't have port 80 open.
Adult Role Playing Forums - - Over five million posts - - Elliquiy's LAMP configuration (maybe NSFW)

Blog about Forums and Servers - - Twenty things to make Simple Machines Forum go faster

Private/Instant Message requests for free support will be ignored.

simmaster

Quote from: Vekseid on December 21, 2009, 04:46:20 PM
Yes, but if I wanted to block all access I would have done years ago.

Err, just match for tor-exit in the hostname, I mean. You'll want to do a hostname lookup for that though. Tor exit nodes don't have port 80 open.

Well, it's not really that hard to do a hostname lookup. Thank you, gethostbyaddr()! ::)

Arantor

You could even cache the hostname into a variable instead of calling it multiple times, just as a thought.

simmaster

#11
Proxy Blocker 1.1 should be out within the week.

Changelog

[+] - Added feature
[-] - Removed feature
[*] - Bugfix
[%] - Security patch

v1.1
[+] Blocks Tor exit nodes
[+] Now 1.1 compatible
[*] Caching hostname into variable
[+] Added language strings:
     [++] Spanish
     [++] Spanish-UTF8
     [++] English-UTF8
     [++] English_GB
     [++] English_GB-UTF8
[+] Block the entire forum
[+] Setting control

qtime

I really like to see this mod for 1.1.11, according to the small code, I hope it's not too much work??

simmaster

It's working with 1.1.11 and should be out later in the day. I just need to fix the issue where blocking the forum blocks everyone.

qtime

Quote from: simmaster on December 23, 2009, 05:47:57 AM
It's working with 1.1.11 and should be out later in the day. I just need to fix the issue where blocking the forum blocks everyone.
great I will look forward to it and will test it at a very busy  board

simmaster

Before I release 1.1, can someone translate these strings into Spanish:

$txt['proxyblock_reg'] = 'Block registration if using proxy';
$txt['proxyblock_index'] = 'Block forum if using proxy';


No, I didn't fix the issue yet.

Arantor

Btw, someone has just commented that the edits to the language files should really have a new line above them to prevent run-on from the previous line.

No biggie, just would be good to keep tidy.

simmaster

Quote from: The Grinch on December 23, 2009, 06:47:28 AM
Btw, someone has just commented that the edits to the language files should really have a new line above them to prevent run-on from the previous line.

No biggie, just would be good to keep tidy.

Noticed that myself and fixed it in 1.1.

simmaster

Proxy Blocker 1.1 is out and fully functional, with the exception of Spanish language strings, which still need the two new language strings translated. Major features are blocking the entire forum, blocking Tor nodes and SMF 1.1 compatibility!

qtime

great news!!! I will test it within a few hours, I asked for a spanish member to help to translate, unfortunately no responds, yet...

Advertisement: