Nmap Development mailing list archives
Re: ncat behaviour - questions
From: David Fifield <david () bamsoftware com>
Date: Mon, 14 Jan 2013 15:25:15 -0800
On Mon, Jan 14, 2013 at 02:53:11PM +0100, Michal Hlavinka wrote:
I just found that ncat does not behave the way I'd expect. Make it listen for udp connection: ncat -l -u 1234 </dev/null and send "Hello": echo "Hello" | ncat -u localhost 1234 The result is that listening ncat waits for the "Hello" message and when it comes, it terminates and prints nothing. In ncat_listen_dgram it select()s change on socket descriptor and after a few checks it goes to """/* stdin -> socket and socket -> stdout */"""" while loop. Where it checks stdin first and finding it closed, it terminates. I'm not sure what is intended behaviour, but I guess it should print the message since it's waiting for it.
I think this behavior is right. Arguably the program should quit immediately upon startup since its input is closed. I would accept a patch to do that.
And another question. Our QA engineers use netcat in their tests and one use case is to wait for connection for some time and then terminate. In old netcat there's -w option which has the same behaviour like the -i in ncat. Unfortunately, -i can't be used together with -l (it prints error message). Why is it that way? Is it just that nobody wrote the code or is there any other reason why it can't be used together?
My guess is that it is just not implemented. David Fifield _______________________________________________ Sent through the dev mailing list http://nmap.org/mailman/listinfo/dev Archived at http://seclists.org/nmap-dev/
Current thread:
- ncat behaviour - questions Michal Hlavinka (Jan 14)
- Re: ncat behaviour - questions David Fifield (Jan 14)