Nmap Development mailing list archives

ncat 5.10BETA handling of -l -p is not compatible with nc-1.10


From: Denys Vlasenko <vda.linux () googlemail com>
Date: Fri, 8 Jan 2010 17:32:00 +0100

Hi,

Every reimplementation of netcat seems to try to break
this syntax:

nc -l -p 123    # listen on local port 123

GNU nc, openbsd's nc all have it broken. And ncat is no exception.
"You too, Brutus". IIRC they even break it in different ways -
they have different ways to specify local port: as a parameter
to -l option, as a standalone port parameter etc... AARRGGHH...

This makes users' lives harder for no apparent benefit.

Can this be changed so that it works as it did in the original nc?

For reference, nc-1.10 (original Hobbit's one) generally
has these ways to specify local and remote ports:

nc [opts] [-l] [-s LHOST] [-p LPORT] [RHOST RPORT]

and this works the same with and without -l.
Of course, without -l, RHOST RPORT is mandatory.

If -l is specified, RHOST RPORT (if present) is interpreted
as "the only address we receive connections from".
In UDP case, nc simply executes connect() to that host/port,
which limits incoming packets only to those from that address.
In TCP case, it checks remote address after accept()
and drop connections from non-matching addresses.

--
vda
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: