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'; ?>