Skip to content

๐ŸŽญ 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:

example.com โ†’ ns.attacker32.com

๐Ÿ‘‰ 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

Before attack:
example.com โ†’ real DNS servers

After attack:
example.com โ†’ ns.attacker32.com

๐Ÿ‘‰ Full domain hijack achieved