-
Notifications
You must be signed in to change notification settings - Fork 0
/
xss-glitch.php
31 lines (31 loc) · 1.11 KB
/
xss-glitch.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
$timeNow = date('Y-m-d-H-i-s');
$requestHeaders = getallheaders();
$requestMethod = $_SERVER['REQUEST_METHOD'];
$requestUri = $_SERVER['REQUEST_URI'];
$requestQuery = $_SERVER['QUERY_STRING'];
function uuid() {
$chars = md5(uniqid(mt_rand(), true));
$uuid = substr ( $chars, 0, 8 ) . '-'
. substr ( $chars, 8, 4 ) . '-'
. substr ( $chars, 12, 4 ) . '-'
. substr ( $chars, 16, 4 ) . '-'
. substr ( $chars, 20, 12 );
return $uuid ;
}
$httpReqData = "Captured HTTP Request Information: \n------------------\n";
$httpReqData .= "Method: " . $requestMethod . "\n";
$httpReqData .= "Uri : " . $requestUri. "\n";
$httpReqData .= "Query : " . $requestQuery. "\n\n";
foreach ($requestHeaders as$key => $value) {
$httpReqData .= $key . ": " .$value . "\n";
}
if ($requestMethod === 'POST') {
$httpReqData .= "\nPOST Data:\n";
foreach ($_POST as$key => $value) {
$httpReqData .=$key . ": " . $value . "\n";
}
}
$httpReqData .= "------------------\n";
$outputFileName = $timeNow . '-' . uuid() . '.txt';
file_put_contents($outputFileName, $httpReqData, FILE_APPEND | LOCK_EX);