diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2024-07-04 12:28:04 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2024-07-04 12:29:03 +0200 |
commit | f45abc91173438b9149a7cfb5cf5515a85873e1f (patch) | |
tree | 4e5a6aafd06b6de66bea23ed99db5f8e31065ea0 | |
download | volse-webtrap-f45abc91173438b9149a7cfb5cf5515a85873e1f.tar.gz volse-webtrap-f45abc91173438b9149a7cfb5cf5515a85873e1f.tar.bz2 volse-webtrap-f45abc91173438b9149a7cfb5cf5515a85873e1f.zip |
Initial primitive honeypot
-rw-r--r-- | index.html | 0 | ||||
-rw-r--r-- | index.php | 0 | ||||
-rw-r--r-- | payloads/.gitkeep | 0 | ||||
-rw-r--r-- | trap-post-payload.php | 19 |
4 files changed, 19 insertions, 0 deletions
diff --git a/index.html b/index.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/index.html diff --git a/index.php b/index.php new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/index.php diff --git a/payloads/.gitkeep b/payloads/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/payloads/.gitkeep diff --git a/trap-post-payload.php b/trap-post-payload.php new file mode 100644 index 0000000..86918f9 --- /dev/null +++ b/trap-post-payload.php @@ -0,0 +1,19 @@ +<?php +$data = [ + 'SERVER_NAME' => $_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'), +]; + +$file_name = __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"); |