There Is No Cat

A huge orangupoid, which no man can conquer

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 through 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

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

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.


Posted at 10:37 PM


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


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.


This site is powered by Missouri. Show me!

Valid XHTML 1.0!

Valid CSS!

XML RSS feed

Read Me via Atom

new host


Home Page
Flickr Photostream
Instagram Archive
Twitter Archive

There Is No Cat is a photo Ralph Brandi joint.



Family Blogs

Jersey Girl Dance
Mime Is Money

Blogs I Read

2020 Hindsight
Apartment Therapy
Assorted Nonsense
Backup Brain
Chocolate and Vodka
Creative Tech Writer
Critical Distance
Daily Kos
Dan Misener likes the radio
Daring Fireball
Design Your Life
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
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
mr. nice guy
oz: the blog of glenda sims
Pinkie Style
Pinkie Style Photos
Pop Culture Junk Mail
Seaweed Chronicles
Shortwave Music
Talking Points Memo
The Unheard Word
Tom Sundstrom -
WFMU's Beware of the Blog