Forum Moderators: open
[edited by: not2easy at 1:55 pm (utc) on Jul 8, 2023]
[edit reason] split thread cleanup [/edit]
So far I have blocked probably a hundred different IP's and incidences now seem to be slowing down - most now come out of the USA.
I have not used the .htaccess file to attempt to block as I am pretty sure X11 the U/A will ignore that too.
8 Jul 2023, 01:30:28|44.229.15.165|GET1.1|403|16,3690|Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0| it appears that they are receiving a 403 response but a huge file in place of a 403 error document - or I've missed a separator. That IP is Amazon and can be blocked (from 44.192.0.0 - 44.255.255.255) with 44.192.0.0/10
I have not used the .htaccess file to attempt to block as I am pretty sure X11 the U/A will ignore that too.Nobody can “ignore” htaccess, just as they can’t ignore the identical directive in the main config file. That’s assuming the config file has the appropriate AllowOverride settings so htaccess can be used in the first place.
I have blocked probably a hundred different IP'sDo you mean individual IPs, down to the last digit? That's not worth it, except in the rare case of an infected human machine from an otherwise legitimate neighborhood. Look up the range and block the whole thing.
200162,241425Can you unpack this? It looks like three separate numbers, starting with the response code:
40316,3690
those IP's you suggest.because 44.192.0.0 - 44.255.255.255 is a range of all IPs from the first IP shown to the last one shown. The 44.192.0.0/10 is the CIDR for all of them and that would be the one to use IF your host allows you to add CIDRs.
SetEnvIfNoCase Request_URI "(robots\.txt)$" pass
Deny from env=ban
Allow from env=pass
SetEnvIfNoCase User-Agent "x11" ban I was concerned about making a mistake writing code I didn't fully understand to .htaccess because I don't really understand the .htaccess file but I know making a mistake in there could be worse than fiddling in the dark with something I don't, yet, fully understandThis is a perfectly sound and reasonable starting position. A simple mistake such as a misplaced comma can bring down your entire site. So always test by opening some random page every time you have made changes in htaccess.
Deny from env=ban
Allow from env=pass
Um, er, ahem. Those are Apache 2.2 directives. They will work in 2.4 if mod_access_compat is installed (it almost certainly is), but if you are just getting started on access controls, you may as well proceed directly to current syntax and then you won’t have to unlearn anything.
so am I going to have to learn Apache too?All of it? Nah, just learn specific things as and when you need them. For access control, start with the two directives
(badbot|bulid|pcor|pytho) so "pytho" blocks anything with Python in the UA string.
Some of the countries it was coming out of were alarming too, like North Korea ! Some of the IP's too like French Atomic Energy Commission.Yikes. Has your site offended someone? When you get endless hits from wildly improbable IPs, a last-resort possibility is some kind of DDoS attack: they don't actually want your files, they just want your server to become overloaded and be unable to serve files to legitimate people who do want them.