You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In server mode, when running a command with -e or -c, ncat does not close the socket before executing the child process. Since the parent process exits when the client stops sending data, this can incorrectly cause the client to think more data is incoming.
When both commands are run in parallel, the server ncat will exit as soon as the client connects, but the client will wait for a second before the socket is closed (with no response data) by sh exiting.
Expected behavior
When a client has stopped sending data, ncat should either:
Exit the server and fully close the connection without waiting for the child to finish.
Wait for the child to finish sending output before exiting.
Option 2 is what I would prefer, but is a bigger change than option 1. In both cases though, there is no reason for the child process to keep the socket open.
Version info (please complete the following information):
OS: Linux 6.8.2
Output of ncat --version: Ncat: Version 7.94 ( https://nmap.org/ncat )
The text was updated successfully, but these errors were encountered:
I agree this seems like a bug. Traditional (Hobbit's) netcat doesn't behave this way. As a workaround for now, you can tell the client not to shutdown the connection when EOF is seen on STDIN by using the --no-shutdown option. This will prevent the client from closing the socket and triggering the parent process of the server to close. Incidentally, this is the behavior of traditional netcat, though OpenBSD netcat requires the -q-1 option to do the same.
Describe the bug
In server mode, when running a command with
-e
or-c
, ncat does not close the socket before executing the child process. Since the parent process exits when the client stops sending data, this can incorrectly cause the client to think more data is incoming.To Reproduce
When both commands are run in parallel, the server ncat will exit as soon as the client connects, but the client will wait for a second before the socket is closed (with no response data) by
sh
exiting.Expected behavior
When a client has stopped sending data, ncat should either:
Option 2 is what I would prefer, but is a bigger change than option 1. In both cases though, there is no reason for the child process to keep the socket open.
Version info (please complete the following information):
ncat --version
:Ncat: Version 7.94 ( https://nmap.org/ncat )
The text was updated successfully, but these errors were encountered: