Last active
February 29, 2020 01:41
-
-
Save makeittotop/b03077f21e00fb972305857775b2438b to your computer and use it in GitHub Desktop.
test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#create a filter at /etc/fail2ban/filter.d/apache-xmlrpc.conf. | |
[Definition] | |
failregex = ^<HOST> .*POST .*xmlrpc\.php.* | |
ignoreregex = | |
#open /etc/fail2ban/jail.conf to add this rule: | |
[apache-xmlrpc] | |
enabled = true | |
port = http,https | |
filter = apache-xmlrpc | |
action = iptables[name=apache-xmlrpc, port=http, protocol=tcp] | |
sendmail-whois[name=SSH, dest=you@youremailaddress.com, sender=fail2ban@yourserver.com] | |
logpath = /var/log/httpd/access_log | |
maxretry = 6 | |
#Restart fail2ban | |
#Check its logs to figure out if it worked | |
awk '($(NF-1) = /Ban/){print $NF}' /var/log/messages | sort | uniq -c | sort -n | |
1 188.0.236.9 | |
1 191.96.249.53 | |
1 191.96.249.54 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment