<?php
function checkSpam($ipAddress) {
// Validate the IP address
if (!filter_var($ipAddress, FILTER_VALIDATE_IP)) {
echo "Invalid IP address format\n";
return;
}
// List of spam databases to check
$spamDatabases = array(
"b.barracudacentral.org",
"bl.spamcop.net",
"dnsbl.sorbs.net",
"zen.spamhaus.org"
);
// Check each database for the IP address
foreach ($spamDatabases as $db) {
$query = $ipAddress . "." . $db;
$result = gethostbyname($query);
// Check if the IP address is listed
if ($result == "127.0.0.2" || $result == "::1") {
echo "$ipAddress found in $db\n";
return;
} else {
echo "$ipAddress not found in $db\n";
}
}
}
// Example usage
$ipToCheck = "123.456.789.10"; // Replace this with the IP address you want to check
checkSpam($ipToCheck);
?>
IP adresi biçimini doğrular ve ardından DNSBL (DNS Kara Listesi) aramalarını kullanarak birkaç spam veritabanına karşı kontrol eder. IP adresi veritabanlarından herhangi birinde bulunursa, nerede bulunduğunu belirten bir mesaj yazdırır. Aksi takdirde IP adresinin belirli bir veritabanında bulunamadığını belirten bir mesaj yazdırır.
Yorumlar (0)
Burada henüz yorum yok, ilk siz olabilirsiniz!