Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Author : Skandare
- Project : Bing Subdomain Scanner
- Thanks : all islamic
- #MaRocco hackers Production
- */
- //No Max Execution Time
- set_time_limit(0);
- //Curl Function
- function curlreq($domain)
- {
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($curl, CURLOPT_URL, $domain);
- $result = curl_exec($curl);
- return $result;
- }
- //Url Cleaning
- function cleanme($url)
- {
- if(preg_match("/^(http(?:s):\/\/)(www\.)?([^\/]+)/i",$url, $matches))
- {
- $host = $matches[3];
- }
- else
- {
- $url = $url;
- preg_match("/^(www\.)?([^\/]+)/i",$url, $matches);
- $host = $matches[2];
- }
- return trim($host);
- }
- // Enter Domain Name http://google.co.ma
- if (isset($_POST['web'])) {
- $web = $_POST['web'];
- $i = 1;
- $subdomains = array();
- while (true)
- {
- $website = curlreq("http://www.bing.com/search?q=domain%3a".$web."&first=".$i);
- $searchme = '#<div class="sb_meta"><cite>(.*?)</cite>#si';
- preg_match_all($searchme, $website, $matches);
- array_push($subdomains, $matches[1]);
- if($i == 1)
- {
- $i = 11;
- }
- else
- {
- $i = $i +12;
- }
- if(!preg_match('/Next/',$website)){break;}
- }
- //print_r($subdomains);
- //get Unique Results
- array_unique($subdomains);
- sort($subdomains);
- //Result
- echo "<textarea rows=\"10\" cols=\"50\">";
- $countotal = 1;
- foreach ($subdomains as $value)
- {
- foreach ($value as $name)
- {
- echo cleanme($name)."\n";
- $countotal++;
- }
- }
- echo "</textarea><br>";
- echo "Number of Subdomains : $countotal";
- }
- ?>
- <html>
- <form method="POST" action="">
- <input name="web" type="text"> <br />
- <input type="submit" value="Scan!">
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement