| 1 | <?php |
| 2 | //Googlevulnbot |
| 3 | |
| 4 | $q = urlencode("allinurl:iis"); //Google query string |
| 5 | $total = 1020; //Max results |
| 6 | $num = 100; //Results per page |
| 7 | $start = 0; //First result |
| 8 | |
| 9 | if(isset($argv[1])) $q = urlencode($argv[1]); |
| 10 | while($start < $total) { |
| 11 | $query = "http://www.google.cz/search?q=$q&num=$num&hl=cs&lr=&as_qdr=all&start=$start&sa=N"; |
| 12 | $start = $start + $num; |
| 13 | preg_match_all('(http:\/\/[_a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,4})',htmlspecialchars_decode(file_get_contents($query)), $response); //{1}[-_~&=\ ?\.a-z0-9\/]* |
| 14 | $response = $response[0]; |
| 15 | unset($stack); $stack[0] = ''; |
| 16 | foreach($response as $addr) { |
| 17 | $addr = str_replace('http://', '', $addr); |
| 18 | $addr = trim($addr); |
| 19 | if (!eregi("(209\.85\.135\.104|google|<|>|htm|php|gif|jpg)", $addr) && !in_array($addr, $stack) ) { |
| 20 | echo($addr."\n"); |
| 21 | array_push($stack, $addr); |
| 22 | } |
| 23 | } |
| 24 | } |