VeriKQL by Kaushik Saha

T1205.002 Socket Filters

Command and ControlPersistenceStealthon attack.mitre.org

ATT&CK Enterprise 20.0 · 20.1 released, update in review

How MITRE detects it

DET0162 Socket-filter trigger → on-host raw-socket activity → reverse connection (T1205.002)

AN0462 Windows

Adversary 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.

MITRE log sourceIn Microsoft Sentinel
WinEventLog:SystemEventCode=7045
  • Windows event logs (Azure Monitor Agent) → Event
    Event | where EventLog in ("System") | where EventID in (7045)
  • Windows Forwarded Events → WindowsEvent
    WindowsEvent | where Channel in ("System") | where EventID in (7045)
WinEventLog:SysmonEventCode=1
  • Windows event logs (Azure Monitor Agent) → Event
    Event | where Source == "Microsoft-Windows-Sysmon" | where EventID in (1)
  • Windows Forwarded Events → WindowsEvent
    WindowsEvent | where Provider == "Microsoft-Windows-Sysmon" | where EventID in (1)

Sysmon has no dedicated Sentinel connector: it is collected as a Windows event log into Event or WindowsEvent.

WinEventLog:SysmonEventCode=3, 22
  • Windows event logs (Azure Monitor Agent) → Event
    Event | where Source == "Microsoft-Windows-Sysmon" | where EventID in (3, 22)
  • Windows Forwarded Events → WindowsEvent
    WindowsEvent | where Provider == "Microsoft-Windows-Sysmon" | where EventID in (3, 22)

Sysmon has no dedicated Sentinel connector: it is collected as a Windows event log into Event or WindowsEvent.

WinEventLog:SysmonEventCode=6
  • Windows event logs (Azure Monitor Agent) → Event
    Event | where Source == "Microsoft-Windows-Sysmon" | where EventID in (6)
  • Windows Forwarded Events → WindowsEvent
    WindowsEvent | where Provider == "Microsoft-Windows-Sysmon" | where EventID in (6)

Sysmon has no dedicated Sentinel connector: it is collected as a Windows event log into Event or WindowsEvent.

WinEventLog:SysmonEventCode=7
  • Windows event logs (Azure Monitor Agent) → Event
    Event | where Source == "Microsoft-Windows-Sysmon" | where EventID in (7)
  • Windows Forwarded Events → WindowsEvent
    WindowsEvent | where Provider == "Microsoft-Windows-Sysmon" | where EventID in (7)

Sysmon has no dedicated Sentinel connector: it is collected as a Windows event log into Event or WindowsEvent.

NSM:FlowSingle, low-volume inbound packet (REJ/S0/OTH or uncommon dport/protocol) from src_ip followed by outbound SF connection to src_ip.Not mapped to Sentinel yet.

AN0463 Linux

Process 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).

MITRE log sourceIn Microsoft Sentinel
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.Not mapped to Sentinel yet.
linux:osqueryfamily=AF_PACKET or protocol raw; process name not in allowlist.Not mapped to Sentinel yet.
NSM:FlowRare inbound packet characteristics (ICMP/UDP/TCP to uncommon port) from src_ip followed ≤TimeWindow by outbound SF from same host to src_ip.Not mapped to Sentinel yet.

AN0464 macOS

Process 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.

MITRE log sourceIn Microsoft Sentinel
OpenBSM:AuditTrailopen/openat of /dev/bpf*; ioctl BIOCSETF-like operations.Not mapped to Sentinel yet.
macos:unifiedlogFirst outbound connection from the same PID/user shortly after an inbound trigger.Not mapped to Sentinel yet.
NSM:FlowInbound one-off packet to uncommon port → outbound SF to same src_ip within TimeWindow.Not mapped to Sentinel yet.

Content Hub rules tagged with it (0)

No Content Hub rule is tagged with this technique.

Rules tagged with this technique (or a sub-technique) in their metadata. Whether one fits your connectors is the coverage view (M2).

In Sigma rules

No SigmaHQ rule names it in their tags outright.

Community rules, not Microsoft's, and not checked by VeriKQL (Sigma is not KQL). From SigmaHQ/sigma at f083329, under the Detection Rule License (DRL) 1.1; each rule is credited to its author.

Mitigations

MITRE ATT&CK® is a registered trademark of The MITRE Corporation. VeriKQL is not affiliated with or endorsed by MITRE. ATT&CK data © The MITRE Corporation, used under its terms of use.