Techniques › T1205 › T1205.002
T1205.002 Socket Filters
stealth · persistence · command and control — Linux, macOS, Windows · attack.mitre.org · JSON
1
MITRE detection strategy
3
analytics
0
Sigma rules tagged attack.t1205.002
0
KEV CVEs mapped here
<p>Adversaries may attach filters to a network socket to monitor then activate backdoors used for persistence or command and control. With elevated permissions, adversaries can use features such as the
libpcap library to open sockets and install filters to allow or disallow certain types of data to come through the socket. The filter may apply to all traffic passing through the specified network interface (or every interface if not specified). When the network interface receives a packet matching the filter criteria, additional actions can be triggered on the host, such as activation of a reverse shell.</p><p>To establish a connection, an adversary sends a crafted packet to the targeted host that matches the installed filter criteria. Adversaries have used these socket filters to trigger the installation of implants, conduct ping backs, and to invoke command shells. Communication with these socket filters may also be used in conjunction with Protocol Tunneling.</p><p>Filters can be installed on any Unix-like platform with libpcap installed or on Windows hosts using Winpcap. Adversaries may use either libpcap with pcap_setfilter or the standard library function setsockopt with SO_ATTACH_FILTER options. Since the socket connection is not active until the packet is received, this behavior may be difficult to detect due to the lack of activity on a host, low CPU overhead, and limited visibility into raw socket usage.</p>KEV CVEs mapped to this technique · CTID Mappings Explorer
None. No KEV entry in the public mapping names this technique. Given that 74.7% of KEV has no mapping at all, this says more about the mapping than about the technique.
Detection strategy · ATT&CK Enterprise v19.2
- DET0162 Socket-filter trigger → on-host raw-socket activity → reverse connection (T1205.002) v1.0
AN0462 WindowsAdversary installs/uses packet-capture or raw-socket capability (WinPcap/Npcap, wpcap/packet DLLs or raw socket attach) and sets a filter. A crafted inbound packet is observed; within a short window the host process that loaded capture libraries initiates an outbound connection (e.g., reverse shell) to the packet origin.NSM:Flow
Single, low-volume inbound packet (REJ/S0/OTH or uncommon dport/protocol) from src_ip followed by outbound SF connection to src_ip.→ DC0085 Network Traffic ContentTunable:TimeWindowCaptureLibIndicatorsAllowedInstallersReversePortsAN0463 LinuxProcess creates a raw/packet socket and attaches a (e)BPF filter (setsockopt SO_ATTACH_FILTER/ATTACH_BPF or bpf(BPF_PROG_LOAD)). Immediately after a matching inbound packet, the same process binds/connects outward to a remote host (reverse shell or beacon).auditd:SYSCALLsocket(AF_PACKET|AF_INET, SOCK_RAW, *), setsockopt(… SO_ATTACH_FILTER|SO_ATTACH_BPF …), bpf(cmd=BPF_PROG_LOAD), open/openat path="/dev/bpf*" (BSD/macOS-like) or setcap cap_net_raw.→ DC0032 Process Creationlinux:osqueryfamily=AF_PACKET or protocol raw; process name not in allowlist.→ DC0082 Network Connection CreationNSM:FlowRare inbound packet characteristics (ICMP/UDP/TCP to uncommon port) from src_ip followed ≤TimeWindow by outbound SF from same host to src_ip.→ DC0085 Network Traffic ContentTunable:UserContextMinPayloadEntropyAFPacketAllowListAN0464 macOSProcess opens /dev/bpf* (libpcap) or loads NetworkExtension filter, then after a crafted inbound packet the same process initiates an outbound connection to the trigger origin.OpenBSM:AuditTrailopen/openat of /dev/bpf*; ioctl BIOCSETF-like operations.→ DC0032 Process Creationmacos:unifiedlogFirst outbound connection from the same PID/user shortly after an inbound trigger.→ DC0082 Network Connection CreationNSM:FlowInbound one-off packet to uncommon port → outbound SF to same src_ip within TimeWindow.→ DC0085 Network Traffic ContentTunable:BPFDevicePathDeveloperMode
Sigma rules · SigmaHQ da9bb07d64, tag attack.t1205.002
No Sigma rule carries this tag. MITRE publishes a detection strategy above, so the behaviour is specified; what is missing is public detection content.