LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-14-2008, 10:07 AM   #1
xchido
LQ Newbie
 
Registered: Jul 2005
Posts: 22

Rep: Reputation: 15
Unhappy Referrer Spam is killing my site. over 1million hits in the last 5 days


Since Friday I get inundated with hits on my site coming from sites that do not have a link to my site. I did some research and found out how to stop some of them. I am still getting thousands of hits that show like this on my logs.


Code:
86.207.195.215 - - [14/May/2008:02:42:34 -0400] "GET /%22http://www.myspace.com/modules/Admin/pnstyle/modules/Admin/pnstyle/%22http://www.myspace.com/modules/Admin/pnstyle/%22http://www.myspace.com/themes/ExtraLite/style/modules/Admin/pnstyle/modules/Admin/pnstyle/%22http://www.myspace.com/themes/ExtraLite/style/%22http://www.myspace.com/themes/ExtraLite/style/themes/ExtraLite/style/themes/ExtraLite/style/%22http://www.myspace.com/themes/ExtraLite/style/themes/ExtraLite/style/%22http://www.myspace.com/themes/ExtraLite/style/modules/Admin/pnstyle/modules/Admin/pnstyle/modules/Admin/pnstyle/themes/ExtraLite/style/%22http://www.myspace.com/themes/ExtraLite/style/themes/ExtraLite/style/%22http://www.myspace.com/%22http://www.myspace.com/themes/ExtraLite/style/modules/Admin/pnstyle/modules/Admin/pnstyle/%22http://www.myspace.com/themes/ExtraLite/style/%22http://www.myspace.com/themes/ExtraLite/style/%22http://www.myspace.com/themes/ExtraLite/style/modules/Admin/pnstyle/themes/ExtraLite/style/modules/Admin/pnstyle/modules/Admin/pnstyle/%22http://www.myspace.com/%22http://www.myspace.com/%22http://www.myspace.com/modules/Admin/pnstyle/modules/Admin/pnstyle/themes/ExtraLite/style/%22http://www.myspace.com/modules/Admin/pnstyle/themes/ExtraLite/style/index.php?name=News&catid=&topic=4 HTTP/1.1" 404 - www.visitazacatecas.org "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)" "-"


210.214.47.44 - - [14/May/2008:02:42:26 -0400] "GET /%22http://www.laopinion.com%22%3ELa%20Opini%F3n%3C/modules/Admin/pnstyle/%22http://www.myspace.com/modules/Admin/pnstyle/modules/Admin/pnstyle/%22http://www.myspace.com/modules/Admin/pnstyle/modules/Admin/pnstyle/modules/Admin/pnstyle/themes/ExtraLite/style/themes/ExtraLite/style/modules/Admin/pnstyle/themes/ExtraLite/style/themes/ExtraLite/style/%22http://www.myspace.com/%22http://www.myspace.com/themes/ExtraLite/style/%22http://www.myspace.com/modules/Admin/pnstyle/themes/ExtraLite/style/themes/ExtraLite/style/modules/Admin/pnstyle/modules/Admin/pnstyle/themes/ExtraLite/style/modules/Admin/pnstyle/%22http://www.myspace.com/themes/ExtraLite/style/%22http://www.myspace.com/%22http://www.myspace.com/modules/Admin/pnstyle/modules/Admin/pnstyle/themes/ExtraLite/style/%22http://www.myspace.com/modules/Admin/pnstyle/modules/Admin/pnstyle/themes/ExtraLite/style/modules/Admin/pnstyle/%22http://www.myspace.com/themes/ExtraLite/style/modules/Admin/pnstyle/modules/Admin/pnstyle/%22http://www.myspace.com/%22http://www.myspace.com/themes/ExtraLite/style/%22http://www.myspace.com/modules/Admin/pnstyle/modules/Admin/pnstyle/%22http://www.myspace.com/modules/Admin/pnstyle/themes/ExtraLite/style/themes/ExtraLite/style/themes/ExtraLite/style/%22http://www.myspace.com/themes/ExtraLite/style/index.php?name=News&catid=&topic=18 HTTP/1.1" 404 - www.quierozacatecas.net "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)" "-"


This is what I have in my htaccess file:


To block ips I use this
Code:
<Limit GET HEAD POST>
order allow,deny
deny from 210.214.47.44
deny from "I just keep adding ip here"
allow from all
</LIMIT>
Also, I use this for spam referrers
Code:
SetEnvIfNoCase Referer "^http://(www.)?fillbest.com" spam_ref=1
SetEnvIfNoCase Referer "^http://(www.)?pharma-cy.info" spam_ref=1
SetEnvIfNoCase Referer "^http://(www.)?wikili.com" spam_ref=1
SetEnvIfNoCase Referer "^http://(www.)?forex-here.com" spam_ref=1
SetEnvIfNoCase Referer "^http://(www.)?I KEEP ADDING REFERESR HERE" spam_ref=1


# block all referrers that have spam_ref set

<FilesMatch "(.*)">
Order Allow,Deny
Allow from all
Deny from env=spam_ref
</FilesMatch>


In the last 5 days my logs recorded over one million hits. It is slowing my site down to a crwal and performance wise it's hurting.


I tried tired denying the ip addresses in my htaccess but they keep showing up. Not only to these ip addresses keep shoing up, but the sites I was able to block changed ip addresses and now I have to add the ip again.


Any ideas no how to block this traffic.

Last edited by win32sux; 05-14-2008 at 12:35 PM. Reason: Removed QUOTE tags, added CODE tags.
 
Old 05-14-2008, 11:24 AM   #2
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Here is the portion of my .htaccess that I use to block referer spam, and I get practically no referer spam. Note that the first couple of lines of each section are there to determine if the referer is from my site; if it is, then there is no need to process the rest of the list. This speeds things up a lot.

This list was developed and tuned over a period of a couple of years; it seems to catch what I want to catch while not throwing out valid connects.

This is part 1 of the relevant portion of my .htaccess file; this site won't let me post the whole thing as one file. Part 2 is in the next post; just append it to part 1 to have the whole thing.
Code:
# Block Referrer Spam
RewriteEngine on
#Options FollowSymLinks

RewriteCond %{HTTP_USER_AGENT} (FAST\ MetaWeb\ Crawler)
RewriteRule ^(.*)$ http://www.fastsearch.com [R,L]

RewriteCond %{HTTP_USER_AGENT} ^.*Googlebot
RewriteRule ^.*\.swf+ - [F,L]

RewriteCond %{HTTP_REFERER} (adverlinkz)
RewriteRule .* adverlinkz.php

RewriteCond %{HTTP_USER_AGENT} ^.*speedyspider
RewriteRule ^.*cart/.* - [F,L]

RewriteCond %{REQUEST_URI} !(/myunattendeddownloadscriptdirectory/index.php)
RewriteCond %{HTTPS} off
RewriteRule ^cart/(.*)$ https://mysecureshoppingcarturl/cart/$1 [R,L]

#block deep link to image from myspace

RewriteCond %{HTTP_REFERER} (http://bulletins.myspace.com/index.cfm?fuseaction=bulletin.read&messageID=4774576758&MyToken=952b16ee-69dd-483f-a435-5177fe70c055)
RewriteRule .* - [F,L]

#block comment spam that has no referrer unless it is The Property Manager
RewriteCond %{HTTP_REFERER} ^$
RewriteCond %{HTTP_USER_AGENT} !(The\ Property\ Manager)
RewriteCond %{REQUEST_METHOD} (post) [NC]
RewriteCond %{SCRIPT_FILENAME} !(contact\.php)
RewriteCond %{SCRIPT_FILENAME} !(formmail.pl)
RewriteRule  .* - [F,L]

#known spammer user agents.  Block unless they are coming from search engine or are already on the site.
RewriteCond %{HTTP_USER_AGENT} ^Mozilla\/4\.0\ \(compatible;\ MSIE\ 6\.0;\ Windows\ NT\ 5\.1;\ SV1\)$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla\/5\.0\ \(Windows;\ U;\ Windows\ NT\ 5\.0;\ de-DE;\ rv:1\.7\)\ Gecko\/20040707\ Firefox\/0\.9\.2$
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !(softwareforlandlords) [NC]
RewriteCond %{HTTP_REFERER} !(justsosoftware) [NC]
RewriteCond %{HTTP_REFERER} !(bluehost) [NC]
RewriteCond %{HTTP_REFERER} !(amazon) [NC]
RewriteCond %{HTTP_REFERER} !(search) [NC]
RewriteCond %{HTTP_REFERER} !(google) [NC]
RewriteCond %{HTTP_REFERER} !(yahoo) [NC]
RewriteCond %{HTTP_REFERER} !(msn\.com) [NC]
RewriteCond %{HTTP_REFERER} !(apartmentrentalguide\.com) [NC]
RewriteCond %{HTTP_REFERER} !(edinformatics) [NC]
RewriteCond %{HTTP_REFERER} !(search\.com) [NC]
RewriteCond %{HTTP_REFERER} !(tucows\.com) [NC]
RewriteCond %{HTTP_REFERER} !(landlord\.com) [NC]
RewriteCond %{HTTP_REFERER} !(adelphia\.net) [NC]
RewriteCond %{HTTP_REFERER} !(cache) [NC]
RewriteCond %{HTTP_REFERER} !(dmoz\.org) [NC]
RewriteCond %{HTTP_REFERER} !(taxsites\.com) [NC]
RewriteCond %{HTTP_REFERER} !(ask\.com) [NC]
RewriteRule .* - [F,L]

# Drugs / Herbal
RewriteCond %{HTTP_REFERER} !(softwareforlandlords) [NC]
RewriteCond %{HTTP_REFERER} !(justsosoftware) [NC]
RewriteCond %{HTTP_REFERER} (tltc\.ttu\.edu) [NC,OR]
RewriteCond %{HTTP_REFERER} (ingyensms) [NC,OR]
RewriteCond %{HTTP_REFERER} (hort\.net) [NC,OR]
RewriteCond %{HTTP_REFERER} (luckypolls) [NC,OR]
RewriteCond %{HTTP_REFERER} (Members*MyPortrait) [NC,OR]
RewriteCond %{HTTP_REFERER} (euro-cscl) [NC,OR]
RewriteCond %{HTTP_REFERER} (aboriginaltimes) [NC,OR]
RewriteCond %{HTTP_REFERER} (pronett\.nl) [NC,OR]
RewriteCond %{HTTP_REFERER} (fraunhofer\.de) [NC,OR]
RewriteCond %{HTTP_REFERER} (portal_memberdata) [NC,OR]
RewriteCond %{HTTP_REFERER} (msdinc) [NC,OR]
RewriteCond %{HTTP_REFERER} (trisourcetitle) [NC,OR]
RewriteCond %{HTTP_REFERER} (funchain\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (kwiz\.biz) [NC,OR]
RewriteCond %{HTTP_REFERER} (bimba) [NC,OR]
RewriteCond %{HTTP_REFERER} (fitaly\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (fleetairarmarchive) [NC,OR]
RewriteCond %{HTTP_REFERER} (europeanservers) [NC,OR]
RewriteCond %{HTTP_REFERER} (freeweb) [NC,OR]
RewriteCond %{HTTP_REFERER} (headspill) [NC,OR]
RewriteCond %{HTTP_REFERER} (penelopeschenk) [NC,OR]
RewriteCond %{HTTP_REFERER} (soul\.9k) [NC,OR]
RewriteCond %{HTTP_REFERER} (alcdrugprog) [NC,OR]
RewriteCond %{HTTP_REFERER} (psychexam) [NC,OR]
RewriteCond %{HTTP_REFERER} (paxil) [NC,OR]
RewriteCond %{HTTP_REFERER} (psychexam) [NC,OR]
RewriteCond %{HTTP_REFERER} (medical) [NC,OR]
RewriteCond %{HTTP_REFERER} (showcaserealestate) [NC,OR]
RewriteCond %{HTTP_REFERER} (health) [NC,OR]
RewriteCond %{HTTP_REFERER} (lvcpa) [NC,OR]
RewriteCond %{HTTP_REFERER} (medication) [NC,OR]
RewriteCond %{HTTP_REFERER} (ottawavalleyag) [NC,OR]
RewriteCond %{HTTP_REFERER} (daystore) [NC,OR]
RewriteCond %{HTTP_REFERER} (metasart) [NC,OR]
RewriteCond %{HTTP_REFERER} (penis) [NC,OR]
RewriteCond %{HTTP_REFERER} (princeofprussia) [NC,OR]
RewriteCond %{HTTP_REFERER} (canadianlabels) [NC,OR]
RewriteCond %{HTTP_REFERER} (bontril) [NC,OR]
RewriteCond %{HTTP_REFERER} (sudtuiles) [NC,OR]
RewriteCond %{HTTP_REFERER} (lisinopril) [NC,OR]
RewriteCond %{HTTP_REFERER} (amoxicillin) [NC,OR]
RewriteCond %{HTTP_REFERER} (atenolol) [NC,OR]
RewriteCond %{HTTP_REFERER} (protonix) [NC,OR]
RewriteCond %{HTTP_REFERER} (prozac) [NC,OR]
RewriteCond %{HTTP_REFERER} (chicken-flu) [NC,OR]
RewriteCond %{HTTP_REFERER} (tamiflu) [NC,OR]
RewriteCond %{HTTP_REFERER} (pharmacies) [NC,OR]
RewriteCond %{HTTP_REFERER} (talentbroker) [NC,OR]
RewriteCond %{HTTP_REFERER} (prescription) [NC,OR]
RewriteCond %{HTTP_REFERER} (asian-flu) [NC,OR]
RewriteCond %{HTTP_REFERER} (sleep-?deprivation) [NC,OR]
RewriteCond %{HTTP_REFERER} (sleep-?disorders) [NC,OR]
RewriteCond %{HTTP_REFERER} (insomnia) [NC,OR]
RewriteCond %{HTTP_REFERER} (phentermine) [NC,OR]
RewriteCond %{HTTP_REFERER} (phentemine) [NC,OR]
RewriteCond %{HTTP_REFERER} (vicodin) [NC,OR]
RewriteCond %{HTTP_REFERER} (hydrocodone) [NC,OR]
RewriteCond %{HTTP_REFERER} (levitra) [NC,OR]
RewriteCond %{HTTP_REFERER} (hgh-) [NC,OR]
RewriteCond %{HTTP_REFERER} (-hgh) [NC,OR]
RewriteCond %{HTTP_REFERER} (ultram-) [NC,OR]
RewriteCond %{HTTP_REFERER} (-ultram) [NC,OR]
RewriteCond %{HTTP_REFERER} (cialis) [NC,OR]
RewriteCond %{HTTP_REFERER} (soma-) [NC,OR]
RewriteCond %{HTTP_REFERER} (-soma) [NC,OR]
RewriteCond %{HTTP_REFERER} (diazepam) [NC,OR]
RewriteCond %{HTTP_REFERER} (gabapentin) [NC,OR]
RewriteCond %{HTTP_REFERER} (celebrex) [NC,OR]
RewriteCond %{HTTP_REFERER} (viagra) [NC,OR]
RewriteCond %{HTTP_REFERER} (fioricet) [NC,OR]
RewriteCond %{HTTP_REFERER} (ambien) [NC,OR]
RewriteCond %{HTTP_REFERER} (valium) [NC,OR]
RewriteCond %{HTTP_REFERER} (zoloft) [NC,OR]
RewriteCond %{HTTP_REFERER} (finasteride) [NC,OR]
RewriteCond %{HTTP_REFERER} (lamisil) [NC,OR]
RewriteCond %{HTTP_REFERER} (meridia) [NC,OR]
RewriteCond %{HTTP_REFERER} (allegra) [NC,OR]
RewriteCond %{HTTP_REFERER} (diflucan) [NC,OR]
RewriteCond %{HTTP_REFERER} (zovirax) [NC,OR]
RewriteCond %{HTTP_REFERER} (valtrex) [NC,OR]
RewriteCond %{HTTP_REFERER} (lipitor) [NC,OR]
RewriteCond %{HTTP_REFERER} (proscar) [NC,OR]
RewriteCond %{HTTP_REFERER} (acyclovir) [NC,OR]
RewriteCond %{HTTP_REFERER} (sildenafil) [NC,OR]
RewriteCond %{HTTP_REFERER} (tadalafil) [NC,OR]
RewriteCond %{HTTP_REFERER} (xenical) [NC,OR]
RewriteCond %{HTTP_REFERER} (melatonin) [NC,OR]
RewriteCond %{HTTP_REFERER} (xanax) [NC,OR]
RewriteCond %{HTTP_REFERER} (herbal) [NC,OR]
RewriteCond %{HTTP_REFERER} (drugs) [NC,OR]
RewriteCond %{HTTP_REFERER} (lortab) [NC,OR]
RewriteCond %{HTTP_REFERER} (adipex) [NC,OR]
RewriteCond %{HTTP_REFERER} (propecia) [NC,OR]
RewriteCond %{HTTP_REFERER} (carisoprodol) [NC,OR]
RewriteCond %{HTTP_REFERER} (tramadol) [NC]
    RewriteRule .* - [F,L]

# Porn
RewriteCond %{HTTP_REFERER} !(softwareforlandlords) [NC]
RewriteCond %{HTTP_REFERER} !(justsosoftware) [NC]
RewriteCond %{HTTP_REFERER} (lesbian) [NC,OR]
RewriteCond %{HTTP_REFERER} (naturaldelights) [NC,OR]
RewriteCond %{HTTP_REFERER} (hoodia) [NC,OR]
RewriteCond %{HTTP_REFERER} (blonde) [NC,OR]
RewriteCond %{HTTP_REFERER} (freaky) [NC,OR]
RewriteCond %{HTTP_REFERER} (-spy) [NC,OR]
RewriteCond %{HTTP_REFERER} (spy-) [NC,OR]
RewriteCond %{HTTP_REFERER} (alba) [NC,OR]
RewriteCond %{HTTP_REFERER} (porno) [NC,OR]
RewriteCond %{HTTP_REFERER} (shemale) [NC,OR]
RewriteCond %{HTTP_REFERER} (gangbang) [NC,OR]
RewriteCond %{HTTP_REFERER} (-cock) [NC,OR]
RewriteCond %{HTTP_REFERER} (-anal) [NC,OR]
RewriteCond %{HTTP_REFERER} (-orgy) [NC,OR]
RewriteCond %{HTTP_REFERER} (cock-) [NC,OR]
RewriteCond %{HTTP_REFERER} (anal-) [NC,OR]
RewriteCond %{HTTP_REFERER} (orgy-) [NC,OR]
RewriteCond %{HTTP_REFERER} (xxx) [NC,OR]
RewriteCond %{HTTP_REFERER} (singles-?christian) [NC,OR]
RewriteCond %{HTTP_REFERER} (dating-?christian) [NC,OR]
RewriteCond %{HTTP_REFERER} (cumeating) [NC,OR]
RewriteCond %{HTTP_REFERER} (cream-?pies) [NC,OR]
RewriteCond %{HTTP_REFERER} (cumsucking) [NC,OR]
RewriteCond %{HTTP_REFERER} (cumswapping) [NC,OR]
RewriteCond %{HTTP_REFERER} (cumfilled) [NC,OR]
RewriteCond %{HTTP_REFERER} (cumdripping) [NC,OR]
RewriteCond %{HTTP_REFERER} (krankenversicherung) [NC,OR]
RewriteCond %{HTTP_REFERER} (cumpussy) [NC,OR]
RewriteCond %{HTTP_REFERER} (suckingcum) [NC,OR]
RewriteCond %{HTTP_REFERER} (drippingcum) [NC,OR]
RewriteCond %{HTTP_REFERER} (pussycum) [NC,OR]
RewriteCond %{HTTP_REFERER} (swappingcum) [NC,OR]
RewriteCond %{HTTP_REFERER} (eatingcum) [NC,OR]
RewriteCond %{HTTP_REFERER} (cum-) [NC,OR]
RewriteCond %{HTTP_REFERER} (-cum) [NC,OR]
RewriteCond %{HTTP_REFERER} (sperm) [NC,OR]
RewriteCond %{HTTP_REFERER} (christian-?dating) [NC,OR]
RewriteCond %{HTTP_REFERER} (jewish-?singles) [NC,OR]
RewriteCond %{HTTP_REFERER} (sex-?meetings) [NC,OR]
RewriteCond %{HTTP_REFERER} (swinging) [NC,OR]
RewriteCond %{HTTP_REFERER} (swingers) [NC,OR]
RewriteCond %{HTTP_REFERER} (personals) [NC,OR]
RewriteCond %{HTTP_REFERER} (sleeping) [NC,OR]
RewriteCond %{HTTP_REFERER} (libido) [NC,OR]
RewriteCond %{HTTP_REFERER} (grannies) [NC,OR]
RewriteCond %{HTTP_REFERER} (mature) [NC,OR]
RewriteCond %{HTTP_REFERER} (enhancement) [NC,OR]
RewriteCond %{HTTP_REFERER} (sexual) [NC,OR]
RewriteCond %{HTTP_REFERER} (gay-?teen) [NC,OR]
RewriteCond %{HTTP_REFERER} (teen-?chat) [NC,OR]
RewriteCond %{HTTP_REFERER} (gay-?chat) [NC,OR]
RewriteCond %{HTTP_REFERER} (adult-?finder) [NC,OR]
RewriteCond %{HTTP_REFERER} (adult-?friend) [NC,OR]
RewriteCond %{HTTP_REFERER} (friend-?finder) [NC,OR]
RewriteCond %{HTTP_REFERER} (friend-?adult) [NC,OR]
RewriteCond %{HTTP_REFERER} (finder-?adult) [NC,OR]
RewriteCond %{HTTP_REFERER} (finder-?friend) [NC,OR]
RewriteCond %{HTTP_REFERER} (discrete-?encounters) [NC,OR]
RewriteCond %{HTTP_REFERER} (cheating-?wives) [NC,OR]
RewriteCond %{HTTP_REFERER} (housewives) [NC,OR]
RewriteCond %{HTTP_REFERER} (\-sex\.) [NC,OR]
RewriteCond %{HTTP_REFERER} (snowballing) [NC]

     RewriteRule .* - [F,L]

# Weight

RewriteCond %{HTTP_REFERER} !(softwareforlandlords) [NC]
RewriteCond %{HTTP_REFERER} !(justsosoftware) [NC]
RewriteCond %{HTTP_REFERER} (fat-) [NC,OR]
RewriteCond %{HTTP_REFERER} (-fat) [NC,OR]
RewriteCond %{HTTP_REFERER} (diet) [NC,OR]
RewriteCond %{HTTP_REFERER} (pills) [NC,OR]
RewriteCond %{HTTP_REFERER} (weight) [NC,OR]
RewriteCond %{HTTP_REFERER} (supplement) [NC]
     RewriteRule .* - [F,L]

# Gambling
RewriteCond %{HTTP_REFERER} !(softwareforlandlords) [NC]
RewriteCond %{HTTP_REFERER} !(justsosoftware) [NC]
RewriteCond %{HTTP_REFERER} (sbko) [NC,OR]
RewriteCond %{HTTP_REFERER} (sbki) [NC,OR]
RewriteCond %{HTTP_REFERER} (prwo) [NC,OR]
RewriteCond %{HTTP_REFERER} (abccosmo) [NC,OR]
RewriteCond %{HTTP_REFERER} (ontwentyoneonline) [NC,OR]
RewriteCond %{HTTP_REFERER} (ccassino) [NC,OR]
RewriteCond %{HTTP_REFERER} (ckasino) [NC,OR]
RewriteCond %{HTTP_REFERER} (ccazino) [NC,OR]
RewriteCond %{HTTP_REFERER} (bethelspringfield) [NC,OR]
RewriteCond %{HTTP_REFERER} (hold-em) [NC,OR]
RewriteCond %{HTTP_REFERER} (cdsfranklin) [NC,OR]
RewriteCond %{HTTP_REFERER} (printkingandcopy) [NC,OR]
RewriteCond %{HTTP_REFERER} (fs\.fed\.us) [NC,OR]
RewriteCond %{HTTP_REFERER} (cathery) [NC,OR]
RewriteCond %{HTTP_REFERER} (firestarter) [NC,OR]
RewriteCond %{HTTP_REFERER} (texasfiji) [NC,OR]
RewriteCond %{HTTP_REFERER} (cyberstarcom) [NC,OR]
RewriteCond %{HTTP_REFERER} (alcdrugprogdesign) [NC,OR]
RewriteCond %{HTTP_REFERER} (summonertanking) [NC,OR]
RewriteCond %{HTTP_REFERER} (dhctx) [NC,OR]
RewriteCond %{HTTP_REFERER} (tx241) [NC,OR]
RewriteCond %{HTTP_REFERER} (aahbears) [NC,OR]
RewriteCond %{HTTP_REFERER} (ktvtx) [NC,OR]
RewriteCond %{HTTP_REFERER} (spwyche) [NC,OR]
RewriteCond %{HTTP_REFERER} (emergent) [NC,OR]
RewriteCond %{HTTP_REFERER} (ahdb\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (useddomain) [NC,OR]
RewriteCond %{HTTP_REFERER} (arch21) [NC,OR]
RewriteCond %{HTTP_REFERER} (xmlweekly) [NC,OR]
RewriteCond %{HTTP_REFERER} (beach-view) [NC,OR]
RewriteCond %{HTTP_REFERER} (texashold) [NC,OR]
RewriteCond %{HTTP_REFERER} (collegesonline) [NC,OR]
RewriteCond %{HTTP_REFERER} (echoice) [NC,OR]
RewriteCond %{HTTP_REFERER} (homesbysellers) [NC,OR]
RewriteCond %{HTTP_REFERER} (bookmarker) [NC,OR]
RewriteCond %{HTTP_REFERER} (your-sport) [NC,OR]
RewriteCond %{HTTP_REFERER} (completely-sport) [NC,OR]
RewriteCond %{HTTP_REFERER} (consultanthub) [NC,OR]
RewriteCond %{HTTP_REFERER} (boatexhibit) [NC,OR]
RewriteCond %{HTTP_REFERER} (sportscribe) [NC,OR]
RewriteCond %{HTTP_REFERER} (rohkalby) [NC,OR]
RewriteCond %{HTTP_REFERER} (vpshs) [NC,OR]
RewriteCond %{HTTP_REFERER} (fearcrow) [NC,OR]
RewriteCond %{HTTP_REFERER} (wslp24) [NC,OR]
RewriteCond %{HTTP_REFERER} (hornesbysellers) [NC,OR]
RewriteCond %{HTTP_REFERER} (xmlindustry) [NC,OR]
RewriteCond %{HTTP_REFERER} (computerxchange) [NC,OR]
RewriteCond %{HTTP_REFERER} (luxuryrenting) [NC,OR]
RewriteCond %{HTTP_REFERER} (nutzu) [NC,OR]
RewriteCond %{HTTP_REFERER} (artisticlandscapes) [NC,OR]
RewriteCond %{HTTP_REFERER} (highprofitclub) [NC,OR]
RewriteCond %{HTTP_REFERER} (crepesuzette) [NC,OR]
RewriteCond %{HTTP_REFERER} (vneighbor) [NC,OR]
RewriteCond %{HTTP_REFERER} (uclaaus) [NC,OR]
RewriteCond %{HTTP_REFERER} (ca-america) [NC,OR]
RewriteCond %{HTTP_REFERER} (knowtax) [NC,OR]
RewriteCond %{HTTP_REFERER} (myjavaserver) [NC,OR]
RewriteCond %{HTTP_REFERER} (craps) [NC,OR]
RewriteCond %{HTTP_REFERER} (slots) [NC,OR]
RewriteCond %{HTTP_REFERER} (hold\-em) [NC,OR]
RewriteCond %{HTTP_REFERER} (mydaycare) [NC,OR]
RewriteCond %{HTTP_REFERER} (birchfieldharriers) [NC,OR]
RewriteCond %{HTTP_REFERER} (seat208) [NC,OR]
RewriteCond %{HTTP_REFERER} (backg[ae]mmon) [NC,OR]
RewriteCond %{HTTP_REFERER} (gambling) [NC,OR]
RewriteCond %{HTTP_REFERER} (baccarat) [NC,OR]
RewriteCond %{HTTP_REFERER} (slot-machine) [NC,OR]
RewriteCond %{HTTP_REFERER} (black-jack) [NC,OR]
RewriteCond %{HTTP_REFERER} (roulette) [NC,OR]
RewriteCond %{HTTP_REFERER} (wsop) [NC,OR]
RewriteCond %{HTTP_REFERER} (play10) [NC,OR]
RewriteCond %{HTTP_REFERER} (discover) [NC,OR]
RewriteCond %{HTTP_REFERER} (payday) [NC,OR]
RewriteCond %{HTTP_REFERER} (berlin\.) [NC,OR]
RewriteCond %{HTTP_REFERER} (talentbroker) [NC,OR]
RewriteCond %{HTTP_REFERER} (guarantee-money) [NC,OR]
RewriteCond %{HTTP_REFERER} (realtysite) [NC,OR]
RewriteCond %{HTTP_REFERER} (smogless) [NC,OR]
RewriteCond %{HTTP_REFERER} (seniordate) [NC,OR]
RewriteCond %{HTTP_REFERER) (showcaserealestate) [NC,OR]
RewriteCond %{HTTP_REFERER} (showcasegifts) [NC,OR]
RewriteCond %{HTTP_REFERER} (seethishome) [NC,OR]
RewriteCond %{HTTP_REFERER} (lambethcouncil) [NC,OR]
RewriteCond %{HTTP_REFERER} (vmasterpiece) [NC,OR]
RewriteCond %{HTTP_REFERER} (vfacility) [NC,OR]
RewriteCond %{HTTP_REFERER} (vpawnshop) [NC,OR]
RewriteCond %{HTTP_REFERER} (vfreeway) [NC,OR]
RewriteCond %{HTTP_REFERER} (vmailman) [NC,OR]
RewriteCond %{HTTP_REFERER} (vexpert) [NC,OR]
RewriteCond %{HTTP_REFERER} (vmasterpiece) [NC,OR]
RewriteCond %{HTTP_REFERER} (vtoyshop) [NC,OR]
RewriteCond %{HTTP_REFERER} (vplaymate) [NC,OR]
RewriteCond %{HTTP_REFERER} (vgardening) [NC,OR]
RewriteCond %{HTTP_REFERER} (vmillionaire) [NC,OR]
RewriteCond %{HTTP_REFERER} (vfacility) [NC,OR]
RewriteCond %{HTTP_REFERER} (vquality) [NC,OR]
RewriteCond %{HTTP_REFERER} (vfreeway) [NC,OR]
RewriteCond %{HTTP_REFERER} (vcats) [NC,OR]
RewriteCond %{HTTP_REFERER} (vadoptions) [NC,OR]
RewriteCond %{HTTP_REFERER} (great\-money) [NC,OR]
RewriteCond %{HTTP_REFERER} (betting) [NC,OR]
RewriteCond %{HTTP_REFERER} (keno) [NC,OR]
RewriteCond %{HTTP_REFERER} (pharmacy) [NC,OR]
RewriteCond %{HTTP_REFERER} (inkjet) [NC,OR]
RewriteCond %{HTTP_REFERER} (diet) [NC,OR]
RewriteCond %{HTTP_REFERER} (drugs) [NC,OR]
RewriteCond %{HTTP_REFERER} (holdem) [NC,OR]
RewriteCond %{HTTP_REFERER} (loan) [NC,OR] 
RewriteCond %{HTTP_REFERER} (texas-?hold-?em) [NC,OR]
RewriteCond %{HTTP_REFERER} (poker) [NC,OR]
RewriteCond %{HTTP_REFERER} (casino) [NC,OR]
RewriteCond %{HTTP_REFERER} (bitlocker) [NC,OR]
RewriteCond %{HTTP_REFERER} (evilplot) [NC,OR]
RewriteCond %{HTTP_REFERER} (blackjack) [NC]
   RewriteRule .* - [F,L]
# User Agents


RewriteCond %{HTTP_USER_AGENT} (Program\ Shareware|Fetch\ API\ Request) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (PycURL\/7.15.5) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (Snoopy\ v1\.2) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (Microsoft\ URL\ Control) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (CFNetwork) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (Shim-Crawler) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (heritrix) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (Java/) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (Jyxobot) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (hl_ftien_spider_v1.1) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (Twiceler) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (webcollage) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (yodaoice) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (Mail.Ru/1.0) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (robotgenius) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (ConervaCrawler) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (192\.comAgent) [NC]
   RewriteRule .* - [F,L]

Last edited by jiml8; 05-14-2008 at 11:26 AM.
 
Old 05-14-2008, 11:25 AM   #3
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Part 2 of my .htaccess file:
Code:
# Misc / Specific Sites
RewriteCond %{HTTP_REFERER} !(softwareforlandlords) [NC]
RewriteCond %{HTTP_REFERER} !(justsosoftware) [NC]
RewriteCond %{HTTP_REFERER} (yourbigbusiness) [NC,OR]
RewriteCond %{HTTP_REFERER} (amorgagesonline) [NC,OR]
RewriteCond %{HTTP_REFERER} (arefinancing) [NC,OR]
RewriteCond %{HTTP_REFERER} (mesothelioma) [NC,OR]
RewriteCond %{HTTP_REFERER} (blogspot\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (belmont-stakes) [NC,OR]
RewriteCond %{HTTP_REFERER} (paris-hilton-free) [NC,OR]
RewriteCond %{HTTP_REFERER} (3equiy) [NC,OR]
RewriteCond %{HTTP_REFERER} (1pdiaz) [NC,OR]
RewriteCond %{HTTP_REFERER} (groupfg) [NC,OR]
RewriteCond %{HTTP_REFERER} (groupyt) [NC,OR]
RewriteCond %{HTTP_REFERER} (groupxq) [NC,OR]
RewriteCond %{HTTP_REFERER} (grouphb) [NC,OR]
RewriteCond %{HTTP_REFERER} (groupij) [NC,OR]
RewriteCond %{HTTP_REFERER} (webkn) [NC,OR]
RewriteCond %{HTTP_REFERER} (webqw) [NC,OR]
RewriteCond %{HTTP_REFERER} (webbv) [NC,OR]
RewriteCond %{HTTP_REFERER} (webij) [NC,OR]
RewriteCond %{HTTP_REFERER} (weblj) [NC,OR]
RewriteCond %{HTTP_REFERER} (webqk) [NC,OR]
RewriteCond %{HTTP_REFERER} (betterbn) [NC,OR]
RewriteCond %{HTTP_REFERER} (worldfq) [NC,OR]
RewriteCond %{HTTP_REFERER} (worlduu) [NC,OR]
RewriteCond %{HTTP_REFERER} (worldvb) [NC,OR]
RewriteCond %{HTTP_REFERER} (worldll) [NC,OR]
RewriteCond %{HTTP_REFERER} (worldya) [NC,OR]
RewriteCond %{HTTP_REFERER} (betterwq) [NC,OR]
RewriteCond %{HTTP_REFERER} (betterdx) [NC,OR]
RewriteCond %{HTTP_REFERER} (bettermk) [NC,OR]
RewriteCond %{HTTP_REFERER} (betterfc) [NC,OR]
RewriteCond %{HTTP_REFERER} (infoyh) [NC,OR]
RewriteCond %{HTTP_REFERER} (infooq) [NC,OR]
RewriteCond %{HTTP_REFERER} (infoxz) [NC,OR]
RewriteCond %{HTTP_REFERER} (infoxd) [NC,OR]
RewriteCond %{HTTP_REFERER} (infoui) [NC,OR]
RewriteCond %{HTTP_REFERER} (onlinefe) [NC,OR]
RewriteCond %{HTTP_REFERER} (onlinexq) [NC,OR]
RewriteCond %{HTTP_REFERER} (onlineayz) [NC,OR]
RewriteCond %{HTTP_REFERER} (spider\.georgetowncollege\.edu) [NC,OR]
RewriteCond %{HTTP_REFERER} (bus\.wisc\.edu) [NC,OR]
RewriteCond %{HTTP_REFERER} (webpollcentral) [NC,OR]
RewriteCond %{HTTP_REFERER} (shrunk\.net) [NC,OR]
RewriteCond %{HTTP_REFERER} (gulfcoast\.edu) [NC,OR]
RewriteCond %{HTTP_REFERER} (webmissiology) [NC,OR]
RewriteCond %{HTTP_REFERER} (1stmagi) [NC,OR]
RewriteCond %{HTTP_REFERER} (salisbury\.edu) [NC,OR]
RewriteCond %{HTTP_REFERER} (onlinevi) [NC,OR]
RewriteCond %{HTTP_REFERER} (pxbonline) [NC,OR]
RewriteCond %{HTTP_REFERER} (byynonline\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (zwitech\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (unco\.edu) [NC,OR]
RewriteCond %{HTTP_REFERER} (nfcares) [NC,OR]
RewriteCond %{HTTP_REFERER} (aginghomeservice) [NC,OR]
RewriteCond %{HTTP_REFERER} (carolnowicki) [NC,OR]
RewriteCond %{HTTP_REFERER} (nsucar) [NC,OR]
RewriteCond %{HTTP_REFERER} (carmda) [NC,OR]
RewriteCond %{HTTP_REFERER} (carmelgrp) [NC,OR]
RewriteCond %{HTTP_REFERER} (careermosaci) [NC,OR]
RewriteCond %{HTTP_REFERER} (ipoo\.org) [NC,OR]
RewriteCond %{HTTP_REFERER} (tinyurl) [NC,OR]
RewriteCond %{HTTP_REFERER} (vacuumswarehouse) [NC,OR]
RewriteCond %{HTTP_REFERER} (roomrooms) [NC,OR]
RewriteCond %{HTTP_REFERER} (fieldhouseinfo) [NC,OR]
RewriteCond %{HTTP_REFERER} (mdihome) [NC,OR]
RewriteCond %{HTTP_REFERER} (specialitygolfcar) [NC,OR]
RewriteCond %{HTTP_REFERER} (chartford) [NC,OR]
RewriteCond %{HTTP_REFERER} (betfair) [NC,OR]
RewriteCond %{HTTP_REFERER} (newhomesflorida) [NC,OR]
RewriteCond %{HTTP_REFERER} (vink-automation) [NC,OR]
RewriteCond %{HTTP_REFERER} (capillarychromatogr) [NC,OR]
RewriteCond %{HTTP_REFERER} (bettercomputersvc) [NC,OR]
RewriteCond %{HTTP_REFERER} (autosafetylab) [NC,OR]
RewriteCond %{HTTP_REFERER} (vink-automation) [NC,OR]
RewriteCond %{HTTP_REFERER} (carbonmonokidekills) [NC,OR]
RewriteCond %{HTTP_REFERER} (starbaseearth) [NC,OR]
RewriteCond %{HTTP_REFERER} (party-flights) [NC,OR]
RewriteCond %{HTTP_REFERER} (carluncover) [NC,OR]
RewriteCond %{HTTP_REFERER} (spidervisit) [NC,OR]
RewriteCond %{HTTP_REFERER} (carnegie) [NC,OR]
RewriteCond %{HTTP_REFERER} (radcraft) [NC,OR]
RewriteCond %{HTTP_REFERER} (insurance) [NC,OR]
RewriteCond %{HTTP_REFERER} (partyshop) [NC,OR]
RewriteCond %{HTTP_REFERER} (mot2jen) [NC,OR]
RewriteCond %{HTTP_REFERER} (getholiday) [NC,OR]
RewriteCond %{HTTP_REFERER} (ourworldcup) [NC,OR]
RewriteCond %{HTTP_REFERER} (debit) [NC,OR]
RewriteCond %{HTTP_REFERER} (soccer) [NC,OR]
RewriteCond %{HTTP_REFERER} (onlysoma) [NC,OR]
RewriteCond %{HTTP_REFERER} (novacspacetravel) [NC,OR]
RewriteCond %{HTTP_REFERER} (sport) [NC,OR]
RewriteCond %{HTTP_REFERER} (bookmakers) [NC,OR]
RewriteCond %{HTTP_REFERER} (adopting) [NC,OR]
RewriteCond %{HTTP_REFERER} (\.name) [NC,OR]
RewriteCond %{HTTP_REFERER} (journalspace) [NC,OR]
RewriteCond %{HTTP_REFERER} (win\-2005) [NC,OR]
RewriteCond %{HTTP_REFERER} (fearcrow) [NC,OR]
RewriteCond %{HTTP_REFERER} (e\-buy) [NC,OR]
RewriteCond %{HTTP_REFERER} (bizame) [NC,OR]
RewriteCond %{HTTP_REFERER} (hotel) [NC,OR]
RewriteCond %{HTTP_REFERER} (education.online) [NC,OR]
RewriteCond %{HTTP_REFERER} (targeted) [NC,OR]
RewriteCond %{HTTP_REFERER} (bargainhunt) [NC,OR]
RewriteCond %{HTTP_REFERER} (watchthisfunnyvideonow) [NC,OR]
RewriteCond %{HTTP_REFERER} (insurance) [NC,OR]
RewriteCond %{HTTP_REFERER} (confessionpoint) [NC,OR]
RewriteCond %{HTTP_REFERER} (realestateseller) [NC,OR]
RewriteCond %{HTTP_REFERER} (knowtax\.net) [NC,OR]
RewriteCond %{HTTP_REFERER} (petsellers) [NC,OR]
RewriteCond %{HTTP_REFERER} (doyle\-brunson) [NC,OR]
RewriteCond %{HTTP_REFERER} (pool) [NC,OR]
RewriteCond %{HTTP_REFERER} (rarehomes) [NC,OR]
RewriteCond %{HTTP_REFERER} (moved\.to) [NC,OR]
RewriteCond %{HTTP_REFERER} (sml338) [NC,OR]
RewriteCond %{HTTP_REFERER} (maui) [NC,OR]
RewriteCond %{HTTP_REFERER} (mydaycare) [NC,OR]
RewriteCond %{HTTP_REFERER} (mycaddy) [NC,OR]
RewriteCond %{HTTP_REFERER} (openlistings) [NC,OR]
RewriteCond %{HTTP_REFERER} (canadianlabels) [NC,OR]
RewriteCond %{HTTP_REFERER} (namedealers) [NC,OR]
RewriteCond %{HTTP_REFERER} (studyinslovakia) [NC,OR]
RewriteCond %{HTTP_REFERER} (teambeck) [NC,OR]
RewriteCond %{HTTP_REFERER} (planyourhome) [NC,OR]
RewriteCond %{HTTP_REFERER} (reservedining) [NC,OR]
RewriteCond %{HTTP_REFERER} (flower) [NC,OR]
RewriteCond %{HTTP_REFERER} (postagepaid) [NC,OR]
RewriteCond %{HTTP_REFERER} (instantsatellite) [NC,OR]
RewriteCond %{HTTP_REFERER} (keylogger) [NC,OR]
RewriteCond %{HTTP_REFERER} (neurontin) [NC,OR]
RewriteCond %{HTTP_REFERER} (payday) [NC,OR]
RewriteCond %{HTTP_REFERER} (mista-x) [NC,OR]
RewriteCond %{HTTP_REFERER} (debt) [NC,OR]
RewriteCond %{HTTP_REFERER} (didrex) [NC,OR]
RewriteCond %{HTTP_REFERER} (bayfronthomes) [NC,OR]
RewriteCond %{HTTP_REFERER} (antique) [NC,OR]
RewriteCond %{HTTP_REFERER} (sportsexpert) [NC,OR]
RewriteCond %{HTTP_REFERER} (refinance) [NC,OR]
RewriteCond %{HTTP_REFERER} (threethreethree) [NC,OR]
RewriteCond %{HTTP_REFERER} (vnsoul) [NC,OR]
RewriteCond %{HTTP_REFERER} (vdiploma) [NC,OR]
RewriteCond %{HTTP_REFERER} (realtorx) [NC,OR]
RewriteCond %{HTTP_REFERER} (vsymphony) [NC,OR]
RewriteCond %{HTTP_REFERER} (mortgage) [NC,OR]
RewriteCond %{HTTP_REFERER} (conjuratia) [NC,OR]
RewriteCond %{HTTP_REFERER} (brainstormer) [NC,OR]
RewriteCond %{HTTP_REFERER} (toylane) [NC,OR]
RewriteCond %{HTTP_REFERER} (www\.xxx\.org) [NC,OR]
RewriteCond %{HTTP_REFERER} (adspoll) [NC,OR]
RewriteCond %{HTTP_REFERER} (money-plans) [NC,OR]
RewriteCond %{HTTP_REFERER} (xmlguy) [NC,OR]
RewriteCond %{HTTP_REFERER} (flower4us) [NC,OR]
RewriteCond %{HTTP_REFERER} (netwasgroup\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (nic4u\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (wear4u\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (foxmediasolutions\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (liveplanets\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (aeterna-tech\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (continentaltirebowl\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (chemsymphony\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (infolibria\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (globaleducationeurope\.net) [NC,OR]
RewriteCond %{HTTP_REFERER} (soma\.125mb\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (mitglied\.lycos\.de) [NC,OR]
RewriteCond %{HTTP_REFERER} (foxmediasolutions\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (jroundup\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (feathersandfurvanlines\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (conecrusher\.org) [NC,OR]
RewriteCond %{HTTP_REFERER} (sbj-broadcasting\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (edthompson\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (codychesnutt\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (artsmallforsenate\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (axionfootwear\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (protzonbeer\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (candiria\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (bigsitecity\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (coresat\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (istarthere\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (amateurvoetbal\.net) [NC,OR]
RewriteCond %{HTTP_REFERER} (alleghanyeda\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (xadulthosting\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (datashaping\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (zick\.biz) [NC,OR]
RewriteCond %{HTTP_REFERER} (newprinceton\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (dvdsqueeze\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (xopy\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (webdevboard\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (devaddict\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (eaton-inc\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (whiteguysgroup\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (guestbookz\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (webdevsquare\.com) [NC,OR]
RewriteCond %{HTTP_REFERER} (indfx\.net) [NC,OR]
RewriteCond %{HTTP_REFERER} (snap\.to) [NC,OR]
RewriteCond %{HTTP_REFERER} (2y\.net) [NC,OR]
RewriteCond %{HTTP_REFERER} (astromagia\.info) [NC,OR]
RewriteCond %{HTTP_REFERER} (free-?sms) [NC]

     RewriteRule .* - [F,L]
 
Old 05-14-2008, 11:37 AM   #4
xchido
LQ Newbie
 
Registered: Jul 2005
Posts: 22

Original Poster
Rep: Reputation: 15
Thanks for your quick response.

I am assuming that on this:

Code:
RewriteCond %{REQUEST_URI} !(/myunattendeddownloadscriptdirectory/index.php)
RewriteCond %{HTTPS} off
RewriteRule ^cart/(.*)$ https://mysecureshoppingcarturl/cart/$1 [R,L]
I don't have a ecommerce or cart on my site and don't have a downloads section. So, I don't need this. If I did, I just replace the Myunattendeddowloads...etc with my own path?

Also, My .htaccess file is about 350kb to big since I've been adding IP addresses to block. Will it be a good idea to just use your .htaccess? Or is it better to just include your spam rules into my file?

One more thing, I've been reading about a way to check and see if the referer has an acutal link on their site before allowing access to my site but I can't find how to set that up. Do you now where can I get information about that?

I don't know much about htaccess and I am learning the as I go. This past week has been avery humbling experience.

Thank for your help.

Last edited by win32sux; 05-14-2008 at 12:37 PM. Reason: Removed QUOTE tags, added CODE tags.
 
Old 05-14-2008, 11:50 AM   #5
xchido
LQ Newbie
 
Registered: Jul 2005
Posts: 22

Original Poster
Rep: Reputation: 15
Will this
Code:
RewriteCond %{HTTP_USER_AGENT} ^.*Googlebot
RewriteRule ^.*\.swf+ - [F,L]
Block Google from getting to my site?

Last edited by win32sux; 05-14-2008 at 12:37 PM. Reason: Removed QUOTE tags, added CODE tags.
 
Old 05-14-2008, 12:40 PM   #6
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
xchido, in your future posts please refrain from using QUOTE tags when posting this sort of content. It messes-up the page layout and it makes it difficult to read. Use CODE tags instead - they are designed precisely for this. I've edited your previous posts.
 
Old 05-14-2008, 02:15 PM   #7
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by xchido View Post
Thanks for your quick response.

I am assuming that on this:

Code:
RewriteCond %{REQUEST_URI} !(/myunattendeddownloadscriptdirectory/index.php)
RewriteCond %{HTTPS} off
RewriteRule ^cart/(.*)$ https://mysecureshoppingcarturl/cart/$1 [R,L]
I don't have a ecommerce or cart on my site and don't have a downloads section. So, I don't need this. If I did, I just replace the Myunattendeddowloads...etc with my own path?

Also, My .htaccess file is about 350kb to big since I've been adding IP addresses to block. Will it be a good idea to just use your .htaccess? Or is it better to just include your spam rules into my file?

One more thing, I've been reading about a way to check and see if the referer has an acutal link on their site before allowing access to my site but I can't find how to set that up. Do you now where can I get information about that?

I don't know much about htaccess and I am learning the as I go. This past week has been avery humbling experience.

Thank for your help.
My site permits unattended downloads after purchase. The secure server doesn't permit downloads, so I have to redirect purchasers to an http: rather than an https: for the actual download. I do this by giving them a download link after they purchase.

The code that actually handles the download is in a subdirectory under my shopping cart. So this specific rule is intended to force all visitors to only access the shopping cart using https: UNLESS they are in the unattended download subdirectory, which they can only access using http:

So you don't need that rule at all.

I only block specific IP addresses or IP ranges when I identify a cracker, or someone who tries to use my forms (which are hardened) for open relay or SQL injection attacks.

I don't think Apache can check a referer for validity through .htaccess but I wouldn't do it anyway; slows everything down. Just nuke the ones that don't belong and forget about it.

Last edited by jiml8; 05-14-2008 at 02:20 PM.
 
Old 05-14-2008, 02:17 PM   #8
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by xchido View Post
Will this
Code:
RewriteCond %{HTTP_USER_AGENT} ^.*Googlebot
RewriteRule ^.*\.swf+ - [F,L]
Block Google from getting to my site?
My robots.txt file tells Google (actually all search engines) to stay away from my shockwave flash files. But googlebot refuses to obey that rule. So I enforce it.
 
Old 05-14-2008, 02:18 PM   #9
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by win32sux View Post
xchido, in your future posts please refrain from using QUOTE tags when posting this sort of content. It messes-up the page layout and it makes it difficult to read. Use CODE tags instead - they are designed precisely for this. I've edited your previous posts.
Thank God!
 
Old 05-14-2008, 03:15 PM   #10
xchido
LQ Newbie
 
Registered: Jul 2005
Posts: 22

Original Poster
Rep: Reputation: 15
Well, oops, I didn’t realize I was using the wrong tag. I just wanted it to emphasize the text. I know better now to stick with just regular tags.

I went ahead and replaced my htaccess file with yours and added my php flags that I need. It all seems to be working perfectly. Site traffic for the last few hours has returned to normal. Still have to check the access logs and see what it says there.

I don’t have flash files so that rewrite rule does not affect me. I left it in anyways.

Can you direct me to a link where I can read about how to block traffic from entire countries. I was doing that with my old htaccess but the file got over 300KB. I tried different sites that provide the ip ranges but most of them are not the same. Is there an official list that shows the countries ip ranges? Aldo, do they stay set or they change with time? I had problems with specific countries hackers trying to and actually hacking my site that I would like to ban.

How big is too big for an htaccess file?

I cannot begin to tell you how much I appreciate your help. I really appreciate it.

Thanks
 
Old 05-14-2008, 04:50 PM   #11
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
I use the database IP2Nation (google for it) and I execute some code on a per-page basis to block entire nations that I do not want accessing particular parts of my site (especially the message boards, since most of the spammers are coming from outside the US. I use phpbb for my message board and I have altered it to enhance security. I won't detail the enhancements because if known they could be compromised.

However here is a PHP code fragment I use to query the IP2Nation database and block those I don't want to have access:

Code:
$sql = 'SELECT 
            country
        FROM 
            ip2nation
        WHERE 
            ip < INET_ATON("'.$_SERVER['REMOTE_ADDR'].'") 
        ORDER BY 
            ip DESC 
        LIMIT 0,1';
	
if( !($result = $dbnation->sql_query($sql)) )
{
	message_die(CRITICAL_ERROR, "Could not query nations database", "", __LINE__, __FILE__, $sql);
} else {
	if ($row = $dbnation->sql_fetchrow($result)) {
		$warn1="Due to major spam problems, ";
		$warn2=" are banned from the message boards.  If you are a legimate visitor, contact Just So Software via our contact form and we can arrange to whitelist you.";
		switch ($row[0]) {
			case 'ru':
				// Block russians
				die($warn1."Russian visitors".$warn2);
			case 'cn':
				// block chinese
				die($warn1."Chinese visitors".$warn2);
			case 'nl':
				// block netherlands
				die($warn1."visitors from the Netherlands".$warn2);
			case 'br':
				// block brazil
				die($warn1."visitors from Brazil".$warn2);
			case 'be':
				// block belgium
				die($warn1."visitors from Belgium".$warn2);
			case 'kr':
				// Block koreans
				die($warn1."Korean visitors".$warn2);
			case 'jp':
				// Block japanese
				die($warn1."visitors from Japan".$warn2);
			case 'ua':
				// Block Ukraine
				die($warn1."visitors from Ukraine".$warn2);
			case 'de':
				// Block Germany
				die($warn1."visitors from Germany".$warn2);
			case 'cz':
				// Block Czech Republic
				die($warn1."visitors from the Czech Republic".$warn2);
			case 'es':
				// Block Spain
				die($warn1."visitors from Spain".$warn2);
			case 'ar':
				// Block Argentina
				die($warn1."visitors from Argentina".$warn2);
			case 'in':
				// Block India
				die($warn1."visitors from India".$warn2);
			case 'gr':
				// Block Greece
				die($warn1."visitors from Greece".$warn2);
			case 'bg':
				// Block Bulgaria
				die($warn1."visitors from Bulgaria".$warn2);
			case 'ro':
				// Block Romania
				die($warn1."visitors from Romania".$warn2);
			case 'co':
				// Block Columbia
				die($warn1."visitors from Columbia".$warn2);
			case 'tw':
				// Block Taiwan
				die($warn1."visitors from Taiwan".$warn2);
			case 'pl':
				// Block Poland
				die($warn1."visitors from poland".$warn2);
			case 'se':
				// Block Sweden
				die($warn1."visitors from Sweden".$warn2);
			default:
		}
	} else {
		message_die(CRITICAL_ERROR, "IP range not found", "", __LINE__, __FILE__, $sql);
	}
 
Old 05-14-2008, 05:04 PM   #12
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Actually, I think there are only a handful of people out there who are responsible for all of the referer spam. I no longer even have the attempts appearing on my sites; I think they gave up and removed my domains from their spam lists. After all, it does take time, and they only get 403 error back so if they can't get through why bother.

It was a battle for quite awhile though.
 
Old 05-14-2008, 05:09 PM   #13
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
You understand, of course, that you should replace these lines:
Code:
RewriteCond %{HTTP_REFERER} !(softwareforlandlords) [NC]
RewriteCond %{HTTP_REFERER} !(justsosoftware) [NC]
with your own domain name(s) so that you don't go through the entire search list when someone is going from page to page within your site.
 
Old 05-14-2008, 05:27 PM   #14
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
LOL. I just checked. So far this month, my site has had a total of 28 (that is twenty eight) 403 (forbidden) errors.

When I was fighting this battle to get the referer spam blocked, I was getting several thousand 403s a day. They finally gave up on me.

Actually, the spam abruptly stopped one day last july. I had thought that someone had been put out of business, but I still show zero referer spam attempts and since you say you are getting hammered, it must mean my domains were just removed from someone's list.

Victory is mine!

Last edited by jiml8; 05-14-2008 at 05:36 PM.
 
Old 05-14-2008, 11:28 PM   #15
xchido
LQ Newbie
 
Registered: Jul 2005
Posts: 22

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jiml8 View Post
You understand, of course, that you should replace these lines:
Code:
RewriteCond %{HTTP_REFERER} !(softwareforlandlords) [NC]
RewriteCond %{HTTP_REFERER} !(justsosoftware) [NC]
with your own domain name(s) so that you don't go through the entire search list when someone is going from page to page within your site.
I didn't but now I know! I am using this now:

Code:
RewriteCond %{HTTP_REFERER} !(zacatecas\.net) [NC]
RewriteCond %{HTTP_REFERER} !(todozacatecas\.com) [NC]
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Killing That Spam With Postgrey And Postfix LXer Syndicated Linux News 0 07-02-2006 11:54 AM
LXer: Six days ‘til GP2X gamer hits UK LXer Syndicated Linux News 0 05-14-2006 10:21 AM
Whats the solution to remove spam at the server site? Niceman2005 Linux - General 1 09-22-2005 10:30 PM
Email Spam Rating Site/Tool? WeNdeL Linux - General 2 04-13-2005 02:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 02:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration