I have new web server running nginx. The default server is receiving 10K+ requests every day from Russian bots. They are clearly probing for something, but it's hard to say what since the requests are partially hex encoded. I have tried decoding them, but still couldn't tell what their aim is. Here are some examples:




The server returns 400 for all these requests. Regardless, I would like to block these bots from making these requests since I don't want them to succeed at whatever it is they're trying to do.

I use fail2ban but it isn't configured to stop these. Should I set-up a special filter to find these in the logs? The only consistency that I can see is they all have "\x##" where ## is a hex code. However, I don't want to block any legitimate requests, so the filter needs to target these bot requests only.

Any ideas on how to do this?

  • 1
    I see two options here but probably there are more, the first one is to take the IP addresses from the logs and block them at firewall level (iptables or other), and the other solution is write a nids (Network Intrusion Detection System) rule (snort, suricata, aiengine and so on) and block it from there. – camp0 Aug 10 '18 at 9:20
  • @camp0 - thanks. I've already blocked them via ip route, but there are tens of IPs every day, so not really feasible long term. I've not used a NIDS before but will look into it. – mattf10 Aug 10 '18 at 14:40

Fail2ban is nice to block attacks that generate a expected output, like login attemps or similar stuff. In your case, you are receiving requests with shellcode. That shellcodes are some kind of payload to try injections or similar (sqli, command injections, etc). So to protect to these kinds of attack what you need is a WAF (Web Application Firewall).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.