Skip to content

Instantly share code, notes, and snippets.

@oralunal
Last active December 21, 2025 21:12
Show Gist options
  • Select an option

  • Save oralunal/62de9150d2de24443b9538366b4c8b86 to your computer and use it in GitHub Desktop.

Select an option

Save oralunal/62de9150d2de24443b9538366b4c8b86 to your computer and use it in GitHub Desktop.
Fail2Ban filter for suspicious accesses
# Fail2Ban filter for suspicious accesses
# Detects access to common backdoor/shell PHP and environment files, detects bots
# Author: @oralunal
[Definition]
# Suspicious PHP files (backdoors, shells, short names)
failregex = ^<HOST> .* ".*" .* .* ".*" "((.*(cc\_bot|Python|Scrapy|aiohttp|Photon|fasthttp|GNSSInternetRadio|CensysInspect|Palo Alto Networks|onlyscans\.com\/about|Go\-http\-client|xfa1|HTTP Banner Detection|bang2012\@tutanota\.de|libredtail\-http|python\-requests|python-urllib|zgrab|l9tcpid|wpbot|curl|wget|Wget|Nuclei|masscan|nmap|scanner|nikto|sqlmap|wpscan|dirbuster|gobuster|python\-httpx|\\x22).*)|\-)"$
^<HOST> .* ".*(botavcisi|database|wp\-config|tinyfilemanager|b374k|wso|c99|r57|nc4|shell|webshell|chosen|alfa|up|fm|pass|core|bolt|adminfuns|xmrlpc|xmlrpc|unixlogin|phpinfo|change\_config|wpdiscuz\-ajax|eval\-stdin)\.php(.*)" (301|302|400|403|404|405|500) .+ ".+" ".+"$
^<HOST> .* ".*xmlrpc\.php(.*)" (200) .+ ".+" ".+"$
^<HOST> .* ".*(site\/phpinfo\.php\.save|cgi\-bin|site\/info\.php\.save|wlwmanifest\.xml|\.env|\.git|JMXInvokerServlet|cgiServer\.exx|pandora_console).*" (403|404) .+ ".+" ".+"$
ignoreregex =
@oralunal
Copy link
Author

oralunal commented Dec 21, 2025

"Mozilla/5.0" is removed. Apple mail fetches images with this user-agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment