Reconnaissance and Eavesdropping
Attackers first scan the network for hosts and open ports (port scans, for example with Nmap). Sniffing captures packets on the network; on open Wi-Fi or shared media it exposes unencrypted data. Countermeasure: encryption, switched networks, and closing unused ports.
Spoofing
IP spoofing forges the source address; ARP spoofing poisons the table that maps IP to MAC addresses so that traffic goes through the attacker; DNS spoofing (cache poisoning) returns false addresses; e-mail and website spoofing support phishing. Countermeasures: ingress filtering, dynamic ARP inspection, DNSSEC, and TLS certificates.
Man-in-the-Middle (MITM)
In a man-in-the-middle attack the attacker secretly sits between two parties, reads and may change their messages. Methods: ARP spoofing, a rogue access point (an evil twin), DNS spoofing and SSL stripping (forcing a downgrade from HTTPS to HTTP). Countermeasures: TLS with proper certificate validation, HSTS (browser always uses HTTPS), certificate pinning, mutual authentication, avoiding unknown Wi-Fi, and using a VPN.
Denial of Service and DDoS
A denial-of-service (DoS) attack makes a service unavailable. A distributed DoS (DDoS) uses thousands of compromised machines (a botnet). Types: volumetric (flooding the bandwidth, for example by UDP floods and amplification through DNS or NTP servers that return larger replies to a spoofed address), protocol attacks such as the SYN flood, and application-layer attacks such as an HTTP flood. The SYN flood sends many TCP SYN packets and never completes the handshake, filling the server's backlog of half-open connections. Countermeasures: SYN cookies, rate limiting, filtering, content delivery networks and scrubbing services, anycast, extra capacity, and an incident plan with the internet provider.
Other Attacks
Password attacks, session hijacking, replay attacks (countered by nonces and timestamps), phishing (training, e-mail filtering, multi-factor authentication) and malware-based attacks.
Definition: DDoS. A distributed denial-of-service attack in which many compromised machines send traffic or requests at the same time to a target so that legitimate users cannot reach the service.
Table 3.3: Attacks and countermeasures
| Attack | How it works | Countermeasure |
|---|---|---|
| Sniffing | Captures packets | Encrypt traffic (TLS, VPN) |
| ARP spoofing | False MAC mapping | Dynamic ARP inspection |
| MITM | Sits between two parties | TLS validation, HSTS |
| SYN flood | Half-open TCP connections | SYN cookies, rate limiting |
| DDoS | Botnet floods a target | Scrubbing, CDN, extra capacity |
Example 3.3: Time to fill a SYN backlog
Problem: A server keeps up to 1,024 half-open connections, each for 60 seconds. An attacker sends 100 SYN packets per second and never completes the handshake. How long until the backlog is full? What rate would keep it full at all times, and how does this compare with a DDoS of 20,000 bots sending 1 Mbps each against a 1 Gbps link?
Solution:
- Time to fill = 1,024 / 100 = 10.24 seconds.
- Entries last 60 seconds, so to keep the table full the attacker needs 1,024 / 60 = 17.1 SYN packets per second.
- DDoS traffic = 20,000 × 1 Mbps = 20,000 Mbps = 20 Gbps.
- Link capacity is 1 Gbps, so the traffic is 20 times the capacity.
Result: The backlog is full in about 10 seconds, and just 17 SYN packets per second keep the service denied; the DDoS exceeds the link by 20 times. SYN cookies avoid keeping state, and scrubbing services absorb volumetric floods.
backlog, rate, hold = 1024, 100, 60
print("Seconds to fill:", backlog / rate)
print("Rate to keep full:", round(backlog / hold, 1), "per second")
traffic = 20000 * 1
print("DDoS (Gbps):", traffic / 1000, "| times capacity:",
traffic / 1000)
Output
Seconds to fill: 10.24
Rate to keep full: 17.1 per second
DDoS (Gbps): 20.0 | times capacity: 20.0
Common mistakes
- Using public Wi-Fi without a VPN or HTTPS.
- Clicking through certificate warnings.
- Having no plan or provider support against DDoS.
- Allowing spoofed source addresses to leave the network.
Key takeaways
- Reconnaissance, sniffing, spoofing, MITM, DoS and DDoS.
- MITM defence: TLS validation, HSTS, VPN.
- SYN flood defence: SYN cookies, rate limits; DDoS defence: scrubbing, CDN.
- Use nonces and timestamps against replay.
Practice questions
- What is a man-in-the-middle attack?
- How does a SYN flood work?
- Name two DDoS countermeasures.
Answers to the practice questions
- An attacker secretly sits between two parties and reads or alters their messages.
- It sends many TCP SYN packets without completing the handshake, filling the server's backlog.
- Rate limiting and traffic scrubbing or CDN services (also SYN cookies, extra capacity).
Sources
- Official BCA syllabus Computer Security, course code 25BCA406DS02, Unit III
