You are not logged in.

#1 2008-01-13 11:38 am

Smurf_Minions
Member
From: Weerselo
Registered: 2008-01-12
Posts: 4
Website

Spambot detector (with the use of this API)

I've made an spambot detector for use for everyone, you can use this for any registration form or anything else, it checks the IP and E-Mail, and if an match has found in the stop forum spam database it gives true.
I've also included an domain blocker, so the main domains like mail.ru can be blocked standard.

You can find an example here: (the source is included)
http://guildwarsholland.nl/phphulp/testspambot.php

Offline

#2 2008-03-30 3:54 am

Russ
Guest

Re: Spambot detector (with the use of this API)

Sorry I missed this, I'm trying to catch up! I'll link to your work from the downloads page.

#3 2008-09-08 10:23 pm

DOOgie
Member
Registered: 2008-09-08
Posts: 2

Re: Spambot detector (with the use of this API)

Nice piece of PHP..

How and where do i put this into my Vbulletin forum ?
*edit*

I found it on Vbull.org.

Thanks installed..

Last edited by DOOgie (2008-09-08 11:54 pm)

Offline

#4 2008-09-09 9:06 pm

pedigree
uıɐbɐ ʎɐqǝ ɯoɹɟ pɹɐoqʎǝʞ ɐ buıʎnq ɹǝʌǝu ɯ,ı
From: New Zealand
Registered: 2008-04-16
Posts: 7,054

Re: Spambot detector (with the use of this API)

DOOgie wrote:

Nice piece of PHP..

How and where do i put this into my Vbulletin forum ?
*edit*

I found it on Vbull.org.

Thanks installed..

Apart from the necro post, do you not search the forums for the native vBulletin mod?

Offline

#5 2008-09-09 9:36 pm

DOOgie
Member
Registered: 2008-09-08
Posts: 2

Re: Spambot detector (with the use of this API)

pedigree wrote:

Apart from the necro post, do you not search the forums for the native vBulletin mod?

Sorry.. forgive my ignorance.. necro post ?  and why No to searching forums.. thanks

Offline

#6 2008-09-18 6:07 pm

MysteryFCM
Member
From: Tyneside, UK
Registered: 2008-01-16
Posts: 606
Website

Re: Spambot detector (with the use of this API)

To expand this to also check the fSpamlist database;

After;

    //check the e-mail adress
    $xml_string = file_get_contents('http://www.stopforumspam.com/api?email='.$mail);
    $xml = new SimpleXMLElement($xml_string);
    if($xml->appears == 'yes'){
        $spambot = true;
    }elseif($spambot != true){
        //e-mail not found in the database, now check the ip
        $xml_string = file_get_contents('http://www.stopforumspam.com/api?ip='.$ip);
        $xml = new SimpleXMLElement($xml_string);
        if($xml->appears == 'yes'){
            $spambot = true;
        }
    }

Add:

    //check the e-mail adress against fSpamlist
    $xml_string = file_get_contents('http://www.fspamlist.com/xml.php?email='.$mail);
    $xml = new SimpleXMLElement($xml_string);
    if($xml->appears == 'yes'){
        $spambot = true;
    }elseif($spambot != true){
        //e-mail not found in the database, now check the ip
        $xml_string = file_get_contents('http://www.fspamlist.com/xml.php?ip='.$ip);
        $xml = new SimpleXMLElement($xml_string);
        if($xml->appears == 'yes'){
            $spambot = true;
        }elseif($spambot != true}{
            // IP not found, lets check the username
            $xml_string = file_get_contents('http://www.fspamlist.com/xml.php?username='.$name);
            $xml = new SimpleXMLElement($xml_string);
            if($xml->appears == 'yes'){
                $spambot = true;
            }
        }
    }

My PHP isn't great, so apologies if there's any errors in the above.

Last edited by MysteryFCM (2008-09-18 6:10 pm)


Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

Offline

#7 2008-09-21 2:30 pm

MysteryFCM
Member
From: Tyneside, UK
Registered: 2008-01-16
Posts: 606
Website

Re: Spambot detector (with the use of this API)


Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

Offline

#8 2008-09-21 10:44 pm

Ax Slinger
Member
From: The North Coast
Registered: 2008-04-10
Posts: 184
Website

Re: Spambot detector (with the use of this API)

You should tell people that if they want to use that code, that in addition to copying and saving the code to a file named check_spammers.php (if they use the same filename as you did anyway) that they also need to create a folder under whatever folder they put that file into named spambots, and CHMOD it to 777 so that the text files you have the file creating will be able to be saved properly, otherwise they will get an error similar to this:

Warning: file_put_contents(spambots/sfs_specified_email_address.com.txt) [function.file-put-contents]: failed to open stream: No such file or directory in /../../check_spammers.php on line 72


I only like Spam if it is Deep Fried and served with Cheese.
But only once every six months or so.

Offline

#9 2008-09-22 12:14 am

MysteryFCM
Member
From: Tyneside, UK
Registered: 2008-01-16
Posts: 606
Website

Re: Spambot detector (with the use of this API)

I'd forgotten about that, hehe ....... I'll make the necessary modification in the post to mention it smile


Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

Offline

#10 2008-09-29 8:29 pm

Ax Slinger
Member
From: The North Coast
Registered: 2008-04-10
Posts: 184
Website

Re: Spambot detector (with the use of this API)

Here's a question for ya... If you do a wildcard search for an Email Domain such as *@gawab.com, it seems to check the fSpamList database but not the SFS database. I commented out the fSpamList section to see if it was just finding things like that in there first, and doing so shows that it isn't doing that. It's not finding them in the SFS database at all...


I only like Spam if it is Deep Fried and served with Cheese.
But only once every six months or so.

Offline

#11 2008-09-29 8:39 pm

MysteryFCM
Member
From: Tyneside, UK
Registered: 2008-01-16
Posts: 606
Website

Re: Spambot detector (with the use of this API)

I'll have a look into it smile


Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

Offline

#12 2008-09-29 8:41 pm

Ax Slinger
Member
From: The North Coast
Registered: 2008-04-10
Posts: 184
Website

Re: Spambot detector (with the use of this API)

Cool... Thanks! smile


I only like Spam if it is Deep Fried and served with Cheese.
But only once every six months or so.

Offline

#13 2008-09-29 11:20 pm

MysteryFCM
Member
From: Tyneside, UK
Registered: 2008-01-16
Posts: 606
Website

Re: Spambot detector (with the use of this API)

I've done a little debugging, and SFS doesn't seem to be allowing * checks. Returning the following when echoing the results;

<response success="true"> false"> <error>invalid email address</error> </response>

Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

Offline

#14 2008-09-30 1:22 am

Ax Slinger
Member
From: The North Coast
Registered: 2008-04-10
Posts: 184
Website

Re: Spambot detector (with the use of this API)

Bummer... That's odd though, considering you can do a wildcard search on the index page of the SFS website. Must just be an internal thing and you can't do it from anywhere else. Oh well... Thanks for checking it out for me.


I only like Spam if it is Deep Fried and served with Cheese.
But only once every six months or so.

Offline

#15 2008-09-30 1:32 am

MysteryFCM
Member
From: Tyneside, UK
Registered: 2008-01-16
Posts: 606
Website

Re: Spambot detector (with the use of this API)

No problem smile

I've updated the code anyway (got a couple extra debugging options and such)


Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

Offline

#16 2008-11-14 1:54 am

MysteryFCM
Member
From: Tyneside, UK
Registered: 2008-01-16
Posts: 606
Website

Re: Spambot detector (with the use of this API)

Updated, and thanks to FastHosts being a pain in the rear and killing the domain, it's been moved aswell;

http://fspamlist.com/checkspammers/

Now also checks Sorbs, DSBL and Spamhaus (if an IP is entered anyway).


Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

Offline

#17 2008-11-23 2:02 pm

MysteryFCM
Member
From: Tyneside, UK
Registered: 2008-01-16
Posts: 606
Website

Re: Spambot detector (with the use of this API)

Updated again yikes)

http://fspamlist.com/checkspammers/?nam … bmit=check

Changes:

+ Added error handling for those using < PHP 5
+ Added error handling for those that don't have SimpleXMLElement available
* Cleaned up HTML/CSS code again
* "Prettied up" results
* Moved text to en.php to allow for localization
* Creation of text file with spammers details is now optional (see config.php)
* Everything except index.php and the images folder, now moved above htdocs root for security
* Cleaned up code formatting
* fSpamlist and StopForumSpam checks now split, so checking an e-mail address is no longer mandatory


Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

Offline

#18 2008-11-27 2:42 am

MysteryFCM
Member
From: Tyneside, UK
Registered: 2008-01-16
Posts: 606
Website

Re: Spambot detector (with the use of this API)

Couple minor updates;

1. Fixed a minor bug in the HTML code
2. Code copied to check_spammers_plain.php and modified to allow phpBB3 users to have their forum check new registrants;

http://temerc.com/forums/viewforum.php?f=71


Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

Offline

#19 2008-11-27 11:25 pm

MysteryFCM
Member
From: Tyneside, UK
Registered: 2008-01-16
Posts: 606
Website

Re: Spambot detector (with the use of this API)

Updated again to allow those without SimpleXMLElement available, to still use the functions


Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

Offline

#20 2008-11-28 8:41 am

diabolic.bg
Member
From: Bulgaria, Eastern Europe
Registered: 2008-11-03
Posts: 589
Website

Re: Spambot detector (with the use of this API)

Hi, MysteryFCM!
I get your new code but how can I install it in phpbb2 \if it possible\?
Thanks in advance!


Funiest jokes and pics

Offline

#21 2008-11-28 9:47 am

MysteryFCM
Member
From: Tyneside, UK
Registered: 2008-01-16
Posts: 606
Website

Re: Spambot detector (with the use of this API)

Open /includes/usercp_register.php

Find:

$error = FALSE;

Replace with:

$error = FALSE;

/// BEGIN SPAM MOD
$username = $HTTP_POST_VARS['username'];
$email = $HTTP_POST_VARS['email'];
$ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR') );
$fspamcheck = file_get_contents('http://temerc.com/Check_Spammers/check_spammers_plain.php?name='.$username.'&email='.$email.'&ip='.$ip);
//echo $fspamcheck;
if (strpos($fspamcheck, 'TRUE') !==False) {
    // Notify admin via e-mail
    $blockedby = str_replace(' TRUE', '', $fspamcheck);
    $blockedby = str_replace(' ', ' & ', $blockedby);
    $msg = 'The following was blocked by the '.$blockedby.' filter<br><br>Username: '.$username.'<br><br>Email: '.$email.'<br><br>IP: '.$ip;
    $to = "YOUR_EMAIL_ADDRESS"; 
    $subject = "Spammer blocked by hpHosts Spam filter"; 
    $headers =    "MIME-Versin: 1.0\r\n" . 
    "Content-type: text/html; charset=ISO-8859-1; format=flowed\r\n" . 
    "Content-Transfer-Encoding: 8bit\r\n" . 
    "From: " . $from . "\r\n" . 
    "X-Mailer: hpHosts Spam Filter"; 
    mail($to, $subject, $msg, $headers);
    // Notify user
    message_die(GENERAL_MESSAGE, "Registration blocked by spam filter. Please contact the forum administrator.", '', __LINE__, __FILE__);
}
/// END SPAM MOD

If you are hosting the check_spammers function locally, then change;

http://temerc.com/Check_Spammers/check_spammers_plain.php

to;

http://YOUR_DOMAIN/PATH_TO_CHECK_SPAMMERS/check_spammers_plain.php

Last edited by MysteryFCM (2008-11-28 9:51 am)


Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

Offline

#22 2008-11-28 11:18 am

diabolic.bg
Member
From: Bulgaria, Eastern Europe
Registered: 2008-11-03
Posts: 589
Website

Re: Spambot detector (with the use of this API)

This is very simple and easy.
Thank you very much! smile


Funiest jokes and pics

Offline

#23 2008-11-28 12:31 pm

MysteryFCM
Member
From: Tyneside, UK
Registered: 2008-01-16
Posts: 606
Website

Re: Spambot detector (with the use of this API)

My pleasure smile


Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

Offline

#24 2008-11-28 3:47 pm

diabolic.bg
Member
From: Bulgaria, Eastern Europe
Registered: 2008-11-03
Posts: 589
Website

Re: Spambot detector (with the use of this API)

Sorry, MysteryFCM, but your spam filter doesn't work in my board \phpbb2\.
When I click "agree" link, I get error:

Warning: file_get_contents(http://temerc.com/Check_Spammers/check_spammers_plain.php?name=&email=&ip=192.168.0.1) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in C:\xAmp\xampp\htdocs\phpbb2\includes\usercp_register.php on line 84

The line 84 is

$fspamcheck = file_get_contents('http://temerc.com/Check_Spammers/check_spammers_plain.php?name='.$username.'&email='.$email.'&ip='.$ip);

I have uploaded folders: check_spammers\private\ in my root dir and change http://temerc.com/Check_Spammers/check_ … _plain.php to http://MY_DOMAIN/heck_spammers/private/check_spammers_plain.php
Now I cann't open register page. sad

What can I do?


Funiest jokes and pics

Offline

#25 2008-11-28 3:55 pm

MysteryFCM
Member
From: Tyneside, UK
Registered: 2008-01-16
Posts: 606
Website

Re: Spambot detector (with the use of this API)

You need to ensure file_get_contents is available. You can check this by using the following (place it in a file called "temp.php", and run it on the server);

<?php
   if(function_exists('file_get_contents')){
      echo 'file_get_contents is available';
   }else{
      echo 'file_get_contents is not available';
   }
?>

If this tells you it's not available, check php.ini for the following;

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On

; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
allow_url_include = Off

allow_url_include should always be Off, but allow_url_fopen needs to be "On" for this function to be available.

/edit

Corrected typo

/edit 2

I forgot to mention, you can also check the copy on your server directly, by going to;

http://YOUR_SERVER/{PATH_TO_Check_Spammers}/check_spammers_plain.php?name=test&email=tom@xxx-search.info&ip=195.24.76.232

If it's installed correctly, the output should be as displayed at;

http://fspamlist.com/checkspammers/?nam … .24.76.232

Last edited by MysteryFCM (2008-11-28 3:59 pm)


Regards
Steven Burn
I.T. Mate / hpHosts
it-mate.co.uk / hosts-file.net

Offline

Board footer

Powered by FluxBB

Close
Close