Man-in-the-Middle Detection Writeup

Date: 20-10-2025 | Platform: TryHackMe | Difficulty: Medium

Overview

Learn what MITM attack is, and how to identify the footprints of this attack in the network traffic. This TryHackMe room focuses on detecting various Man-in-the-Middle attack techniques through packet-level network traffic analysis using Wireshark.

MITM Attack Types Covered

This room explores three main categories of MITM attacks:

1. ARP Analysis - ARP Spoofing Detection

1.1 How many ARP packets from the gateway MAC Address were observed?

To detect ARP spoofing, we analyze ARP packets in the packet capture. The legitimate gateway MAC address should only send announcements when necessary.

Answer: 10

1.2 What MAC address was used by the attacker to impersonate the gateway?

ARP spoofing involves an attacker sending fake ARP replies claiming to be the gateway. We identify the attacker's MAC address by looking for duplicate ARP replies for the gateway IP.

Answer: 02:fe:fe:fe:55:55

1.3 How many Gratuitous ARP replies were observed for 192.168.10.1?

Gratuitous ARP packets are unsolicited ARP announcements used in spoofing attacks to update other hosts' ARP caches with fake mappings.

Answer: 2

1.4 How many unique MAC addresses claimed the same IP (192.168.10.1)?

This question reveals how many different devices claimed ownership of the gateway IP address, indicating a spoofing attack.

Answer: 2

1.5 How many ARP spoofing packets were observed in total from the attacker?

Count all ARP packets (replies and gratuitous) sent by the attacker to maintain the spoofing attack.

Answer: 14

2. DNS Analysis - DNS Spoofing Detection

2.1 How many DNS responses were observed for the domain corp-login.acme-corp.local?

Multiple DNS responses for the same domain can indicate spoofing attempts. DNS spoofing involves sending fake DNS replies before the legitimate resolver.

Answer: 211

2.2 How many DNS requests were observed from the IPs other than 8.8.8.8?

This helps identify unusual DNS traffic patterns. Legitimate DNS requests should primarily go to configured DNS servers.

Answer: 2

2.3 What IP did the attacker's forged DNS response return for the domain?

The attacker redirects the victim to a malicious IP address controlled by them, allowing interception of traffic.

Answer: 192.168.10.55

3. HTTP/HTTPS Analysis - SSL Stripping Detection

3.1 How many POST requests were observed for our domain corp-login.acme-corp.local?

SSL stripping involves downgrading HTTPS to HTTP, allowing the attacker to capture login credentials in plain text.

Answer: 1

3.2 What's the password of the victim found in the plaintext after successful SSL stripping attack?

Once HTTPS is downgraded to HTTP, all data including passwords are sent in clear text and can be easily captured by the MITM attacker.

Answer: Secret123!

What is a Man-in-the-Middle Attack?

A Man-in-the-Middle (MITM) attack occurs when an attacker secretly intercepts and possibly alters the communication between two parties who believe they are directly communicating with each other.

MITM Attack Characteristics:

Common MITM Attack Vectors

Layer 2 Attacks

DNS-Based Attacks

Transport Layer Attacks

Application Layer Attacks

Detection Techniques

ARP Anomaly Detection

DNS Anomaly Detection

SSL/TLS Detection

General Indicators

Wireshark Analysis Techniques

ARP Analysis Filters

arp                    # All ARP traffic
arp.opcode == 2       # ARP replies only
arp.src.proto_ipv4    # ARP announcements
arp.duplicate-address-detected  # Built-in duplicate detection

DNS Analysis Filters

dns                    # All DNS traffic
dns.flags.response    # DNS responses only
dns.qry.name contains # Domain-specific filtering
dns.time > 0.1        # Slow responses (may indicate spoofing)

HTTP Analysis Filters

http                   # All HTTP traffic
http.request.method == POST  # POST requests
http.host contains   # Host header filtering
http.user_agent      # User agent analysis

SSL/TLS Analysis

tls                    # TLS traffic
tls.alert_message    # TLS alerts
tls.handshake        # Handshake analysis
ssl.record.version == 0x0301  # Older SSL versions

Prevention and Mitigation

Network Level

Application Level

DNS Security

Monitoring Solutions

Tools for MITM Detection and Analysis

Lessons Learned

Real-World Impact

MITM attacks are responsible for significant data breaches and financial losses worldwide:

Advanced MITM Concepts

HTTPS Downgrade Attacks

WPA Enterprise Attacks

Mobile Network Attacks