4 ms·
How do you refer to each implementation & what are some of the subtle incompatibilities?
by cogburnd02 6y ago
How do you refer to each implementation & what are some of the subtle incompatibilities?
- vesinisa 6y agoThe original one is the "TCP/IP Swiss army knife" released in 1995: https://nc110.sourceforge.io/ https://nc110.sourceforge.io/ (original release: https://seclists.org/bugtraq/1995/Oct/28 https://seclists.org/bugtraq/1995/Oct/28) Although it is "freely given away to the Internet community" with "an obligation to give credit where due", at least OpenBSD and GNU have seen the need to write their own versions under their project licenses: GNU netcat: http://netcat.sourceforge.net/ http://netcat.sourceforge.net/ OpenBSD nc: https://man.openbsd.org/nc.1 https://man.openbsd.org/nc.1 (The OpenBSD version has been ported to at least FreeBSD and Apple Macintosh OS.) All of them have the same basic telnet's `host port` syntax for outbound TCP connections, but annoyingly the syntax for opening a local listening TCP socket varies. Say, you want to open a TCP socket listening on port 1234 (local), and a confirmation when it is ready: The original and GNU netcats: netcat -v -l -p 1234 BSD netcat: nc -v -l 1234
- rwmj 6y agoThat makes 4 implementations, because nmap also has one (https://nmap.org/ncat/ https://nmap.org/ncat/).
- vesinisa 6y agoDammit, they have of course gone with the BSD syntax for opening a local listen socket (ncat -l 1234): https://nmap.org/book/ncat-man-examples.html https://nmap.org/book/ncat-man-examples.html Means half of implemations use `-l -p 1234` and half `-l 1234`.
- cogburnd02 6y agoDoes BSD netcat give an error if you include the -p?
- vesinisa 6y agoYes, the manual explicitly notes that -p can not be used with -l: https://man.openbsd.org/nc.1 https://man.openbsd.org/nc.1 And this is indeed enforced, see line 424: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/netcat.c?annotate=1.217 http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/netc... However, at least Debian ships a ported version of BSD's netcat. They actually apply a patch to allow using -p and -s with -l for consistency with traditional netcat: https://sources.debian.org/patches/netcat-openbsd/1.217-3/use-flags-to-specify-listen-address.patch/ https://sources.debian.org/patches/netcat-openbsd/1.217-3/us...