๐ญ 06-07: Fake Records in Legitimate DNS Response¶
๐ Definition¶
A Fake Record in a Legitimate Response is when an attacker inserts malicious DNS records inside an otherwise valid-looking DNS reply.
๐ The packet appears completely normal, but contains hidden malicious data.
๐ง Key Idea¶
A DNS response has multiple sections:
- Question โ what was asked
- Answer โ direct IP response
- Authority โ who controls the domain
- Additional โ extra helpful info
๐ฅ Attackers inject fake data into Authority or Additional sections.
๐งพ Example: Legitimate DNS Response¶
;; QUESTION SECTION:
;www.example.com. IN A
;; ANSWER SECTION:
www.example.com. 86370 IN A 93.184.216.34
;; AUTHORITY SECTION:
example.com. 172769 IN NS b.iana-servers.net.
example.com. 172769 IN NS a.iana-servers.net.
;; ADDITIONAL SECTION:
a.iana-servers.net. 1770 IN A 199.43.135.53
b.iana-servers.net. 1770 IN A 199.43.133.53
๐ This is a normal DNS reply
โ ๏ธ Malicious Version (Poisoned Response)¶
;; QUESTION SECTION:
;www.example.com. IN A
;; ANSWER SECTION:
www.example.com. 259200 IN A 1.2.3.4 โ fake IP
;; AUTHORITY SECTION:
example.com. 259200 IN NS ns.attacker32.com โ injected!
;; ADDITIONAL SECTION:
ns.attacker32.com. 259200 IN A 10.9.0.153
๐ฅ What Changed?¶
| Section | Change |
|---|---|
| Answer | Fake IP (redirect user) |
| Authority | Attacker controls domain |
| Additional | IP of attacker DNS |
๐ฏ Why This Works¶
- DNS accepts extra records in response
- Resolver caches Authority + Additional data
- Packet looks legitimate โ not rejected
๐ฅ Result:
๐ Now attacker controls ALL subdomains
๐ Connection to Kaminsky Attack¶
- Kaminsky attack sends many spoofed responses
- Each response includes:
- Correct-looking answer
-
Malicious authority record
-
If one response matches:
- DNS cache stores fake NS record
- Entire domain gets hijacked
๐ก Final Intuition¶
| Component | Role |
|---|---|
| Answer | Redirect victim |
| Authority | Take domain control |
| Additional | Help resolver trust attacker |
| UDP | No verification โ easy spoof |
๐ Final Outcome¶
๐ Full domain hijack achieved