我有这个用 PHP 编写的函数
<?php
/***************************************************************************************
This is a simple PHP script to lookup for blacklisted IP against multiple DNSBLs at once.
You are free to use the script, modify it, and/or redistribute the files as you wish.
Homepage: http://dnsbllookup.com
****************************************************************************************/
function flush_buffers(){
ob_end_flush();
flush();
ob_start();
}
function dnsbllookup($ip)
{
$dnsbl_lookup=array(
"access.redhawk.org",
"b.barracudacentral.org",
"bl.csma.biz",
"bl.emailbasura.org",
"bl.spamcannibal.org",
"bl.spamcop.net",
"bl.technovision.dk",
"blackholes.five-ten-sg.com",
"blackholes.wirehub.net",
"blacklist.sci.kun.nl",
"block.dnsbl.sorbs.net",
"blocked.hilli.dk",
"bogons.cymru.com",
"cart00ney.surriel.com",
"cbl.abuseat.org",
"dev.null.dk",
"dialup.blacklist.jippg.org",
"dialups.mail-abuse.org",
"dialups.visi.com",
"dnsbl.ahbl.org",
"dnsbl.antispam.or.id",
"dnsbl.cyberlogic.net",
"dnsbl.kempt.net",
"dnsbl.njabl.org",
"dnsbl.sorbs.net",
"dnsbl-1.uceprotect.net",
"dnsbl-2.uceprotect.net",
"dnsbl-3.uceprotect.net",
"duinv.aupads.org",
"dul.dnsbl.sorbs.net",
"dul.ru",
"escalations.dnsbl.sorbs.net",
"hil.habeas.com",
"http.dnsbl.sorbs.net",
"intruders.docs.uu.se",
"ips.backscatterer.org",
"korea.services.net",
"mail-abuse.blacklist.jippg.org",
"misc.dnsbl.sorbs.net",
"msgid.bl.gweep.ca",
"new.dnsbl.sorbs.net",
"no-more-funn.moensted.dk",
"old.dnsbl.sorbs.net",
"pbl.spamhaus.org",
"proxy.bl.gweep.ca",
"psbl.surriel.com",
"pss.spambusters.org.ar",
"rbl.schulte.org",
"rbl.snark.net",
"recent.dnsbl.sorbs.net",
"relays.bl.gweep.ca",
"relays.bl.kundenserver.de",
"relays.mail-abuse.org",
"relays.nether.net",
"rsbl.aupads.org",
"sbl.spamhaus.org",
"smtp.dnsbl.sorbs.net",
"socks.dnsbl.sorbs.net",
"spam.dnsbl.sorbs.net",
"spam.olsentech.net",
"spamguard.leadmon.net",
"spamsources.fabel.dk",
"tor.ahbl.org",
"web.dnsbl.sorbs.net",
"whois.rfc-ignorant.org",
"xbl.spamhaus.org",
"zen.spamhaus.org",
"zombie.dnsbl.sorbs.net",
"bl.tiopan.com",
"dnsbl.abuse.ch",
"tor.dnsbl.sectoor.de",
"ubl.unsubscore.com",
"cblless.anti-spam.org.cn",
"dnsbl.tornevall.org",
"dnsbl.anticaptcha.net",
"dnsbl.dronebl.org"
); // Add your preferred list of DNSBL's
$AllCount = count($dnsbl_lookup);
$BadCount = 0;
if($ip)
{
$reverse_ip = implode(".", array_reverse(explode(".", $ip)));
foreach($dnsbl_lookup as $host)
{
if(checkdnsrr($reverse_ip.".".$host.".", "A"))
{
echo "<span color='#339933'>Listed on ".$reverse_ip.'.'.$host."!</span><br/>";
flush_buffers();
$BadCount++;
}
else
{
echo "Not listed on ".$reverse_ip.'.'.$host."!<br/>";
flush_buffers();
}
}
}
else
{
echo "Empty ip!<br/>";
flush_buffers();
}
echo "This ip has ".$BadCount." bad listings of ".$AllCount."!<br/>";
flush_buffers();
}
if(preg_match("/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\z/",@$_GET['ip']) == true)
{
dnsbllookup($_GET['ip']);
}
?>
如果在某些黑名单中列出,它会检查 IP
http://127.0.0.1/check4_html.php?ip=123.123.123.123
Not listed on 123.123.123.123.access.redhawk.org!
Not listed on 123.123.123.123.b.barracudacentral.org!
Not listed on 123.123.123.123.bl.csma.biz!
Not listed on 123.123.123.123.bl.emailbasura.org!
bu 我有一个小问题,我想在每次检查时刷新输出,我该怎么做?
脚本运行时发生的第一件事,我等待 20 秒,然后弹出 20 次检查,然后每秒 1 次,这是为什么呢?
任何帮助,将不胜感激。