CVE-2008-4250 Microsoft Sentinel · KQL

Detect MS08-067 NetAPI Buffer Overflow Exploitation Attempt (CVE-2008-4250) in Microsoft Sentinel

CVE-2008-4250 is a critical buffer overflow vulnerability in the Windows Server service (netapi32.dll) affecting Microsoft Windows XP, 2000, 2003, Vista, and Server 2008. Exploitation via a specially crafted RPC request to the NetpwPathCanonicalize function allows unauthenticated remote code execution as SYSTEM. This vulnerability was exploited by the Conficker worm and remains listed in CISA's Known Exploited Vulnerabilities catalog. Detection focuses on suspicious SMB/RPC activity, NetAPI service anomalies, and post-exploitation indicators including lateral movement and payload staging.

MITRE ATT&CK

Tactic
Initial Access Lateral Movement Privilege Escalation

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
let timeWindow = 1h;
let suspiciousRPCPorts = dynamic(["445", "139", "135"]);
union
(
  DeviceNetworkEvents
  | where TimeGenerated >= ago(timeWindow)
  | where RemotePort in (suspiciousRPCPorts)
  | where ActionType == "ConnectionSuccess"
  | summarize ConnectionCount = count(), DistinctTargets = dcount(DeviceName) by InitiatingProcessFileName, RemoteIP, RemotePort, bin(TimeGenerated, 5m)
  | where ConnectionCount > 10 or DistinctTargets > 5
  | extend DetectionReason = "High-frequency SMB/RPC lateral connection sweep"
),
(
  DeviceProcessEvents
  | where TimeGenerated >= ago(timeWindow)
  | where InitiatingProcessFileName =~ "svchost.exe"
  | where FileName in~ ("cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe", "rundll32.exe", "regsvr32.exe")
  | where InitiatingProcessCommandLine has_any ("netsvcs", "netapi")
  | extend DetectionReason = "Suspicious child process spawned from netapi/svchost context"
),
(
  SecurityEvent
  | where TimeGenerated >= ago(timeWindow)
  | where EventID in (4624, 4625)
  | where LogonType == 3
  | where IpAddress != "-" and IpAddress != "127.0.0.1"
  | summarize FailCount = countif(EventID == 4625), SuccessCount = countif(EventID == 4624) by IpAddress, bin(TimeGenerated, 5m)
  | where FailCount > 20
  | extend DetectionReason = "Brute-force or exploit scan via SMB network logon"
)
| project TimeGenerated, DetectionReason, InitiatingProcessFileName, FileName, RemoteIP, RemotePort, ConnectionCount, IpAddress
critical severity medium confidence

Detects exploitation indicators for MS08-067 including high-frequency SMB/RPC connection sweeps consistent with worm scanning, suspicious child processes from svchost in netapi context, and high-volume SMB authentication failures indicative of exploit attempts.

Data Sources

Microsoft Defender for EndpointWindows Security EventsAzure Monitor

Required Tables

DeviceNetworkEventsDeviceProcessEventsSecurityEvent

False Positives & Tuning

  • Legitimate administrative tools performing bulk SMB connections such as SCCM or patch management systems
  • Security scanners and vulnerability assessment tools performing network enumeration
  • High-volume file server access from authenticated users during business hours

Other platforms for CVE-2008-4250


Testing Methodology

Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1MS08-067 Exploitation via Metasploit (Isolated Lab)

    Expected signal: Inbound TCP connection to port 445 on target from attacker IP; svchost.exe spawning cmd.exe or a shell process; network connection back to attacker on port 4444; Windows Security Event 4624 (logon type 3) from attacker IP

  2. Test 2Conficker-Style SMB Scanning Simulation

    Expected signal: High-volume TCP SYN packets to ports 445, 139, and 135 across multiple destination IPs; network flow logs showing >30 connections from single source within 5 minutes; IDS/firewall alerts for port scan activity

  3. Test 3Post-Exploitation Service Installation (Conficker Persistence Simulation)

    Expected signal: Windows System Event ID 7045 (new service installed); Windows Security Event ID 4697 (service installed); Sysmon Event ID 12/13 registry modifications under HKLM\SYSTEM\CurrentControlSet\Services

  4. Test 4Lateral Movement via PsExec over SMB (Post-Exploitation Simulation)

    Expected signal: TCP connection to port 445 on target; Windows Security Event 4624 (logon type 3) on target; PSEXESVC service installation Event ID 7045 on target; cmd.exe execution on target host under SYSTEM or Administrator context

Unlock Pro Content

Get the full detection package for CVE-2008-4250 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections