Mit Knockd kann man Ports nach erfolgreichem Klopfzeichen öffnen und automatisch schliessen. Knockd fügt hierfür neue Iptables-Regeln ein. Es ist auch möglich per Knockd einzelne Dienste zu starten / stoppen. Knockd arbeitet sehr ressourcenschonen, nicht zuletzt weil das Binary nur wenige Bytes gross ist.
Die Konfiguration erfolgt ausschliesslich in der knockd.conf und ist sehr einfach gehalten. Das Beispiel zeigt die Konfiguration für SSH und der dazugehörigen Firewall Regel.
[options]
logfile = /var/log/knockd.log
[SSH]
sequence = 1234,56,78
seq_timeout = 15
tcpflags = syn,ack
start_command = /usr/sbin/iptables -A INPUT -s %IP% -p tcp --syn --dport 22 -j ACCEPT
cmd_timeout = 10
stop_command = /usr/sbin/iptables -D INPUT -s %IP% -p tcp --syn --dport 22 -j ACCEPT
Um Knockd noch sicherer zu machen, empfehle ich die Kombination mit Fail2Ban. Dadurch wird sichergestellt das ein Angreifer nicht permanent anklopft und versucht die Sequenz zu “erraten”. Stattdessen wird er zB nach 3 Klopfversuchen für 24 Stunden komplett gesperrt.













September 4th, 2009 at 12:03 am
[...] http://blog.telpl.de/port-knocking-mit-knockd.html Tags » Trackback: Trackback-URL | Feed zum Beitrag: RSS 2.0Thema: Linux, SSH, iptables [...]
January 20th, 2012 at 8:36 pm
[...]the time to read or visit the content or sites we have linked to below the[...]……
[...]here are some links to sites that we link to because we think they are worth visiting[...]……
January 21st, 2012 at 1:48 am
Micons…
[...]The pain stationed in the chest sometimes moves onto the neck, throat or the angle of the jaw if the quantity of gastric acid is more[...]…