Last active
August 29, 2015 14:13
-
-
Save gboddin/06df09f9142087773c69 to your computer and use it in GitHub Desktop.
net corruption test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#quick nt wrapper thanks V****** Franck | |
[ -z "$1" ] && echo "First arg is <server/client>"&&exit 1 | |
if [ "$1" = "server" ]; then | |
[ -z "$2" ] && echo "Second arg is listening port"&&exit 1 | |
while /bin/true; do | |
nc -lp $2 2>/dev/null > /tmp/tcptest || nc -l $2 2> /dev/null > /tmp/tcptest | |
md5sum /tmp/tcptest | |
sleep 1 | |
done | |
elif [ "$1" = "client" ]; then | |
[ -z "$2" ] && echo "Second arg is target IP"&&exit 1 | |
[ -z "$3" ] && echo "Third arg is target port"&&exit 1 | |
while /bin/true; do | |
dd if=/dev/urandom bs=64 count=99999 | tee /tmp/tcptest > /dev/tcp/$2/$3 && md5sum /tmp/tcptest | |
sleep 2 | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment