- May 8, 2015
- 967
- 934
- 211
All credits go to shawly. c/p'ed from here
Hi,
I just wanted to share my Fail2Ban filter which bans failed server query login attempts. This is useful if you use the default teamspeak ports and have all query ips whitelisted. This is of course not necessary if you have restricted the access to the query login with your query whitelist.
I also know that the query automatically bans an IP that had 3 failed login attempts, but this could also be expanded more to filter out other attacks or people that connect and disconnect randomly, so I'm just sharing it, maybe someone will have some use for this.
Save this code to /etc/fail2ban/filter.d/teamspeak.conf
And save this to your /etc/fail2ban/jail.local
You obviously have to change the path to your teamspeak log dir and if you don't use the default ports, you also have to change the ports or add ports when you have multiple servers.
You also can adjust the bantime and the maxretry, currently the bantime is one day after three failed login attempts.
Hi,
I just wanted to share my Fail2Ban filter which bans failed server query login attempts. This is useful if you use the default teamspeak ports and have all query ips whitelisted. This is of course not necessary if you have restricted the access to the query login with your query whitelist.
I also know that the query automatically bans an IP that had 3 failed login attempts, but this could also be expanded more to filter out other attacks or people that connect and disconnect randomly, so I'm just sharing it, maybe someone will have some use for this.
Save this code to /etc/fail2ban/filter.d/teamspeak.conf
Code:
[INCLUDES]
before = common.conf
[Definition]
failregex = .*query from .* <HOST>:.* attempted to login with account.*
ignoreregex =
And save this to your /etc/fail2ban/jail.local
Code:
[teamspeak]
enabled = true
port = 2008,2010,9987,10011,30033,41144
filter = teamspeak
logpath = /home/teamspeak/log/server/ts3server_*.log
maxretry = 3
bantime = 86400
findtime = 7800
action = iptables-multiport[name="teamspeak", port="2008,2010,9987,10011,30033,41144"]
You obviously have to change the path to your teamspeak log dir and if you don't use the default ports, you also have to change the ports or add ports when you have multiple servers.
You also can adjust the bantime and the maxretry, currently the bantime is one day after three failed login attempts.