Skip to content

Instantly share code, notes, and snippets.

@csghone
Created June 23, 2020 07:37
Show Gist options
  • Select an option

  • Save csghone/3297b84bfdd10e907b43cab4275c1426 to your computer and use it in GitHub Desktop.

Select an option

Save csghone/3297b84bfdd10e907b43cab4275c1426 to your computer and use it in GitHub Desktop.
Telnet communication via STDIN/STDOUT using socat
#!/bin/bash
HOST=192.xxx.xxx.xxx
PORT=1234
echo 'some_string' | socat - EXEC:"telnet $HOST $PORT",pty,setsid,ctty | tail -n +5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment