[ Index ]

PHP Cross Reference of Nuke-Evolution v2.0.5

title

Body

[close]

/ -> trap.php (source)

   1  <?
   2  
   3  //Idea taken from http://seven-3-five.blogspot.com/2006/09/simple-php-based-bad-bot-trap_04.html
   4  
   5  $ip = $_SERVER['REMOTE_ADDR'];
   6  header("Content-type: text/html; charset=utf-8");
   7  echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
   8  echo '<html xmlns="http://www.w3.org/1999/xhtml">
   9      <head>
  10      <title>Caught You!</title>
  11      </head>
  12  
  13      <body>
  14      <p>You will now be banned!</p>
  15  
  16      </body>
  17  </html>';
  18  $text = 'deny from ' . $ip . "\r\n";
  19  $file = dirname(__FILE__).'/.htaccess';
  20  
  21  if (is_file($file) && is_writable($file)){
  22      if ($handle = @fopen($file, 'a')) {
  23          fwrite($handle, $text);
  24          fclose($handle);
  25      }
  26  }
  27  
  28  ?>


Generated: Wed Jun 6 11:38:01 2007 Cross-referenced by PHPXref 0.7