🕵️
VeryLazyTech
📜 Medium🛒 My Shop👾 Github📩 Telegram 📺 YouTube✖ Twitter
  • 🕵️Welcome!
    • VeryLazyTech
    • Support VeryLazyTech
      • 👾 GitHub
      • 📜 Medium
      • ☕ My Shop
      • 📺 YouTube
      • ✖ Twitter
      • 📩 Telegram
  • 🛡️ Vulnerabilities and Exploits
    • CVE - POC
      • Unauthenticated RCE Flaw in Rejetto HTTP File Server - CVE-2024-23692
      • POC - CVE-2024–4956 - Nexus Repository Manager 3 Unauthenticated Path Traversal
      • POC - CVE-2024-45241: Path Traversal in CentralSquare's CryWolf
      • Telerik Auth Bypass CVE-2024-4358
      • Check Point Security Gateways Information Disclosure - CVE-2024-24919
      • CVE-2024-23897 - Jenkins File Read Vulnerability
      • CVE-2024–10914- Command Injection Vulnerability in name parameter for D-Link NAS
      • POC - CVE-2024-21534 Jsonpath-plus vulnerable to Remote Code Execution (RCE)
      • CVE-2024-9935 - PDF Generator Addon for Elementor Page Builder <= 1.7.5 - Unauthenticated Arbitrary
      • CVE-2024-50623- Cleo Unrestricted file upload and download
      • POC - WordPress File Upload plugin, in the wfu_file_downloader.php file before version <= 4.24.11
      • POC - Remote and unauthenticated attacker can send crafted HTTP requests to RCE - cve-2025-3248
      • POC - CVE-2025–2539 File Away <= 3.9.9.0.1 - Missing Authorization to Unauthenticated Arbitrary File
      • POC - CVE-2025-29306 FOXCMS /images/index.html Code Execution Vulnerability
  • 🕵️‍♂️Dorks
    • GitHub Dorks
    • Google Dork Online Tool
  • 📚 Resources
    • Top Hacking Books for 2024: FREE and Paid
    • How to Study for OSCP with the PWK Book PDF
    • Top 20 phishing tools to use in 2024
    • Top 8 Bug Bounty Books for 2025: Must-Reads for Ethical Hackers
    • Top Hacking Tools and Skills You Need to Learn in 2025
    • Offensive Cloud
    • Penetration Testing & Hacking Tools List
    • Top Cybersecurity Books by Topic
  • The Ultimate Penetration Testing Methodology (2025 Edition)
  • 🕸️Pentesting Web
    • Client Side Template Injection (CSTI)
    • Identify a Server’s Origin IP
    • 2FA/MFA/OTP Bypass
  • IDOR
  • Open Redirect
  • Subdomain Takeover
  • Penetration Testing WiFi Networks
  • Client-Side Path Traversal
  • Clickjacking
  • Command Injection
  • JWT Vulnerabilities
  • Bypass rating limit
  • CORS - Misconfigurations & Bypass
  • LDAP Injection
  • File upload vulnerabilities
  • Content Security Policy (CSP) bypass
  • 🐧Linux
    • Practical Linux Commands
    • Bypassing Bash Restrictions - Rbash
    • Privilege escalation - Linux
  • Linux Environment Variables
  • 🪟Windows
    • Active Directory Methodology
  • 🌐Network Pentesting
    • FTP - Port 21
    • SSH- Port 22
    • Telnet - Port 23
    • SMTP/s - Port 25,465,587
    • WHOIS - Port 43
    • TACACS+ - Port 49
    • DNS - Port 53
    • TFTP/Bittorrent-tracker - Port 69/UDP
    • Finger - Port 79
    • Web - Port 80,443
    • Kerberos - Port 88
    • POP - Port 110/995
    • Portmapper - Port 111/TCP/UDP
    • Ident - Port 113
    • NTP - Port 123/UDP
    • MSRPC - Port 135, 539
    • NetBios - Port 137,138,139
    • SMB - Port 139 445
    • IMAP - Port 143, 993
    • SNMP - Ports 161, 162, 10161, and 10162/UDP
    • IRC - Ports 194,6667,6660-7000
    • Check Point Firewall - Port 264
    • LDAP - Ports 389, 636, 3268, 3269
    • IPsec/IKE VPN - Port 500/UDP
    • Modbus - Port 502
    • Rexec - Port 512
    • Rlogin - Port 513
    • Rsh - Port 514
    • Line Printer Daemon (LPD) - Port 515
    • Apple Filing Protocol (AFP) - PORT 548
    • RTSP - Port 554, 8554
    • IPMI - Port 623/UDP/TCP
    • Internet Printing Protocol (IPP) - Port 631
    • EPP - Port 700
    • Rsync - Port 873
    • Rusersd Service - Port 1026
    • Socks - Port 1080
    • Java RMI - RMI-IIOP - Port 1098/1099/1050
    • MSSQL (Microsoft SQL Server) - Port 1433
    • Oracle TNS Listener - Port 1521,1522-1529
  • PPTP - Port 1723
  • MQTT (Message Queuing Telemetry Transport) - Port 1883
  • Compaq HP Insight Manager - Port 2301, 2381
  • NFS Service - Port 2049
  • Docker - Port 2375,2376
  • Squid - Port 3128
  • iScsi - Port 3260
  • SAPRouter - Port 3299
  • 😎Post-exploitation
    • File Transfer Cheatsheet: Windows and Linux
  • 🧑‍🔧Technical guides
    • Kali Linux - Installation
Powered by GitBook
On this page
  • What is Subdomain Takeover?
  • Why is it Dangerous?
  • Step-by-Step Guide to Subdomain Takeover
  • Enumerating Subdomains
  • Identifying Vulnerable Subdomains
  • Exploiting the Vulnerability
  • Common Services Vulnerable to Subdomain Takeover

Was this helpful?

Subdomain Takeover

PreviousOpen RedirectNextPenetration Testing WiFi Networks

Last updated 2 months ago

Was this helpful?

  • Become VeryLazyTech ! 🎁

  • Follow us on:

    • ✖ Twitter .

    • 👾 Github .

    • 📜 Medium .

    • 📺 YouTube .

    • 📩 Telegram .

    • 🕵️‍♂️ My Site .

  • Visit our for e-books and courses. 📚

Subdomain takeovers are a critical vulnerability that allows attackers to seize control of a subdomain by exploiting misconfigurations in DNS settings. These attacks can lead to phishing, data leaks, and malicious redirection, and they are highly valuable for both penetration testers and bug bounty hunters. This guide will walk you through every step of identifying and exploiting subdomain takeovers using practical techniques, diverse tools, and real-world examples.


What is Subdomain Takeover?

Subdomain takeover happens when a subdomain points to an external service (like GitHub Pages, AWS S3, Heroku, etc.), but the service is not properly configured. The DNS record remains in place, but the resource it points to is no longer active or owned, leaving the subdomain vulnerable to exploitation.

Why is it Dangerous?

  1. Phishing Attacks: Attackers can impersonate the domain to trick users into providing sensitive information.

  2. Defacement: Attackers can host malicious content on the subdomain, impacting the organization’s reputation.

  3. Hijacking Subdomain Trust: Since the subdomain is part of a trusted domain, it may bypass security filters or add credibility to attacks.


Step-by-Step Guide to Subdomain Takeover

Enumerating Subdomains

The first step in exploiting subdomain takeovers is identifying which subdomains are in use by the target. Subdomain enumeration helps you discover a list of subdomains that may be vulnerable.

Tools and Commands:

  • Subfinder:

subfinder -d target.com -o subdomains.txt

Subfinder is an excellent tool for passive subdomain enumeration that pulls data from public sources.

  • Amass:

amass enum -d target.com -o subdomains_amass.txt

Amass performs both passive and active enumeration, giving a comprehensive list of subdomains.

Subfinder and Amass are useful for quickly gathering subdomains that may be pointing to third-party services. These tools provide a good starting point for vulnerability assessment.

Identifying Vulnerable Subdomains

Once you’ve collected subdomains, the next step is checking whether any subdomains are vulnerable to takeover. The subdomains that are candidates for takeover often point to cloud services like AWS, GitHub Pages, or Heroku, where the resource has been deleted or not claimed.

Tools and Commands:

  • HTTP Probing (httprobe):

cat subdomains.txt | httprobe > live_subdomains.txt

This will filter out only the subdomains that are alive by checking if they return a valid HTTP response.

  • Check for CNAME Records (dig):

dig CNAME subdomain.target.com

CNAME records can help identify if a subdomain points to a third-party service like GitHub, AWS, or Heroku.

If you see that a CNAME record exists for a service like github.io, but the resource doesn’t return any valid content (e.g., a 404 or default error message), the subdomain could be vulnerable.

Exploiting the Vulnerability

Once a vulnerable subdomain is identified, the next step is claiming the resource and exploiting the takeover.

Common Services Prone to Subdomain Takeover:

GitHub Pages: If a subdomain is pointing to GitHub Pages (username.github.io) but no repository exists, you can create a repository and claim the subdomain.

git init 
git remote add origin https://github.com/username/target-repo.git echo "Subdomain takeover!" > index.html 
git add . 
git commit -m "Initial commit" 
git push origin master

AWS S3 Buckets: If a subdomain points to an S3 bucket (bucket-name.s3.amazonaws.com) but the bucket is unclaimed, you can create a bucket with the same name.

aws s3 mb s3://bucket-name 
aws s3 cp takeover.html s3://bucket-name --acl public-read

Heroku: If a subdomain points to Heroku (herokuapp.com) and the app is deleted, you can create an app with the same name.

heroku create app-name 
git push heroku master

The process of taking over these services involves reclaiming the abandoned resources and linking them to your content, effectively gaining control over the subdomain.

Automating the Detection (Subjack and Nuclei)

To streamline the process of finding and exploiting subdomain takeovers, automation tools like Subjack and Nuclei are highly effective.

subjack -w subdomains.txt -t 100 -ssl -o takeovers.txt

Subjack automates the detection of vulnerable subdomains by checking for misconfigurations in popular cloud services.

nuclei -l live_subdomains.txt -t takeover-templates/ -o takeovers_report.txt

Nuclei is a vulnerability scanning tool that can be used with specific templates for subdomain takeovers.

Using these tools speeds up the process by automatically identifying potential takeovers without the need for manual probing. This allows for larger-scale testing, especially useful in bug bounty programs.


Common Services Vulnerable to Subdomain Takeover

  • GitHub Pages (username.github.io)

  • AWS S3 (bucket-name.s3.amazonaws.com)

  • Heroku (herokuapp.com)

  • Shopify (shops.myshopify.com)

  • Azure Blob Storage (accountname.blob.core.windows.net)

Each of these services, when misconfigured or abandoned, leaves a subdomain exposed to takeover. By knowing how to check for specific services, you can more efficiently discover and exploit these vulnerabilities.

:

:

Subjack
Nuclei
member
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
shop