Check Website
Inclusion Status
It is currently Tue Jun 25, 2019 2:05 am

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Patch: Functions.php (LogSpammerToFile)
PostPosted: Tue Jan 11, 2011 2:00 pm 
Site Admin

Joined: Thu May 28, 2009 10:25 am
Posts: 6018
This is a patch for an issue that's been identified with the LogSpammerToFile function preventing check_spammers_plain working, and causing an issue with check_spammers (used by index.php for the SBST GUI).

If you'd like to save time downloading, just replace the LogSpammersToFile function in functions.php with;

// Used to increment and log spammers to text file (if enabled)
//   Requires:
//      $sLogPath   = Path to the folder you'd like the text files created
//      $sLDB      = Database the spammer was listed in (fSpamList, StopForumSpam, SpamCop etc)
//      $sLName      = Spammers username
//      $sLIP      = Spammers IP address
//      $sLMail      = Spammers e-mail address
//   Usage:
//      $lRet = LogSpammerToFile('./spambots/', 'fSpamList', 'volter', '', '')
function LogSpammerToFile($sLogPath, $sLDB, $sLName, $sLIP, $sLMail){
      if(file_exists($sLogPath) == false){
         return false;
         echo 'You\'ve asked me to dump the results to text file, but file_put_contents is not available. Please enable it or disable dumping to a text file';
         return false;
      if(ini_get('allow_url_fopen') == false){
         echo 'Unable to save to file, allow_url_fopen is disabled on this server';
         return false;

      // We need a spammer database
         return false;
         //   bs_      = BotScout
         //   fsl_      = fSpamlist
         //   sfs_      = StopForumSpam
         //   php_      = ProjectHoneyPot
         //   sorbs_      = Sorbs
         //   spamhaus_   = SpamHaus
         //   scop_      = SpamCop
         //   drone_      = DroneBL
            case "BotScout";
               $sSpamDB ='bs_';
            case "fSpamlist";
               $sSpamDB ='fsl_';
            case "StopForumSpam";
               $sSpamDB ='sfs_';
            case "ProjectHoneyPot";
               $sSpamDB ='php_';
            case "Sorbs";
               $sSpamDB ='sorbs_';
            case "SpamHaus";
               $sSpamDB ='spamhaus_';
            case "SpamCop";
               $sSpamDB ='scop_';
            case "DroneBL";
               $sSpamDB ='drone_';
            case "AHBL";
               $sSpamDB ='ahbl_';
         // If any of the vars are empty, change them to "NULL"

         // Since our text files are created using the e-mail address as part of the name
         // we can't have an empty e-mail address, or it's not going to work is it?
         // In this case, we'll skip the text files creation

         if($sLMail !='NULL'){
            $file = str_replace('*', '', $sLMail);
               $spambot_old_info = file_get_contents($sLogPath.$sSpamDB.$file.'.txt');
               $spambot_old_info = explode(',',$spambot_old_info);
               $spambot_old_info[2] = $spambot_old_info[2]+1; // Increase count
               $spambot_old_info = implode(',',$spambot_old_info);
               if(ini_get('allow_url_fopen') == true){
               $spambot_info = $sLIP.','.$sLName.',1';
               if(ini_get('allow_url_fopen') == true){
            } // End if(file_exists($sLogPath.$sSpamDB.$file.'.txt'))

            return true;
            return false;

   } // End if($bln_SaveToFile==true....

File comment: Patch for functions.php [4.81 KiB]
Downloaded 286 times

Steven Burn
I.T. Mate / hpHosts /

Keeping it FREE!

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
hpHosts and hpHosts Online are copyright © Malwarebytes Corp - All Rights Reserved

Powered by phpBB © 2000-2009 phpBB Group