xt_pknock: import digest generation utility

This commit is contained in:
Jan Engelhardt
2016-04-22 22:48:56 +02:00
parent bc6aaf74d8
commit 80bed0655f
2 changed files with 32 additions and 0 deletions

15
extensions/pknock/knock.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
# $1 -> IP src
# $2 -> IP dst
# $3 -> PORT dst
# $4 -> secret
if [ -z $4 ]; then
echo "usage: $0 <IP src> <IP dst> <PORT dst> <secret>"
exit 1
fi
digest_file="/tmp/digest.txt"
python ../test/py/gen_hmac.py $4 $1 > $digest_file
nemesis udp -S $1 -D $2 -y $3 -P $digest_file