diff --git a/README.md b/README.md index 9f3d050..88ef3f3 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ most to least recommended | bash | [mostly internals](clients/bash.sh) | | netcat | `nc r0c.int 531` | -you can even `exec 147<>/dev/tcp/r0c.int/531;cat<&147 &while IFS= read -rN1 x;do printf '%s' "$x">&147;done` (disconnect using `exec 147<&-; killall cat #sorry`) +you can even `exec 147<>/dev/tcp/r0c.int/531;cat<&147 &while IFS= read -rn1 x;do [[ "x$x" == "x" ]] && x=$'\n'; printf '%s' "$x">&147;done` (disconnect using `exec 147<&-; killall cat #sorry`) ## firewall rules diff --git a/clients/bash.sh b/clients/bash.sh index d54a5d7..e26d6b8 100755 --- a/clients/bash.sh +++ b/clients/bash.sh @@ -31,8 +31,11 @@ function connect() cat <&147 & cat_pid=$! # read keyboard and send each key to the socket - while IFS= read -rN1 x + while IFS= read -rn1 x do + [[ "x$x" == "x" ]] && + x=$'\n' + [[ $debug ]] && { printf '%s' "$x" |