$_SERVER['SERVER_NAME'], 'REMOTE_ADDR' => $_SERVER['REMOTE_ADDR'], 'REMOTE_PORT' => $_SERVER['REMOTE_PORT'], 'REQUEST_METHOD' => $_SERVER['REQUEST_METHOD'], 'REQUEST_URI' => $_SERVER['REQUEST_URI'], 'QUERY_STRING' => $_SERVER['QUERY_STRING'], 'REQUEST_TIME' => $_SERVER['REQUEST_TIME'], 'REQUEST_HEADERS' => getallheaders(), 'POST' => $_POST, 'COOKIES' => $_COOKIE, 'BODY' => file_get_contents('php://input'), ]; if (preg_match('/xmlrpc\.php/i', $data['REQUEST_URI']) && $data['REQUEST_METHOD'] === 'POST') { $method = XmlRpcMethod::parse($data['BODY']); if ($method->name === 'wp.getUsersBlogs') { $file_name = dirname(__DIR__) . '/payloads/credentials.txt'; $file = new SplFileObject($file_name, 'a'); $file->fwrite("{$method->params[0]}: {$method->params[1]}\n"); error_log("Trapped XML-RPC request, saving credentials to {$file_name}"); header("HTTP/1.1 404 Not Found"); die(); } } $file_name = dirname(__DIR__) . "/payloads/{$data['REQUEST_TIME']}-{$data['SERVER_NAME']}.json"; error_log("Trapped request, saving to {$file_name}"); file_put_contents($file_name, json_encode($data)); header("HTTP/1.1 404 Not Found");