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.