forked from gwen001/pentest-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ssrf-generate-ip.php
executable file
·63 lines (58 loc) · 1.19 KB
/
ssrf-generate-ip.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
<?php
$t_ip = array();
$t_init = array(
'localhost',
'0.0.0.0',
'127.0.0.1',
);
$how_much = 10000;
$port = 0;
$file = 'ssrf_ip.txt';
$t_port = '21,22,23,25,53,80,110,111,135,139,143,443,445,993,995,1723,3306,3389,5900,8080';
$t_port = explode( ',', $t_port );
$cnt_port = count($t_port) - 1;
foreach( $t_init as $ip ) {
$t_ip[] = $ip;
if( $port > 0 ) {
$ip .= ':'.$port;
$t_ip[] = $ip;
} elseif( $port < 0 ) {
$ip .= ':'.$t_port[rand(0,$cnt_port)];
$t_ip[] = $ip;
}
}
/*
for( $i=0 ; $i<$how_much ; $i++ ) {
$ip = '10.'.rand(0,254).'.'.rand(0,254).'.'.rand(0,254);
if( $port > 0 ) {
$ip .= ':'.$port;
} elseif( $port < 0 ) {
$ip .= ':'.$t_port[rand(0,$cnt_port)];
}
$t_ip[] = $ip;
}
*/
for( $i=0 ; $i<$how_much ; $i++ ) {
$ip = '172.31.'.rand(0,254).'.'.rand(0,254);
if( $port > 0 ) {
$ip .= ':'.$port;
} elseif( $port < 0 ) {
$ip .= ':'.$t_port[rand(0,$cnt_port)];
}
$t_ip[] = $ip;
}
/*
for( $i=0 ; $i<$how_much ; $i++ ) {
$ip = '192.168.'.rand(0,254).'.'.rand(0,254);
if( $port > 0 ) {
$ip .= ':'.$port;
} elseif( $port < 0 ) {
$ip .= ':'.$t_port[rand(0,$cnt_port)];
}
$t_ip[] = $ip;
}
*/
//var_dump( $t_ip );
file_put_contents( $file, implode("\n",$t_ip) );
exit();
?>