Honeypot

honeypot.php

<?php
$timestamp = date("d.m.Y H:i:s");
$ip = $_SERVER["REMOTE_ADDR"];
$host = gethostbyaddr($_SERVER['HTTP_X_REAL_IP']);
$reqtype = $_SERVER['REQUEST_METHOD'];
$file = $_SERVER['REQUEST_URI'];
$browser = $_SERVER["HTTP_USER_AGENT"];

$filename="logging/logfile.txt";

$header = array("Timestamp", "IP", "Hostname", "RequestType", "File", "Browser");
$infos = array($timestamp, $ip, $host, $reqtype, $file, $browser);

$entry = implode("\t", $infos);

$write_header = !file_exists($filename);

$file=fopen($filename,"a");

if($write_header) {
$heading = implode("\t", $header);
fwrite($file, $heading."\n");
}

fwrite($file,$entry."\n");
fclose($file);
?>

xmlrpc.php / wp-login.php #1:

<?php include 'honeypot.php'; ?>

Array: Datum mit ausgeschriebenem Monat

<?php $monate = array(1=>"Januar",
                2=>"Februar",
                3=>"Maerz",
                4=>"April",
                5=>"Mai",
                6=>"Juni",
                7=>"Juli",
                8=>"August",
                9=>"September",
                10=>"Oktober",
                11=>"November",
                12=>"Dezember");
$monat = date("n");
$tag = date("d");
$jahr = date("Y");
?>

<p><b>Datum: <?php echo $tag,". ",$monate[$monat]," ",$jahr;?></b></p>

Banner-rotator mit mt_rand

<?php
$Img1 = "/banner/TASK-one.png";
$Url1 = "http://www.TASK-one.tld";
$Alt1 = "TASK-one";

$Img2 = "/banner/TASK-two.png";
$Url2 = "http://www.TASK-two.tld";
$Alt2 = "TASK-two";

$num = mt_rand (1,2);

$Image = ${'Img'.$num};
$URL = ${'Url'.$num};
$Alt = ${'Alt'.$num};

Print "<a href=\"".$URL."\" target=\"_blank\"><img src=\"".$Image."\" alt=\"".$Alt."\" height=\"68\" width=\"300\" border=\"0\" /></a>";
?>