RSS Feed Technorati Profil Share Share

Honeypod Code - PHP-Snipplet · 29.03.2009 20:20

BloodyWing

Ein Stück PHP Code zu Honeypot
Funktioniert auf jeden Fall standalone, braucht aber PHP5.

EN: A short PHPCode snipplet for Honeypot. Works for testing purposes standalone, but needs PHP5.
Download: httpbl.php

Working example here …: Klick me!
I know it is white, that meens you’re not a spamer :) – go take a cup of coffee and get your own api key.

  1. <?php // Honeypot Module
  2.     $key = "BLABLABLA"; // Your API Key
  3.     $honig = "http://example.org/link/to/honeypot.php"; // Your Honeypot
  4.     $ip = implode( ".", array_reverse(explode(".",$_SERVER["REMOTE_ADDR"]))); // Visitor IP
  5.     $result = dns_get_record($key . "." . $ip . "." . "dnsbl.httpbl.org",DNS_A); // the query :)
  6.     $toleranz = 20; // higher values = more tolerance - the threadlevel;
  7.     $days = 30; //Bot will not be checked if last activity is above $days days
  8. $data = explode (".",$result[0]['ip']);
  9.  if ($data[0] == 127) {
  10.   if ($data[1] < $days) {
  11.   $spam = '1';
  12.   }
  13.    if ($data[2] > $toleranz) {
  14.   $spam .= '1';
  15.    }
  16.   if ($data[3] > 1)
  17.     {
  18.   $spam .= '1';
  19.     }
  20.   if ($data[2] > 70)
  21.   {
  22.   $spam = '111';
  23.   }
  24.  }
  25.  if (strcmp('111',$spam) == 0) {
  26.  $blocked = true;
  27.  header( "HTTP/1.1 301 Moved Permanently ");
  28.  header( "Location: $honig" );
  29.  }
  30.  if ($blocked) die(); ?>
Tags: , , ,
Kategorie:

— BloodyWing

---

Kommentare

Textile-Hilfe
(Vorschau muss ein mal geklickt werden)

|