Integrating Spambot into a regular website

Need help with fSpamList? Post here! (DO NOT post removal requests here)

Moderator: fspamlist

me_suzy
Posts: 10
Joined: Sun Jul 25, 2010 12:36 am
Contact:

Integrating Spambot into a regular website

Postby me_suzy » Sun Jul 25, 2010 12:49 am

hello. I want to integrate Check_Spammers to my website. I follow all the instruction from readme.txt ,I copy all the files to public_html, I put the api key, but when I tested it, doesn't work at all. I created the database from here http://forum.hosts-file.net/viewtopic.php?f=68&t=1607 and not any spam-email enters in database.

The counter.txt and whitelist.txt does nothing

What should I do? What did I wrong?

I try to add this line to my php:

include: 'chech_spammers/check_spammers.php';

Nothing happens when I test the form with an spam-email address.

What should I do? What did I wrong?

Check_Spammers scripts should not select emails and ip spam and not give them permission to enter the database?

User avatar
MysteryFCM
Site Admin
Site Admin
Posts: 3721
Joined: Sun May 15, 2005 12:42 pm
Location: Newcastle, UK
Contact:

Re: Integrating Spambot into a regular website

Postby MysteryFCM » Sun Jul 25, 2010 1:29 am

The SBST was never meant to be integrated directly into a website, so no provisions for such were made.

To do this, you need to modify your PHP script so it sends the IP, username and e-mail, to the check_spammers_plain.php file during processing. For example;

Code: Select all

<?php
if(isset($_POST['myform'])){
    // get vars
    $sName = $_POST['name'];
    $sEmail = $_POST['email'];
    $sIP = $_SERVER['REMOTE_ADDR'];

    // Check against spam filter
    $sReturn = file_get_contents('http://yourdomain.com/path_to/check_spammers_plain.php?ip='.$sIP.'&name='.$sName.'&email='.$sEmail);
    if (strpos($fspamcheck, 'TRUE') !==False) {
      // Reject it
    }else{
       // Allow it to go through
    }

}else{
    // Display form
}
?>
Regards

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

Keeping it FREE!

me_suzy
Posts: 10
Joined: Sun Jul 25, 2010 12:36 am
Contact:

Re: Integrating Spambot into a regular website

Postby me_suzy » Sun Jul 25, 2010 3:50 am

I put your code into one of my form comments. BUT I believe it doesn't do anything...

I copy a spam email from http://www.stopforumspam.com/ , and I fill the form. Well, it is working fine. No change in whitelist.txt or counter.txt, or in database.

chech_spammers should verify the boot for the spam-emails, and then to stop them to apear into the form, isn't it?

User avatar
MysteryFCM
Site Admin
Site Admin
Posts: 3721
Joined: Sun May 15, 2005 12:42 pm
Location: Newcastle, UK
Contact:

Re: Integrating Spambot into a regular website

Postby MysteryFCM » Sun Jul 25, 2010 10:25 am

Can you post the code you're using please?
Regards

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

Keeping it FREE!

me_suzy
Posts: 10
Joined: Sun Jul 25, 2010 12:36 am
Contact:

Re: Integrating Spambot into a regular website

Postby me_suzy » Sun Jul 25, 2010 10:51 am

Code: Select all

<?php
define('PHP_FIREWALL_REQUEST_URI', strip_tags( $_SERVER['REQUEST_URI'] ) );
define('PHP_FIREWALL_ACTIVATION', true );
if ( is_file( @dirname(__FILE__).'/php-firewall/firewall.php' ) )
   include_once( @dirname(__FILE__).'/php-firewall/firewall.php' );
         
if(isset($_POST['Form'])){
    // get vars
    $sName = $_POST['name'];
    $sEmail = $_POST['email'];
    $sIP = $_SERVER['REMOTE_ADDR'];

    // Check against spam filter
    $sReturn = file_get_contents('http://domain.com/chech_spammers/check_spammers_plain.php?ip='.$sIP.'&name='.$sName.'&email='.$sEmail);
    if (strpos($fspamcheck, 'TRUE') !==False) {
      // Reject it
    }else{
       // Allow it to go through
    }

}else{
    // Display form
}                 


$conn = mysql_connect("localhost", "user", "pass");


mysql_select_db("database",$conn);



$sql = "SELECT name,message,homepage,timpul FROM guest_book WHERE guest_book.subiecte_id = 'adevar_sau_provocare'";
$rezultat = mysql_query($sql) or die("Nu se poate executa interogarea!");

while ($rand = mysql_fetch_array($rezultat, MYSQL_BOTH))
    {
       
   if (strlen($rand['homepage'])>0)
{
      echo $bebef.''.'<a href="http://'.$rand['homepage'].'" TARGET="_blank"><i>'.$rand['name'].'</i></a>'.' says:<br>';
}
else
{
      echo "<p><i>$rand[name]</i> says:<br>"; 
}

   echo '<span style="color:#06c; font-size:11px; font-family:Arial;">'.$rand['timpul'].'</span>';
   
    echo '<p><span style="color:#333; font-size:12px; font-family:Arial;">'.$rand['message'].'</span><p><hr/>';

    }
      
mysql_free_result($rezultat);
mysql_close($conn);
?>

User avatar
MysteryFCM
Site Admin
Site Admin
Posts: 3721
Joined: Sun May 15, 2005 12:42 pm
Location: Newcastle, UK
Contact:

Re: Integrating Spambot into a regular website

Postby MysteryFCM » Sun Jul 25, 2010 11:33 am

If you're using the above "as is", then you need to change;

// Reject it

and;

// Allow it to go through

.. with the respective processing code. For example;

Code: Select all

    // Check against spam filter
    $sReturn = file_get_contents('http://domain.com/chech_spammers/check_spammers_plain.php?ip='.$sIP.'&name='.$sName.'&email='.$sEmail);
    if (strpos($sReturn, 'TRUE') !==False) {
       // Notify admin via e-mail
      $blockedby = str_replace(' TRUE', '', $sReturn);
      $blockedby = str_replace(' ', ' & ', $blockedby);
      $msg = 'The following was blocked by the '.$blockedby.' filter<br><br>Username: '.$sName.'<br><br>Email: '.$sEmail.'<br><br>IP: '.$sIP;
      $to = "your@email.addr";
      $from = "nobody@".$_SERVER['SERVER_NAME'];
      $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
      die('Your registration has been blocked by our <a href="http://temerc.com/Check_Spammers/">spam filter</a>. Please either try again or contact an administrator');
}else{
      // The code you use to process the submission for addition to the database, goes here
}
Regards

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

Keeping it FREE!

me_suzy
Posts: 10
Joined: Sun Jul 25, 2010 12:36 am
Contact:

Re: Integrating Spambot into a regular website

Postby me_suzy » Mon Aug 02, 2010 1:59 pm

Parse error: syntax error, unexpected $end in....

User avatar
MysteryFCM
Site Admin
Site Admin
Posts: 3721
Joined: Sun May 15, 2005 12:42 pm
Location: Newcastle, UK
Contact:

Re: Integrating Spambot into a regular website

Postby MysteryFCM » Mon Aug 02, 2010 2:16 pm

Bit wierd, $end isn't one of the vars.

Can you attach a copy of the file please?
Regards

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

Keeping it FREE!

me_suzy
Posts: 10
Joined: Sun Jul 25, 2010 12:36 am
Contact:

Re: Integrating Spambot into a regular website

Postby me_suzy » Mon Aug 02, 2010 2:28 pm

is the exact code I write earlier, except I change with your new script from // Check against spam filter

User avatar
MysteryFCM
Site Admin
Site Admin
Posts: 3721
Joined: Sun May 15, 2005 12:42 pm
Location: Newcastle, UK
Contact:

Re: Integrating Spambot into a regular website

Postby MysteryFCM » Mon Aug 02, 2010 3:02 pm

Can you check there's no line breaks where there aren't meant to be? (I can't see anything wrong with the code, same one works just fine here)
Regards

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

Keeping it FREE!

me_suzy
Posts: 10
Joined: Sun Jul 25, 2010 12:36 am
Contact:

Re: Integrating Spambot into a regular website

Postby me_suzy » Mon Aug 02, 2010 3:18 pm

this is my code. The problem is from the code. Because, if I delete the code, the page is working fine.

Code: Select all

if(isset($_POST['Form'])){
    // get vars
    $sName = $_POST['name'];
    $sEmail = $_POST['email'];
    $sIP = $_SERVER['REMOTE_ADDR'];

// Check against spam filter
    $sReturn = file_get_contents('http://xxx.com/chech_spammers/check_spammers_plain.php?ip='.$sIP.'&name='.$sName.'&email='.$sEmail);
    if (strpos($sReturn, 'TRUE') !==False) {
       // Notify admin via e-mail
      $blockedby = str_replace(' TRUE', '', $sReturn);
      $blockedby = str_replace(' ', ' & ', $blockedby);
      $msg = 'The following was blocked by the '.$blockedby.' filter<br><br>Username: '.$sName.'<br><br>Email: '.$sEmail.'<br><br>IP: '.$sIP;
      $to = "xxx@gmail.com";
      $from = "nobody@".$_SERVER['SERVER_NAME'];
      $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
      die('Your registration has been blocked by our <a href="http://temerc.com/Check_Spammers/">spam filter</a>. Please either try again or contact an administrator');
}else{
      // The code you use to process the submission for addition to the database, goes here
}   

User avatar
MysteryFCM
Site Admin
Site Admin
Posts: 3721
Joined: Sun May 15, 2005 12:42 pm
Location: Newcastle, UK
Contact:

Re: Integrating Spambot into a regular website

Postby MysteryFCM » Mon Aug 02, 2010 4:02 pm

Spotted the error. Replace it with;

Code: Select all

if(isset($_POST['Form'])){
   // get vars
   $sName = $_POST['name'];
   $sEmail = $_POST['email'];
   $sIP = $_SERVER['REMOTE_ADDR'];

   // Check against spam filter
   $sReturn = file_get_contents('http://xxx.com/chech_spammers/check_spammers_plain.php?ip='.$sIP.'&name='.$sName.'&email='.$sEmail);
   if (strpos($sReturn, 'TRUE') !==False) {
      // Notify admin via e-mail
      $blockedby = str_replace(' TRUE', '', $sReturn);
      $blockedby = str_replace(' ', ' & ', $blockedby);
      $msg = 'The following was blocked by the '.$blockedby.' filter<br><br>Username: '.$sName.'<br><br>Email: '.$sEmail.'<br><br>IP: '.$sIP;
      $to = "xxx@gmail.com";
      $from = "nobody@".$_SERVER['SERVER_NAME'];
      $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
      die('Your registration has been blocked by our <a href="http://temerc.com/Check_Spammers/">spam filter</a>. Please either try again or contact an administrator');
   }else{
      // The code you use to process the submission for addition to the database, goes here
   }
}
Regards

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

Keeping it FREE!

me_suzy
Posts: 10
Joined: Sun Jul 25, 2010 12:36 am
Contact:

Re: Integrating Spambot into a regular website

Postby me_suzy » Mon Aug 02, 2010 9:22 pm

ok, seems fine. I don't get eny king of error. Thank you.

But

I want to test the code, so:

I copy a spam email from http://www.alsportbike.com/spamcheck/?p=view

I go to my form comments and fill it with Name, Subject, Comment and E-Mail (I put the spam email address).

I still get the comment. Doesn't have to stop the spam email and IP?
In config.php I replaced the API KEY's from Project Honey Pot, StopForumSpam API, fSpamlist, BotScout API Key

Did I made something wrong?

User avatar
MysteryFCM
Site Admin
Site Admin
Posts: 3721
Joined: Sun May 15, 2005 12:42 pm
Location: Newcastle, UK
Contact:

Re: Integrating Spambot into a regular website

Postby MysteryFCM » Tue Aug 03, 2010 4:17 am

You can check what's being returned by pointing your browser to;

Code: Select all

http://xxx.com/chech_spammers/check_spammers_plain.php?ip={IP}&name={username}&email={email}


If all is working well, it should return "TRUE" (with the list of blacklists blocking it) if it's blocked, and FALSE if not.
Regards

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

Keeping it FREE!

me_suzy
Posts: 10
Joined: Sun Jul 25, 2010 12:36 am
Contact:

Re: Integrating Spambot into a regular website

Postby me_suzy » Tue Aug 03, 2010 4:24 am

I check in browser, and I have an error. Took me in the 403 shtml error page. Don't know why.

User avatar
MysteryFCM
Site Admin
Site Admin
Posts: 3721
Joined: Sun May 15, 2005 12:42 pm
Location: Newcastle, UK
Contact:

Re: Integrating Spambot into a regular website

Postby MysteryFCM » Tue Aug 03, 2010 4:46 am

403 is permission denied, which suggests either you don't have read access to the script, or the directory. The server process MUST have read access to the SBST folder, and write access to the spambots folder (if logging to file is enabled).
Regards

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

Keeping it FREE!

me_suzy
Posts: 10
Joined: Sun Jul 25, 2010 12:36 am
Contact:

Re: Integrating Spambot into a regular website

Postby me_suzy » Tue Aug 03, 2010 5:07 am

all the folder chech_spammers and all the files into are 777 permision. I check this. But I believe is something else. What should I do to change settings on the server to read access to the SBST folder??? From Cpanel??

User avatar
MysteryFCM
Site Admin
Site Admin
Posts: 3721
Joined: Sun May 15, 2005 12:42 pm
Location: Newcastle, UK
Contact:

Re: Integrating Spambot into a regular website

Postby MysteryFCM » Tue Aug 03, 2010 5:43 am

If the folder and file already has read/write permissions, then the only thing I can suggest is to speak to your hosting company I'm afraid.
Regards

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

Keeping it FREE!

me_suzy
Posts: 10
Joined: Sun Jul 25, 2010 12:36 am
Contact:

Re: Integrating Spambot into a regular website

Postby me_suzy » Tue Aug 03, 2010 5:59 am

ok, now php works fine.

But, the same problem.

I test the code, so:

I copy a spam email from http://www.alsportbike.com/spamcheck/?p=view

I go to my form comments and fill it with Name, Subject, Comment and E-Mail (I put the spam email address).

I still get the comment. The code doesn't have to stop the spam email and IP?

User avatar
MysteryFCM
Site Admin
Site Admin
Posts: 3721
Joined: Sun May 15, 2005 12:42 pm
Location: Newcastle, UK
Contact:

Re: Integrating Spambot into a regular website

Postby MysteryFCM » Tue Aug 03, 2010 6:32 am

It's likely something in your servers configuration is intefering with or blocking it. You need to speak to your host I'm afraid.
Regards

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

Keeping it FREE!


Return to “Help and Support”

Who is online

Users browsing this forum: No registered users and 2 guests