4 function ip_rand($all = false) {
6 return(rand(1,254).'.'.rand(1,254).'.'.rand(1,254).'.'.rand(1,254));
8 return(rand(0,255).'.'.rand(0,255).'.'.rand(0,255).'.'.rand(0,255));
12 function ip_range($ip) {
13 $ip = explode('.', trim($ip));
14 if($ip[0]==0 ||
$ip[0]==255) return 3;
15 if($ip[0]==127 && $ip[1]==0 && $ip[2]==0) return 2;
16 if($ip[0]==10) return 1;
17 if($ip[0]==172 && $ip[1]>=16 && $ip[1]<=31) return 1;
18 if($ip[0]==192 && $ip[1]==168) return 1;
22 function scan_check($ip, $port=80, $timeout = 0.4) {
23 $fp = @fsockopen
($ip, $port, $errno, $errstr, $timeout);
27 //while(1) echo(ip_range(ip_rand())."\n");
31 if(ip_range($ip = ip_rand())) continue;
32 if(scan_check($ip, 23)) echo($ip."\n");
33 //echo($ip.' - '.gethostbyaddr($ip)."\n"); //Debug
36 24-bit block 10.0.0.0 - 10.255.255.255
37 20-bit block 172.16.0.0 - 172.31.255.255
38 16-bit block 192.168.0.0 - 192.168.255.255
This page took 0.386087 seconds and 4 git commands to generate.