SECURITY ENGINEERING · PART 2 · NETWORKING FOR SECURITY · BASICS · 21 OF 229

Where Data Gets Attacked: A Request, Hop by Hop

Follow one login request from a laptop to a database and back across eight hops: the device, Wi-Fi, DNS, the internet, the CDN and WAF, the load balancer, the application and the data store. At every hop: what an attacker can sniff or change there, and the one control that protects it. The map for the rest of this part.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 9
  9. 10
  10. 11
  11. 12
  12. 13
  13. 14
  14. 15
  15. 16
  16. 17
  17. 18
  18. 19
  19. 20
  20. 21
  21. 22
  22. 23
  23. 24
  24. 25
  25. 26
  26. 27
  27. 28
  28. 29
  29. 30
  30. 31
  31. 32
  32. 33
  33. 34
  34. 35
  35. 36
  36. 37
  37. 38
  38. 39
  39. 40
  40. 41
  41. 42
  42. 43
  43. 44
  44. 45
  45. 46
  46. 47
  47. 48
  48. 49
  49. 50
  50. 51
  51. 52
  52. 53
  53. 54
  54. 55
  55. 56
  56. 57
  57. 58
  58. 59
  59. 60
  60. 61
  61. 62
  62. 63
  63. 64
  64. 106
  65. 107
  66. 108
  67. 109
  68. 110
  69. 111
  70. 112
  71. 113
  72. 114
  73. 115
  74. 116
  75. 117
  76. 118
  77. 119
  78. 120
  79. 121
  80. 122
  81. 123
  82. 124
  83. 125
  84. 126
  85. 127
  86. 128
  87. 129
  88. 130
  89. 131
  90. 132
  91. 133
  92. 134
  93. 135
  94. 136
  95. 137
  96. 138
  97. 139
  98. 140
  99. 141
  100. 142
  101. 143
  102. 144
1 / 13

Press play to hear the narration, or step through at your own pace.

Key takeaways

  • Device
  • Wi-Fi
  • DNS
  • internet
  • edge
  • load balancer
  • app
  • data: an attack and a control at every hop

Notes

Hop 1 · The device

Hop one is the device itself. Before the request leaves, malware on the laptop can read the password as it is typed, and a common kind called an infostealer copies the session cookies that keep you logged in. Encryption on the network does not help, because the theft happens before encryption. The defenses are a patched, managed device with endpoint protection and no local admin, plus multi-factor login so a stolen password alone is not enough.

On the laptop
  • attack: malware reads keys as you type; an infostealer copies session cookies
  • attack: a malicious browser extension
  • defense: patching, EDR, no local admin, disk encryption
  • defense: MFA, so a stolen password is not enough

Hop 2 · Local network

Hop two is the local network. On shared Wi-Fi, anyone nearby can capture packets off the air. An attacker can run an evil twin, a fake access point with the cafe's name, or use ARP spoofing to convince your laptop that their machine is the router, which puts them in the middle of every connection. The defenses are modern Wi-Fi security, and above all TLS, so that whatever they capture is unreadable.

On Wi-Fi or the office LAN
  • attack: sniffing, reading packets off the air
  • attack: evil twin, a fake access point with a real name
  • attack: ARP spoofing, pretend to be the router (MITM)
  • defense: WPA3 or 802.1X, and TLS on every connection

Hop 3 · DNS

Hop three is DNS, the lookup that turns a name into an address. It is a quiet, old protocol, and if an attacker can forge the answer, or poison the resolver's cache, your browser connects to their server instead of the real one, with the right name still in the address bar. Worse, an attacker who takes over the domain's registrar account controls every answer. The defenses are DNSSEC, encrypted DNS, and a locked, MFA-protected registrar account.

The name lookup
  • the browser asks: where is shop.example?
  • attack: DNS spoofing, a forged answer
  • attack: cache poisoning at the resolver
  • attack: hijack the domain at the registrar
  • defense: DNSSEC, DNS over HTTPS, registrar lock + MFA

Hop 4 · The internet

Hop four is the internet itself: a chain of routers owned by companies you never chose. Any of them can read unencrypted traffic. An attacker can even announce false routes with BGP, the internet's routing protocol, so traffic detours through them. And SSL stripping tries to keep your first request on plain HTTP. The defense that makes this hop safe is TLS, with HSTS telling browsers to never use plain HTTP for the site at all.

Across the internet
  • many routers, many owners
  • attack: interception by any network on the path
  • attack: BGP hijack, reroute traffic through the attacker
  • attack: SSL stripping, force the first request to HTTP
  • defense: TLS 1.3, HSTS, certificate monitoring

Hop 5 · The edge

Hop five is the company's edge: a content delivery network and a web application firewall. This is where volume attacks land. A DDoS tries to flood the front door. Bots scrape prices and replay millions of stolen passwords, called credential stuffing. Scanners probe for known flaws. The edge answers with DDoS absorption, rate limits, bot detection, and firewall rules that drop obviously malicious requests before they reach anything valuable.

CDN and WAF
  • attack: DDoS, flood the front door until it falls
  • attack: bots, scraping, credential stuffing
  • attack: probing for known web flaws
  • defense: DDoS protection, rate limits, bot defense, WAF rules

Hop 6 · Inside the door

Hop six is the load balancer or API gateway, where TLS is usually decrypted. Two things go wrong here. Old protocol versions and weak ciphers left enabled. And the assumption that the inside network is safe, so traffic from here onward travels as plain text, readable by anyone who gets a foothold inside. The defenses are modern TLS only, encryption between internal services too, and authentication enforced at the gateway.

Load balancer and gateway
  • TLS is usually decrypted here
  • attack: weak TLS settings, old protocol versions
  • attack: plain HTTP on the inside, readable by anyone who gets in defense: modern TLS only, encrypt inside too (mTLS), auth at the gateway

Hop 7 · The application

Hop seven is the application. The network did its job and delivered the request. Now the danger is the request's content. SQL injection, cross-site scripting, server-side request forgery, and broken access control, where the code never checks that this user may see this order. No firewall can fix a missing permission check. The defenses are in the code: safe queries, input validation, and authorization on every single call. That is all of Part six.

In the application
  • the request is now trusted bytes in your code
  • attack: SQL injection, XSS, SSRF, broken access control
  • no firewall fixes a missing permission check
  • defense: safe queries, input checks, authz on every call
  • this is all of Part 6

Hop 8 · The data

Hop eight is the data, the real target of nearly every attack. It is reached with stolen database credentials, through a storage bucket left public, through a backup nobody protected, or by an insider with more access than their job needs. The defenses: keep data stores off the public network, give each service the least privilege it needs, encrypt with managed keys, and log every read so unusual access is visible.

Database and storage
  • attack: stolen credentials used directly on the DB
  • attack: a public bucket or a leaked backup
  • attack: an insider with too much access
  • defense: private network, least privilege, encryption with KMS, audit every read

The whole path

Step back and three lessons stand out. First, TLS protects the middle of the journey, the network hops, and nothing else. Second, the two ends, the device and the application, are where most real breaches happen, exactly because encryption does not cover them. Third, every hop needs its own control. This is defense in depth from Part zero, drawn as a map. When you review any system, walk the request hop by hop and ask what protects each one.

What the journey teaches
  • 1 TLS protects the middle, hops 2 to 5, not the two ends
  • 2 the ends, device and application, are where most real breaches happen
  • 3 every hop needs its own control: defense in depth, drawn on a map

Common mistakes

Mistakes. Believing that HTTPS means secure, when it covers only the middle hops. Running plain HTTP inside the network. Leaving the domain registrar account with a weak password, when it controls where all traffic goes. Trusting whatever device shows up. Keeping no logs at the data hop, so theft is invisible. And relying on one strong control, usually a firewall, to cover eight different hops.

Avoid these
  • "we have HTTPS, so we are secure"
  • plain HTTP inside the network
  • an unprotected registrar account
  • trusting the device
  • no logging at the data hop
  • one control for eight hops

Say it like this

In the interview, this is the security version of what happens when you type a URL. Walk the hops in order: device, local network, DNS, internet, edge, load balancer, application, database. At each one name the attack and the control: endpoint protection and MFA on the device, TLS and HSTS for the network, DNSSEC for names, a WAF and rate limits at the edge, authorization in the code, and least privilege with encryption at the data.

In the interview
  • "I walk the hops: device, local
  • network, DNS, internet, edge, load balancer, app, database.
  • For each I name the attack and the control: EDR and MFA, TLS
  • and HSTS, DNSSEC, WAF and rate
  • limits, authz in code, least
  • privilege and encryption."

Interview questions

Q1From a security view, what happens when you log in to a website?

The request crosses the device, the local network, DNS, the internet, the site edge (CDN/WAF), a load balancer, the application and the database. Each hop has its own attacks, such as malware, sniffing, DNS spoofing, DDoS, injection and data theft, and needs its own control.

Q2What does TLS protect, and what does it not?

TLS protects data in transit between the two endpoints from being read or changed on the network. It does not protect against a compromised device, flaws in the application, or theft from the database, which is why HTTPS alone does not make a system secure.

Q3What is a man-in-the-middle attack?

An attacker positions themselves between two parties, for example with ARP spoofing or a fake Wi-Fi access point, so traffic flows through them and can be read or changed. TLS with certificate validation defeats it by encrypting and authenticating the connection.

Q4Why is DNS a security risk?

DNS decides which server a name resolves to, and classic DNS is unauthenticated. Forged answers, poisoned resolver caches or a hijacked registrar account can send users to an attacker server. DNSSEC, encrypted DNS and a locked, MFA-protected registrar account reduce the risk.

Q5What is SSL stripping and how does HSTS stop it?

SSL stripping intercepts the first plain HTTP request and keeps the victim on HTTP while the attacker talks HTTPS to the site. HSTS tells browsers to only ever use HTTPS for that domain, and preloading covers even the first visit.

Q6Why encrypt traffic inside the internal network?

If TLS ends at the load balancer and internal traffic is plain text, anyone with a foothold inside can read credentials and data. Encrypting service-to-service traffic, often with mutual TLS, removes the assumption that the internal network is trusted.

Q7Where do most real breaches happen along the path?

At the two ends: the user device (malware, stolen sessions, phishing) and the application and data layer (injection, broken access control, exposed storage), because network encryption does not cover them.

Q8What does a WAF do, and what can it not do?

A web application firewall inspects HTTP requests at the edge and blocks known malicious patterns, with rate limits and bot rules. It cannot fix logic flaws such as a missing authorization check, so it complements secure code rather than replacing it.