我已经编写了以下代码,试图结束看似无休止的垃圾邮件攻击。我正在使用我在另一篇与同一问题相关的文章中找到的关键字列表;然而,该作者正在编写不同的架构。我在IIS7上写PHP。问题是当代码确实接收到垃圾邮件引用者而不是访问者重定向到我想要的127.0.0.1时,该页面将呈现为纯文本,页面的内容可见。这是代码:
<?php
$strReferrer = $_SERVER['HTTP_REFERER'];
$strFilterKeywords = array("Uggboots", "porn", "pharma", "viagra", "vuitton", "jerseys", "handbags", "sleep-deprivation", "sleep-disorders", "insomnia", "phentermine", "phentemine", "vicodin", "hydrocodone", "levitra", "hgh-", "-hgh", "ultram-", "-ultram", "cialis", "soma-", "-soma", "diazepam", "gabapentin", "celebrex", "viagra", "fioricet", "ambien", "valium", "zoloft", "finasteride", "lamisil", "meridia", "allegra", "diflucan", "zovirax", "valtrex", "lipitor", "proscar", "acyclovir", "sildenafil", "tadalafil", "xenical", "melatonin", "xanax", "herbal", "drugs", "lortab", "adipex", "propecia", "carisoprodol", "tramadol", "porno", "shemale", "gangbang", "-cock", "-anal", "-orgy", "cock-", "anal-", "orgy-", "singles-christian", "dating-christian", "cumeating", "cream-pies", "cumsucking", "cumswapping", "cumfilled", "cumdripping", "krankenversicherung", "cumpussy", "suckingcum", "drippingcum", "pussycum", "swappingcum", "eatingcum", "cum-", "-cum", "sperm", "christian-dating", "jewish-singles", "sex-meetings", "swinging", "swingers", "personals", "sleeping", "libido", "grannies", "mature", "enhancement", "sexual", "gay-teen", "teen-chat", "gay-chat", "adult-finder", "adult-friend", "friend-finder", "friend-adult", "finder-adult", "finder-friend", "discrete-encounters", "cheating-wives", "housewives", "/-sex/", "xxx", "snowballing", "fat-", "-fat", "diet", "pills", "weight", "supplement", "texas-hold-em", "poker", "casino", "blackjack", "mortgage", "refinancing", "cash-advance", "cash-money", "pay-day", "netwasgroup.com", "nic4u.com", "wear4u.com", "foxmediasolutions.com", "liveplanets.com", "aeterna-tech.com", "continentaltirebowl.com", "chemsymphony.com", "infolibria.com", "globaleducationeurope.net", "soma/125mb.com", "mitglied/lycos.de", "foxmediasolutions.com", "jroundup.com", "feathersandfurvanlines.com", "conecrusher/org", "sbj-broadcasting.com", "edthompson.com", "codychesnutt.com", "artsmallforsenate.com", "axionfootwear.com", "protzonbeer.com", "candiria.com", "bigsitecity.com", "coresat.com", "istarthere.com", "amateurvoetbal.net", "alleghanyeda.com", "xadulthosting.com", "datashaping.com", "zick/biz", "newprinceton.com", "dvdsqueeze.com", "xopy.com", "webdevboard.com", "devaddict.com", "eaton-inc.com", "whiteguysgroup.com", "guestbookz.com", "webdevsquare.com", "indfx.net", "snap/to", "2y.net", "astromagia/info", "free-sms");
foreach ($strFilterKeywords as $strFilter) {
if stripos($strReferrer, $strFilter) !== false
{
Header("Location: http://127.0.0.1");
}
}
unset($strFilter)
?>
有什么想法吗?
谢谢, 杰森
ANSWERED&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT ;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;&GT;
在我批准答案之前,提供工作解决方案的人取消了他的职位;然而,为了别人的利益,我希望他的回答是可见的。以下是他建议的代码:
<?php
$strReferrer = $_SERVER['HTTP_REFERER'];
$strFilterKeywords = array("Uggboots", "whiteguysgroup.com", "guestbookz.com", "webdevsquare.com", "indfx.net", "snap/to", "2y.net", "astromagia/info", "free-sms");
foreach ($strFilterKeywords as $strFilter)
{
if( stristr($strReferrer, $strFilter) ) // wrap the if statement in ( ) - use stristr function
{
header("Location: http://127.0.0.1");
}
}
unset($strFilter); // end ;
?>
对于这个神秘答案的人,我表示衷心的感谢!
杰森
答案 0 :(得分:0)
尝试更改
Header("Location: http://127.0.0.1");
到例如
Header("Location: http://google.com");
查看问题是否是您的脚本。虽然看起来不错。如果呈现“页面的内容”(我假设你的意思是php代码),它表示服务器的配置问题,即它不解释PHP,而是将其作为纯文本提供。