Subdomain Takeover Detection One-Liners | 7HacX

Listen to this Post

Subdomain takeover is a critical security issue where an attacker can claim a subdomain that is no longer in use but still points to a vulnerable third-party service. Detecting such vulnerabilities early can prevent potential exploitation.

Command Breakdown

The following one-liner helps detect subdomain takeovers efficiently:

subfinder -d hackerone.com -silent | dnsprobe -silent -f domain | httprobe -prefer-https | nuclei -t nuclei-templates/subdomain-takeover/detect-all-takeovers.yaml

#### **Explanation of Tools & Steps:**

1. **`subfinder`** – Discovers subdomains of `hackerone.com`.

subfinder -d hackerone.com -silent 
  1. dnsprobe – Resolves the discovered subdomains to check their DNS records.
    dnsprobe -silent -f domain 
    

  2. httprobe – Checks which subdomains are live via HTTP/HTTPS.

    httprobe -prefer-https 
    

  3. nuclei – Scans for subdomain takeover vulnerabilities using predefined templates.

    nuclei -t nuclei-templates/subdomain-takeover/detect-all-takeovers.yaml 
    

### **You Should Know:**

#### **Manual Verification Steps**

If you suspect a subdomain takeover, manually verify by:
– Checking DNS records:

dig CNAME suspicious.example.com 

– If it points to a deleted cloud service (e.g., AWS S3, GitHub Pages), you may claim it.

#### **Preventive Measures**