Referrer Spam may also be known as "access_log spam", "stat spam", or other names. Referrer Spam appears as if your site has been linked to from sites like "incest-taboo.com", "asstraffic.biz" or "rape-stories.biz", and they are sending a lot of traffic to your site. If you use a web-based statisitics program like Webalizer or Urchin, then they may appear as your highest sources of traffic.
The problems are many. First, your church group might not want to appear that they are getting so much traffic from porn sites. Second, it skews your view of your real stats from real visitors. Third, the spammer's bot can consume a ton of bandwidth, which may cost you money.
Figure 1: Two Spam Bots consuming big bandwidth from a personal site:As with e-mail spam, someone is payng the spammers for "advertising" or "spamvertising".
Using your firewall is going to be the the method that will require the least amount of resources from your servers.
With IPTables (Linux):iptables -A INPUT -p tcp -s 64.124.222.172 -j REJECTWith PF (BSD):
block in quick inet from 64.124.222.172 to anyThe Windows 2000 and XP built-in "IP Filtering" can't be configured to block single addresses. Use a network-based firewall product or another OS.
Here are some examples on how to use Apache's Rewrite Engine (mod_rewrite). The below example will take any request with a HTTP_REFERER field of any of the domains below and return a "Forbidden" to the requestor.
RewriteCond %{HTTP_REFERER} allinternal\.biz [OR] RewriteCond %{HTTP_REFERER} djhits\.com [OR] RewriteCond %{HTTP_REFERER} asstraffic\.biz [OR] RewriteCond %{HTTP_REFERER} ass-traffic\.biz [OR] RewriteCond %{HTTP_REFERER} drtushy\.biz [OR] RewriteCond %{HTTP_REFERER} "-cartoon" [OR] RewriteCond %{HTTP_REFERER} "-sex" [OR] RewriteCond %{HTTP_REFERER} "-naked" [OR] RewriteCond %{HTTP_REFERER} "incest-" [OR] RewriteCond %{HTTP_REFERER} "teen-" [OR] RewriteCond %{HTTP_REFERER} "xxx" [OR] RewriteCond %{HTTP_REFERER} "-rape" [OR] RewriteCond %{HTTP_REFERER} "-stories" [OR] RewriteCond %{HTTP_REFERER} "hardcore" RewriteRule .* - [F,L]
While option 2 above will block requests with certain characteristics, it may prove easier to just block the source of the requests if they seem to come from only a few sources.
Apache:Order Allow,Deny Allow from all Deny from sys53.3fe.net 64.124.222.172 anotherspammer.bizMicrosoft IIS: