dvorak uncensored » blog comment spam fix
dvorak uncensored » blog comment spam fix
dvorak uncensored
9/26/2005
blog comment spam fix
filed under:
general — john c dvorak @ 12:01 am
most people who run blogs have issues with comment spam in their blogs and there are all sorts of fixes. marc perkel at ctyme.com – my host — was floored, he said, when he realized a simple command to the apache software would kill most of it — and it does indeed work!
here is the short code running on the ctyme server for my dvorak.org using wordpress-based blogging software. altering it for other blog software and other blogs should be simple for anyone running apache.
< location /blog/wp-comments-newpost.php >
rewriteengine on
rewritecond %{http_referer} !^.*dvorak.org/.*
rewriterule ^.* http://www.ctyme.com/comment-spam.html
< /location >
essentially it makes the basic condition for any post rigid: it has to be coming from a link within the blog itself, the “comment” link. most spam does not.
my spam count on the blog has dropped from 50-100 to 2 per day without any other tricks.
39 comments
this will block the stupid bots, but the smarter bots that spoof the referer will have no problem. good tip though.
comment by blueboi — 9/26/2005 @ 2:24 am
this is only a temporary fix. it’s very easy to fake the referer header.
comment by clear rivers — 9/26/2005 @ 3:07 am
this post should have included a link to the “i get no spam” audio clip. what the hey, i could have saved it and used it as the “new email notification” sound event because “i get no spam” as well.
comment by lenny — 9/26/2005 @ 3:23 am
i’d like to have that ‘i get no spam’ logo in a bigger format so i could make a t-shirt. can it be arranged?
oooops, there goes a nice merchandising idea…
but i’d really like to get the logo…
comment by miguel lopes — 9/26/2005 @ 3:41 am
bravo, marc!
comment by eideard — 9/26/2005 @ 3:53 am
so, john, now it’s “i get almost no spam”?
twitfully yours,
zc
comment by zen curmudgeon — 9/26/2005 @ 4:02 am
works for now, but spammers will adapt the minute the method becomes widely used enough for them to notice. in this case all these need to do is spoof the referer: header, which is technically trivial.
comment by nullbit — 9/26/2005 @ 5:18 am
glad to hear that’s working out for you. it should be noted, however, that the “referer” field is actually part of http get or post requests that are made by comment spammers, and as such, would be trivial to bypass for most software by making sure that the domain they are spamming is also included in the referer post header.
frankly, i’m surprised they aren’t already doing this. but then, nobody ever said spammers were smart.
comment by ernie miller — 9/26/2005 @ 5:30 am
that’s awesome. i’m gonna put this on http://michaelcotterell.com/blog/ !
comment by michael cotterell — 9/26/2005 @ 5:38 am
nice job
dvorak = no spam at all
lol
comment by evilpig — 9/26/2005 @ 5:45 am
surely if the re-write engine is seeing the referrer sent by the user-agent this is easily bypassed by spoofing the http referrer.
in php you can use a token method to prevent bots posting forms. first create a random token, (say use the rand in php and then use md5 on it) put this into a hidden form field and also write it to the php session.
on receiving the form data if the hidden field token doesn’t match the one in the session then the form wasn’t sent from that site and it can be safely denied.
comment by stuart colville — 9/26/2005 @ 6:03 am
not exactly related, but there is a photo of a young man at the spx (small press expo) in bethesda maryland with a shirt that says “the dvorak zone”. http://209.198.111.165/thebeat/
comment by kathy p. — 9/26/2005 @ 6:22 am
i agree this fix will fade if implemented by too many people. as a test i recommend nobody use it but me!
and, yes, i have looked at numerous special fixes and have tried most of them. eventaully i’m sure i’ll have to use the “post code” trick where you type something that appears in a box.
comment by site admin — 9/26/2005 @ 7:06 am
this is a great hint and will definitely help combat some of the stupider spam bots. like people have said so far, the referrer is trivial to spoof. at this time, if a smart spam bot were developed, i’m not sure there’s much to do except moderate any comments that have urls in them.
comment by durin platnick — 9/26/2005 @ 8:55 am
that famous episode of twit with the “i get no spam” conversation is what made me check out this blog. i must say it is my first stop every day now! thanks john, always informative and hilarious!
comment by carnell — 9/26/2005 @ 9:49 am
great job! now if you could only find a way to stop subjecting us readers to your spam advertising ..
comment by cycincal al — 9/26/2005 @ 10:14 am
it’s actually possible, as long as you are willing to sacrifice a few potential posts by requiring javascript to be enabled. the solution is hashcash (also on wikipedia).
the basic idea is to challenge the client machine to solve a time consuming problem where the answer is a key that will allow the post to pass through. the hashcash system was originaly developed for combating email spam but the idea is the same.
if i remember correctly there is even a wordpress plugin available.
comment by mikael karon — 9/26/2005 @ 11:38 am
i think they call that a turing test. now, where can i get a big ‘i get no spam’ logo? c’mon?
comment by miguel lopes — 9/26/2005 @ 11:50 am
wp hash cache uses a token method and stops spam dead. pretty much the only spam it can’t stop is manually entered spam… and that’s basically impossible to stop.
no need for any extra input boxes, just works.
comment by gregory — 9/26/2005 @ 12:27 pm
i tried to add the code to my .htaccess but i now get a internal server error on every page.
comment by cavemonkey50 — 9/26/2005 @ 12:28 pm
like everyone said manual spam seems to be the only problem after a hack like this. the problem with that is there are companies in india that you can pay very small sums of money and they have 5-10 people who will just sign up onto forums and blogs and leave the spam comments for you. i imagine we’ll see more and more of this as the spammers get tired of fighting the great filters that keep coming out.
comment by nullvariable — 9/26/2005 @ 12:44 pm
i manually changed the field names and the variables to the page that they are submitted to. that stops the scripts in its tracks….
comment by jon maddox — 9/26/2005 @ 1:24 pm
spamkarma is the only spam plugin i’ve used on any of my blogs for months now, and it’s killed all but maybe 10 spam posts (and those 10 were completely random letters - not even a poker link) with only 2 false positives in that time. it even nails trackback and pingback spam
comment by rust — 9/26/2005 @ 1:35 pm
so this pretty much just blocks autospamming bots? it seems to me like this is something that blogging software should come built with. it should be checking that it only allows connections to the comment posting script from a file within the website.
what about people that come on and post links to their free ipod referal sites?
comment by ryan — 9/26/2005 @ 1:57 pm
i’ve pretty much killed comment spam on my wp site recently by using both bad behavior and spam karma 2. they’re pretty invisible to 95% of users, and they’re been very effective so far.
comment by vince anido — 9/26/2005 @ 4:46 pm
what about using capatcha and the referer trick, plus i like the idea of using tokens, session can’t be seen by anything on the client side, so if you put an aways changing token on the form and also in the session heh you have a fix there, for one alot of these bots don’t support cookies and a session won’t work without a cookie. so basically in theory it would be bullet proof, but you aren’t going to stop a human spammer, cause they will always pass these tests.
comment by blueboi — 9/26/2005 @ 5:04 pm
yes - they could spoof the referrer but then they lost the diverse source ips they get with the current proxy tricks. then i can just block the ip. so it’s not as easy as you think.
comment by marc perkel — 9/26/2005 @ 5:48 pm
a few months ago i did some research into anti-spam techniques for the b2evolution blogging software. it was in regards to referer spam for which this absolutely doesn’t work but i still looked at, evaluated and rejected this option as a general anti-spam measure for the following reasons. it is also important to remember i was doing said research for the b2evolution community not just myself so if it caused problems for basic users or could not be included by default it was unworkable.
1) as others have mention the referer is client suppllied and easy to change, especially in an automatic spamming script.
2) in addition, some site visitors intentionally block the referer via software on their pc (which they may not even know they have) and this prevents them from commenting.
3) this relies on your apache installation supporting mod_rewrite not all installations do. even among those that do there is some debate in the community as to how much of a blow it is to server resources to implement such a solution.
4) making such modification requires either a dedicated server with access to the httpd.conf file or support for .htaccess files which are also not supported by all hosts.
in conclusion, while the technique may work for some people for a while it is far from an end all be all solution, is not usable by many people with basic shared hosting plans and has been discussed in the blogging community before and generally rejected.
comment by ben franske — 9/26/2005 @ 7:09 pm
sorry to ask, but would you think there would be an alternative version in .asp ?
comment by e mooney — 9/27/2005 @ 12:31 am
didn’t pay much attention to this at first because i dont have a blog. but when i heard you talking about it on twit i came back to it. what about people that link to your page from a different place. for example the new google personalized. i try to link form there to here. but it comes up with nothing but the headers. however i just have to reload it to make it work. not a big deal, but something to think about.
comment by 0x1d3 — 9/27/2005 @ 4:28 pm
i use spamkarma - it’s astounding. i get no spam!
http://unknowngenius.com/blog/wordpress/spam-karma/
comment by squozen — 9/27/2005 @ 11:08 pm
it’s worth noting that a number of so-call “internet security” products (norton is one) will actively strip the http_referer from outgoing http traffic. some firewall devices are configured to do this too.
the end result being that valid users may not be able to leave comments due to this technique. you’re effectively introducing a chance of false-positives.
comment by drew mclellan — 9/28/2005 @ 4:49 am
you can’t trust referer, it is client supplied. you’ll probably do better checking for a valid session cookie…
comment by n a — 9/29/2005 @ 3:54 am
dear gentlemen:
since you kindly asked me to leave a comment, then here you are:
please in turn visit my site sedu beauty products
good luck!
comment by steve van exel — 10/10/2005 @ 6:02 am
okay….so i’ve read the comments and plenty of propellerheads think this is just a tiny bandaid fix, but nobody explains how to do it. so….it would be very helpful if there was a step by step for implementing this (or any other for that matter) bit of code.
comment by eric nentrup — 10/14/2005 @ 4:44 am
this is working for me on asp pages:
function stopspamscumbags(infield)
stopspamscumbags=instr(infield,”content-type:”)
end function
if ( stopspamscumbags(request.form(”form_name”)) > 0 ) then
‘ this is more than likely a spam
else
‘ ok, lets process the form
end if
hope this helps others.
comment by txprogrammer — 12/2/2005 @ 7:31 am
i just hope the government doesn’t get involved. i think we have already lost alot of free speech. we don’t need the govenrment telling us if we add a link to a comment it’s “comment spam” and you’re going away for 10 years! i believe this is how police states are created. there has to be a way without involving the government. it’s really no good anyways because the spammers just go offshore. economically not good because advertising dollar go to other countries.
francisco barcenas
just my 2 cents.
comment by openmls — 4/24/2006 @ 10:01 am
9/11 the same happy few music were also on the spot to point foto the finger of blame at everyone mp3 but themselves - as soon as they felt safe wma/
comment by franz — 8/11/2006 @ 4:39 am
you can’t trust referer, it is client supplied. you’ll probably do better checking for a valid session cookie…
comment by bannerdesign — 12/5/2006 @ 7:01 pm
rss feed for comments on this post.
link to public/social bookmark systems:
|
|
|
|
please leave a comment
sorry, the comment form is closed at this time.
dvorak blog -- read it daily
blog info
about us (masthead)
blog primer
comment guidelines for those wishing to add comments
how to use this blog
short bio of john c. dvorak
terms of use/privacy policy
dvorak columns
cranky geeks online vidcast
ongoing review of wordpress
tech5 daily podcast
this week in technology (podcast)
weekly dow-jones marketwatch column
links
2005 personal portal
child safe personal portal
public speaking
public documents, important essays, papers
actual review of top horoscope websites
links to older essays and archives
should your ceo become a blogger?
whatever happened to alaskan airlines?
slide shows
amsterdam
copenhagen
ft. worth, texas
northern spain
six flags/marine world
slovenia
solano stroll/lomography
sweden
switzerland
venice
video archives
october 2006 video archive
september 2006 video archive
categories:
column fodder
general
lost columns archive
recipe nook
research
reviews
travel
video
whatever happened to..
aries
taurus
gemini
cancer
leo
virgo
libra
scorpio
sagittarius
capricorn
aquarius
pisces
brought to you by
horoscope.com
search:
put your vizu web poll
here
the editors at dvorak uncensored all use the firefox browser. you should too.
musharraf defiant on emergency rule - in an interview at the presidential building, the pakistani leader insisted that emergency rule would not interfere with free and fair elections and was harshly critical of former prime minister benazir bhutto.
chinese minister in nuclear talks in iran - the chinese foreign minister urged iran to comply with demands to halt its uranium-enrichment program, in advance of two reports on the country's nuclear program.
south korea calls for talks to cement progress with north - president roh moo hyun of south korea called for a meeting of the leaders of the united states, china and the two koreas.
hamas arrests fatah supporters - hamas police officers rounded up scores of supporters of the rival fatah movement in gaza on tuesday, a day after a mass rally in honor of yasser arafat ended in violence.
3 dead in blast at philippine congress - the explosion killed three people, one of them a lawmaker, and wounded several others, officials said.
fresh inflation spells trouble for china - consumer prices unexpectedly surged again last month in china despite price controls on a wide range of industries, with the prospect of even higher inflation this month.
2 u.s. states' voters still not settled on favorite presidential candidates - twin new york times/cbs news polls suggest that the outcome for the presidential nominating battle is far from settled in either iowa or new hampshire.
split over naval mission could prompt early election in japan - the lower house of parliament voted to resume naval support for u.s.-led operations in afghanistan, setting the stage for a confrontation with the upper house that could lead to an early general election.
google fails to win eu approval for doubleclick deal - the european commission said the $3.1 billion merger raised competition concerns and required a more thorough review of its impact on the internet advertising business.
mean streets hold little magic for young african 'witches' - in parts of angola, congo and the congo republic, a surprising number of children are identified as witches and beaten, abused or abandoned.
bush vetoes domestic spending bill on health, education and jobs - the veto and his signing of a bill to increase the pentagon's non-war funding guaranteed a new round of wrangling with the democrats.
denmark narrowly re-elects rasmussen - but the coalition government will need the support of a far-right party and a laissez-faire party to pass legislation, according to initial exit polls and early vote-counting.
eu moves to reduce aircraft emissions - the measures - approved by the european parliament but still requiring approval by national governments - are fiercely opposed by the united states and the airline industry.
personality has shaped u.s.-pakistani relations - president pervez musharraf of pakistan has charmed washington policy makers for years, building personal capital that has eased him through the crisis with the united states.
riding the train of dreams across india - for the first time, the world is more urban than rural, a trend helped along by migrants arriving in mumbai aboard the pushpak express.
november 2007
s
m
t
w
t
f
s
« oct
123
45678910
11121314151617
18192021222324
252627282930
other:
login
register
meta:
rss 2.0
comments rss 2.0
valid xhtml
wp
subscribe to main blog feed here:
subscribe to comments too (below):
powered by wordpress
Acceuil
suivante
dvorak uncensored » blog comment spam fix If it ain't broke, don't fix it! (uit Engels in Frans translation ... Chevilles SPIT FIX II - BTP MAT Bebe Confort Creatis Fix - Comparer les prix pour Bebe Confort ... Howto fix Firefox Flash Video Sound on Ubuntu Linux Dapper ideal ... KIT FIX ALFA/FIAT Reborn Mr Fix-it, Ahmed Chalabi, pulls Iraq out of darkness ... Fix-CA Matrix Infinity Fix sur PsTwo - PsTwo la nouvelle PS2 de Sony ... Stop The ACLU » Blog Archive » Fred Thompson Proposes Social ... SPECIAL BATIMAT - De l'inédit chez Sader : Top Fix®, la Pâte à ... How to fix your iTunes artwork - Download Squad Offre d’emploi FIX Connectivity Specialist Investment Banking ... Thèses de l'ULP - Auteur: FIX, Thomas La Gallerie du Kap Course :: Beach volley by fix!!! Pattex - Ni Clou Ni Vis Fix & Défix : Toutcoller.com Siège coque - Créatis Fix BB Red - Fnac éveil et jeux - achat en ligne Operator @FIX - RSA, The Security Division of EMC FixMyVista.com - Your One Stop Windows Vista Fix It Site Groupe 0-0+, Cabrio Fix de Maxi Cosi : Aubert Pants'Fix trousers solution men homme - Vidéos Actualités Mode ... Fix Iraq - Free US Casualty In Iraq counter, join the discussion ... MacSlash iMac Freeze Fix Promised Fix You de Coldplay : paroles et extrait - Fluctuat.net Theory Fix (Isabelle2005: October 2005) Télécharger Object Fix Zip - 01net. Telecharger.com ... How to fix the Firefox memory leak (Firefox hack) « // Internet ... BYO - In Memoriam: Dr. George J. Fix III Jackie Craven: The Fix Tax Fix Numlock Fix for Linux Fix-Saint-Geneys - vue photo satellite Welkom op de Homepage van C-Fix Pants'Fix trousers solution women femme - Vidéos Actualités Mode ... Fix de rando sur piste ? - Skitour BANQUETTE PIANO CONCERT 172 FIX CUIR NOIR CAPITONNE (PORT OFFERT ... FPL annonce que le langage FIX Algorithmic Trading Definition ... Mobistar Fix Professionnal Nouveaux tarifs Mobistar Fix Professional Data Theft: How to Fix the Mess - New York Times Code Reviews: Find and Fix Vulnerabilities Before Your Application ... Philippe Fix - auteur-illustrateur jeunesse Fix design Recharge 750ml PHP Maximus CMS - Fix sécurité du module Sections Galerie Photo Plongée sous-marine de Plongeur.com - fix Galerie ... Air - Fix - Tecni.art Fix L'Oréal Professionnel sur Beauté-test.com Base Fixante à Paupières Fix It Essence sur Beauté-test.com sonnerie fix you (Sonnerie monophonique fix you) (suonerie.vnunet.it) Inside the Fix -nearly DTC. INSIDE THE FIX PRESENTE LE DOSSIER DU MOIS: La bibliothèque d'images du Wiki Autrans :: Autrans2004 par Fix Video: Your daily Tesla fix! - AutoblogGreen 156 Useful Run Commands Fixateurs externes Uni-fix, PH-fix, MP-fix, Hybrid Homepage von Prof. Dr. phil. habil. Fix FixOyun.Com >> Spor Oyunları >> Fix Ralli Oyunu , Bedava Fix Ralli ... coding... and other random stuff - home of Bingo Caller SNOW, BOTTES ET FIX NEUVE JAMAIS SORTI Snow Planches a neige fix et botte & sac "Traduction Fix You"