Last active
September 21, 2017 03:15
-
-
Save tyzbit/f30b8577b870105f6d5c to your computer and use it in GitHub Desktop.
Connect to an arbitrary TCP port to Read/Write. Very basic, will probably break easily but robust enough to test FTP credentials sans FTP
This file contains hidden or 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 | |
if [ ! -z $2 ]; then | |
host=$1 | |
port=$2 | |
exec 5<>/dev/tcp/$host/$port | |
cat <&5 & | |
trap "exec 5>&- " EXIT | |
while true; do | |
read p | |
echo "$p" >&5 | |
done | |
else | |
echo "not enough args" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this is better
exec 5<>/dev/tcp/$host/$port; cat <&5 & cat >&5; exec 5>&-