Detect DHCP Spoofing in Splunk
Adversaries may redirect network traffic to adversary-owned systems by spoofing Dynamic Host Configuration Protocol (DHCP) traffic and acting as a malicious DHCP server on the victim network. By achieving the adversary-in-the-middle (AiTM) position, adversaries may collect network communications, including passed credentials sent over insecure, unencrypted protocols. Rogue DHCP servers can distribute malicious DNS server addresses, default gateway settings, or WPAD proxy configuration that silently routes victim traffic through attacker-controlled infrastructure. DHCPv6 spoofing extends this to IPv6 networks via INFORMATION-REQUEST responses. Adversaries may also abuse DHCP to perform starvation attacks by exhausting the DHCP allocation pool with spoofed DISCOVER messages.
MITRE ATT&CK
- Tactic
- Credential Access Collection
- Technique
- T1557 Adversary-in-the-Middle
- Sub-technique
- T1557.003 DHCP Spoofing
- Canonical reference
- https://attack.mitre.org/techniques/T1557/003/
SPL Detection Query
index=wineventlog (sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" OR sourcetype="WinEventLog:Microsoft-Windows-Sysmon/Operational")
(EventCode=1 OR EventCode=3 OR EventCode=13)
| eval lower_image=lower(Image)
| eval lower_cmdline=lower(CommandLine)
| eval lower_destip=coalesce(DestinationIp, "")
| eval lower_regval=lower(coalesce(Details, ""))
| eval lower_regkey=lower(coalesce(TargetObject, ""))
(
(
EventCode=3
AND (DestinationPort=67 OR SourcePort=67)
AND NOT (lower_image LIKE "%\\svchost.exe" OR lower_image="system")
)
OR
(
EventCode=1
AND (
match(lower_image, "(yersinia|dhcpig|gobbler|dhcpstarv|ettercap|bettercap|mitm6)")
OR match(lower_cmdline, "(yersinia|dhcpig|gobbler|dhcpstarv|ettercap|bettercap|mitm6)")
OR (match(lower_image, "(python|ruby|perl|bash|pwsh|powershell)") AND match(lower_cmdline, "(dhcp|bootp|rogue.*dhcp|dhcp.*spoof|mitm6|dhcp6)"))
)
)
OR
(
EventCode=13
AND match(lower_regkey, "tcpip\\\\parameters\\\\interfaces")
AND match(lower_regkey, "(dhcpnameserver|nameserver|dhcpdefaultgateway)")
AND NOT (lower_image LIKE "%\\svchost.exe" OR lower_image="system" OR lower_image LIKE "%\\lsass.exe")
)
)
| eval DetectionType=case(
EventCode=3 AND (DestinationPort=67 OR SourcePort=67), "DHCP_Port67_Binding",
EventCode=1 AND match(lower_image, "(yersinia|dhcpig|gobbler|dhcpstarv|ettercap|bettercap|mitm6)"), "Known_DHCP_Attack_Tool",
EventCode=1, "Interpreter_With_DHCP_Keywords",
EventCode=13, "DHCP_DNS_Registry_Change",
true(), "Unknown")
| eval RiskScore=case(
DetectionType="Known_DHCP_Attack_Tool", 100,
DetectionType="DHCP_Port67_Binding", 75,
DetectionType="Interpreter_With_DHCP_Keywords", 60,
DetectionType="DHCP_DNS_Registry_Change", 50,
true(), 10)
| table _time, host, User, Image, CommandLine, DestinationIp, DestinationPort, SourcePort, TargetObject, Details, DetectionType, RiskScore
| sort - RiskScore, - _time Detects DHCP spoofing across three event types using Sysmon logs: EventCode=3 (Network Connection) for processes binding to UDP port 67 other than svchost.exe or System; EventCode=1 (Process Create) for known DHCP attack tools (yersinia, dhcpig, bettercap, mitm6) or interpreters invoked with DHCP-related keywords; EventCode=13 (Registry Value Set) for unexpected modifications to TCPIP interface DNS or gateway registry keys that may reflect DHCP-pushed malicious configuration. Assigns risk scores to prioritize analyst review: known tools score 100, port 67 binding scores 75, interpreter patterns score 60, registry changes score 50.
Data Sources
Required Sourcetypes
False Positives & Tuning
- Legitimate DHCP servers running authorized DHCP services — add known DHCP server hostnames to an allowlist using NOT host IN (allowlist)
- VMware, VirtualBox, or Hyper-V virtual network adapters running DHCP for guest VMs on developer workstations
- Docker or Podman container bridge network DHCP services on developer or CI/CD build machines
- Network administrators using packet crafting tools (Scapy, dhcpdump) for authorized network diagnostics
- DHCP relay agents or helper-address configurations on routers that legitimately forward DHCP on port 67
Other platforms for T1557.003
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.
- Test 1Rogue DHCPv4 Server via Python Scapy
Expected signal: Sysmon EventCode=1: Process Create with Image=python3 and CommandLine containing 'scapy', 'BOOTP', 'DHCP', and 'sendp'. Sysmon EventCode=3: Network Connection from python3 to 255.255.255.255:68 on UDP port 67 (source). Linux auditd: SYSCALL records for socket() with AF_PACKET or AF_INET on port 67. Network: DHCP OFFER packet visible in packet capture with source IP not matching authorized DHCP server.
- Test 2mitm6 DHCPv6 Adversary-in-the-Middle Attack
Expected signal: Sysmon EventCode=1: Process Create with Image containing 'mitm6' or python3 with 'mitm6' in CommandLine. Sysmon EventCode=3: Network connections on UDP port 547 (DHCPv6 server port) from the mitm6 process. Linux auditd: socket() syscalls creating raw IPv6 sockets. Network: DHCPv6 REPLY packets visible in PCAP containing malicious recursive DNS server (Option 23) pointing to attacker-controlled IPv6 address.
- Test 3DHCP Starvation Attack with DHCPig
Expected signal: Sysmon EventCode=1: Process Create with python3 and DHCP/BOOTP keywords in CommandLine. Sysmon EventCode=3: High-volume UDP port 67 connections from python3 within a short time window. Linux auditd: Repeated socket() and sendto() syscalls at high frequency. Network: Burst of DHCP DISCOVER packets with varying source MACs visible in PCAP — this pattern is the signature of starvation attacks.
- Test 4Yersinia DHCP Attack Tool Execution
Expected signal: Sysmon EventCode=1: Process Create with Image='yersinia' or full path to yersinia binary. CommandLine contains '--help' or 'dhcp'. Linux auditd: execve() syscall for yersinia. The binary name 'yersinia' in process creation events is the primary indicator — this is a known attack tool with no legitimate administrative use case.
References (10)
- https://attack.mitre.org/techniques/T1557/003/
- https://datatracker.ietf.org/doc/html/rfc2131
- https://datatracker.ietf.org/doc/html/rfc3315
- https://isc.sans.edu/forums/diary/new+rogueDHCP+server+malware/6025/
- https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/dn800668(v=ws.11)
- https://web.archive.org/web/20231202025258/https://lockstepgroup.com/blog/monitor-dhcp-scopes-and-detect-man-in-the-middle-attacks/
- https://github.com/dirkjanm/mitm6
- https://github.com/nicowillis/DHCPig
- https://attack.mitre.org/techniques/T1499/002/
- https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst6500/ios/12-2SX/configuration/guide/book/snoodhcp.html
Unlock Pro Content
Get the full detection package for T1557.003 including response playbook, investigation guide, and atomic red team tests.