Advertisement
Guest User

From Site To Filter CMS Sites In The Server

a guest
Dec 1st, 2016
1,036
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.01 KB | None | 0 0
  1. <?php
  2. @set_time_limit(0);
  3. @error_reporting(0);
  4. ignore_user_abort(true);
  5. ini_set('memory_limit', '640000M');
  6. echo "
  7.                                                        
  8. ,--.   ,--.            ,--.       ,--.                  
  9. |   `.'   |,--.--.     |  | ,---. |  |,-. ,---. ,--.--.
  10. |  |'.'|  ||  .--',--. |  || .-. ||     /| .-. :|  .--'
  11. |  |   |  ||  |   |  '-'  /' '-' '|  \  \\   --.|  |    
  12. `--'   `--'`--'    `-----'  `---' `--'`--'`----'`--'    
  13.                                                        
  14. \n\n";
  15. echo "\n==========================================================\n".
  16.      "|| Welcome To Extract Site From IP                      ||\n".
  17.      "==========================================================\n".
  18.      "|| Coded By : MrJoker - Libyan Attacker                 ||\n".
  19.      "==========================================================\n".
  20.      "|| Skype : live:mr9_9 - Face : 1337MrJoker              ||\n".
  21.      "==========================================================\n".
  22.      "|| Usage : php {$argv[0]}                                 ||\n".
  23.      "==========================================================\n";
  24.  
  25. echo"\r\nWebSite-List --> ";
  26. $WB = trim(fgets(STDIN));
  27. if(!file_exists($WB)){
  28. die("File Not Found");
  29. }
  30. $c=file($WB);
  31. echo"\n\n[+] Total Target : ".count($c)."\n\n";
  32. foreach($c as $site){
  33. $site = trim($site);
  34. $ip = gethostbyname($site);
  35. echo "$site "."IP : --> ".$ip." <--";
  36. $sites = @bingReverse($ip);
  37. echo "\n\n\t Total site loaded : ".count($sites)."\n\n";
  38. foreach($sites as $site2)
  39.     {
  40. $getcontents=@get_source($site2);
  41. echo "[#] Scaning : $site2\n";
  42. if (preg_match('#PrestaShop#i', $getcontents)) {
  43.        
  44.         echo "[+] PrestaShop Site = $site2 "."\n";
  45.                 echo "\n";
  46.                 $fopen = fopen("PrestaShop.txt","a+");
  47.                 fwrite($fopen,"$site2"."\n");
  48.                 fclose($fopen);
  49.         }elseif(preg_match('#WordPress#i', $getcontents)){
  50.             echo "[+] WordPress Site = $site2 "."\n";
  51.                 echo "\n";
  52.                 $fopen = fopen("WordPress.txt","a+");
  53.                 fwrite($fopen,"$site2"."\n");
  54.                 fclose($fopen);
  55.         }elseif(preg_match('#Joomla#i', $getcontents)){
  56.             echo "[+] Joomla Site = $site2 "."\n";
  57.                 echo "\n";
  58.                 $fopen = fopen("Joomla.txt","a+");
  59.                 fwrite($fopen,"$site2"."\n");
  60.                 fclose($fopen);
  61.         }else{
  62.                 echo "\n";
  63.                 echo "[-] Unknown CMS"."\n";
  64.                 echo "\n";
  65.         }
  66. }
  67. }
  68. function bingReverse($ip){
  69.     $ch = curl_init();
  70.     $i = 1;
  71.     while($i){
  72.         curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  73.         curl_setopt($ch, CURLOPT_URL, "http://www.bing.com/search?q=ip%3A$ip&first=$i");
  74.         curl_setopt($ch, CURLOPT_USERAGENT, 'msnbot/1.0 (+http://search.msn.com/msnbot.htm)');
  75.         curl_setopt($ch, CURLOPT_ENCODING, "gzip, deflate, compress");
  76.         curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  77.         $data = curl_exec($ch);
  78.         preg_match_all('/<h2><a href="(.*?)"/', $data, $matches);
  79.         $links = array_unique($matches[1]);
  80.         foreach($links as $link){
  81.             $allLinks[] = correctit($link);
  82.         }
  83.         if(!preg_match('#"sw_next"#', $data)) break;
  84.         $i+=10;
  85.     }
  86.     curl_close($ch);
  87.     if(!empty($allLinks) && is_array($allLinks)){
  88.         return array_unique($allLinks);
  89.     }
  90. }
  91. function correctit($http){
  92.     if((strpos(trim($http), "http://") === 0) || (strpos(trim($http), "https://") === 0)){
  93.         return parse_url($http, PHP_URL_HOST);
  94.     }else{  return trim($http); }
  95. }      
  96. function get_source($link, $safemode = false, $agent){
  97.     if($safemode === true) sleep(1);
  98.     if(!$agent){ $agent='Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'; }
  99.     if(!function_exists('curl_init')){
  100.         return file_get_contents($link);
  101.     }else{
  102.         $ch = curl_init();
  103.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  104.         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  105.         curl_setopt($ch, CURLOPT_URL, $link);
  106.         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  107.         curl_setopt($ch, CURLOPT_USERAGENT, $agent);
  108.         curl_setopt($ch, CURLOPT_ENCODING, 0);
  109.         curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  110.         $data = curl_exec($ch);
  111.         curl_close($ch);
  112.        
  113.         return $data;
  114.     }
  115. }
  116. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement