xt_pknock: replace nemesis by socat

Use a utility much more widely available.
This commit is contained in:
Jan Engelhardt
2016-04-22 22:50:42 +02:00
parent 80bed0655f
commit f5e95f35a7

View File

@@ -1,15 +1,6 @@
#!/bin/bash #!/bin/bash
# $1 -> IP src if [ "$#" -ne 4 ]; then
# $2 -> IP dst
# $3 -> PORT dst
# $4 -> secret
if [ -z $4 ]; then
echo "usage: $0 <IP src> <IP dst> <PORT dst> <secret>" echo "usage: $0 <IP src> <IP dst> <PORT dst> <secret>"
exit 1 exit 1
fi fi
python gen_hmac.py "$4" "$1" | socat - "udp-sendto:$2:$3,bind=$1"
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