Sec-88
  • 🧑Whoami
  • 🕸️Web-AppSec
    • Features Abuse
      • 2FA
      • Ban Feature
      • CAPTCHA
      • Commenting
      • Contact us
      • File-Upload
      • Inviting Feature
      • Messaging Features
      • Money-Related Features
      • Newsletter
      • Profile - Settings
      • Registration
      • Reset Password
      • Review
      • Rich Editor/Text
      • Social Sharing
      • Billing-Shipping Address Management
      • Integrations - Webhooks
      • API Key Management
    • Reconnaissance
      • Attacking Organizations with big scopes
    • Subdomain Enumeration
    • Fingerprinting
    • Dorking
    • XSS-HTML Injection
    • Improper Authentication
      • JWT Security
    • OAUTH Misconfigurations
      • OAuth 2.0 Basics
      • OAUTH Misconfigurations
    • Auth0 Misconfigurations
    • Broken Access Control
      • Insecure Direct Object References (IDOR)
      • 403 Bypass
    • Broken Link Injection
    • Command Injection
    • CORS
    • CRLF
    • CSRF
    • Host Header Attacks
    • HTTP request smuggling
    • JSON Request Testing
    • LFI
      • LFI to RCE
    • No Rate Limit
    • Parameters Manual Testing
    • Open Redirect
    • Registration & Takeover Bugs
    • Remote Code Execution (RCE)
    • Session Fixation
    • SQL Injection
      • SQL To RCE
    • SSRF
    • SSTI
    • Subdomain Takeover
    • Web Caching Vulnerabilities
    • WebSockets
    • XXE
      • XXE to RCE
    • Cookie Based Attacks
    • CMS
      • AEM [Adobe CMS]
    • XSSI (Cross Site Script Inclusion)
    • NoSQL injection
    • Local VS Remote Session Fixation
    • Protection
      • Security Mechanisms for Websites
      • Cookie Flags
      • SameSite Cookie Restrictions
      • Same-origin policy (SOP)
      • CSP
    • Hacking IIS Applications
    • Dependency Confusion
    • Attacking Secondary Context
    • Hacking Web Sockets
    • IDN Homograph Attack
    • DNS Rebinding Attack
    • LLM Hacking Checklist
    • Bypass URL Filtration
    • Cross-Site Path Traversal (CSPT)
    • PostMessage Security
    • Prototype Pollution
      • Client-Side Prototype Pollution
      • Server-Side prototype pollution
    • Tools-Extensions-Bookmarks
    • WAF Bypassing Techniques
    • SSL/TLS Certificate Lifecycle
    • Serialization in .NET
    • Client-Side Attacks
      • JavaScript Analysis
    • Bug Bounty Platforms/Programs
    • DNS Dangling / NS Takeover
  • ✉️API-Sec
    • GraphQL API Security Testing
      • The Basics
      • GraphQL Communication
      • Setting Up a Vulnerable GraphQL Server
      • GraphQL Hacking Tools
      • GraphQL Attack Surface
      • RECONNAISSANCE
      • GraphQL DOS
      • Information Disclosure
      • AUTHENTICATION AND AUTHORIZATION BYPASSES
      • Injection Vulnerabilities in GraphQL
      • REQUEST FORGERY AND HIJACKING
      • VULNERABILITIES, REPORTS AND EXPLOITS
      • GraphQL Hacking Checklist
    • API Recon
    • API Token Attacks
    • Broken Object Level Authorization (BOLA)
    • Broken Authentication
    • Evasive Maneuvers
    • Improper Assets Management
    • Mass Assignment Attacks
    • SSRF
    • Injection Vulnerabilities
    • Excessive Data Exposure
    • OWASP API TOP 10 MindMap
    • Scanning APIs with OWASP ZAP
  • 📱Android-AppSec
    • Setup Android App Pentesting environment on Arch
    • Setup Android App Pentesting environment on Mac M4
    • Setup Android Pentesting Environment on Debian Linux
    • Android App Fundamentals
      • Android Architecture
      • Android Security Model
      • Android App Components
        • Intents
        • Pending Intents
    • Android App Components Security Cheatsheet
    • Android App Pentesting Checklist
    • How To Get APK file for application
    • ADB Commands
    • APK structure
    • Android Permissions
    • Exported Activity Hacking
    • BroadcastReceiver Hacking
    • Content Provider Hacking
    • Signing the APK
    • Reverse Engineering APK
    • Deep Links Hacking
    • Drozer Cheat Sheet
    • SMALI
      • SMALI Cheat Sheet
      • Smali Code Patching Guide
    • Intent Redirection Vulnerability
    • Janus Vulnerability (CVE-2017-13156)
    • Task Hijacking
    • Hacking Labs
      • Injured Android
      • Hacking the VulnWebView Lab
      • Hacking InsecureBankv2 App
    • Frida Cheat Sheet
  • 📶Network-Sec
    • Networking Fundamentals
    • Open Ports Security Testing
    • Vulnerability Scanning
    • Client Side Attacks
    • Port Redirection and Tunneling
    • Password Attacks
    • Privilege Escalation [PrevEsc]
      • Linux Privilege Escalation
    • Buffer Overflow (BOF)
      • VulnServer
      • Sync Breez Enterprize
      • Crashed CTF
      • BOF for Linux
    • AV Evasion
    • Post Exploitation
      • File Transfer
      • Maintaining Access
      • Pivoting
      • Clean Up
    • Active Directory
      • Basic AD Pentesting
  • 💻Desktop AppSec
    • Thin Client vs. Thick Client
  • ☁️Cloud Sec
    • Salesforce Hacking
      • Basics
      • Salesforce SAAS Apps Hacking
    • Firebase
    • S3 Buckets Misconfigurations
    • Amazon Cognito Misconfiguraitons
  • 👨‍💻Programming
    • HTML
    • JavaScript (JS)
      • window.location object
    • Python
      • Python Tips
      • Set
        • SetMethods
    • JAVA
      • Java Essentials
      • Java Essentials Code Notes
      • Java OOP1
      • JAVA OOP Principles
        • Inheritance
        • Method Overriding
        • Abstract Class
        • Interface
        • polymorphism
        • Encapsulation
        • Composition
      • Java OOP Challenges
      • Exception Handling
    • Go
      • Go Syntax Tutorial in one file
      • Methods and Interfaces
      • Go Slices
      • Go Maps
      • Go Functions
      • Concurrency
      • Read Files
      • Write Files
      • Package
        • How to make personal Package
        • regexp Packages
        • Json
        • bufio
        • Time
      • Signals-Exit
      • Unit Testing
  • 🖥️Operating Systems
    • Linux
      • Linux Commands
      • Tools
      • Linux File System
      • Bash Scripting guide
      • tmux
      • Git
      • Install Go tools from private repositories using GitHub PAT
    • VPS
    • Burp Suite
  • ✍️Write-Ups
    • Hunting Methodology
    • API BAC leads to PII Data Disclosure
    • Misconfigured OATUH leads to Pre-Account Takeover
    • Automating Bug Bounty with GitHub Actions
    • From Recon to Reward: My Bug Bounty Methodology when Hunting on Public Bug Bounty Programs
    • Exploring Subdomains: From Enumeration to Takeover Victory
    • 0-Click Account Takeover via Insecure Password Reset Feature
    • How a Simple Click Can Lead to Account Takeover: An OAuth Insecure Implementation Vulnerability
    • The Power Of IDOR even if it is unpredictable IDs
    • Unlocking the Weak Spot: Exploiting Insecure Password Reset Tokens
    • AI Under Siege: Discovering and Exploiting Vulnerabilities
    • Inside the Classroom: How We Hacked Our Way Past Authorization on a Leading EdTech Platform
    • How We Secured Our Client’s Platform Against Interaction-Free Account Thefts
    • Unchecked Privileges: The Hidden Risk of Role Escalation in Collaborative Platforms
    • Decoding Server Behavior: The Key to Mass Account Takeover
    • Exploiting JSON-Based CSRF: The Hidden Threat in Profile Management
    • How We Turned a Medium XSS into a High Bounty by Bypassing HttpOnly Cookie
Powered by GitBook
On this page
  • What is an NS Takeover Vulnerability?
  • NS Takeover vs. Subdomain Takeover: Key Differences
  • How to Test for NS Takeover Vulnerabilities
  • Best Practices to Prevent NS Takeovers
  • Real-World Context
  • Conclusion
  • References

Was this helpful?

Edit on GitHub
  1. Web-AppSec

DNS Dangling / NS Takeover

PreviousBug Bounty Platforms/ProgramsNextAPI-Sec

Last updated 5 days ago

Was this helpful?

The Domain Name System (DNS) is the internet’s address book, translating domain names into IP addresses. However, vulnerabilities in DNS configurations, particularly Name Server (NS) takeovers, can expose organizations to severe security risks. Unlike other DNS misconfigurations, NS takeovers target the core of a domain’s DNS infrastructure, potentially granting attackers control over all DNS resolutions. This blog post dives into NS takeover vulnerabilities, their differences from subdomain takeovers, and how to test for them responsibly.

What is an NS Takeover Vulnerability?

An NS takeover occurs when an attacker gains control over a domain’s Name Server records, which dictate where DNS queries for a domain are resolved. NS records are critical because they point to the authoritative servers responsible for the domain’s DNS data. If an attacker compromises these records—often by registering an expired or unclaimed nameserver—they can control the entire domain’s DNS resolution, redirecting traffic, intercepting communications, or disrupting services.

According to , NS takeovers are particularly dangerous due to their "blast radius," affecting all subdomains and services under the targeted domain. Common causes include:

  • Expired Nameservers: When a domain’s NS records point to nameservers hosted on expired or unregistered domains.

  • Misconfigured DNS Providers: Vulnerabilities in DNS providers that allow attackers to claim or manipulate nameservers.

  • Improper Delegation: Failure to update NS records after changing DNS providers, leaving old records vulnerable.

The impact of an NS takeover is profound:

  • Full Domain Control: Attackers can redirect all traffic, including subdomains, to malicious servers.

  • Data Interception: Sensitive communications, such as emails or API requests, can be intercepted.

  • Service Disruption: Legitimate services can be replaced with fraudulent ones, eroding user trust.

NS Takeover vs. Subdomain Takeover: Key Differences

While NS takeover is a type of DNS takeover, it differs significantly from subdomain takeover in scope and impact.

Subdomain Takeover

Subdomain takeover targets individual subdomains (e.g., blog.example.com) due to misconfigured records, often involving CNAMEs pointing to unclaimed resources. For example, a subdomain linked to a decommissioned cloud service can be claimed by an attacker. As noted by , subdomain takeovers are limited to specific subdomains and don’t affect the entire domain.

NS Takeover

How to Test for NS Takeover Vulnerabilities

Testing for NS takeover vulnerabilities requires a focused approach to identify misconfigured or vulnerable NS records. Below are practical steps and tools to detect these issues responsibly. Important: Always obtain explicit permission before testing, as unauthorized attempts are illegal and unethical.

1. Identify Vulnerable NS Records

Check if NS records point to expired or unclaimed domains. Use tools like dig or whois to query NS records and verify the status of the referenced nameservers. For example:

dig ns example.com

2. Verify DNS Provider Security

Provider
Status
Fingerprint
Takeover Instructions

Digital Ocean

Vulnerable

ns1.digitalocean.com

Issue #22

DNSMadeEasy

Vulnerable

ns0.dnsmadeeasy.com

Issue #6

DNSimple

Vulnerable

ns1.dnsimple.com

Issue #16

3. Use Automated Tools

Automated tools can streamline NS takeover detection:

Run these tools against a list of domains to identify potential NS takeover risks efficiently.

4. Manual Verification

Manually verify NS takeovers by attempting to register the expired or unclaimed domain referenced in the NS records. For example, if ns1.exampledns.com is listed as an NS record and exampledns.com is available, registering it could allow control over the target domain’s DNS. Document findings carefully and avoid disrupting services.

5. Monitor NS Delegation

Best Practices to Prevent NS Takeovers

To protect against NS takeover vulnerabilities, organizations should:

  • Monitor NS Records: Regularly verify that NS records point to active, authorized nameservers.

  • Secure Domain Registrations: Ensure nameserver domains are renewed and locked to prevent unauthorized registration.

  • Choose Reputable DNS Providers: Use providers with strong security practices and DNSSEC support.

Real-World Context

Conclusion

Stay proactive, audit your NS records regularly, and leverage the resources below to protect your digital assets.

References

NS takeover, in contrast, affects the entire domain by compromising its authoritative nameservers. According to , an NS takeover grants attackers control over all DNS records, including those for subdomains, making it far more severe. For instance, if example.com’s NS records point to a nameserver on an expired domain, an attacker can register that domain and control all DNS queries for example.com.

highlights that NS takeovers are less common than subdomain takeovers but have a higher impact due to their domain-wide control. Unlike subdomain takeovers, which often exploit specific services, NS takeovers target the DNS infrastructure itself.

This command lists the NS records for example.com. If any point to a domain that is expired or available for registration, it’s a potential vulnerability. suggests looking for SERVFAIL or REFUSED responses, which may indicate nameserver issues.

Some DNS providers are more susceptible to NS takeovers due to weak validation processes. The GitHub repository lists providers and their vulnerability status. Below is a sample of providers with known NS takeover risks (check the repository for updates):

Before reporting, perform a proof of concept (e.g., adding a TXT record via the claimed nameserver) to confirm the vulnerability, as advised by .

Nuclei: Scans for DNS misconfigurations, including NS-related issues, by detecting SERVFAIL or REFUSED responses, as per .

DNSTake: A Python tool () designed for DNS takeover detection, including NS vulnerabilities, offering scalability for large domain sets.

: dnsx is a fast and multi-purpose DNS toolkit allow to run multiple DNS queries of your choice with a list of user-supplied resolvers.

Ensure NS records are correctly delegated to authorized nameservers. Use whois to check the registrar and nameserver status, and cross-reference with the DNS provider’s records. recommends regular audits to prevent unauthorized NS delegations.

Audit DNS Changes: Implement strict processes for updating NS records, especially during provider migrations, as suggested by .

NS takeovers remain a critical threat. An X post by highlighted a critical bug in the Ethereum Name Service (ENS) that allowed DNSSEC-based NS takeovers, demonstrating their relevance in modern systems. Similarly, notes that while NS takeovers are rare, their impact is devastating, making proactive testing essential.

NS takeover vulnerabilities are a high-stakes risk, granting attackers control over a domain’s entire DNS infrastructure. By understanding their differences from subdomain takeovers and employing rigorous testing methods—using tools like dig, nuclei, and —security professionals can mitigate these threats. Always test responsibly with explicit permission, and adopt best practices to safeguard your DNS environment.

🕸️
Trickest
Valimail
ProjectDiscovery
SecurityTrails
Trickest
can-i-take-over-dns
can-i-take-over-dns
Trickest
GitHub
dnsX
OWASP
MDN
@tinchoabbate
SecurityTrails
can-i-take-over-dns
DNS Takeover Explained: Protect Your Online Domain
A Guide to DNS Takeovers: The Misunderstood Cousin of Subdomain Takeovers
SecurityTrails: Blast Radius DNS Takeovers
GitHub: can-i-take-over-dns
DNSTake: Python Implementation for DNS Takeovers
Subdomain Takeovers - Security on the Web
OWASP: Test for Subdomain Takeover
X Post: Critical Bug on ENS