Site news: No referrer, no comment

by Volker Weber

If your personal firewall* blocks referrers, you can no longer post comments to the site. This is another effort to block malicious bots:

RewriteCond %{REQUEST_FILENAME} mt-cmmnt.cgi [NC]
RewriteCond %{HTTP_REFERER} !^http://vowe\.net.*$ [NC]
RewriteRule (.*) - [F,L]

Comment spam bots call cgi without going through the site. For now they are coming in with a blank referrer. Using mod_rewrite it is rather simple to divert them with a 403 return code before they hit cgi, thus avoiding any unnecessary load on the server.

Maybe I will add another rule for those smartass people that send a long string of ++++ instead of a referrer.

*) Technically you are not using a firewall but rather a local proxy server that takes requests from your browser, processes them and then relays the request to the site. Symantec calls the stripping of referrers Browser-Datenschutz in german. No idea how they call this in english.

Comments

Hi Volker,
there have been bits and pieces of defense information published on your blog. Do you have a summary? Kind of problem/solution table?
:-) stw

I guess, that would probably be read by spam bot authors pretty soon and would be a comprehensive compendium on which countermeasures to by-pass to even access a well-protected blog. In order to be one step ahead, this might not be such a good idea.

Ragnar Schierholz, 2004-12-20 09:19

I published a summary of anti-spam measures here (in German):
http://vnude.typepad.com/itfrontal/2004/12/spamschutz_in_w.html

I'm using this rule since two weeks, no more spam so far - but hundreds of HTTP 403s in my log file.

Since you have to allow the comment script's URL as a referrer (because of comment previewing), it will be easy for spambots to fake a correct referrer - they just have to insert the script address. Guess it won't take too long until "smart" spambots will exploit that weakness.

I guess in English it´s call privacy protection. :-)

I can live without previews. Personally, I find them annoying. I proof read in the edit form and I an error slips through, well, that's life.

We could enforce the referer rule by using a regex like

!^http://vowe\.net/([0-9]+)\.html$

to ensure only requests made from entry archives are accepted.

And to check for either an entry archive or the comment cgi, we could use this (untested, but should work after some testing ;) )

RewriteCond %{REQUEST_FILENAME} mt-cmmnt.cgi [NC]
RewriteCond %{HTTP_REFERER} !^http://vowe\.net/([0-9]+)\.html$ [OR]
RewriteCond %{HTTP_REFERER} !^http://vowe\.net/cgi-bin/mt-cmmnt\.cgi$ [NC]
RewriteRule (.*) - [F,L]

If not this way, mod_rewrite also provides chaining, which also could solve the problem.

Post a comment











Shall I remember this for you?




Use your full name and a working email address. Unless you want your comment to be removed. No kidding.



Recent comments

Elijah Lapson on Lotus Vista? at 02:03
Volker Weber on GoDaddy.com Launches New Hosted Microsoft Exchange Plans at 01:14
Samuel Orsenne on GoDaddy.com Launches New Hosted Microsoft Exchange Plans at 00:02
Martin Rosenberg on Danke Bahn, geht doch at 23:56
Volker Weber on Things I learned while signing up for Bluehouse at 19:59
Mathias Ziolo on Ubuntu for the Asus Eee Netbooks at 17:33
Stuart Mcintyre on Things I learned while signing up for Bluehouse at 15:58
Flemming Riis on Bluehouse does not support my browser at 15:30
Thomas Radigewski on Bluehouse does not support my browser at 15:26
Stuart Mcintyre on Bluehouse does not support my browser at 15:25
Volker Weber on Bluehouse does not support my browser at 15:03
Stuart Mcintyre on Bluehouse does not support my browser at 14:59
Daniel Haferkorn on Bluehouse does not support my browser at 14:51
Ben Poole on Bluehouse does not support my browser at 14:43
Petite Abeille on XING expands into UK and Ireland at 10:50
Stuart Mcintyre on XING expands into UK and Ireland at 10:47
Stuart Mcintyre on XING expands into UK and Ireland at 10:42
Volker Weber on GoDaddy.com Launches New Hosted Microsoft Exchange Plans at 09:52
Stephan H. Wissel on GoDaddy.com Launches New Hosted Microsoft Exchange Plans at 04:39
Henning Heinz on GoDaddy.com Launches New Hosted Microsoft Exchange Plans at 22:32
Volker Weber on Things I learned while signing up for Bluehouse at 22:09
Frank van Rijt on Ubuntu for the Asus Eee Netbooks at 21:57
Jef Reynders on Things I learned while signing up for Bluehouse at 21:56
Volker Weber on GoDaddy.com Launches New Hosted Microsoft Exchange Plans at 21:03
Yves Luther on GoDaddy.com Launches New Hosted Microsoft Exchange Plans at 21:00

Ceci n'est pas un blog

vowe.net is a personal website published by Volker Weber a.k.a. vowe. I am an author, consultant and systems architect based in Darmstadt, Germany.

rss Click here to subscribe

Hello

About me
Contact
Publications
Certificates
Frequently asked questions

Twitter Updates

More >

Poll

Can you bring a camera phone to work?

Getting poll results. Please wait...

Local time is 04:03

visitors.gif
111 visitors online

News

Other sources of news, imported into my own format to make them more accessible:

Heise Online
Schlagzeilen
Weather

Archives

As most of my articles roll off the front page rather quickly, I am making an archive of previous posts available here. You can also use the handy search box at the top of the page if you are looking for something particular.

Last 30 days
More archives

Got the T-shirt?

Got the T-shirt?
Are you buying from the US?

Systems Architecture

This site runs on an Apache web server on top of the Linux operating system. The content is managed with MovableType which is implemented in Perl. Last but not least the HTML code your browser sees is put together with PHP.

© 1992-2008 Volker Weber.
All Rights Reserved.

Impressum