There Is No Cat

Hollering into the void since 2002

Monday, August 21, 2006

Yawn, another boring post about spam prevention

Looking through my logs, one of the worst offenders in trying to spam There Is No Cat are hosts with IP addresses from BezeqNet in Israel. In particular, I get a ton of attempted spams from IP addresses in the range 84.110.224.0 through 84.110.255.255. I decided tonight that I've had enough of BezeqNet and that, despite the fact that my spam filters are catching all of their requests and filtering them out, I just want to prevent hosts on that net from accessing my site at all, period, end of sentence, full stop, hey hey hey, good bye. I do this occasionally for the worst offenders by adding their IP addresses to my .htaccess file. Typically, if you want to deny access from a single host, an entry like the following would suffice:

Deny from 84.110.224.90

But that would only prevent accesses from that one host. I get spam attempts from a number of IP addresses in that subnet. So maybe I want to be a little more aggressive and ban everything from that subnet:

Deny from 84.110.224

Now any machine with an IP address starting with those numbers will be prevented from accessing There Is No Cat. But my logs show that I'm being hit by computers in every subnet from 84.110.224 to 84.110.255. That's a lot of entries to cover each individual set of IP addresses.

There's a quicker way of doing this.

Classless Inter Domain Routing, or CIDR, is a way of specifying a range of IP addresses that doesn't cover an entire group, just a large section of it. This is done by adding a slash and a number representing a bit mask at the end of the IP address representing the network. In the case of the Bezeqnet network I wanted to block, this could be represented as follows:

Deny from 84.110.224.0/19

Now, binary math is not my strong suit, and I'm not really inclined to explain why this works, but if you find yourself in a situation where you need to specify a number of networks like this, there are calculators online that will help you out. I like this subnet calculator, which also includes other pages for other formats of IP addresses if you're a network administrator and need such things. For the purposes of adding a list of networks to deny access to in your .htaccess file, the CIDR calculator should suffice.

I really hope at some point to be able to stop writing about this stuff. It seems silly to maintain a weblog that then draws spam and devote the whole damned thing to preventing spam. If that's all I'm going to write about, then the most effective prevention would be to not have the weblog to start with. I do expect to do one more post exploring what are the characteristics of the spam POST requests I get, then hopefully that will be it for a while.

Tags:

Posted at 10:37 PM

Comments

Note: I’m tired of clearing the spam from my comments, so comments are no longer accepted.

Trackbacks

This site is copyright © 2002-2024, Ralph Brandi.

What do you mean there is no cat?

"You see, wire telegraph is a kind of a very, very long cat. You pull his tail in New York and his head is meowing in Los Angeles. Do you understand this? And radio operates exactly the same way: you send signals here, they receive them there. The only difference is that there is no cat."

- Albert Einstein, explaining radio


There used to be a cat

[ photo of Mischief, a black and white cat ]

Mischief, 1988 - December 20, 2003

[ photo of Sylvester, a black and white cat ]

Sylvester (the Dorito Fiend), who died at Thanksgiving, 2000.


Stylesheets


This site is powered by Missouri. Show me!

Valid XHTML 1.0!

Valid CSS!

XML RSS feed

Read Me via Atom

new host

Me!

Home Page
Resume
Married
Photographs
Flickr Photostream
Instagram Archive
Twitter Archive

last.fm

There Is No Cat is a photo Ralph Brandi joint.


Archives

Search



Family Blogs

Geneablogy
Jersey Girl Dance
Awakening
DullBlog
Mime Is Money

Blogs I Read

2020 Hindsight
AccordionGuy
Adactio
Allied
Apartment Therapy
Assorted Nonsense
Backup Brain
Burningbird
Chocolate and Vodka
Creative Tech Writer
Critical Distance
Daily Kos
Dan Misener likes the radio
Daring Fireball
Design Your Life
design*sponge
Doc Searls
Edith Frost
Elegant Hack
Emergency Weblog
Empty Bottle
Five Acres with a View
Flashes of Panic
Future of Radio
Groundhog Day
Hello Mary Lu
iheni
Inessential
Interllectual
Jeffrey Zeldman Presents
Jersey Beat
John Gushue ... Dot Dot Dot
john peel every day
JOHO The Blog
Kathryn Cramer
Kimberly Blessing
La Emisora de la Revolucion
Lacunae
Loobylu
mamamusings
Medley
mr. nice guy
MyDD
Orcinus
oz: the blog of glenda sims
Pinkie Style
Pinkie Style Photos
Pop Culture Junk Mail
Seaweed Chronicles
Shortwave Music
Slipstream
Talking Points Memo
The Unheard Word
Tom Sundstrom - trsc.com
Typographica
Unadorned
Vantan.org
WFMU's Beware of the Blog