Network security: eavesdropping, MITM and DDoS

Sniffing and ARP spoofing on a shared segment, how a man in the middle works and how certificate pinning stops it, reflection attacks, and the defensive layers that actually help.

Eavesdropping on a local network

On a shared segment, a host can often see traffic not addressed to it. ARP has no authentication, so an attacker can answer for another host's address and have traffic sent to them instead.

normal        client  --->  gateway        (ARP says this address is at that MAC)

spoofed       client  --->  attacker  --->  gateway
              attacker replies to ARP for the gateway address with its own MAC,
              then forwards the traffic so nothing looks broken
  • Unencrypted protocols expose credentials, tokens and content to anyone on the path.
  • Even with encryption, metadata such as which hosts are contacted and how much is transferred remains visible.
  • Switch port security, DHCP snooping and dynamic ARP inspection raise the cost on a managed network.
  • The real fix is end-to-end encryption so that on-path access yields nothing useful.

Man in the middle

VectorHow it worksDefence
Rogue access pointThe client associates with the attacker's APPrefer known networks; verify certificates
ARP spoofingTraffic is redirected on a shared segmentDynamic ARP inspection, encryption
DNS spoofingA forged answer points to the attackerDNSSEC, DoH, and certificate validation
Corporate TLS interceptionA trusted root is installed on the deviceCertificate pinning; review the root store
BGP hijackA more specific prefix is announcedRPKI, prefix filtering, monitoring
Malicious proxy configurationThe proxy is set by policy or PACPin certificates and validate the path
pin the public key, not only the certificate

normal validation   chain -> trusted root -> hostname matches
pinning adds        the leaf or intermediate public key must match a known value

benefit   an attacker with a trusted-but-wrong certificate cannot intercept
cost      key rotation requires a release unless multiple pins are allowed

Pinning is powerful and operationally sharp. Always pin at least two keys — the current and the next — and ship an update path, or an emergency rotation locks every installed client out permanently.

Denial of service and reflection

AttackMechanismMitigation
Volumetric floodSaturate the link with raw trafficUpstream scrubbing, anycast, CDN absorption
SYN floodHalf-open connections exhaust the backlogSYN cookies, backlog tuning, edge filtering
Reflection and amplificationSpoofed source triggers a large reply to the victimDisable open resolvers and amplifiers, ingress filtering
SlowlorisMany partial requests hold connections openHeader timeouts, connection limits per client
Application floodExpensive endpoints called repeatedlyRate limits, caching, cost-based quotas
Cache bypassA unique query string defeats the cacheNormalise the cache key, ignore irrelevant parameters
# confirm you are not running an open amplifier
ss -tlnp | grep -E ':53|:123|:1900'
dig +short CHAOS TXT version.bind @your-dns-server

# rate limit at the edge rather than in the application
# nginx example
# limit_req_zone $binary_remote_addr zone=api:10m rate=20r/s;
# limit_req zone=api burst=40 nodelay;
⚠️
Defence is layered because no single control stops a determined flood: absorb at the edge, rate limit per identity, time out aggressively, and cap the cost of any single request. Application-level limits on a key you cannot cheaply forge matter more than raw bandwidth.

FAQ

Is HTTPS enough against a man in the middle?
It defeats a passive eavesdropper completely. Against an attacker who can install a trusted root on the device, only pinning or an out-of-band verification helps.
Can I prevent a DDoS attack?
You cannot prevent the traffic being sent, but you can avoid being the amplifier, absorb what you can upstream, and make each request expensive enough for the attacker and cheap enough for you.

TLS and HTTPS: certificates and the handshake Proxies, load balancers and CDNs

Last refreshed 2026-09-18.