Last active
March 24, 2019 06:13
-
-
Save miguelmota/205520edd6f067922f75878d77b8d06e to your computer and use it in GitHub Desktop.
Bash pipe exec stderr and stderr to file descriptor which is an open tcp socket
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
exec 3<>/dev/tcp/127.0.0.1/1337 && head -1 <&3 | |
exec &> >(tee >(cat >&3)) | |
# netcat equivalent: | |
# exec > >(nc localhost 1337) 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment