Add port-knock function
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
3d33b8d73b
commit
b7fb88cb79
1 changed files with 10 additions and 0 deletions
10
.zsh/config.sh.d/portknock.sh
Normal file
10
.zsh/config.sh.d/portknock.sh
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# pknock provides a port-knock tool based on ncat
|
||||||
|
function pknock {
|
||||||
|
HOST="$1"
|
||||||
|
|
||||||
|
# Perform port knocking sequence
|
||||||
|
echo "Knocking requested port sequence (${HOST} - ${*:2})" >&2
|
||||||
|
for i in ${*:2}; do
|
||||||
|
ncat -w 50ms "${HOST}" $i 1>/dev/null 2>&1
|
||||||
|
done
|
||||||
|
}
|
Loading…
Reference in a new issue