Sample Header Ad - 728x90

send input to netcat and save output

0 votes
1 answer
3296 views
I am trying to send a command to netcat which will result into an output and I want to save that output to a file. while true; do echo "showHistory userx"; done | nc -w1 xxx.xxx.xxx.xx 2222 > out.txt & I tried a lot of google searches and read a lot of stackexchange questions but could not solve it. I played around with while, tee, mkfifo but no luck. The file out.txt remains blank but has a lot of NUL chars Edit: I have updated showhistory to showHistory userx in order to highlight that it is a command to be supplied over telnet/netcat session
Asked by th3pirat3 (101 rep)
Feb 6, 2018, 10:44 PM
Last activity: Jul 27, 2025, 08:08 PM