Network Attacks and Defenses: ARP, DNS, MITM, DoS, and Wireless
Understand how attackers abuse trust on local networks and DNS, how denial-of-service and wireless attacks work, and which controls actually reduce the risk.
By the end, you’ll be able to…
- Explain ARP spoofing and how it enables on-path man-in-the-middle attacks.
- Describe DNS cache poisoning, spoofing, hijacking, and tunnelling.
- Compare rogue DHCP, VLAN hopping, denial-of-service, and wireless attacks.
- Select controls such as dynamic ARP inspection, DHCP snooping, DNSSEC, segmentation, 802.1X, and WPA3.
- Practise detection and defence only in an isolated lab that you own.
01ARP: Trust Without Proof
The Address Resolution Protocol maps a local IPv4 address to a MAC address. When a host wants to send to 10.10.10.1, it broadcasts a request asking who has that address. The owner replies with its MAC address, and the host stores the mapping in its ARP cache for a while. ARP has no authentication and no concept of a trusted reply. Any device on the segment can claim an address, including an address it does not own.
ARP spoofing abuses that trust. An attacker sends forged replies telling the victim that the gateway's IP belongs to the attacker's MAC, and telling the gateway that the victim's IP belongs to the same attacker MAC. Traffic then flows through the attacker, who can forward it to preserve connectivity while reading or modifying it. This is a man-in-the-middle attack at layer two. If the attacker does not forward traffic, the result is a denial of service instead.
Detection starts with inconsistency. A gateway IP that suddenly maps to a new MAC, one MAC claiming many IP addresses, unsolicited ARP replies, or a sudden increase in latency are all clues. On a host, compare the current neighbour table with a known baseline. On a switch, look for MAC flapping and ARP traffic from unexpected ports. Detection is not prevention, so pair it with switch features that validate ARP against a trustworthy binding.
# Show the local neighbour cache.ip neigh show# Watch ARP requests and replies on the lab segment.sudo tcpdump -i eth0 -nn -e arp# Compare the gateway MAC over time.watch -n 5 "ip neigh show 10.10.10.1"10.10.10.1 dev eth0 lladdr 52:54:00:12:34:56 REACHABLE 10.10.10.30 dev eth0 lladdr aa:bb:cc:dd:ee:01 STALE 10.10.10.40 dev eth0 lladdr aa:bb:cc:dd:ee:01 STALE ARP, Request who-has 10.10.10.1 tell 10.10.10.30, length 28 ARP, Reply 10.10.10.1 is-at aa:bb:cc:dd:ee:01, length 28
02DNS Attacks: Poisoning, Spoofing, and Tunnelling
DNS cache poisoning tries to insert a false answer into a recursive resolver's cache so that many users are redirected. The classic attack races the legitimate response: the attacker guesses the transaction ID and source port of a pending query and sends a forged reply first. Modern resolvers randomise the source port and transaction ID, and some add query-name encoding, which makes blind guessing much harder. DNSSEC goes further by signing records so a validating resolver can detect tampering.
On-path DNS spoofing does not need to guess as much. An attacker on the same local network can observe a query and send a forged response that arrives before the real one. A compromised router, a malicious Wi-Fi hotspot, or a rogue DHCP server that hands out its own resolver can achieve the same result. DNS hijacking at the registrar or DNS provider is even more powerful: the attacker changes the authoritative records, so every resolver in the world receives the new answer.
DNS is also a data channel. DNS tunnelling encodes data in query names and TXT records, allowing malware to exfiltrate information or receive commands through a resolver that looks like normal traffic. Long random labels, high query volume to one domain, unusual record types, and queries at regular intervals are worth investigating. Defences include DNSSEC validation, trusted and monitored resolvers, encrypted DNS for privacy, registrar locks with multi-factor authentication, and alerts on unexpected record changes.
# Request DNSSEC records and show whether the resolver validated them.dig +dnssec example.com A# Look at the delegation signer and public key records.dig example.com DSdig example.com DNSKEY# Ask a validating public resolver for comparison.dig @1.1.1.1 example.com A +dnssec;; flags: qr rd ra ad; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1 ;; ANSWER SECTION: example.com. 300 IN A 203.0.113.10 example.com. 300 IN RRSIG A 13 2 300 20261201000000 20261101000000 12345 example.com. abc123...
03Rogue DHCP and VLAN Hopping
DHCP assigns addresses, gateways, DNS servers, and other options. The normal exchange is DISCOVER, OFFER, REQUEST, ACK. A rogue DHCP server can answer first and give clients a gateway or DNS server controlled by the attacker, which turns into a man-in-the-middle position without touching ARP. A DHCP starvation attack exhausts the legitimate pool with fake requests, making it easier for the rogue server to win. Some clients also accept advanced options such as classless static routes that redirect specific destinations.
VLANs separate broadcast domains, but they are not a security boundary by themselves. Switch spoofing abuses dynamic trunk negotiation: an attacker emulates a switch, negotiates a trunk, and receives traffic for multiple VLANs. Double tagging sends a frame with two 802.1Q headers; the first switch strips the outer tag on the native VLAN and forwards the inner tag toward another VLAN. These attacks depend on misconfiguration, which is why access ports should never negotiate trunks and unused ports should be disabled.
The controls are well understood. Enable DHCP snooping so only trusted uplink ports can offer leases, and let dynamic ARP inspection use the snooping bindings to reject forged ARP. Disable DTP and set explicit access or trunk modes. Change the native VLAN away from VLAN 1, prune allowed VLANs on trunks, and avoid using VLAN 1 for user traffic. Port security limits how many MAC addresses can appear on an access port, and 802.1X requires authentication before the port carries traffic.
NORMAL DHCP EXCHANGEDISCOVER client broadcast: is there a DHCP server?OFFER server to client: here is an address and optionsREQUEST client broadcast: I accept this offerACK server to client: confirmed, lease time, optionsROGUE SERVER RISKS- hands out the attacker as default gateway- hands out a malicious DNS resolver- pushes static routes that redirect selected traffic- wins the race by answering before the real serverVLAN HOPPING PRECONDITIONS- access port negotiates a trunk (DTP)- native VLAN mismatch enables double tagging- trunk allows more VLANs than the attached device needs04Denial of Service: Volume, Protocol, and Application
Denial-of-service attacks target availability. Volumetric attacks consume bandwidth with sheer traffic volume. Protocol attacks exhaust state tables, such as a SYN flood that leaves many half-open connections and fills the server's backlog. Application-layer attacks target expensive operations, such as search queries, login attempts, or large exports, and can succeed with far less bandwidth than a volumetric flood.
Reflection and amplification make attacks larger without giving the attacker more capacity. The attacker spoofs the victim's source address and sends a small request to an open service. The service sends a much larger response to the victim. DNS, NTP, memcached, SSDP, and CLDAP have all been used this way. The amplification factor varies with the protocol and the query, and the victim sees traffic from many innocent reflectors rather than from the attacker.
Defences are layered. Close or rate-limit open UDP services, apply ingress filtering so spoofed source addresses cannot leave a network, enable SYN cookies and connection limits, and put a plan in place for upstream scrubbing or content delivery absorption. Anycast can spread volumetric traffic across locations, but it is not a substitute for a response plan. The most important control is preparation: know who to call, what to shut off, and which service must stay available.
REFLECTOR TYPICAL FACTOR NOTEOpen DNS resolver roughly 28-54x large ANY or TXT responsesNTP monlist roughly 200x+ older or misconfigured serversmemcached over UDP roughly 10,000x+ exposed 11211 must be closedSSDP roughly 30x home routers and IoT devicesFactors vary with query size and configuration. The defence is the same:close open reflectors, rate-limit, filter spoofed sources, and plan capacity.05Wireless: Rogue APs, Evil Twins, and WPA2/WPA3
A rogue access point is any unauthorised Wi-Fi device attached to the network. It may be an employee plugging in a travel router, or an attacker connecting a small AP to an open Ethernet port. An evil twin is a rogue AP that copies a legitimate SSID and broadcasts a stronger signal. Victims associate with it, land on a captive portal, and hand over credentials or accept a malicious certificate. Deauthentication frames can push clients off the real network so they reconnect to the twin.
WPA2-Personal derives keys from a pre-shared passphrase through a four-way handshake. An attacker who captures that handshake can take it offline and test guesses; a weak passphrase falls quickly. PMKID attacks can sometimes avoid waiting for a client. WPA2-Enterprise replaces the shared key with 802.1X and EAP, but a rogue RADIUS server can still harvest credentials if clients are not configured to validate the server certificate.
WPA3-Personal uses Simultaneous Authentication of Equals, which is resistant to offline dictionary guessing and provides forward secrecy. WPA3 also requires protected management frames, which makes deauthentication harder. Transition mode, which allows both WPA2 and WPA3 clients, can permit downgrade attacks, and WPS PINs remain a weak point when enabled. For high-value networks, certificate-based EAP-TLS with server validation is stronger than passwords, and guest traffic should be isolated from internal systems.
MODE AUTHENTICATION MAIN RISKOpen none anyone nearby can capture trafficWPA2-Personal pre-shared key offline guessing if passphrase is weakWPA2-Enterprise 802.1X/EAP credential theft via rogue RADIUSWPA3-Personal SAE resistant to offline guessingWPA3-Enterprise 802.1X/EAP strongest common deploymentCONTROLS- disable WPS and unused radios- require protected management frames- validate the RADIUS server certificate on clients- isolate guest and IoT traffic- use a VPN on networks you do not control06Detection and Layered Defences
Prevention starts with segmentation. Put users, servers, management interfaces, guests, and IoT devices in separate zones with explicit firewall rules between them. An attacker who compromises a laptop should not be able to reach the hypervisor management network or the backup server. Private VLANs and restricted east-west rules reduce the reach of ARP and DHCP attacks as well, because the attacker cannotsee or influence hosts in another segment.
Access control comes next. 802.1X authenticates devices and users before a switch port or Wi-Fi association carries production traffic. DHCP snooping and dynamic ARP inspection protect the local segment. Port security, BPDU guard, root guard, and disabled unused ports reduce switch-level abuse. On the DNS side, use validating resolvers, DNSSEC where the zone supports it, and registrar protections. On wireless, prefer WPA3, disable WPS, and validate the authentication server certificate.
Detection fills the gaps that prevention misses. IDS and IPS tools such as Suricata, Zeek, and Snort can alert on ARP anomalies, DHCP offers from untrusted ports, DNS tunnelling patterns, and flood behaviour. NetFlow or IPFIX shows traffic volumes and top talkers. Switch logs show MAC flapping and port changes. Wireless IDS can detect rogue BSSIDs and evil-twin SSIDs. Correlate these sources with accurate, time-synchronised logs, and rehearse the response so an alert becomes containment rather than a ticket.
ATTACK PREVENT DETECTARP spoofing DAI + DHCP snooping ARP anomalies, MAC flappingRogue DHCP DHCP snooping, port security DHCP offers on untrusted portsDNS cache poisoning DNSSEC, patched resolvers Unexpected record changesDNS tunnelling Egress filtering, monitoring Long labels, query volumeVLAN hopping Disable DTP, prune VLANs New trunks, VLAN changesSYN flood SYN cookies, rate limits Half-open connection growthDDoS Scrubbing, anycast, BCP 38 Volumetric and flow anomaliesEvil twin / rogue AP WIDS/WIPS, 802.1X, WPA3 Rogue BSSID, duplicate SSIDWeak Wi-Fi passphrase WPA3, strong passphrase Handshake capture attempts07Practise Only in a Lab You Own
Every technique in this lesson can disrupt real people. Only test on an isolated network that you control, with virtual machines you can snapshot and restore. Do not run ARP spoofing, rogue DHCP, deauthentication, or denial-of-service tools against a home network you share, a workplace, a school, a public hotspot, or any address you do not own. Unauthorised interference with a network is a crime in many jurisdictions, even if you believe you are only experimenting.
A good lab has a victim VM, an attacker VM, and an observer VM on a host-only network. Build a baseline: record the gateway MAC, DHCP server, DNS resolver, and normal traffic pattern. Then introduce one change at a time, capture the effect, and revert the snapshot. The learning comes from comparing the baseline with the anomaly, not from causing the biggest disruption.
Report like a defender. State the scope, the time window, the exact commands, the observed evidence, the affected assets, and the limits of your test. Map each finding to a control: dynamic ARP inspection, DHCP snooping, DNSSEC, segmentation, 802.1X, WPA3, rate limiting, or monitoring. A finding without a remediation path is entertainment; a finding with an owner and a verification step is security work.
# Confirm you are on the isolated lab network.ip -brief addressip route# Capture ARP and DHCP for a short baseline window.sudo tcpdump -i eth0 -nn -c 50 'arp or udp port 67 or udp port 68'# Record the gateway mapping before and after a lab change.ip neigh show 10.10.10.1date -u +"%Y-%m-%dT%H:%M:%SZ"# Stop, restore the snapshot, and verify the baseline again.eth0 UP 10.10.10.20/24 default via 10.10.10.1 dev eth0 10.10.10.1 dev eth0 lladdr 52:54:00:12:34:56 REACHABLE 2026-11-01T12:00:00Z
The ideas worth keeping.
- ARP and DHCP have no built-in authentication, so local network trust must be enforced by switch features and segmentation.
- DNSSEC protects integrity, not confidentiality; encrypted DNS protects privacy, not the truth of the answer.
- Denial-of-service defence is preparation: close reflectors, filter spoofed sources, rate-limit, and plan upstream absorption.
- Wireless security depends on WPA3 or strong WPA2, server validation, protected management frames, and rogue AP detection.
Make it yours.
Type and test your code right here in the interactive workspace. Run your solution, check the output, and compare with the worked guide when ready.
Exercise 1: Investigate a suspected ARP spoof
Users on a lab VLAN report slow access. The gateway 10.10.10.1 normally maps to 52:54:00:12:34:56. The current neighbour table shows 10.10.10.1 mapped to aa:bb:cc:dd:ee:01, and 10.10.10.40 and 10.10.10.50 also map to aa:bb:cc:dd:ee:01. A packet capture shows repeated unsolicited ARP replies claiming 10.10.10.1. Explain the likely attack, the evidence you would preserve, immediate containment, and two permanent controls.
Explore a worked solution
Likely attack: ARP spoofing. The attacker is claiming the gateway IP with its own MAC and may also be claiming other hosts, placing itself on the path between victims and the gateway. Preserve the neighbour table output with timestamps, the packet capture showing the unsolicited replies, switch MAC and port logs, DHCP leases, and any authentication logs. Immediate containment: isolate the switch port associated with the suspicious MAC, or shut it down, then restore the correct ARP entry or let it expire; do not tip off the user before you have the switch evidence. Permanent controls: enable DHCP snooping and dynamic ARP inspection on the VLAN with trusted uplinks, add port security, segment the network, and monitor for duplicate MACs and gateway MAC changes. Also consider static ARP for a few critical hosts as a stopgap, but it does not scale.ARP spoofing is a local trust problem. Evidence collection must happen before containment changes the state, and the permanent fix belongs on the switch, not only on the victim.
Exercise 2: Prioritise defences for a flat small office
A small office has one flat /24 network, a consumer router, WPA2-Personal Wi-Fi, no VLANs, and no monitoring. The owner has a limited budget. Choose three controls to implement first, justify the order, and explain what each one does not solve.
Explore a worked solution
1. Replace the consumer router with a business router or firewall that supports separate guest and staff networks, and move guests and IoT devices to the guest zone. Segmentation limits what a compromised laptop or camera can reach and is the highest-leverage change on a flat network. It does not stop attacks between hosts in the same zone. 2. Enable WPA3 where clients support it, or keep WPA2 with a long unique passphrase, disable WPS, and change default admin credentials. This raises the cost of wireless compromise but does not stop a determined attacker from targeting a weak client or an evil twin. 3. Add managed switches with DHCP snooping, dynamic ARP inspection, and port security if the budget allows, plus basic logging to a central collector. These controls protect the local segment from spoofing and rogue DHCP, but they do not replace endpoint security, patching, MFA, or backups. If managed switches are out of reach, prioritise segmentation and monitoring on the router, and document the residual risk.Order controls by the blast radius they reduce. Segmentation changes what an attacker can reach; wireless hardening raises the entry cost; switch protections defend the local trust boundary.
What stayed with you?
Check the ideas while they’re fresh. Your answers stay in this page and feedback appears as you go.
Keep exploring.
The official references behind this lesson, when you want a second angle or the full details.
One lesson closer.
Reading is a start. Trying it yourself makes the connection.