Netcat is reaaallly handy for piping stuff over networks. But it’s also been largely unchanged for years. There were a few forks and rewrites but they tended to be linux-only. One of the tricks it could do was ip/port scan. Scanning happened to be the primary function of the Nmap project, and so it grew to incorporate netcat features, and much more. Behold Ncat!
Edit (2010-08-03): 5.35DC1 made “-l -e” exit on disconnect, and “-l -e -k” keep awaiting new connections.
Edit (2010-03-16): I announced app this too early. 5.30b1 corrected the piping bugs I mentioned before. However, combining -l and -e still makes a server that never dies on its own (acts like -k), and must be killed manually. That might be fixed in a later release.
It’s got…
- All of netcat’s wondrous features, including running under Linux, Windows, and OSX
- SSL encryption (and acting as a generic client for SSL’d protocols)
- SOCKS proxy support
- Connection brokering to join two outgoing connections together via a 3rd-party, to avoid port-forwarding
- IPv6 support
- Executing other commands, redirecting their streams to/from a port, and disconnecting when finished (in addition to plain shell piping)
- Multiplexing (Think IRC-ish chat hubs)
- Host blacklists/whitelists
- LF and CR-LF line endings
- Raw/Hex transcript dumping
To get it, download the zip (or the installer if you must) and take the following: ncat.exe, ssleay32.dll, libeay32.dll. Those can be carried around and run portably. See my earlier post on integrating it into your UnixUtils repertoire. On other platforms the sole executable may be enough since OpenSSL is practically stock.