<form method=post > <input type=text size=9 name=ip value='0.0.0'> <input type=submit value="Сканировать Диапазон x.x.x.0-x.x.x.255"> <?php if(isset($_POST['button'])) { $ip = $_POST['ip']; $valid_file = 'good_list.txt'; for($i=1; $i<255;$i++) if($fs = fsockopen("http://$ip.$i/index.php", 80, $errno, $errstr, 1)) $new_spisok[$i] = "http://$ip.$i/index.php"; $fp = fopen($valid_file, 'w'); for($i=0; $i<count($new_spisok); $i++) fwrite($fp, $new_spisok[$i]); fclose($fp); } ?>
<?php $valid_file = 'good_spisok.txt'; $new_spisok = array(); for($i=1; $i<255;$i++) if(file_get_contents("http://58.211.53.".$i."/index.php")) $new_spisok[] = "http://58.211.53.".$i."/index.php"; $fp = fopen($valid_file, 'w'); for($i=0; $i<count($new_spisok); $i++) fwrite($fp, $new_spisok[$i]); fclose($fp); ?>