Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- set_time_limit(0);
- /**
- * @author: jjeincovers!
- * thx! sanjunganjiwa x idx!
- * usage: php bing.php 'bing_dork' -> with ' (ex: php bing.php '"/admin/" site:com')
- */
- function getsource($url) {
- $curl = curl_init($url);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
- $content = curl_exec($curl);
- curl_close($curl);
- return $content;
- }
- $do = urlencode($argv[1]);
- if(isset($argv[1])) {
- $npage = 1;
- $npages = 30000;
- $allLinks = array();
- $lll = array();
- while($npage <= $npages) {
- $x = getsource("http://www.bing.com/search?q=".$do."&first=".$npage);
- if($x) {
- preg_match_all('#<h2><a href="(.*?)" h="ID#', $x, $findlink);
- foreach ($findlink[1] as $fl) array_push($allLinks, $fl);
- $npage = $npage + 10;
- if (preg_match("(first=" . $npage . "&)siU", $x, $linksuiv) == 0) break;
- } else break;
- }
- $URLs = array();
- foreach($allLinks as $url){
- echo "$url\n";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement