libcli icon indicating copy to clipboard operation
libcli copied to clipboard

libcli with nc

Open mouneshb opened this issue 7 years ago • 3 comments

Can we make libcli to work with 'nc - netcat ' ? I tried connecting with nc, it connects but output is not displayed.

mouneshb avatar Nov 20 '18 12:11 mouneshb

It can, mostly, but you need to ensure you are using CRLF as the terminators and disable line buffering. From linux this works to talk to the clitest program.

stty_orig=ssty -g ; stty -echo -icanon ; nc localhost 8000; stty $stty_orig

Not sure of the windows equivalent.

RobSanders avatar Nov 27 '18 17:11 RobSanders

The above keeps a copy of the existing terminal characteristics, disables local echo and special character processing (and ensures chars are sent one at a time instead of line at a time), then invokes netcat with telnet prompts and CRLF line terminators, and finally restores the terminal settings when done.

RobSanders avatar Nov 27 '18 17:11 RobSanders