"") $ss = $s."?".str_replace($_SERVER["QUERY_STRING"],"'","''"); $_SESSION["ReturnPage"] = $s; } //--------------------------- Lookup Host if necessary and then log servervariables ------------------- if (isset($_SESSION["Remote_Domain"])) $str_Remote_Domain=$_SESSION["Remote_Domain"]; else $str_Remote_Domain=""; if (isset($_SERVER["HTTP_REFERER"])) $str_HTTP_REFERER=$_SERVER["HTTP_REFERER"]; else $str_HTTP_REFERER=""; if (isset($_SERVER["REMOTE_ADDR"])) $str_REMOTE_ADDR=$_SERVER["REMOTE_ADDR"]; else $str_REMOTE_ADDR=""; $bool_bot=false; $str_Remote_Domain=""; if ($str_Remote_Domain=="") { $remoteIP=$_SERVER["REMOTE_ADDR"]; if (strstr($remoteIP, ', ')) { $ips = explode(', ', $remoteIP); $remoteIP = $ips[0]; } $str_Remote_Domain=gethostbyaddr($remoteIP); $_SESSION["Remote_Domain"]=$str_Remote_Domain; //if ($str_Remote_Domain=="") AddToLog ("Reverse Lookup", 1411, "Reverse lookup failed for address \"$remoteIP\"."); //else AddToLog ("Reverse Lookup", 1411, "Domain = $str_Remote_Domain"); $ip=explode(".",$remoteIP); $str_lookupname="osxzmhrhsgbk.".$ip[3].".".$ip[2].".".$ip[1].".".$ip[0].".dnsbl.httpbl.org"; $str_honeypot_lookup=gethostbyname($str_lookupname); if ($str_honeypot_lookup==$str_lookupname) { //AddToLog ("Honeypot Lookup", 1411, "Honeypot lookup failed for address \"$remoteIP\"."); $str_honeypot_lookup="255.255.255.255"; // Set to indicate unknown (probably safe?) lookup score } else { AddToLog ("Reverse Lookup", 1411, "Honeypot = $str_honeypot_lookup"); $hp=explode(".",$str_honeypot_lookup); // if type==Suspicious(score 40) or type>Suspicious(Score 10) blacklist if ($hp[0]==127) // if not 127 then some kind of error has occurred if ($hp[3]==0) $bool_bot=true; //if ((($hp[3]>1) && ($hp[2]>10)) || (($hp[3]==1) && ($hp[2]>40))) $bool_blacklist=true; } } if (!$bool_bot) { //echo "Blacklisted by personal request! How nice!"; if ($bool_blacklist) blacklist("Blacklisted by personal request! How nice!"); /* // prepare mail message $swift =& new Swift(new Swift_Connection_NativeMail()); $mail =& new Swift_Message("Blacklisted $str_Remote_Domain", "Fool got himself blacklisted by personal request."); // Add recipients $recipients =& new Swift_RecipientList(); $recipients->addTo("dave.driesen@pandemonium.be", "Dave Driesen"); $from =& new Swift_Address("webmaster@pandemonium.be", "Webmaster"); // Send if (!$swift->send($mail, $recipients, $from)) { // do nothing, not needed } */ if (checkblacklist()) { echo "Do not click here: root"; Die(); } } ?>