问题原文
原帖链接 · MrAureliusR · CC BY-SA 3.0
I've been the target of a brute force attack on two WordPress sites I own. The attacker is using the good old XML-RPC thing to amplify brute-force password attacking. Luckily we have extremely well-generated passwords, so I highly doubt he'll ever get anywhere.
I've just been using iptables to block his requests whenever he pops up again (always from the same virtual cloud provider), but I would much rather modify the server so that whenever his IP address requests any page, he gets a response telling him to get a life. Most of the requests are POSTs, so I would ideally just like to modify the reponse header to include something like "Better luck next time!" or something equally satisfying.
Is this possible? I'm far from an expert with Apache, so I'm not certain how difficult this would be to implement. But even if it takes me hours, the satisfaction will be priceless.
For reference, I'm running Ubuntu 16.04.2 LTS, with Apache 2.4.18 hosting Wordpress 4.7.3.
社区高分解答
原帖链接 · BlackWebWolf · CC BY-SA 3.0
There is a possibility, and we did it quite a lot, to reverse possible attacks. Use iptables to redirect the cloud provider (address range) to a different port - and there serve the attacker a response, even in plain headers.
In Apache you can modify headers by example:
Header set GetOut "Better luck next time!"
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
