Sample Header Ad - 728x90

Is it possible to create a ncat loop?

1 vote
1 answer
578 views
If you had two computers, wanting to control one from another using only ncat, without using telnet, ssh or other networking tools and only two shells, how could i go about that? I have successfully done so with three shells: 1. cat | ncat 192.168.0.11 2. ncat -l | bash | ncat 192.168.0.16 3. ncat -l Would it be possible to have one shell, where the input from one ncat would get displayed on the screen and the input in the shell would get piped into the other ncat? So far I have run into the following problems: 1. Before a ncat can start sending data, another ncat has to be listening for it, so I need a way to force a ncat to send data anyways. 2. If I did something like ncat -l | cat | ncat 192.168.0.11, the data would just get looped right back into the sending ncat (which I don't want), and wouldn't get displayed on the screen (which I want) and the input from the keyboard would just get ignored (which I also don't want). Maybe the first two problems could be solved by somehow redirecting the received data to stderr, but how would I capture KB input? It doesn't matter in which shell such a manouver would be possible, just that it works (fish, bash, zsh, anything is fine). This is not a serious scenario, I am just curious.
Asked by Tada Fireworks (11 rep)
Jun 28, 2022, 11:26 AM
Last activity: Jun 28, 2022, 05:26 PM