Nmap Development mailing list archives

ncat behaviour - questions


From: Michal Hlavinka <mhlavink () redhat com>
Date: Mon, 14 Jan 2013 14:53:11 +0100

Hi,

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.

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?

Cheers,
Michal
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


Current thread: