% echo -e 'e.g.,\n'
% iptables -L -n
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- foo.bar.qux.def 0.0.0.0/0 tcp dpt:22
DROP tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
% cat /etc/knockd.conf
[openSSH]
sequence = foobar,def,plugh,fred,xyzzy,thud
seq_timeout = 5
command = /sbin/iptables -I INPUT -s %IP% -p tcp --dport 22 -j ACCEPT
tcpflags = syn
[closeSSH]
sequence = thud,def,fred,foobar,xyzzy,plugh
seq_timeout = 5
command = /sbin/iptables -D INPUT -s %IP% -p tcp --dport 22 -j ACCEPT
tcpflags = syn
% knock -v foo.bar.qux.quux foobar def plugh fred xyzzy thud
% echo 'however, knocks can be sent via netcat, hping, packit, etc.'
% echo 'open_port command executed @foo.bar.qux.def.'
% echo 'do sleep 16; while job_done; done...'
% knock -v foo.bar.qux.quux thud def fred foobar xyzzy plugh
% echo 'close_port command now executed @specific.host. all set. w00t!'
n.b.
#01. {def,foobar,fred,plugh,thud,xyzzy} == (tcp || udp) ports.
#02. use as many as you want... anyway, 3 should be just fine (read as `secure').
. ..:
7 comments:
Oi. Start writing. Can't leave your blog dead and Identica frozen. Reach out and choke someone.
Felicitari in primul rand pentru blog,este o munca depusa eficient,in al doilea rand pentru minunatele postari...mi se pare foarte interesant. succes si sa munciti cu cel putin acelasi simt de raspundere pe viitor
wtf jula, ti-au raspuns chinezii si curvele. fii atent (re, knockd): http://ingles.homeunix.net/software/ost/ noi fol. ostiary ptr ssh
This tutorial on knockd was really informative Ionut. Thanks a lot for sharing it with us. We make some Python tutorials as well that may benefit your readers at https://www.linkedin.com/company/firebox-training
What's up, this weekend is fastidious in favor of me, since this occasion i am reading this great educational post here at my residence.
I got this web site from my friend who informed me on the topic of this website and at the moment this time I am browsing this web page and reading very informative articles or reviews at this time.
Post a Comment