Are you in my blocklist?

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).
Published on Sunday, 12 February 2023

Photo by Marek Studzinski on Unsplash

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
313

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):

1.169.65.70
1.169.71.75
1.169.94.42
2a01:4f9:2a:9a7::2
2a01:e0a:ab3:8ee0:7285:c2ff:fe7f:45dc
2a02:c207:2038:1770::1
2a03:b0c0:3:d0::18f3:3001
2a0d:5600:44:7000::3642
2a12:d6c7:3585:281:a9cb:9975:da3a:da0e
2.196.211.158
2.58.82.130
5.157.14.179
5.157.32.182
5.157.43.194
5.157.58.114
5.157.59.234
5.161.46.52
5.165.138.66
5.165.253.119
5.172.177.218
5.181.252.102
5.188.159.17
5.227.25.1
5.252.235.126
5.62.43.147
5.62.43.182
5.62.47.155
5.62.59.89
5.62.61.215
8.215.40.234
8.219.211.176
8.219.76.117
13.235.73.17
14.186.36.41
20.102.66.0
20.246.72.39
20.254.191.116
23.105.157.157
23.105.157.239
23.105.157.30
23.108.233.191
23.108.45.80
23.108.47.227
23.108.48.124
23.128.248.18
23.154.177.5
23.19.248.162
23.229.107.206
23.229.52.10
23.229.53.34
23.231.15.24
23.231.32.228
23.231.34.122
23.231.39.158
23.231.39.162
23.231.39.213
23.231.39.248
23.236.148.139
23.236.162.202
23.250.44.241
23.250.52.180
23.250.53.35
23.250.54.189
23.253.253.26
23.81.227.124
23.81.227.185
23.81.227.27
23.81.227.50
23.81.227.59
23.81.230.218
23.81.231.136
23.83.179.226
23.83.179.233
23.83.89.214
23.83.89.228
23.90.29.9
23.90.30.148
23.90.30.70
23.90.43.45
23.94.171.163
23.94.229.235
23.95.204.72
23.95.232.193
23.95.239.106
23.95.239.56
24.108.106.119
34.212.159.85
35.180.23.142
36.71.80.10
36.77.91.240
36.90.21.29
37.139.179.19
37.139.53.199
37.139.53.33
37.145.130.234
37.146.245.196
37.20.173.52
37.204.161.9
37.220.87.15
37.220.87.27
37.220.87.30
37.220.87.5
37.46.115.24
38.109.246.20
38.109.246.241
38.153.112.165
38.153.128.179
38.153.128.89
38.153.131.0
38.153.131.230
38.153.141.27
38.153.148.11
38.153.223.191
38.154.132.47
38.170.34.55
40.87.23.218
43.153.80.231
43.155.131.100
44.200.17.20
45.10.164.233
45.114.14.238
45.120.49.110
45.120.49.153
45.120.49.192
45.120.49.242
45.120.51.144
45.125.245.226
45.126.185.232
45.127.250.160
45.129.99.168
45.130.60.74
45.131.194.207
45.134.22.4
45.136.155.91
45.136.172.121
45.136.254.190
45.139.124.38
45.146.130.212
45.158.185.237
45.192.131.207
45.192.138.177
45.192.143.105
45.192.143.39
45.192.143.76
45.192.158.155
45.252.189.248
45.32.127.27
45.43.65.177
45.70.236.194
45.72.119.167
45.72.67.12
45.8.133.44
45.83.85.238
45.87.249.76
45.89.105.216
45.91.21.53
45.92.20.208
45.92.21.233
45.92.23.225
45.94.45.243
45.95.203.65
45.95.29.242
45.95.39.134
45.95.39.59
46.0.41.27
46.0.43.43
46.0.43.66
46.101.37.189
46.185.169.124
46.21.146.150
46.53.243.51
46.53.244.17
46.8.111.229
49.206.121.204
49.36.89.118
49.79.64.207
49.79.66.248
50.231.0.43
50.3.137.232
50.3.159.46
50.3.159.48
50.3.193.201
50.3.86.33
51.195.102.23
51.68.125.26
51.79.129.236
51.79.137.185
51.89.153.112
54.153.80.45
59.33.205.149
61.220.204.181
62.133.47.8
62.171.129.108
62.210.80.33
62.4.24.100
64.137.48.23
64.137.48.81
64.137.92.179
64.137.93.142
64.187.235.212
64.187.235.63
64.187.236.113
64.187.236.142
64.235.41.116
64.235.61.101
64.43.89.48
64.43.90.185
64.43.90.248
65.109.172.58
66.115.149.83
66.115.181.195
66.146.235.51
66.42.52.115
68.71.249.153
69.147.248.68
69.16.157.113
69.30.214.154
69.61.200.104
72.195.34.59
72.210.221.223
72.255.9.84
73.142.23.215
74.82.50.155
75.127.11.5
76.108.0.152
77.234.43.142
77.245.2.148
77.73.134.2
79.137.71.24
79.139.183.195
79.181.164.15
80.253.250.9
80.80.194.11
80.80.194.38
81.106.26.182
81.22.37.109
82.118.29.137
83.217.11.2
83.24.171.42
83.31.253.64
85.203.36.175
86.111.229.12
86.48.0.173
87.122.21.243
87.62.99.122
88.103.235.229
88.147.153.69
88.147.231.47
88.99.218.174
89.178.99.179
89.187.143.31
89.238.183.237
91.108.177.112
91.108.177.150
91.198.230.131
91.198.230.25
91.198.230.57
91.199.3.112
91.208.184.9
91.219.212.195
91.223.133.253
91.223.133.47
91.228.155.242
91.229.239.162
91.231.143.158
91.242.54.52
91.243.191.237
91.244.42.203
91.245.37.46
91.246.192.201
92.205.161.205
92.55.19.101
93.120.32.192
93.124.112.37
93.124.114.145
93.124.126.153
93.157.28.43
93.73.179.112
94.103.80.181
94.130.18.223
94.130.212.213
94.198.51.129
94.26.31.115
95.164.135.245
95.164.234.98
95.181.151.86
95.214.55.165
95.216.105.155
95.217.106.216
95.79.224.133
96.8.118.15
101.255.151.17
102.129.152.38
102.129.153.112
102.165.1.213
102.165.1.46
102.165.51.172
102.165.52.135
102.165.54.26
103.112.0.165
103.121.122.184
103.135.207.21
103.140.205.177
103.14.226.100
103.14.226.101
103.14.250.137
103.142.21.41
103.146.23.202
103.149.86.248
103.149.86.249
103.149.86.25
103.149.86.251
103.153.69.134
103.153.69.145
103.155.217.167
103.155.217.176
103.160.228.56
103.176.20.13
103.196.37.111
103.204.169.215
103.204.169.230
103.211.15.93
103.221.232.215
103.240.99.72
103.240.99.80
103.241.225.210
103.251.167.21
103.48.68.34
103.80.86.100
103.80.86.251
103.87.142.138
103.87.142.154
104.131.161.101
104.143.226.121
104.143.245.65
104.143.253.188
104.144.109.64
104.144.26.58
104.144.98.186
104.149.136.105
104.153.81.107
104.153.81.221
104.153.82.143
104.153.82.169
104.153.82.38
104.160.17.171
104.160.17.205
104.160.17.224
104.160.17.247
104.160.17.37
104.168.107.111
104.168.25.34
104.206.203.138
104.206.203.251
104.211.91.72
104.222.185.102
104.222.185.70
104.222.186.22
104.223.227.141
104.227.146.52
104.227.90.161
104.232.211.9
104.238.50.78
104.239.126.0
104.239.33.141
104.239.97.89
105.112.191.250
105.159.76.66
106.92.117.111
106.92.117.45
107.150.31.92
107.150.31.94
107.150.64.186
107.150.84.111
107.150.89.132
107.152.140.83
107.152.177.44
107.158.116.89
107.158.85.124
107.158.85.97
107.170.81.141
107.172.130.116
107.172.146.137
107.172.146.179
107.172.181.221
107.172.227.240
107.172.229.62
107.172.44.238
107.172.61.252
107.172.67.146
107.172.69.111
107.172.71.47
107.172.73.111
107.173.177.71
107.173.177.73
107.173.33.63
107.173.3.45
107.173.53.197
107.174.108.204
107.174.148.4
107.174.149.92
107.174.238.96
107.174.251.162
107.174.9.188
107.175.34.53
107.175.37.114
107.175.90.60
107.181.112.187
107.181.152.162
107.181.152.236
108.184.160.113
108.62.124.161
109.172.109.28
109.186.170.152
109.195.85.80
109.196.161.165
109.196.163.62
109.196.170.52
109.230.218.140
109.230.218.27
109.230.218.34
109.230.220.133
109.230.220.67
109.69.108.83
109.70.100.19
109.70.100.27
112.87.140.164
113.72.123.166
116.30.137.246
117.160.250.137
117.194.113.43
117.214.45.162
117.214.73.246
117.252.236.31
119.126.157.67
119.160.59.222
119.59.115.161
122.241.127.128
123.24.119.87
124.122.197.206
125.228.230.78
128.1.184.212
128.199.143.141
128.90.114.85
130.105.48.51
135.181.188.233
136.0.45.157
136.144.35.210
137.59.5.198
138.117.160.34
138.128.40.146
138.128.40.53
138.197.71.247
138.199.59.137
138.219.121.78
139.162.2.219
139.28.223.56
139.99.121.192
140.83.49.207
140.99.15.205
140.99.73.105
141.226.72.198
141.98.235.228
142.132.203.69
142.252.198.45
142.44.203.5
143.244.44.169
144.168.213.137
144.91.120.165
145.255.9.153
145.40.103.113
146.70.59.5
147.28.182.125
147.28.184.73
147.78.141.237
149.129.237.71
149.200.184.73
149.28.142.54
149.5.4.226
149.5.4.34
152.58.114.157
152.58.90.187
152.58.91.195
152.58.92.7
154.12.141.175
154.12.142.93
154.13.102.93
154.13.103.91
154.13.26.76
154.13.54.117
154.13.55.18
154.13.55.199
154.13.56.211
154.13.60.178
154.13.61.145
154.13.62.107
154.13.98.127
154.16.4.124
154.17.76.139
154.17.76.14
154.194.11.247
154.194.9.187
154.29.111.252
154.30.246.179
154.30.252.160
154.3.222.164
154.37.192.176
154.47.28.72
154.84.130.39
154.84.132.110
154.84.132.12
154.84.132.130
154.84.132.142
154.84.132.147
154.84.132.16
154.84.132.39
154.84.132.46
154.84.132.56
154.84.132.74
154.84.132.82
154.84.132.89
154.84.132.92
154.84.132.93
154.84.133.109
154.84.133.121
154.84.133.133
154.84.133.147
154.84.133.148
154.84.133.65
154.84.133.7
154.84.133.81
154.85.101.29
154.9.200.210
154.9.200.85
154.92.112.50
154.92.113.112
154.92.122.202
154.92.123.182
154.92.123.214
154.92.126.206
154.92.127.41
155.138.156.38
156.146.36.113
156.146.36.66
156.146.36.97
156.146.60.135
156.238.5.173
157.185.148.136
157.254.202.223
157.90.129.60
159.242.227.130
159.242.227.152
159.242.227.154
159.89.163.128
159.89.228.253
160.202.95.20
161.117.10.233
161.117.9.99
161.123.101.124
161.123.192.18
162.212.174.105
162.212.174.18
162.212.174.49
162.212.174.55
162.244.134.102
162.244.134.164
162.254.191.46
164.90.152.213
164.90.174.185
164.90.204.215
165.231.105.42
165.231.108.220
165.231.225.175
165.231.225.20
165.231.225.40
165.231.24.158
165.231.35.81
165.231.97.230
165.231.98.121
166.88.232.101
166.88.232.12
166.88.232.127
166.88.232.2
166.88.232.4
166.88.232.51
166.88.232.55
166.88.232.58
166.88.232.75
166.88.232.92
166.88.232.97
166.88.248.110
166.88.248.120
166.88.248.127
166.88.248.43
166.88.248.54
166.88.248.59
166.88.248.65
166.88.248.68
166.88.248.93
167.179.58.58
167.71.190.131
168.151.243.32
168.151.243.57
168.196.160.61
168.81.46.54
168.90.199.228
168.90.199.86
168.91.8.75
170.2.223.254
170.83.176.37
170.83.178.226
171.224.177.249
171.224.179.247
171.224.180.26
171.96.174.88
172.102.211.238
172.104.163.82
172.104.70.19
172.245.101.137
172.245.107.238
172.245.107.242
172.245.113.113
172.245.113.135
172.245.171.78
172.245.229.114
172.245.229.135
172.245.229.85
172.245.242.175
172.245.250.164
172.245.255.181
172.245.33.58
172.245.34.24
172.245.35.223
172.245.64.120
172.245.73.13
172.245.73.79
172.245.84.232
172.245.87.80
172.94.53.2
172.96.80.55
173.208.153.35
173.213.84.142
173.44.153.151
173.44.153.174
173.44.153.212
173.44.155.143
173.44.155.215
173.44.155.243
173.44.164.162
173.44.167.44
173.44.213.133
173.44.213.197
173.44.213.33
173.44.222.123
173.44.222.168
173.44.222.173
173.44.222.185
173.44.222.227
173.44.222.53
173.44.223.150
173.44.223.44
173.82.102.194
175.100.60.212
175.171.147.181
176.124.210.117
176.124.220.43
176.124.223.175
176.126.123.12
176.31.115.13
176.31.182.123
176.58.125.165
177.128.197.114
177.234.143.189
177.234.143.215
177.234.143.52
178.159.37.11
178.159.37.156
178.159.37.55
178.175.128.42
178.223.143.196
178.239.173.48
178.34.151.49
178.45.209.125
178.45.220.250
178.62.100.151
179.60.183.33
180.190.99.47
180.253.65.124
181.177.102.25
181.177.102.73
181.177.110.192
181.177.110.193
181.196.142.114
181.215.47.83
182.90.224.115
183.111.79.2
183.111.79.215
183.17.124.225
183.17.127.10
183.88.53.224
183.89.71.200
184.174.29.226
184.174.58.245
185.100.87.192
185.100.87.250
185.102.112.137
185.104.216.134
185.104.219.106
185.104.219.191
185.107.56.155
185.107.57.2
185.107.80.193
185.109.22.119
185.121.138.185
185.135.157.89
185.140.249.71
185.153.151.147
185.158.104.125
185.158.106.60
185.16.38.111
185.161.70.197
185.165.46.170
185.166.25.98
185.168.158.149
185.174.159.245
185.181.61.23
185.193.52.180
185.195.71.3
185.205.18.2
185.206.249.76
185.212.206.118
185.212.206.8
185.213.80.177
185.214.74.39
185.220.100.249
185.220.100.252
185.220.100.253
185.220.101.12
185.220.101.16
185.220.101.161
185.220.101.191
185.220.101.44
185.220.101.50
185.220.101.87
185.220.101.9
185.220.102.243
185.220.102.252
185.220.102.253
185.220.103.113
185.220.103.117
185.220.103.120
185.223.234.166
185.223.234.49
185.231.223.88
185.238.229.53
185.238.229.58
185.242.92.212
185.243.218.61
185.246.188.73
185.250.23.233
185.47.88.150
185.5.251.131
185.61.219.119
185.61.222.223
185.65.134.162
185.65.134.164
186.179.42.198
186.179.42.51
186.179.43.199
186.179.43.79
186.179.6.142
186.179.6.249
188.130.185.41
188.130.211.142
188.132.174.221
188.162.80.230
188.166.255.229
188.74.169.174
188.74.182.6
188.74.210.156
189.6.234.58
190.113.42.162
190.144.34.146
190.185.108.158
191.101.110.24
191.101.114.232
191.101.250.185
191.102.143.189
191.102.143.191
191.102.143.210
191.102.151.196
191.102.154.246
191.102.154.88
191.102.156.55
191.102.158.44
191.102.182.196
191.96.181.14
191.96.181.83
192.109.110.91
192.109.110.98
192.111.130.5
192.126.158.129
192.126.158.203
192.126.182.207
192.126.182.60
192.126.182.68
192.126.204.7
192.126.232.78
192.186.145.52
192.210.144.73
192.210.144.89
192.210.168.118
192.210.169.123
192.210.190.28
192.210.190.46
192.210.194.146
192.210.194.163
192.210.201.241
192.227.205.168
192.227.222.204
192.227.253.133
192.227.253.147
192.241.105.188
192.241.116.210
192.241.118.20
192.3.143.79
192.3.188.203
192.3.241.13
192.40.95.123
192.42.116.173
192.42.116.175
192.42.116.191
192.42.116.192
192.42.116.209
192.42.116.210
192.42.116.216
193.109.221.64
193.150.70.96
193.169.255.43
193.178.134.54
193.188.20.88
193.189.100.200
193.219.0.192
193.233.149.237
193.27.23.102
193.38.235.152
193.39.245.124
193.43.119.189
194.105.158.100
194.105.158.111
194.124.158.79
194.15.113.22
194.169.217.48
194.195.91.12
194.233.85.63
194.34.248.138
194.5.148.27
194.5.53.1
194.5.53.40
194.5.83.16
194.53.140.105
194.53.140.128
194.53.140.129
194.53.140.92
194.76.114.233
194.88.152.40
194.93.37.181
195.140.176.216
195.140.177.144
195.140.177.77
195.154.61.146
195.176.3.19
195.206.105.27
195.206.110.163
196.0.87.2
196.18.123.35
196.196.164.160
196.196.164.254
196.196.164.28
196.196.169.17
196.196.194.122
196.196.194.91
196.196.224.180
196.196.247.127
196.196.47.133
196.199.55.115
196.240.104.239
196.240.105.94
196.240.143.57
196.240.143.82
196.240.173.175
196.240.173.195
196.240.173.231
196.240.237.131
196.240.237.186
196.240.237.190
196.240.254.56
196.240.58.14
196.240.58.22
196.242.10.240
196.242.195.2
196.242.20.23
196.242.21.196
196.242.21.215
196.242.21.24
196.242.57.25
196.242.84.110
196.244.4.203
196.244.4.62
196.244.48.99
196.245.148.151
196.245.148.204
196.245.157.196
196.245.157.247
196.245.159.119
196.245.159.51
196.245.163.242
196.245.184.126
196.245.184.234
196.245.216.100
196.245.217.23
196.245.217.245
196.245.217.41
196.245.237.117
196.245.237.120
196.245.237.5
196.245.246.60
196.245.247.25
196.245.247.60
196.245.250.202
196.245.250.203
196.247.40.15
196.247.40.200
196.247.40.24
196.92.209.249
198.12.108.68
198.12.119.173
198.12.66.183
198.12.66.209
198.144.159.124
198.144.180.89
198.20.178.107
198.23.216.218
198.23.238.73
198.240.91.236
198.37.124.114
198.46.185.80
198.46.206.17
198.46.206.28
198.46.222.168
198.46.225.49
198.46.241.147
198.59.191.249
198.96.155.3
198.98.48.192
199.167.138.122
199.181.239.141
199.249.230.105
199.249.230.183
200.105.215.22
201.229.250.21
202.186.214.112
202.80.218.116
202.8.74.10
202.94.175.246
202.94.175.60
204.10.194.8
204.217.128.246
204.217.128.9
204.217.220.31
206.189.117.108
206.232.27.98
207.154.240.108
209.145.59.112
212.102.33.198
212.102.33.241
212.102.33.69
212.102.33.85
212.102.39.98
212.60.20.163
212.83.170.137
213.183.234.32
213.194.138.138
213.232.120.54
216.12.174.122
216.127.188.18
216.131.77.18
216.131.88.52
216.173.74.197
216.24.212.68
221.158.33.23
223.29.214.2
223.29.253.4
223.29.254.71
240e:34c:5706:367:a0d4:93ae:98d7:6ac8
2405:19c0:c303:29c5:2856:6a7e:7517:6cc4
2405:19c0:c303:3908:627c:7f0e:77d:3fbc

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 ./blcheck.sh $ip;
  done
2023-02-12_08:09:24 api_key.124.227.81.23.dnsbl.httpbl.org.     127.72.8.5
2023-02-12_08:10:25 api_key.12.67.72.45.dnsbl.httpbl.org.       127.11.9.5
2023-02-12_08:10:35 api_key.51.243.53.46.dnsbl.httpbl.org.      127.2.26.5
2023-02-12_08:10:42 api_key.108.129.171.62.dnsbl.httpbl.org.    127.83.21.5
2023-02-12_08:12:08 api_key.27.100.70.109.dnsbl.httpbl.org.     127.19.54.7

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 :-) And I stopped using WordPress.