Skip to content

Instantly share code, notes, and snippets.

@dwallraff
Last active March 22, 2021 17:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dwallraff/4b278a114fdc45502b87d713653381ff to your computer and use it in GitHub Desktop.
Save dwallraff/4b278a114fdc45502b87d713653381ff to your computer and use it in GitHub Desktop.
Use bash for tcp test connections on linux
exec 3<>/dev/tcp/example.com/80 && echo -e "HEAD / HTTP/1.1\r\nHost: example.com\r\nConnection: close\r\n\r\n" >&3 && cat <&3
# exec 3<>/dev/tcp/www.google.com/80
# echo -e "GET /index.html HTTP/1.1\r\nConnection: close\r\n\r\n" >&3
# cat <&3
# cat < /dev/tcp/<ip>/<port> > outfile.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment