Support

Admin Tools

#37773 Auto-lock ip by the url

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
3.10.11
PHP version
7.4
Admin Tools version
6.1.7

Latest post by sheka2013 on Monday, 26 September 2022 02:14 CDT

sheka2013

Good afternoon. I have a joomla website. But very often they try to hack it, I think that it is on WordPress. And accordingly, in the log (see screenshot) there are a lot of repeating addresses, in which there are elements of the address by which you can unequivocally say that this IP can be blocked immediately. How to make the setting that if the address contains wp-content, wp-admin, etc. would the component immediately block this ip and move it to the black list?

nicholas
Akeeba Staff
Manager

Use the 404Shield feature, that's exactly what it was made for. See https://www.akeeba.com/documentation/admin-tools/web-application-firewall.html#waf-configure-joomla-hardening and search for “Enable 404 Shield” and “404Shield”.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

sheka2013

This setting is enabled. Attempts to access this address are logged. But then I manually add these addresses to the black list, because. after a while they again try to check the site at these addresses. Those. the system skips 4-5 times, then blocks, but the IP address is not automatically transferred to the black list. How can I make it immediately blacklist this address on the first try?

 

Automatic blocking of IP after 1 or 2 attempts is not suitable. Here it is precisely necessary that the IP be blacklisted at the request address.

nicholas
Akeeba Staff
Manager

> Those. the system skips 4-5 times, then blocks, but the IP address is not automatically transferred to the black list.

Okay, this is the intended behaviour. Accessing a URL blocked by 404Shield records a blocked request. Do that many times within the blocking window (configurable by you, in the Configure WAF page) and they get their IP blocked. If they keep doing that they will get their IP permanently blocked based on the settings you have provided for permanent IP blocking, again in the Configure WAF page. This is how it's supposed to work, it's also documented why.

> Automatic blocking of IP after 1 or 2 attempts is not suitable.

Yes, it is.

If we blocked an IP immediately and permanently we'd make it super easy for an attacker to delist your site from search engines. All an attacker would have to do is create a page with real text and links to the non-functional WordPress URLs on your site. The search engine would dutifully pick these links up and try to crawl them. As soon as your site saw the crawler it would permanently block it, forever. As a result any other URL the search engine would try to crawl would appear to be permanently blocked with HTTP 403 Forbidden and the search engine would drop your site. 

Furthermore, a legitimate client visiting such a URL would be parma-banned. It's easy for someone to make a malicious phishing campaign only that instead of directing your clients to a shady URL to steal their credentials they'd be sending them to your domain, but on a URL which would get their IP address permanently banned. The user might miss the sender but they'd sure wouldn't miss the fact that they are really in your legitimate domain name and they are told they are blocked because they are a hacker. Can you imagine the havoc this wreaks upon an e-commerce site?

You also have people who are just plain curious and legitimate vulnerability scanners you may be running on your site. If you automatically and permanently block them you are doing a disservice to your site.

Finally, as I've said in the documentation and written in these here ticket replies thousands of times: IP addresses are NOT static. The IP address you are banning today because it belongs to a malicious actor will not necessarily remain assigned to them in all eternity. Very likely they are using a bot across a few compromised computers. These computers will sooner rather than later be assigned a different IP from their ISP and the old IP will be assigned to a different, legitimate client. If they try to access your site they will find themselves blocked. Don't overdo it with permanent IP banning, it will come back to bite you.

When doing security you need to think about the consequences of your actions. If you permanently block IPs for the slightest hint of a possibly problematic request you will come back here telling me that Admin Tools is preventing access to your site for legitimate users or that it keeps blocking you all the time. The problem won't be Admin Tools, it'll be your hair trigger configuration — after all, Admin Tools only does what you tell it to do, nothing less and nothing more.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

sheka2013

Thank you. Now everything is clear. You can close the ticket.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!