Login Register






[PERL] StopForumSpam filter_list
Author
Message
[PERL] StopForumSpam #1
Okay, well, this is just a quick little perl hack/script i worked up for a specific need... was attempting to register on a forum that had implemented StopForumSpam (using a proxy). After 10-15 registration attempts with different IP's i was getting fed up of being denied

Basically, this reads a file called iplist.txt which is populated with IP's (1 per line) to check against the SFS site. Any IP's that return 0 results get printed to a file called clean.txt - These are not found in the SFS database!

Must have Perl and Curl - Tested only on my Linux system

They do have an API - i didnt want to fiddle around with obtaining one and what not. This probably breaks their terms of service and its probably a bit slower than having used the API due to curl needing to download a webpage for each IP... wouldnt recommend doing hundreds of requests... might get yourself banned, but as far as a quick check on a handful or two of IP's it works well enough imo.

Code:
#!/usr/bin/perl open (CLEAN, '>>clean.txt'); open (IP, 'iplist.txt'); while (<IP>) { chomp; $sfs = `curl http://www.stopforumspam.com/ipcheck/$_`; $re1='(database)'; $re2='(\\s+)'; $re3='(\\d+)'; $re4='(\\s+)'; $re5='((?:[a-z][a-z]+))'; $re=$re1.$re2.$re3.$re4.$re5; if ($sfs =~ m/$re/is) { $int1=$3; if($int1 <= 0) { print CLEAN "$_\n"; } } } close (IP); close (CLEAN);

*disclaimer, I did use a regex generator to generate the regex code. Not my strong point.

Reply

[PERL] StopForumSpam #2
Okay, well, this is just a quick little perl hack/script i worked up for a specific need... was attempting to register on a forum that had implemented StopForumSpam (using a proxy). After 10-15 registration attempts with different IP's i was getting fed up of being denied

Basically, this reads a file called iplist.txt which is populated with IP's (1 per line) to check against the SFS site. Any IP's that return 0 results get printed to a file called clean.txt - These are not found in the SFS database!

Must have Perl and Curl - Tested only on my Linux system

They do have an API - i didnt want to fiddle around with obtaining one and what not. This probably breaks their terms of service and its probably a bit slower than having used the API due to curl needing to download a webpage for each IP... wouldnt recommend doing hundreds of requests... might get yourself banned, but as far as a quick check on a handful or two of IP's it works well enough imo.

Code:
#!/usr/bin/perl open (CLEAN, '>>clean.txt'); open (IP, 'iplist.txt'); while (<IP>) { chomp; $sfs = `curl http://www.stopforumspam.com/ipcheck/$_`; $re1='(database)'; $re2='(\\s+)'; $re3='(\\d+)'; $re4='(\\s+)'; $re5='((?:[a-z][a-z]+))'; $re=$re1.$re2.$re3.$re4.$re5; if ($sfs =~ m/$re/is) { $int1=$3; if($int1 <= 0) { print CLEAN "$_\n"; } } } close (IP); close (CLEAN);

*disclaimer, I did use a regex generator to generate the regex code. Not my strong point.

Reply

RE: [PERL] StopForumSpam #3
(12-12-2013, 07:05 AM)Geoff Wrote: its probably a bit slower than having used the API due to curl needing to download a webpage for each IP... wouldnt recommend doing hundreds of requests... might get yourself banned

Why instead of downloading the page for each IP in the file don't you download the page only once and then check each IP address?
My Bitcoin address: 1AtxVsSSG2Z8JfjNy9KNFDUN6haeKr7LiP
Give me money by visiting www.google.com here: http://coin-ads.com/6Ol83U

If you want a Bitcoin URL shortener/advertiser, please, use this referral: http://coin-ads.com/register.php?refid=noize

Reply

RE: [PERL] StopForumSpam #4
(12-12-2013, 03:28 PM)noize Wrote:
(12-12-2013, 07:05 AM)Geoff Wrote: its probably a bit slower than having used the API due to curl needing to download a webpage for each IP... wouldnt recommend doing hundreds of requests... might get yourself banned

Why instead of downloading the page for each IP in the file don't you download the page only once and then check each IP address?

Well, if they had a big page of IP addresses... I didnt see it. From what I gather its a script that takes the IP as an argument and checks it against the database and returns how many results.

So with this method, not using the API, it needs to request the page for each IP address to get the results for the IP address.

Makes sense?

Reply

RE: [PERL] StopForumSpam #5
(12-12-2013, 03:33 PM)Geoff Wrote:
(12-12-2013, 03:28 PM)noize Wrote:
(12-12-2013, 07:05 AM)Geoff Wrote: its probably a bit slower than having used the API due to curl needing to download a webpage for each IP... wouldnt recommend doing hundreds of requests... might get yourself banned

Why instead of downloading the page for each IP in the file don't you download the page only once and then check each IP address?

Well, if they had a big page of IP addresses... I didnt see it. From what I gather its a script that takes the IP as an argument and checks it against the database and returns how many results.

So with this method, not using the API, it needs to request the page for each IP address to get the results for the IP address.

Makes sense?

Oh, yeah, sure. I still didn't check the source out.

My bad.
My Bitcoin address: 1AtxVsSSG2Z8JfjNy9KNFDUN6haeKr7LiP
Give me money by visiting www.google.com here: http://coin-ads.com/6Ol83U

If you want a Bitcoin URL shortener/advertiser, please, use this referral: http://coin-ads.com/register.php?refid=noize

Reply