PDA

View Full Version : Administrative and Maintenance Tools - Moderate New Registrations Based On IP Geographical Origin


Jafo232
12-08-2008, 10:00 PM
This mod will put any new registration into moderation so you can either approve or deny based on the physical location of the IP address. If the IP is located in a country that you white list, the registration will go through as normal.

This may be different for everyone else, but on my forums, I have yet to have a Russian IP sign up for anything other than posting SPAM. This plugin has moderated them all!

I hope to have time to eventually expand this to do other things. This works with 4.0.x.

You MUST download the zone files from this site:

http://www.ipdeny.com/ipblocks/

The free license does not allow me to include them with the product, plus it is better to download the latest files anyway.

No real screenshots to show here, sorry.

Changelog:

12/20/2008
Coded the routine in, instead of using external whois program.
Now compatible with Windows
(39 download of 1.0)2/11/2009

77 downloads at this point
Rewrote application to use zone files rather than relying on ArinTo upgrade, READ THE README, and re-install product (select overwrite).

Don't forget to:

CLICK INSTALL! (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=198440)

Jafo232
12-09-2008, 02:40 PM
Reserved...

dboogie2288
12-09-2008, 02:57 PM
So uh, dumb question, I've got it installed....now what happens? Your readme, and description is a little vague.

Jafo232
12-09-2008, 03:24 PM
Users who register from countries not on your white list will be moderated.. What else do you need to know?

dboogie2288
12-09-2008, 03:55 PM
Ok, I dig it. I didnt know if perhaps that within the moderation panel it would show countries of origin..stuff like that. But since, I moderate everyone, this isn't really relevant...thanks for the info.

Jafo232
12-09-2008, 04:11 PM
Yeah, if you moderate everyone, then this won't be useful. It is more for fine tuning your moderation criteria.

Hornstar
12-10-2008, 06:23 AM
How do you know that the account signed up is going to be a spam bot or not? Because when I look at any spam bot that has spammed viagra, computer sales, TVs etc. They truly look like a legit user until they start spamming weeks later.

meissenation
12-10-2008, 01:14 PM
If you analyze their IP address they will probably be from Russia or Turkey since it seems like most of the problems of the internet derives from over there. While not as effective, if you use a website like whatsmyipaddress.com and enter the IP address into the search box it will tell you an approximation of where the IP originates from.

In any case, sounds like a great idea but since I have Windows Server 2003 so it's no good for me.

Jafo232
12-10-2008, 02:50 PM
How do you know that the account signed up is going to be a spam bot or not? Because when I look at any spam bot that has spammed viagra, computer sales, TVs etc. They truly look like a legit user until they start spamming weeks later.

This will not tell you 100% that someone is a spam bot, however it is no secret that vast majority of forum spammers come from places like Russia, etc.. This mod will determine the country of the IP address, and if you have not white listed that country, it will put it into moderation so you can approve it.

My motivation to write this is because of one forum I run that is a local forum for a small area in NY State. It makes no sense for people from Saudi Arabia or Russia to even want an account there. At first I was just going to outright deny registrations to these countries, but figured for prudence sake, to put them in moderation just in case there was a false positive.

meissenation
12-12-2008, 08:27 PM
Still wishing you'd write this for Windows Server 2003 also.

Jafo232
12-13-2008, 01:37 AM
If you can find the program called "whois" for windows, then this might work with it.

BiZiMDiYaR
12-20-2008, 11:05 PM
If you analyze their IP address they will probably be from Russia or Turkey since it seems like most of the problems of the internet derives from over there. While not as effective, if you use a website like whatsmyipaddress.com and enter the IP address into the search box it will tell you an approximation of where the IP originates from.

In any case, sounds like a great idea but since I have Windows Server 2003 so it's no good for me.

Dear Sir,

I don't expect that you read this... but I still need to tell you this... TAKE care on your comments !!! If you call my family scum, that same to you and your familiy is scum for me also, take a look there and do NEVER ever make such remark again to catogorize a whole country, due to some persons. !

MODS, how to accept such comment ?? Doesn't anybody look ??? I hope his comment will be deleted very soon and edit mine pls !

Thanks.

Jafo232
12-21-2008, 12:04 AM
Dear Sir,

I don't expect that you read this... but I still need to tell you this... TAKE care on your comments !!! If you call my family scum, that same to you and your familiy is scum for me also, take a look there and do NEVER ever make such remark again to catogorize a whole country, due to some persons. !

MODS, how to accept such comment ?? Doesn't anybody look ??? I hope his comment will be deleted very soon and edit mine pls !

Thanks.

No offense BiZiMDiYaR, but most of the SPAMMERS do come from those regions, and SPAMMERS are scum. If that offends you, then perhaps your country should take harsher steps against these people.

Meissenation did not say ALL people from these places are scum but:

If you analyze their IP address they will probably be from Russia or Turkey since it seems like most of the scum of the internet derives from over there

At least when a UK or US spammer is found, their ISP shuts them off, their Governments go after them, and they are hunted like dogs. In Russia and Turkey, nothing happens to them. This is a fact.

The reason I made this mod was not to start some international incident, but to try and shut out these idiot spammers in any way I can. Is that offensive? Surely not nearly as offensive as waking up in the morning and checking your FAMILY ORIENTATED forum to find that some Russian IP posted about 30 threads all containing XXX rated pornography. If it was up to me, the Internet should be cut off from these places until their Governments can at least make an attempt at policing its use.

Jafo232
12-21-2008, 02:15 AM
Ok, I broke down and made a Windows compatible version. Should work on all platforms now for that matter..

Marco van Herwaarden
12-21-2008, 08:54 AM
People please cool off. Unless your family are spammers (or other unwanted internet activity), then nobody insulted your family our your fellow countrymen.

Only thing that has been posted is the observation that a lot of "scum" on the internet originates from IP addreses in those countries.

Edit: In order to avoid misinterpretations we have changed the word "scum" to "problems". This should still leave the original mesage meaning the same, but avoiding words that might be understood in the wrong way.

meissenation
12-21-2008, 12:21 PM
Dear Sir,

I don't expect that you read this... but I still need to tell you this... TAKE care on your comments !!! If you call my family scum, that same to you and your familiy is scum for me also, take a look there and do NEVER ever make such remark again to catogorize a whole country, due to some persons. !

MODS, how to accept such comment ?? Doesn't anybody look ??? I hope his comment will be deleted very soon and edit mine pls !

Thanks.

I apologize if you were offended by the statement as it shouldn't be offensive to anyone that isn't a spammer or hacker. My site, as well as many car-oriented websites, have been attacked a handful of times by the "Turkish Hacking Ring" and I forever will be turned off to the entire country thanks to the work of a handful of people.

No offense BiZiMDiYaR, but most of the SPAMMERS do come from those regions, and SPAMMERS are scum. If that offends you, then perhaps your country should take harsher steps against these people.

Meissenation did not say ALL people from these places are scum but:



At least when a UK or US spammer is found, their ISP shuts them off, their Governments go after them, and they are hunted like dogs. In Russia and Turkey, nothing happens to them. This is a fact.

The reason I made this mod was not to start some international incident, but to try and shut out these idiot spammers in any way I can. Is that offensive? Surely not nearly as offensive as waking up in the morning and checking your FAMILY ORIENTATED forum to find that some Russian IP posted about 30 threads all containing XXX rated pornography. If it was up to me, the Internet should be cut off from these places until their Governments can at least make an attempt at policing its use.

That was the only point I was intending to make. :)

Ok, I broke down and made a Windows compatible version. Should work on all platforms now for that matter..

:D:D:D:D:D:D:D:D THANK YOU SIR!!!!! :D:D:D:D:D:D:D:D

I understand Linux can be made much more secure, but it's much easier for me to fix a Windows box than a box with an OS I'm just not familiar with. :)

Jafo232
12-21-2008, 04:14 PM
:D:D:D:D:D:D:D:D THANK YOU SIR!!!!! :D:D:D:D:D:D:D:D

I understand Linux can be made much more secure, but it's much easier for me to fix a Windows box than a box with an OS I'm just not familiar with. :)

Not a problem. You know how I learned Linux? I had an old PC laying around like many of us do and I installed a flavor of Linux on it. Linux is great for older machines! I then put it on my network and just tinkered. Next thing you know, I became a Linux nut when it comes to servers. I still use XP for my desktop though.. Much easier lol..

Jim O
12-23-2008, 02:13 PM
Very helpful mod. For me, however, it's more helpful to create a simple list of excluded countries as I have an international membership. Most of my spammers seem to originate in Nigeria and China, with a few from Bulgaria and Russia. It's hard to eliminate Russia as I have a number of legitimate Russian users as this is a World War II site and the Soviet Union was a major combatant. In fact a very large part of my site deals with the war on the eastern front.

I've modified the code to disallow users from specified countries. It hasn't been fully tested as I haven't had any registrations yet from those countries but the changes are fairly simple and I suspect that it will work as intended. I'd be happy to share it with the developer's permission.

Jafo232
12-23-2008, 02:57 PM
I've modified the code to disallow users from specified countries. It hasn't been fully tested as I haven't had any registrations yet from those countries but the changes are fairly simple and I suspect that it will work as intended. I'd be happy to share it with the developer's permission.

Not a bad idea, I think I will add it to the next version if I get time. To do it in the code, simply find this line in whois.php:


if (!in_array($country, $valid_countries)) { $userdata->set('usergroupid', 4); }

Change to:

if (in_array($country, $valid_countries)) { $userdata->set('usergroupid', 4); }

Now your include list becomes and exclude list.

Cheers.

Jim O
12-23-2008, 03:14 PM
Yeah that's the basic change. I also prettied up the phrases and changed the variable "valid_countries" to "excluded_countries" just to make the code easier to understand.

Thanks again for the mod. It definitely should help.

Jafo232
12-23-2008, 03:23 PM
Great, let me know how it works out for you in a while. I am considering expanding this to something more. Would be real interested in your feedback..

Jim O
12-30-2008, 01:30 PM
Great, let me know how it works out for you in a while. I am considering expanding this to something more. Would be real interested in your feedback..

Unfortunately it does not seem to be working. For non-ARIN related IP's it defaults to the location of the Regional Internet registry such as RIPE or APNIC. So China IP's appear to come from Australia. I had a registration from China today from IP 58.244.50.212 which localizes to Changchun, Jilin, China but the mod (and test.php) saw it as Australia (APNIC headquarters) and let it through.

Not sure why that would be. Maybe a limitation of the whois function.

vbplusme
01-01-2009, 04:13 AM
APNIC is Asia Pacific, not just Australia, FYI

Jim O
01-01-2009, 05:01 AM
Unfortunately it does not seem to be working. For non-ARIN related IP's it defaults to the location of the Regional Internet registry such as RIPE or APNIC. So China IP's appear to come from Australia. I had a registration from China today from IP 58.244.50.212 which localizes to Changchun, Jilin, China but the mod (and test.php) saw it as Australia (APNIC headquarters) and let it through.

Not sure why that would be. Maybe a limitation of the whois function.

APNIC is Asia Pacific, not just Australia, FYI

Your point????

FYI, please read my post slowly, it's quoted here in its entirety for your convenience, and then please show me where I said any such thing.

When I went to school I was taught that China was in fact in Asia, not in Australia, so give me just a bit of credit for knowing that APNIC does not refer to Australia alone.

What I said was: "For non-ARIN related IP's it defaults to the location of the Regional Internet registry."

Now just where is APNIC located? I'm not talking about the region it serves but where it is actually located (I even used the word "headquarters" in my post). Uhmm... hmmm... let's see. A quick look at http://www.apnic.net/info/contact/index.html will show they are pysically located in Milton, Brisbane, QLD, AUSTRALIA So Chinese IP's, and in fact all APNIC related IP's appear to be from Australia.

For the same reason, all RIPE related IP's appear to come from the Netherlands. Yes, I know there are many countries served by RIPE beside the Netherlands, but it is located in Amsterdam. So if I wanted to exclude Belarus the adaptation of this modification that I wrote would fail because Belarussian IP's appear, to this modification, to be from the Netherlands, just as Chinese IP's appear to be from Australia. I tested this with multiple IP's from multiple countries for both RIPE and APNIC and the results were 100% consistent.

Now have I made myself clear enough so you won't feel the need to make another drive by off topic comment?

dknelson
01-17-2009, 12:09 PM
Has anybody tried this on 3.8?

Sorry, just saw in the first post that this should work on 3.8. I've installed so should know soon. If it works as described, this is a FANTASTIC hack. Thanks much.

dknelson
01-18-2009, 11:14 AM
OK....I had previously not moderated new members. I installed this yesterday and this morning found my first member in the moderation que. I have the US and Canada whitelisted. I ran this IP Address through Whois and it shows to be in Texas. Why was this registrant placed into moderation? 76.210.32.55

kfiasche81
01-18-2009, 02:56 PM
i have write in the valid country : US,CA,IT
IT= italian
but a new user whit this ip 213.140.16.183 was made on moderation park.

dknelson
01-20-2009, 03:08 PM
I love what this mod is SUPPOSED to do but it's just not working for me. It is not correctly identifying the location of the IP addresses. It works for some but I have it set to not moderate users from the USA and Canada but it still puts some of them into moderation. Maybe the one that used the external whois would work better...I'm not sure but think I'll try it.

dknelson
01-21-2009, 08:41 PM
I've uninstalled it. Love the concept but it simply doesn't work. It keeps putting people into moderation who are within the countries that I have white listed. Will continue looking for a solution.

kfiasche81
01-26-2009, 11:44 AM
I love what this mod is SUPPOSED to do but it's just not working for me. It is not correctly identifying the location of the IP addresses. It works for some but I have it set to not moderate users from the USA and Canada but it still puts some of them into moderation. Maybe the one that used the external whois would work better...I'm not sure but think I'll try it.

I've uninstalled it. Love the concept but it simply doesn't work. It keeps putting people into moderation who are within the countries that I have white listed. Will continue looking for a solution.

me too

sweetfunny
01-31-2009, 02:36 AM
One solution might be to use the free MaxMind GeoLite Country database locally on your server and run the IP queries against that instead of Arin.net

They also have the free GeoLite City with more resolution, plus a remotely hosted Javascript version you could connect to:


http://www.maxmind.com/app/javascript_city

http://www.maxmind.com/app/geolitecountry

http://www.maxmind.com/app/geolitecity



Both have 99.5% accuracy on a Country level, and GeoLite City has 79% on a city level. So there may be something there you can work with.

Jafo232
02-11-2009, 04:50 PM
Ok, I have rewrote this application to use zone files. You need to download these files here:

http://www.ipdeny.com/ipblocks/

(choose the all files download).

Their free license prohibits me from including them, plus, you might as well get the most up to date version.

relaxiha
02-12-2009, 01:10 AM
does is work on 3.8?

ForumsMods
02-12-2009, 01:35 AM
<a href="https://vborg.vbsupport.ru/showthread.php?t=205044" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=205044</a>

skwestle
04-11-2009, 01:53 AM
I have installed the mod but not sure how to upload the Country's can someone help me upload the folder inside the upload directory to my forum root.

Jamey
09-15-2009, 02:47 PM
Thanks...I will try this.

clarkstoncracke
09-22-2009, 02:32 PM
I'll start off by saying I'm not gay.

But I think I love you.

//installed.

10-20 bots an hour into moderation.

I love it.

You have no idea how many spam preventing addons we use, and a few still trickle in.

Jafo232
09-22-2009, 03:00 PM
Thanks, this mod has saved me so much time, I really am glad it still works.

(yes, still works with 3.8)..

Theo-zzzz
12-08-2009, 09:39 AM
Does this work with vb4.0 ?

Jafo232
12-27-2009, 01:24 PM
Yes.. Works with 4.0.

Brother
01-17-2010, 04:05 PM
I'm not sure how should it works

i done everything but i can't see any change in the users moderation page!!

The_Hawk
05-26-2010, 09:05 PM
ignore me, wrong thread :P

wheretobet
10-25-2011, 03:05 PM
is there gonna be a release for version 4?

TheDevil666Damo
03-09-2012, 07:08 PM
This used to be a fantastic little plugin stopping ALL spam by restricting certain country IP's, however, just installed it since our upgrade to 4.1.10 and it no longer seems to be working properly, or at least causing registration problems...

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 71 bytes) in /home/xxxxxxx/public_html/plugins/whois.php on line 33

...when's its disabled registrations work again, anyone got any ideas?

DAMINK
05-31-2012, 01:26 AM
Just curious, is this working in 4.2?
Should this be added or duplicated to go in the 4.0 mods if it is??

thenashy
07-23-2012, 11:37 AM
Just to confirm, I have this running on 4.2 perfectly fine.

kevinh
07-26-2012, 01:40 AM
Great idea. I've been blocking CIDR ranges but it's a never ending battle. The whitelist will work much better for us as we run a couple of professional forums for the Australian market. We're not really interested in posts from other jurisdictions because they are not relevant.

We do however get heaps of comment spammers from India, Pakistan, China, Vietnam and one or two other countries. We don't seem to be on the RU spammer's radar yet :)

We currently moderate first posts, but what I suspect are paid SEO spammers are getting very clever. They make detailed posts about complex topics which read like genuine posts. Fortunately they almost always trip up some way or other which raises our suspicions and we check the IP.

Frankly I would rather just stop them from registering in the first place.

The irony here is that often the products that these spammers are promoting are often US or UK products. My guess is that these companies are buying SEO services and are unaware that they are paying for comment spam.

Perhaps we need a public "name & shame" list for companies who's products or services are being promoted in our forums by comment spammers?

Installing now ....

imported_dfmafia
07-26-2012, 03:35 PM
its flagging US IP's as China and thus blocking them from registering.

toon79
08-20-2012, 12:05 PM
How do edit the rejection email that goes out?

Bilderback
08-27-2012, 02:36 PM
Love the concept but I had to uninstall it due to improper flagging and it will not allow users to accept the forum rules during registration using the default mobile style.
I have many registrations using mobile devices and I cannot afford to shut them out.
Every time a user attempts to register on a mobile device, they receive the error:
You have chosen not to accept the forum rules......