View Single Post
  #31  
Old 02-02-2010, 11:46 PM
edward hamilton edward hamilton is offline
 
Join Date: Mar 2007
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm still getting a few spam registrations but they have definitely slowed way down.

To see what I'm missing, I wrote this to take a look occasionally, while I sip a beer in my new free time.

I used http://www.maxmind.com/app/csv to help determine the countries from the ip addresses


added spamlog table with fields id_spamlog, ip, viewdate, num_spam
added geoip_data table with fields country_full, ip32_start, ip32_end
http://www.maxmind.com/app/csv




PHP Code:
<?php
session_start
();
include 
'/admin/config.php'// connect to database

foreach ($_POST as $key => $value) {  $$key $value; }
?>
 <table><tr><td colspan="4">
<form action="" method="post" name="theform"  >
 
  Find the last <input type="text" name="lastspam"  value=" "> 
    <input type="submit" name="action"  value="bots"> 
     
        </form></td></tr> 
<?php

if(isset($lastspam)){  


$sql "SELECT id_spamlog  
           FROM spamlog 
          ORDER by id_spamlog DESC LIMIT 1"
;  
          
$result mysql_query($sql)  
          or die(
mysql_error()); 

  list(
$num) = mysql_fetch_row($result); 
//   echo "num $num";
 
$id =($num $lastspam); 
 
    while(
$num $id)        {
    
$sql "SELECT id_spamlog, ip, viewdate, num_spam 
            FROM spamlog 
            WHERE id_spamlog = '
$num' "
            
$result mysql_query($sql
            or die(
mysql_error()); 
            
            list(
$id_spamlog$ip$viewdate$num_spam) = mysql_fetch_row($result); 
            
            if(!empty(
$id_spamlog)){
echo 
"<tr><td> id </td><td></td><td>ip </td><td>Country</td><td>Date</td><td></td> <td>Attempts</td></tr>";

/*<td>ip32_start / ip_spam / ip32_end</td> */

//break ip address into four section 
// 404232216 = 16777216*24 + 65536*24 + 256*24 + 24

 
$ip32 explode("."$ip);  

 
$ip32_spam = (16777216*$ip32[0] + 65536*$ip32[1] + 256*$ip32[2] + $ip32[3]);
 
// echo "16777216*$ip32[0] + 65536*$ip32[1] + 256*$ip32[2] + $ip32[3]<br>";
// echo "ipspam - $ip32_spam<br> ";

$ip32_spam str_replace(' '''$ip32_spam);

$ip32_spam abs($ip32_spam);       
 
 
$sql "SELECT  country_full, ip32_start, ip32_end 
            FROM geoip_data 
            WHERE '
$ip32_spam' between ABS(ip32_start) AND ABS(ip32_end) ";
            
$result mysql_query($sql
            or die(
mysql_error()); 

list(
$country$ip32_start$ip32_end) = mysql_fetch_row($result); 

 
echo 
"<tr><td> $id_spamlog</td><td width=\"10\"></td><td>$ip </td><td>$country</td><td>$viewdate</td><td width=\"20\"><td>$num_spam</td> </tr>
<tr><td height = \"20\"></td></tr>"
;
}
    
$num--; 
     }
echo 
"</table>";
}
?>
Further down in this spam log some bots try as many as 8 times a day.
Yesterday there were 78 different ip addresses trying to register.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01197 seconds
  • Memory Usage 1,807KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete