Mr1337Joker

Extract Site From List IP ( OpenCart )

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