-
Notifications
You must be signed in to change notification settings - Fork 5
/
Mini Bing Dorker (PHP)
59 lines (51 loc) · 1.76 KB
/
Mini 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
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
print "
Mr.MaGnoM
mini bing dorker
https://www.facebook.com/mr.magnom2/
http://magsec.blogspot.com/
";
// function getsource is not made by me .
// usage : php script.php
function getsource($url, $proxy) {
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
if ($proxy) {
$proxy = explode(':', autoprox());
curl_setopt($curl, CURLOPT_PROXY, $proxy[0]);
curl_setopt($curl, CURLOPT_PROXYPORT, $proxy[1]);
}
$content = curl_exec($curl);
curl_close($curl);
return $content;
}
echo "\n\t ur dork here : ";$dork=trim(fgets(STDIN,1024));
$do=urlencode($dork);
//$ip="200.58.111.34";
$npage = 1;
$npages = 30000;
$allLinks = array();
$lll = array();
while($npage <= $npages) {
$x = getsource("http://www.bing.com/search?q=".$do."&first=" . $npage."&FORM=PERE4", $proxy);
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"\nToTaL SiTe : ". $sss.'';
foreach ($array as $domain) {
echo"\nhttp://".$domain.'/';
}
?>