Skip to main content
T1557Credential Accesshard difficulty

Adversary-in-the-Middle

Adversary-in-the-Middle (T1557) is when an attacker sits between two systems to intercept, relay, or steal session data, whether through LLMNR/NBT-NS poisoning and SMB relay on a local network or an Evilginx-style reverse proxy that steals a live authentication cookie. Detection means catching the relay's forced-authentication mismatch or the stolen session's impossible geography.

Practice detecting Adversary-in-the-Middle on realistic SIEM, XDR alerts in SOCSimulator Operations.

SIEMXDR

What is Adversary-in-the-Middle?

Adversary-in-the-Middle is documented as technique T1557 in MITRE ATT&CK® v19.1 under the Credential Access tactic. Detection requires visibility into SIEM, XDR telemetry.

The network-level flavor starts with name resolution. Windows falls back to LLMNR (UDP 5355) and NBT-NS (UDP 137) whenever DNS fails to resolve a hostname, and both protocols trust the first reply they get with no authentication. A tool like Responder listens passively, answers every LLMNR/NBT-NS/mDNS broadcast as though it owns the requested name, and stands up rogue SMB, HTTP, and LDAP servers to catch whatever authentication follows. A workstation that mistypes a share name or a legacy printer driver polling for a print server both hand Responder an NTLMv2 challenge-response it can crack offline or, worse, relay live with ntlmrelayx or impacket's smbrelayx into a real service the victim account has access to, often escalating straight to a domain controller.

ARP cache poisoning (T1557.002), DHCP spoofing (T1557.003), and rogue access points or evil twins (T1557.004) get an attacker into the same position at a lower layer: broadcast forged ARP replies claiming to own the gateway's IP, hand out a rogue DHCP lease that points the victim's default gateway or DNS server at the attacker, or stand up a lookalike Wi-Fi SSID, and every packet the victim sends now transits the attacker's machine first. WPAD (Web Proxy Auto-Discovery) abuse works the same way at the application layer: an attacker who can create or reclaim a wpad DNS record gets every browser on the network that trusts default proxy discovery to route its HTTP traffic, NTLM handshake included, through them.

The cloud flavor swaps the network position for a reverse proxy. Evilginx2 sits between the victim's browser and the real Microsoft 365 or Google login page, serving the genuine page content through itself so the victim types real credentials into a real-looking flow, including the MFA prompt. Because the proxy relays the live session rather than just capturing a password, it also captures the authentication cookie issued after MFA succeeds, and the attacker imports that cookie into their own browser to walk straight into the account with no password and no second factor needed, only a cookie the identity provider already trusts.

Where Adversary-in-the-Middle fits in an attack

AiTM rarely opens the intrusion on its own. On the network side it is a credential-harvesting step that follows initial network access, whether that is a compromised guest port, a rogue device on the LAN, or a foothold already gained through phishing; the NTLMv2 hashes or relayed sessions it produces feed straight into privilege escalation and lateral movement, which is why forced-authentication relay sits directly upstream of admin-level access on a second host. On the cloud side, AiTM phishing is usually the initial access step itself: the attacker sends the reverse-proxy link instead of a plain credential-harvesting page precisely because it defeats the MFA that would otherwise stop a stolen password cold.

MITRE's own procedure examples show how broadly the technique is used. ArcaneDoor intercepted HTTP traffic on compromised network devices to support espionage; Kimsuky ran a modified PHProxy instance to examine victims' web traffic and steal session data; Sea Turtle modified DNS records at the registrar level to redirect traffic toward attacker infrastructure for large-scale credential capture; and evilginx2 itself is the reference implementation behind most commodity AiTM phishing kits sold as phishing-as-a-service. Once an AiTM foothold lands in a cloud tenant, the next moves are predictable: register a new MFA method or OAuth app for persistence, then move to mailbox rules, data collection, or further lateral movement inside the tenant.

Detection Strategies

The following detection strategies help SOC analysts identify Adversary-in-the-Middle activity. These methods apply across SIEM, XDR environments and can be implemented as detection rules, correlation queries, or behavioral analytics in your security platform.

EQL
authentication where host.os.type == "windows" and event.code in ("4624", "4625") and
 winlog.logon.type == "Network" and winlog.event_data.AuthenticationPackageName == "NTLM" and
 endswith~(user.name, "$") and user.name != "$" and
 source.ip != null and source.ip != "::1" and source.ip != "127.0.0.1" and
 startswith~(host.name, substring(user.name, 0, -1)) and
 not endswith(string(source.ip), string(host.ip)) and
 not stringContains(string(host.ip), string(source.ip))

Elastic's Potential Computer Account NTLM Relay Activity rule (mapped to T1557 and T1557.001). Flags an NTLM logon by a machine account whose source IP does not belong to the host it claims to be, the signature of a relayed LLMNR/NBT-NS-captured hash.

SPL
`o365_management_activity` Workload=AzureActiveDirectory Operation=UserLoggedIn
| fillnull
| stats count min(_time) as firstTime max(_time) as lastTime values(src) as src BY signature dest user vendor_account vendor_product SessionId
| where mvcount(src) > 1
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `o365_concurrent_sessions_from_different_ips_filter`

Splunk Security Content's O365 Concurrent Sessions From Different IPs analytic. Groups Azure AD UserLoggedIn events by SessionId and flags any session seen from more than one IP, the pattern a stolen AiTM cookie produces when replayed from attacker infrastructure.

Simulated example generated by SOCSimulator Research
SigninId: 8f2e51d0-9c3b-4a71-9e2f-115c2b2ce930
UserPrincipalName: kburns@fabrikam-corp.io
SessionId: 8b6a2f3e-7cd1-4e60-9dc4-2a1f9d8c7a56
IPAddress: 198.51.100.44
Location: Warsaw, PL
AppDisplayName: Office 365 Exchange Online
ConditionalAccessStatus: success
CreatedDateTime: 2026-07-16T02:14:09Z
---
SigninId: 2a71c904-6e5d-4f18-8b3a-9d0f4c2e7711
UserPrincipalName: kburns@fabrikam-corp.io
SessionId: 8b6a2f3e-7cd1-4e60-9dc4-2a1f9d8c7a56
IPAddress: 203.0.113.9
Location: Kansas City, US
AppDisplayName: Office 365 Exchange Online
ConditionalAccessStatus: success
CreatedDateTime: 2026-07-16T02:15:39Z

Tuning and false positives

LLMNR and NBT-NS chatter is loud in a normal Windows network even without an attacker. Misconfigured DNS suffixes, printers and IoT devices that only speak NetBIOS, and users who fat-finger a share name all generate the same broadcast-and-fallback pattern Responder feeds on, so a rule that alerts on any LLMNR response will bury an analyst. Legitimate NTLM authentication also produces the same event codes (4624/4625) the relay detection watches; VPN concentrators, jump hosts, and load balancers that terminate connections on behalf of a computer account can make the source IP legitimately not match the host, which is why the Elastic rule narrows to a username-to-hostname mismatch rather than IP mismatch alone.

On the cloud side, a genuinely traveling user, a corporate VPN that changes egress IP mid-session, or a mobile client that hops between cellular and Wi-Fi can produce the same same-SessionId-different-IP pattern as a stolen cookie. Tune by correlating the IP change against travel-time feasibility (a session ID from Warsaw and then Kansas City ninety seconds later cannot belong to one legitimate person) and by checking whether the second IP maps to a known corporate egress range or VPN exit node before treating it as attacker infrastructure. Conditional Access token protection and continuous access evaluation reduce the false-positive rate further by invalidating stolen cookies that move networks, so alert volume should already be sparse once those controls are enabled.

Example Alerts

These realistic alert examples show what Adversary-in-the-Middle looks like in your security tools. Use them to tune detection rules and train analysts to recognize true positives versus false positives in live environments.

CriticalSIEM

NTLM Relay Detected Against Domain Controller DC01

Windows Security Event 4624 on DC01.corp.local shows computer account WKSTN14$ authenticating over NTLM from source IP 10.20.4.87, a subnet the workstation itself does not sit on. The hostname-to-source mismatch matches Elastic's NTLM relay analytic and points to a forced-authentication relay landing directly on a domain controller.

CriticalSIEM

Same Session ID Signed In From Warsaw and Kansas City

Entra ID sign-in logs show session ID 8b6a2f3e authenticating to Office 365 Exchange Online from 198.51.100.44 (Warsaw, PL) and, 90 seconds later, from 203.0.113.9 (Kansas City, US). Neither location is a known VPN egress for the user kburns, consistent with a stolen AiTM session cookie replayed from attacker infrastructure.

HighXDR

ntlmrelayx.py Executed on Finance Subnet Workstation

WKSTN-14.corp.local ran python3 ntlmrelayx.py -tf targets.txt -smb2support under user kburns's session, spawned from bash inside WSL. Combined with prior LLMNR broadcast responses from the same host, this is an active relay tool standing up rogue authentication targets on the local segment.

Responding to Adversary-in-the-Middle

When an NTLM relay or WPAD alert fires, the first question is whether the source is infrastructure you control: a VPN concentrator, a proxy, a known backup job account, or something unexplained. If unexplained, pull the target host's recent authentication history, since a relay that lands on a domain controller or file server is materially worse than one that dead-ends on a workstation with no useful access. For a concurrent-session or impossible-travel alert, check whether the second IP correlates with a Conditional Access failure, a new MFA method registration, or a mailbox rule created immediately after, since those are the tells that the session was actually used and not just observed in passing.

Contain fast on either flavor. For network AiTM, isolate the source host from the segment, since Responder and its relatives need to sit on the same broadcast domain to work, and rotate the credentials for any account whose hash plausibly reached the rogue server. For cloud AiTM, revoke the user's refresh tokens and active sessions immediately, which invalidates the stolen cookie even though the attacker never had the password, force a password reset, and re-register MFA. Then check the tenant's OAuth app consents and mailbox rules for anything created during the compromise window before closing out the incident.

Frequently Asked Questions

How do SOC analysts detect Adversary-in-the-Middle?
Detection centers on SIEM, XDR telemetry for the credential access phase of the attack. Disable LLMNR and NBT-NS across the environment where legacy applications allow it, and for what remains, alert on Windows Event IDs 4624 and 4625 where the authenticating computer account's name does not match the workstation name in the logon event, the exact mismatch Elastic's Potential Computer Account NTLM Relay Activity rule checks for. Watch Directory Service Changes (Event ID 5137) for a new or re-enabled DNS record named wpad, since re-adding that record after it was intentionally blocklisted is the classic move behind WPAD spoofing for traffic interception.
What does a Adversary-in-the-Middle alert look like?
A representative SIEM detection is "NTLM Relay Detected Against Domain Controller DC01" (critical severity): Windows Security Event 4624 on DC01.corp.local shows computer account WKSTN14$ authenticating over NTLM from source IP 10.20.4.87, a subnet the workstation itself does not sit on. The hostname-to-source mismatch matches Elastic's NTLM relay analytic and points to a forced-authentication relay landing directly on a domain controller.
Which tools detect Adversary-in-the-Middle, and how can I practice?
Adversary-in-the-Middle (T1557) is best surfaced with SIEM, XDR telemetry, which exposes the credential access signals described above. Practice detecting it on those exact consoles in SOCSimulator Operations, free.

Practice Adversary-in-the-Middle in a Free Room

Investigate Adversary-in-the-Middle on realistic SIEM, XDR, and firewall consoles, free.

Credential Harvesting: The Lookalike Login

Credential Harvesting: The Lookalike Login

Investigate an adversary-in-the-middle (AiTM) credential phishing campaign that lured an employee to a lookalike Microsoft 365 login page. Working entirely from SIEM logs, you will identify the lookalike domain, reconstruct the multi-hop redirect chain through a compromised legitimate site, uncover a secondary phishing wave against another employee, and confirm account takeover in Azure AD sign-in logs via impossible travel and session-token replay. You finish by choosing the containment action that actually evicts an attacker holding a valid session token. Foundational skills for SOC analysts in lookalike-domain analysis and identity-centric incident response.

40m·257 tasks
View Operation
MFA Fatigue: The Notification Flood

MFA Fatigue: The Notification Flood

In this guided walkthrough, you will step into the shoes of a SOC analyst investigating a modern identity-based attack. The threat landscape in 2026 has shifted: adversaries are no longer just 'breaking in'—they are logging in. You will analyze real-time identity signals, correlate disparate log sources across a hybrid cloud environment, and identify the markers of an MFA fatigue attack used by the FlowerStorm phishing kit. This scenario highlights the critical importance of behavioral analysis over simple IOC matching in an era of malware-free intrusions and compromised human identities.

30m·256 tasks
View Operation
QR Code Phishing: Scan to Compromise

QR Code Phishing: Scan to Compromise

In this scenario, you will investigate a modern 'Quishing' (QR phishing) attack that bypassed traditional email filters by hiding its payload inside an image. You will trace the full chain: a spoofed MFA-enrollment lure sent from purpose-built infrastructure, a redirect server that conceals the final destination, and an Evilginx-style adversary-in-the-middle page that stole an authenticated session cookie despite MFA. You will then follow the attacker's post-compromise moves — Graph API mailbox enumeration, SharePoint exfiltration, and a hidden inbox forwarding rule — and choose the containment action that actually evicts them.

30m·256 tasks
View Operation
Glossary

What is Brute Force Attack? SOC Glossary

A brute force attack systematically tries large numbers of username and password combinations, or decryption keys, until…

Read more
Glossary

What is MFA? SOC Glossary

Multi-Factor Authentication (MFA) requires a user to prove their identity with two or more independent factors, somethin…

Read more
Glossary

What is Lateral Movement? SOC Glossary

Lateral movement is the attack phase where adversaries expand access from an initial foothold to additional systems, usi…

Read more
Glossary

What is SIEM? SOC Glossary

Security Information and Event Management (SIEM) is a platform that aggregates, normalizes, and correlates log data from…

Read more
Career Path

SOC Analyst (Tier 1) Career Guide: Salary & Skills

Tier 1 SOC Analysts are the front line. You monitor alert queues, triage incoming detections, classify them as true or f…

Read more
Career Path

Incident Responder Career Guide: Salary & Skills

Incident Responders lead the technical response when confirmed breaches happen. You coordinate containment, run forensic…

Read more
Tool

SIEM Training Console: SOCSimulator

The SIEM console in SOCSimulator replicates the workflow of enterprise platforms like Splunk Enterprise Security, Micros…

Read more
Tool

XDR Training Console: SOCSimulator

The XDR console in SOCSimulator replicates the investigation workflow of platforms like CrowdStrike Falcon, Microsoft De…

Read more
Comparison

SOCSimulator Vs. Letsdefend: Platform Comparison

SOCSimulator wins on operational realism. You get multi-tool shift simulation with SLA pressure, noise injection, and al…

Read more
Free Room

Evilginx AiTM: Session Cookie Hijack

medium difficulty room covering T1557

Read more
Glossary

SOC Glossary: Security Operations Terminology

Complete glossary of Security Operations Center terminology for aspiring SOC analysts.

Read more
Feature

Shift Mode: Real-Time SOC Simulation

Practice alert triage under realistic time pressure with SLA timers and noise injection.

Read more