Welcome, Guest!!
follow us on... rss

Author Topic: a php code feature for you all  (Read 3629 times)

bananasfk

  • Newbie
  • *
  • Posts: 2
    • View Profile
a php code feature for you all
« on: June 27, 2011, 01:48:04 AM »
Hi an email  report per bot attempt was ok, but annoying for a webform/something.  Thought i could do a summary say during a set time.

so i init a var and if 1 i run code be careful of users and groups if writing to file,  Enjoy

 in the php file near the bottom (line 258)

Code: [Select]
/* banana*/
$botreport='1';


if($botreport=='1')
{
$msgText = "$XUSER,$XMAIL,$XIP\n";       
/* open file */

$fp = @fopen("bot.txt", "a", 1);

if (!$fp)

   {
   echo 'Information failed to store.';
   exit;

   }



/* write file */

fwrite($fp, $msgText);

}
/* end banana*/

Theres a cron job to report (being quick and dirty)    then each day at 5am i clear file and report next 5am.

Code: [Select]
!/bin/sh
echo Botscout report
ls -la /bot.txt
echo bots spotted:
wc -l bot.txt
cat bot.txt
$>bot.txt
ls -la bot.txt

Issues file permission and job scheduling,  (insert php about line 258)
Changes you could make The feature could write vars to an sqldb.   If you dont like text files.

What you get as output of the cron job:
Quote
-rw-r--r-- 1 www-data www-data 996 2011-06-12 03:34
EndonWakenark,dotoadmilelap%40ziptracker67311.info,91.224.160.6
next bot on this line,
etc

This can be imported into your favorite spreadsheet as a coma delimited data or whatever,

This is very quick (5 minutes) and dirty php code which i run for two weeks on linux, (i dont use windoze)   For the record I like your stuff and i was one of the people who managed to get Robert Soloway to attention and can spam laws first use..

A small thank you to Botscout, for the lookup.  I hope this code is useful to somebody either to run as or adapt further.

Mike

  • Administrator
  • Sr. Member
  • *****
  • Posts: 300
    • View Profile
Re: a php code feature for you all
« Reply #1 on: June 27, 2011, 05:03:28 AM »
Very nice, I'm sure this will be useful to a lot of people. Thank you!

Hi an email  report per bot attempt was ok, but annoying for a webform/something.  Thought i could do a summary say during a set time.
Please don't PM me for assistance- post your questions in the forum where others can see them.