T1611

Escape to Host

This detection identifies adversaries attempting to escape containerized or virtualized environments to gain access to the underlying host. Key indicators include execution of namespace manipulation utilities (nsenter, unshare), privileged container operations, Docker socket abuse from within containers, cgroup release_agent exploitation, kernel module loading via insmod/modprobe, and host filesystem access via /proc/1/root bind mounts. The detection targets techniques used by malware families such as Doki, Hildegard, and Siloscape, as well as threat groups like TeamTNT that exploit container misconfigurations or kernel vulnerabilities to break out of isolation boundaries and gain host-level code execution.

Microsoft Sentinel / Defender
kusto
let ContainerEscapeBinaries = dynamic(["nsenter", "unshare", "insmod", "modprobe"]);
DeviceProcessEvents
| where TimeGenerated > ago(24h)
| where FileName in~ (ContainerEscapeBinaries)
    or (FileName =~ "docker" and ProcessCommandLine has_any ("docker.sock", "/var/run/docker.sock") and ProcessCommandLine has "run")
    or (FileName in~ ("sh", "bash", "python", "python3", "perl") and ProcessCommandLine has_all ("/cgroup", "release_agent"))
    or (FileName =~ "keyctl" and ProcessCommandLine has_any ("session", "link", "show"))
    or (ProcessCommandLine has_all ("mount", "/proc/1/root"))
    or (ProcessCommandLine has_all ("nsenter", "-t 1"))
    or (FileName =~ "chroot" and ProcessCommandLine has "/host")
| extend EscapeType = case(
    ProcessCommandLine has_all ("nsenter", "-t 1"), "Namespace Entry - PID 1 Targeting",
    FileName =~ "nsenter", "Namespace Entry (nsenter)",
    FileName =~ "unshare" and ProcessCommandLine has_any ("--mount", "--pid", "--net", "--user"), "Namespace Unshare",
    FileName =~ "keyctl" and ProcessCommandLine has_any ("session", "link"), "Keychain Secret Theft",
    FileName =~ "docker" and ProcessCommandLine has "docker.sock", "Docker Socket Abuse",
    ProcessCommandLine has_all ("/cgroup", "release_agent"), "Cgroup Release Agent Escape",
    FileName in~ ("insmod", "modprobe"), "Kernel Module Load",
    ProcessCommandLine has_all ("mount", "/proc/1/root"), "Host Filesystem Mount via /proc",
    FileName =~ "chroot" and ProcessCommandLine has "/host", "Chroot Escape",
    "Container Escape Indicator"
)
| extend RiskScore = case(
    EscapeType =~ "Cgroup Release Agent Escape", 95,
    EscapeType =~ "Namespace Entry - PID 1 Targeting", 90,
    EscapeType =~ "Host Filesystem Mount via /proc", 90,
    EscapeType =~ "Docker Socket Abuse", 85,
    EscapeType =~ "Namespace Entry (nsenter)", 80,
    EscapeType =~ "Kernel Module Load", 80,
    EscapeType =~ "Keychain Secret Theft", 75,
    EscapeType =~ "Namespace Unshare", 70,
    65
)
| project TimeGenerated, DeviceName, AccountName, FileName, ProcessCommandLine,
    InitiatingProcessFileName, InitiatingProcessCommandLine, EscapeType, RiskScore,
    ProcessId, InitiatingProcessId, SHA256
| order by RiskScore desc, TimeGenerated desc
high severity medium confidence

Data Sources

Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents

False Positives

  • Legitimate container orchestration runtimes (kubelet, containerd, cri-o) using nsenter internally for container exec and health check operations
  • System administrators using nsenter or unshare on the host for namespace debugging or network troubleshooting tasks
  • Legitimate kernel driver installation by hardware vendors or OS package managers using insmod/modprobe during system initialization

Unlock Pro Content

Get the full detection package for T1611 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections