-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbing-dorker.php
46 lines (44 loc) · 1.28 KB
/
bing-dorker.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
<?php
set_time_limit(0);
//error_reporting(0);
// coded by Mr. Magnom
// Re-Coded to Web Based by Mr. Error 404 - IndoXploit
// greetz to Mr. Magnom - Sanjungan Jiwa
// 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){
$exp = explode("/", $url);
$URLs[] = $exp[2];
}
$array = array_filter($URLs);
$array = array_unique($array);
$sss = count(array_unique($array));
//echo "ToTaL SiTe : $sss\n";
//echo "--------------------------------------\n";
foreach($array as $domain) {
echo "http://$domain/\n";
}
}
?>