Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
Netcat reads and writes raw TCP and UDP connections from the command line, which makes it a universal network utility and a universal improvised attack tool.

What Is Netcat?
Netcat does one thing: it moves data between standard input, standard output, and a network socket. Run it as a client and it connects somewhere and relays whatever you type. Run it with a listen flag and it waits for a connection and relays whatever arrives. That is the entire concept, and it has kept the tool in use since Hobbit released the original in 1995.
Its nickname, the TCP/IP Swiss army knife, is accurate in a specific sense: it has no features, so everything is improvised from the same primitive. That generality is why it appears in network troubleshooting guides and in intrusion reports with equal frequency.
In offensive use, the significant capability is the shell. A classic reverse shell connects outbound from a compromised host to a listener the attacker controls, and pipes a command interpreter through the connection. This matters because outbound connections usually succeed where inbound connections are blocked. Most original Netcat builds shipped with an execute flag to do this directly; the majority of distribution packages now omit it, so the same result is assembled from pipes and named FIFOs, which changes nothing about the outcome.
What is installed as nc varies considerably, and the differences matter when reading an incident timeline.
For anything beyond a simple relay, Chisel and similar tunnelling tools have taken over, because they reconnect automatically, multiplex connections, and blend into web traffic.
Netcat is a legitimate administrative utility, so presence alone proves nothing. Behaviour is the signal.
/proc file descriptors pointing to sockets; on Windows, process creation events with suspicious lineage.nc at runtime, and a Falco rule catching that is one of the easier high-value container detections to write.Egress filtering does most of the work: outbound traffic from servers through an authenticated proxy only, with direct outbound connections blocked. Application allowlisting prevents the binary from running where it has no business. Minimal container images that contain no shell and no network utilities remove the option entirely, which is one of the stronger arguments for distroless base images. Network segmentation limits where a relay can reach even when one is established.
Note the limitation of removing the binary. If an attacker can execute code, they can usually establish the same channel with Bash’s built-in network redirection, with Python, with PowerShell, or with any interpreter present. Removing Netcat raises the cost; it does not close the path. The controls that constrain egress and detect anomalous process behaviour are the ones that hold.
At Privia Security, our Network Security Services test egress filtering and segmentation assumptions directly, and report which outbound channels succeeded.
It is a reasonable hardening step on production servers, where administrators rarely need it, but treat it as raising cost rather than closing a path. An attacker who can execute code can usually build the same channel with Bash’s network redirection, Python, PowerShell, or any interpreter present. Egress filtering and behavioural detection are what actually hold.
A shell session where the compromised host initiates the connection outbound to the attacker’s listener, rather than waiting for an inbound connection. It is used because firewalls almost always block unsolicited inbound traffic while permitting outbound connections, so the compromised host does the dialling. The same logic drives most command and control design.
Ncat is the Nmap project’s modern reimplementation. It adds TLS encryption, proxy support, IPv6, access control lists, and connection brokering, and it is actively maintained. The encryption is the significant difference for defenders, since it means the session content is not visible to network inspection, so detection has to rest on connection behaviour and process lineage.
A command interpreter whose standard input and output are attached to a network socket, or a shell spawned as a child of a network-facing service such as a web server. That pattern identifies a reverse shell regardless of which tool created it, which makes it durable in a way that alerting on the executable name is not.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.