Access blocked

Are you in my blocklist?

Recently, Jeff Starr wrote about blocking IP addresses posting random string comment spam. That post reminded me about my own older post about blocking WordPress comment spammers manually. With just a few manual steps, you create your own little blocklist for WordPress in either a .htaccess or web.config file. Here are the IP addresses I’m currently blocking. Note, this list can get long (loooonnggg).

$ grep -c 'Require not ip' .htaccess
313Code language: Apache (apache)

That’s 313 unique IP addresses posting spam comments here on Sysadmins of the North. Consider this a public pillory. Unlike Jeff, I do remove the comments, so there are no samples saved. I have database backups available, so it’s easily restored. Those 313 was initial, I’m now at 1375.

Read how to restore single MySQL table from a full mysqldump backup file.

Without further ado, here’s the list (tip, use grep 'Require not ip' .htaccess | cut -d " " -f 4 | sort -n | uniq):
2405:19c0:c303:3908:627c:7f0e:77d:3fbcCode language: Apache (apache)

Here is how to properly block the IP addresses in .htaccess files.

Next step is to lookup netblocks for those IP addresses, to make the list of IP’s smaller and block entire networks. If you use my Bash script to check an IP address blacklist status you can quickly verify whether an IP address is already listed in Project Honey Pot, for example:

$ for ip in $(cat blocked_ips.txt);
  do ./ $ip;
2023-02-12_08:12:08 language: Bash (bash)

Explanation about the result addresses is in Project Honey Pot’s Http:BL API Specification. Because you have to keep an eye out for the size of your .htaccess file (the larger the slower), it’s beter to use a (semi) commercial solution like Project Honey Pot, Stop Forum Spam, or perhaps even Imunify 360. All in cooperation with ModSecurity of course.

Happy hunting!

Update: I stopped updating this post because the list of blocked IP addresses was getting too large :)

buy me a coffee
buy me a coffee

Jan Reilink

Hi, my name is Jan. I am not a hacker, coder, developer or guru. I am merely an application manager / systems administrator, doing my daily thing at Embrace - The Human Cloud. In the past I worked for clidn and Vevida. With over 20 years of experience, my specialties include Windows Server, IIS, Linux (CentOS, Debian), security, PHP, websites & optimization. I blog at