Profile

Shadow


Ryōiki Tenkai: DNS Exploitation

By Sh1dO0w October 11, 2025 Posted in Network

Welcome to the battle of Domains.
Ryōiki Tenkai DNS Exploitation.

DNS

DNS serves as the backbone of internet navigation, translating human-readable domain names (e.g., www.example.com) into IP addresses (e.g., 192.0.2.1). Its architecture comprises several critical components:

Enumeration

Nmap -sC (default scripts) and -sV (version scan) (collecting info about the other’s domain) DIG - NS Query

dig ns inlanefreight.htb @10.129.14.128

DIG - Version Query

dig CH TXT version.bind 10.129.120.85

DIG - ANY Query

dig any inlanefreight.htb @10.129.14.128

Attacks

(Let the Domain battle begain!)

  1. DNS Zone Transfer is a DNS operation that copies the entire contents of a DNS zone (all records for a domain) from a primary/master DNS server to a secondary/slave server. It’s used for legitimate DNS replication, but if misconfigured it can leak your full DNS namespace to anyone who requests it.

Use the dig utility with DNS query type AXFR option to dump the entire DNS namespaces. DIG - AXFR Zone Transfer

dig AXFR @ns1.inlanefreight.htb inlanefreight.htb
  1. Domain Takeovers & Subdomain Enumeration
./subfinder -d inlanefreight.com -v
dig +noall +answer sub.example.com

The tool has found four subdomains associated with inlanefreight.com . Using the nslookup or host command, we can enumerate the CNAME records for those subdomains. EX—

host support.inlanefreight.com
support.inlanefreight.com is an alias for inlanefreight.s3.amazonaws.com

The support subdomain has an alias record pointing to an AWS S3 bucket. However, the URL https://support.inlanefreight.com shows a NoSuchBucket error indicating that the subdomain is potentially vulnerable to a subdomain takeover.

  1. DNS Spoofing Injecting fake DNS responses (local cache poisoning, man-in-the-middle) to redirect victims to attacker-controlled IPs.

Local DNS Cache Poisoning From a local network perspective, an attacker can also perform DNS Cache Poisoning using MITM tools like Ettercap or Bettercap.

To perform this attack, I have to edit the

/etc/ettercap/etter.dns

and enter the name of the site i want to spoof(e.g., lol.com) and the ip i want to user to redirect (e.g., 192.168.225.110)

cat /etc/ettercap/etter.dns 
lol.com A 192.168.225.110
*.lol.com A 192.168.225.110

now start the ettercap once it’s done add the target IP address (e.g.,192.168.152.129 ) to Target1 and add a default gateway IP (e.g., 192.168.152.2 ) to Target2.

Activate dns_spoof attack by navigating to Plugins > Manage Plugins . This sends the target machine with fake DNS responses that will resolve lol.com to IP address 192.168.225.110 :

DNS diagram

DNS flow
After a successful DNS spoof attack, if a victim user coming from the target machine 192.168.152.129 visits the inlanefreight.com domain on a web browser, they will be redirected to a Fake page that is hosted on IP address 192.168.225.110 :

What’s the impact?

(what’s the impact of this battle) This class of DNS vulnerabilities poses a critical risk to both users and the business: attackers can harvest a full inventory of hosts via misconfigured zone transfers, claim dangling subdomains to host phishing or malware, or silently redirect users through cache poisoning and spoofing. With those capabilities an attacker can steal credentials and session tokens, intercept or alter traffic (enabling MITM and data exfiltration), hijack integrations or webhooks, and even amplify DDoS attacks — all without needing direct access to the target systems. The result is account takeover, financial loss, loss of sensitive data, service outages, regulatory exposure, and severe reputational damage that erodes user trust and partner confidence.

Mitigation

(how to protect our selft from other’s doamin!)

Follow me on X for updates and more write-ups :Sh1dO0w


You Might Also Like