netcat (often abbreviated tonc) is a computer networking utility for reading from and writing to network connections usingTCP orUDP. Thecommand is designed to be a dependableback-end that can be used directly or easily driven by other programs and scripts. At the same time, it is a feature-rich network debugging and investigation tool, since it can produce almost any kind of connection its user could need and has a number of built-in capabilities.
![]() The netcat command | |
Original author(s) | *Hobbit* |
---|---|
Developer(s) | Avian Research |
Initial release | October 28, 1995; 29 years ago (1995-10-28)[1] |
Final release | 1.10 / March 1996; 29 years ago (1996-03) |
Operating system | Unix andUnix-like,DOS,Microsoft Windows,Windows CE |
Type | Networkutility |
License | Original version: custom,permissive license GNU version:GPL OpenBSD version:BSD |
Website | nc110 |
It is able to performport scanning,file transferring and port listening.
Features
editThe original netcat's features include:[2]
- Outbound or inbound connections, TCP or UDP, to or from any ports
- FullDNS forward/reverse checking, with appropriate warnings
- Ability to use any local source port
- Ability to use any locally configured network source address
- Built-in port-scanning capabilities, with randomization
- Built-in loose source-routing capability
- Can read command line arguments from standard input
- Slow-send mode, one line every N seconds
- Hex dump of transmitted and received data
- Optional ability to let another program service establish connections
- Optionaltelnet-options responder
Rewrites like GNU's and OpenBSD's support additional features. For example, OpenBSD's nc supportsTLS, and GNU netcat natively supports atunneling mode supporting UDP and TCP (optionally allowing one to be tunneled over the other) in a single command,[3] where other versions may require piping data from one netcat instance to another.
Ports and reimplementations
editThe original version of netcat was aUnix program. The last version (1.10) was released in March 1996.[4]
There are several implementations onPOSIX systems, including rewrites from scratch likeGNU netcat[5] orOpenBSD netcat,[6]the latter of which supports IPv6 andTLS. The OpenBSD version has been ported to theFreeBSD base,[7]Windows/Cygwin,[8]and Linux.[9]Mac OS X comes with netcat installed as of OSX 10.13 or users can useMacPorts to install a variant.[10]
ADOS version ofnetcat calledNTOOL is included in theFreeDOS Package groupNetworking.[11] It is based on the WatTCP stack and licensed under theEuropean Union Public Licence Version 1.1.[12]
Known ports for embedded systems includes versions forWindows CE (named "Netcat 4 wince"[13]) or for theiPhone.[14]
BusyBox includes by default a lightweight version of netcat named mini-netcat.[15] Another version with more features, named bloaty nc, is also available.[16]
Solaris 11 includes netcat implementation based on OpenBSD netcat.[17]
Socat[18] is a more complex variant ofnetcat. It is larger and more flexible and has more options that must be configured for a given task. On February 1, 2016,Santiago Zanella-Beguelin andMicrosoft Vulnerability Research issued a security advisory regarding acompositeDiffie-Hellman parameter which had beenhard-coded into theOpenSSL implementation ofsocat.[19] The implausibility that a composite might have been unintentionally introduced where aprime number is required has led to the suspicion ofsabotage to introduce abackdoorsoftware vulnerability.[20] This socat bug affected version 1.7.3.0 and 2.0.0-b8 it was corrected in following releases from 1.7.3.1 and 2.0.0-b9.[19]
Cryptcat[21] is a version ofnetcat with integrated transport encryption capabilities.
In the middle of 2005,Nmap announced another netcat incarnation called Ncat.[22] It features new possibilities such as "Connection Brokering", TCP/UDP Redirection, SOCKS4 client and server support, ability to "Chain" Ncat processes, HTTP CONNECT proxying (and proxy chaining), SSL connect/listen support and IP address/connection filtering. LikeNmap, Ncat iscross-platform.
On some systems, modified versions or similar netcat utilities go by the command name(s)nc
,ncat
,pnetcat
,socat
,sock
,socket
,sbd
.
ncat
editNcat is a similar tool to netcat provided byNmap suite.[22]"While Ncat isn't built on any code from the “traditional” Netcat (or any other implementation), Ncat is most definitely based on Netcat in spirit and functionality."[23]
Ncat features includes: ability to chain Ncats together, redirect both TCP and UDP ports to other sites, SSL support, and proxy connections viaSOCKS4 or HTTP (CONNECT method) proxies (with optional proxy authentication as well).[24]
See also
edit- List of Unix commands
- cat (Unix) – Shell command for writing an input file or stream to standard output
- Nmap
- OpenSSL
- Telnet
- Plink
- Packet Sender
- Banner grabbing
References
edit- ^Hobbit (1995-10-28)."New tool available: Netcat".Bugtraq mailing list. Retrieved2019-06-05.
- ^Vacca, John R. (2006).Guide to Wireless Network Security.Springer Publishing. p. 266.ISBN 978-0387954257.
- ^Giovanni Giacobbi (2006-11-01)."The GNU Netcat project". Retrieved2020-03-22.
- ^"Netcat 1.10".nc110.sourceforge.net. 2008-02-14. Retrieved2019-06-05.
- ^Giovanni Giacobbi (2006-11-01)."The GNU Netcat project". Retrieved2019-06-05.
- ^"OpenBSD CVSWeb: /src/usr.bin/nc/".OpenBSD. Retrieved2019-06-05.
- ^delphij (2005-02-06)."Contents of /release/5.4.0/usr.bin/nc/Makefile".FreeBSD. Retrieved2019-06-05.
- ^Thomas Linden (2011-03-02)."Netcat OpenBSD Cygwin Port 1.10.2.3".Daemon.de. Retrieved2019-06-05.
- ^Debian netcat-openbsd
- ^"MacPorts Portfiles: netcat".MacPorts. Retrieved2019-06-05.
- ^"ibiblio.org FreeDOS Group -- Networking".ibiblio. 2019-03-03. Retrieved2019-06-05.
- ^Jürgen Hoffmann (2018-11-03)."various tools". Retrieved2019-06-05.
- ^Andreas Bischoff (2010-06-07)."Netcat 4 wince". Retrieved2019-06-05.
- ^"Revision 835: /trunk/data/netcat". 2008-08-18. Retrieved2019-06-05.
- ^"nc: mini-netcat - built from the ground up for LRP".git.busybox.net.
- ^"busybox - bloaty nc".git.busybox.net.
- ^"Oracle Solaris 11.2 Information Library - Performing TCP and UDP Administration With the netcat Utility".docs.oracle.com.
- ^"socat - Multipurpose relay". 2019-04-06. Retrieved2019-06-05.
- ^ab"Socat security advisory 7". 2016-02-01. Retrieved2019-06-05.
- ^Chirgwin, Richard (2016-02-03)."Socat slams backdoor, sparks thrilling whodunit".The Register. Retrieved2019-06-05.
- ^"CryptCat Project". 2005-10-18. Retrieved2019-06-05.
- ^ab"Ncat - Netcat for the 21st Century".Nmap. 2009-07-08. Retrieved2019-06-05.
- ^"ncat(1) - Ncat Reference Guide".manpages.debian.org. 2016-12-18. Retrieved2019-06-05.
- ^"Ncat - Netcat for the 21st Century".
External links
edit- Official website
nc(1)
– Linux User CommandsManual
[[Program network station program 4.2