Lesson 2 of 2 Network Attacks and Countermeasures

Network Attack Countermeasures

Network attacks are countered by layers of controls. This lesson explains content delivery networks and DDoS protection, firewalls and filtering, network access controls, intrusion detection and prevention systems, and specific defences against MITM and DNS attacks.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe CDNs and DDoS protection.
  • Explain ingress and egress filtering.
  • Describe switch features that counter layer 2 attacks.
  • Choose countermeasures for MITM and DNS attacks.

Content delivery networks and DDoS protection

A content delivery network (CDN) is a distributed network of servers at many locations that cache and serve content close to users. Because a CDN has enormous total capacity and absorbs traffic near its sources, it can withstand volumetric DDoS attacks that would overwhelm a single organisation's link, and it hides the origin servers' addresses. Many CDNs include web application firewalls and bot management.

Other DDoS countermeasures include scrubbing services that receive traffic (through DNS or routing changes), filter attack traffic and forward clean traffic; upstream filtering by internet providers; rate limiting; SYN cookies; overprovisioned capacity and autoscaling in the cloud; anycast routing, which spreads traffic across many sites; and an incident response playbook for DDoS, prepared with the providers in advance.

The following diagram shows the preparations a retailer has in place against DDoS extortion before its peak season.

Preparing a retailer for DDoS extortion before peak season. A CDN or scrubbing service with enough capacity fronts the website and the origin accepts traffic only from it; WAF and rate-limiting rules handle application-layer floods; upstream filtering is agreed with the provider; and a rehearsed playbook holds contacts and decision points.
The scenario is illustrative.

Firewalls and filtering

Firewalls enforce which traffic may pass between zones and block much attack traffic: unsolicited inbound connections, traffic to closed ports and known malicious addresses. Anti-spoofing filters drop packets with impossible source addresses, such as internal addresses arriving from the internet. Ingress filtering (blocking spoofed traffic entering a network) and egress filtering (allowing only legitimate source addresses and required outbound traffic to leave) are recommended practice, described in BCP 38; egress filtering also limits malware communication and stops an organisation's systems taking part in reflection attacks.

Network access controls

Network access controls prevent unauthorised devices from joining the network in the first place. 802.1X port-based authentication admits only authenticated devices and users; network access control (NAC) adds posture checks; port security limits MAC addresses per switch port. Switch features defend against layer 2 attacks: DHCP snooping allows DHCP offers only from trusted ports, blocking rogue DHCP servers; dynamic ARP inspection validates ARP messages against DHCP snooping records, blocking ARP spoofing; and disabling unused ports and setting the native VLAN carefully counter VLAN hopping.

Intrusion detection and prevention systems

Intrusion detection and prevention systems (IDPS) examine traffic for signs of attack. An IDS alerts; an IPS sits inline and can block. They detect scans, exploit attempts, malware command traffic, protocol anomalies and known attack signatures, and they feed alerts to the SIEM. Their operation is covered in the network security appliances module.

Match the pairs

Countermeasures

Exam skills 6.2.2

Match each attack with the countermeasure that addresses it.

Log in to try this activity Interactive activities are free with an account.

Defences against MITM and DNS attacks

Encryption with authentication is the primary defence against MITM: TLS with proper certificate validation, HTTP Strict Transport Security (HSTS) to prevent SSL stripping, VPNs on untrusted networks, SSH with verified host keys, and mutual TLS between services. WPA3 or WPA2-Enterprise and wireless intrusion prevention counter rogue access points.

Against DNS attacks, DNSSEC adds digital signatures to DNS records so that validating resolvers can detect forged answers. Resolvers randomise source ports and transaction IDs, which makes poisoning much harder, and recursive resolvers are restricted to internal clients rather than left open to the internet, where they could be used in amplification attacks. Encrypted DNS (DNS over HTTPS or TLS) protects queries from eavesdropping and tampering in transit. Registrar lock and MFA on registrar accounts prevent hijacking, and monitoring for long or high-volume DNS queries reveals tunnelling. The following table maps attacks to countermeasures.

AttackKey countermeasures
Volumetric DDoSCDN, scrubbing service, upstream filtering, anycast
SYN floodSYN cookies, rate limiting, firewalls and load balancers with SYN protection
Application-layer DDoSWAF, bot management, rate limiting, caching
ARP spoofingDynamic ARP inspection, DHCP snooping, TLS
Rogue DHCPDHCP snooping
MITM and SSL strippingTLS with certificate validation, HSTS, VPN
DNS cache poisoningDNSSEC, randomised ports and IDs, closed resolvers
IP spoofingIngress and egress filtering
Worked example

Preparing for DDoS

An online retailer expects to be targeted by DDoS extortion during its peak season. What should it put in place before the season?

Front the website with a CDN or DDoS scrubbing service with enough capacity, and hide the origin servers so they accept traffic only from the CDN. Enable WAF and rate-limiting rules for application-layer floods, confirm upstream filtering arrangements with the internet provider, and prepare and rehearse a DDoS playbook with contacts and decision points, including a policy on extortion demands.

Worked example

The open resolver

An audit finds that the company's DNS resolver answers recursive queries from anyone on the internet. Why is this a problem?

An open resolver can be abused in DNS amplification attacks against third parties and is more exposed to cache poisoning attempts. It should be configured to answer recursive queries only from internal clients, with DNSSEC validation enabled and source-port randomisation in place.

Check yourself

Which switch feature stops rogue DHCP servers?

Show answer

DHCP snooping, which permits DHCP server messages only from trusted ports.

Exam Tips

Remember for the exam

  • CDNs and scrubbing absorb volumetric DDoS; SYN cookies counter SYN floods.
  • DNSSEC counters cache poisoning; TLS with certificate validation and HSTS counter MITM.
  • Dynamic ARP inspection and DHCP snooping counter layer 2 attacks.