Skip to content
-
Learn Cybersecurity & Ethical Hacking in Nepal with CyberSamir — Start Learning →
Cyber Samir Cyber Samir Cyber Samir

Learn Cybersecurity, Ethical Hacking & Bug Bounty in Nepal

Cyber Samir Cyber Samir Cyber Samir

Learn Cybersecurity, Ethical Hacking & Bug Bounty in Nepal

  • Home
  • About Us
  • Blogs
    • Ethical Hacking
    • Cybersecurity
    • Penetration testing
  • Tools
    • Phishing email Detector tool
    • Website Security Checker Tool
    • Age|Face Shape|Expression Guess
    • Text Cleaner Tool
    • Image Converter & Resizer Tool (Free Online)
  • Contact Us
  • Home
  • About Us
  • Blogs
    • Ethical Hacking
    • Cybersecurity
    • Penetration testing
  • Tools
    • Phishing email Detector tool
    • Website Security Checker Tool
    • Age|Face Shape|Expression Guess
    • Text Cleaner Tool
    • Image Converter & Resizer Tool (Free Online)
  • Contact Us
Close

Search

Subscribe
  • Facebook
  • Telegram
  • Instagram
  • Youtube
  • Linkedin
  • Whasapp
Cyber Samir Cyber Samir Cyber Samir

Learn Cybersecurity, Ethical Hacking & Bug Bounty in Nepal

Cyber Samir Cyber Samir Cyber Samir

Learn Cybersecurity, Ethical Hacking & Bug Bounty in Nepal

  • Home
  • About Us
  • Blogs
    • Ethical Hacking
    • Cybersecurity
    • Penetration testing
  • Tools
    • Phishing email Detector tool
    • Website Security Checker Tool
    • Age|Face Shape|Expression Guess
    • Text Cleaner Tool
    • Image Converter & Resizer Tool (Free Online)
  • Contact Us
  • Home
  • About Us
  • Blogs
    • Ethical Hacking
    • Cybersecurity
    • Penetration testing
  • Tools
    • Phishing email Detector tool
    • Website Security Checker Tool
    • Age|Face Shape|Expression Guess
    • Text Cleaner Tool
    • Image Converter & Resizer Tool (Free Online)
  • Contact Us
Close

Search

Subscribe
  • Facebook
  • Telegram
  • Instagram
  • Youtube
  • Linkedin
  • Whasapp
Penetration testing

Subdomain Takeover Vulnerability

By cybersamir
May 24, 2025 3 Min Read
Comments Off on Subdomain Takeover Vulnerability

Subdomain Takeover: The Hidden DNS Threat

Understanding and preventing one of the most overlooked web vulnerabilities

⚠️ Legal Notice: Only test domains you own or have permission to test. Unauthorized subdomain takeover attempts are illegal.

What is Subdomain Takeover?

Subdomain takeover occurs when an attacker gains control over a subdomain of a target domain by exploiting dangling DNS records. This happens when:

  • A subdomain points to a third-party service (e.g., AWS S3, GitHub Pages)
  • The service is discontinued or deleted
  • The DNS record isn’t removed
  • An attacker claims the service endpoint
1
Company sets up blog.example.com
Points to AWS S3 bucket: blog.example.com.s3-website-us-east-1.amazonaws.com
2
S3 bucket is deleted
But DNS record for blog.example.com remains
3
Attacker discovers vulnerability
Creates AWS S3 bucket with same name
4
Complete takeover
blog.example.com now serves attacker’s content

Why Subdomain Takeovers Are Dangerous

1. Phishing Attacks

Attackers can host phishing pages on legitimate subdomains:

https://login.example.com/  ← Looks legitimate to users

2. Cookie Stealing

Subdomains often share cookies with the root domain:

Set-Cookie: session=abc123; Domain=.example.com; Secure; HttpOnly

3. Service Hijacking

APIs and webhooks configured to use subdomains can be compromised:

POST https://api.example.com/webhook
Content-Type: application/json

{"malicious": "payload"}

Common Vulnerable Services

Service Indicator Risk Level
AWS S3 NoSuchBucket error High
GitHub Pages There isn’t a GitHub Pages site here High
Heroku No such app High
Shopify Sorry, this shop is currently unavailable Medium
Azure 404 The specified blob does not exist High

How to Find Vulnerable Subdomains

1. Subdomain Enumeration

Discover all subdomains associated with a domain:

# Using subfinder
subfinder -d example.com -o subdomains.txt

# Using amass
amass enum -d example.com -o subdomains.txt

2. Check DNS Records

Identify CNAME records pointing to third-party services:

dig CNAME blog.example.com

;; ANSWER SECTION:
blog.example.com. 300 IN CNAME example.s3-website-us-east-1.amazonaws.com.

3. Verify Service Availability

Check if the service endpoint is unclaimed:

curl -v http://blog.example.com
< HTTP/1.1 404 Not Found
< x-amz-error-code: NoSuchBucket

Testing for Subdomain Takeover

Important: Only test subdomains you own or have explicit permission to test.

1. Manual Testing Steps

  1. Find subdomain with CNAME to third-party service
  2. Visit the subdomain and note error messages
  3. Research if the service allows claiming those endpoints
  4. Attempt to claim the service (if authorized)

2. Automated Tools

# Using subjack
subjack -w subdomains.txt -t 100 -o results.json

# Using nuclei
nuclei -t takeovers/ -l subdomains.txt -o results.txt

Popular Services and Their Vulnerabilities

AWS S3 Buckets

If you see a NoSuchBucket error, the bucket may be available for takeover:

# Check bucket availability
aws s3 ls s3://blog.example.com

# If available, create bucket with same name
aws s3 mb s3://blog.example.com

GitHub Pages

GitHub Pages shows specific error when no repository is configured:

# Check if GitHub Pages is available
curl -v http://docs.example.com

# If vulnerable, create repo with GitHub Pages enabled
# Repository name must match: docs.example.com

Prevention and Mitigation

1. DNS Record Management

  • Regularly audit DNS records
  • Remove unused CNAME records immediately
  • Use TXT records to document subdomain purposes

2. Monitoring

  • Set up alerts for DNS changes
  • Monitor SSL certificates for unexpected issuers
  • Use services like HackerOne’s Domain Monitor

3. Service Configuration

  • Reserve all possible subdomains with providers
  • Use wildcard certificates carefully
  • Implement DMARC, DKIM, and SPF to prevent email spoofing
Pro Tip: For critical subdomains, use A records instead of CNAMEs when possible to prevent takeover risks.

Real-World Examples

Case 1: Microsoft Azure Takeover

Researchers found hundreds of vulnerable *.azurewebsites.net subdomains belonging to major corporations.

Case 2: Shopify Takeover

An attacker took over a Shopify subdomain and used it to steal customer credentials.

Case 3: AWS S3 Bucket Compromise

A financial institution’s abandoned S3 bucket was claimed by attackers to host malware.

Conclusion

Subdomain takeover remains a significant threat because it’s often overlooked in security assessments. The impact can be severe, ranging from phishing to data theft. Prevention requires ongoing DNS hygiene and monitoring.

Remember: Regular subdomain audits should be part of your organization’s security program.

Further Resources

  • Can I Take Over XYZ? – Service list
  • OWASP Testing Guide

Tags:

bug bountycloud service takeoverdangling DNS recordsDNS misconfigurationdomain securitysubdomain hijackingsubdomain takeoversubdomain takeover vulnerabilitywebsite security
Author

cybersamir

Follow Me
Other Articles
Previous

Google Stitch AI UI Design Tool: Revolutionizing Frontend Development

social engineering scams warning illustration Nepal cybersecurity awareness cybersamir.com
Next

Social Engineering Scams You’re Probably Falling For

Your ad here

300 x 250 banner slot

Reach Nepali students, developers, and security learners reading about ethical hacking, CTFs, and cyber news.

Book on WhatsApp Or send an email

Sponsors: VPNs, courses, hosting, security tools

Recent Posts

  • How to Recover Money from Online Scam Nepal: 2026 Guide
  • How to Check If Your Data Was Leaked (Nepal 2026 Guide)
  • Is PHP Dead? A 2026 Reckoning
  • Nepal Cyber Shield CTF: Top 10 Teams Qualified for the Grand Finale
  • How to Report Cybercrime in Nepal: Step-by-Step Guide (2026)

Nepal Cyber Shield 2026

Been scammed or hacked?

Act fast: save screenshots, don't delete chats, and report it.

  • 100 Nepal Police emergency line
  • +9779851286770 Nepal Police Cyber Bureau
Report here (Nepal Police) Read the step-by-step reporting guide

Money lost? Call your bank first so they can try to freeze the transfer.

Categories

  • Awareness
  • Blog
  • Career & Learning
  • Cybersecurity
  • Ethical Hacking
  • Nepal Tech & Digital Safety
  • News
  • Penetration testing
  • Tools & Reviews

Latest security alerts

  • 3 Winning Moves to Grow MSSP Profits and Keep SOC Costs Under Control
  • ARTEX AI Hacking Tool Used by Cybercriminals Can Be Hacked by Its Own Targets
  • New Protopterus Windows Spyware Found Targeting Families of Azerbaijani Political Prisoners
  • USB2Shell Linux Kernel Flaw Lets Malicious USB Devices Gain Root Access Without Login
  • Hackers Breach Canada's Military Export Permit System in Suspected AI-Assisted Attack
  • PHP Vulnerability And Global Cybersecurity - The Rising Nepal
  • Nepal's digital vulnerability goes beyond PHP - myRepublica
  • SEBON introduces IT policy to strengthen cybersecurity in Nepal’s capital market - OnlineKhabar English News
  • From heartbleed to PHP2Shell: Is Nepal ready for the next cyber crisis? - The Annapurna Express
  • SEBON steps up effort to prevent cyber attacks in stock exchange platform - myRepublica

You May Have Missed

how to recover money from online scam Nepal
Awareness

How to Recover Money from Online Scam Nepal: 2026 Guide

cybersamir
By cybersamir
November 28, 2026
data leak check nepal
Awareness

How to Check If Your Data Was Leaked (Nepal 2026 Guide)

cybersamir
By cybersamir
November 26, 2026
Cinematic PHP programming thumbnail with the headline “Is PHP Dead? 2026 Reckoning,” a glowing blue PHP elephant, and CyberSamir branding.
Awareness

Is PHP Dead? A 2026 Reckoning

cybersamir
By cybersamir
October 25, 2026
ctf top 10 selected teams
News

Nepal Cyber Shield CTF: Top 10 Teams Qualified for the Grand Finale

cybersamir
By cybersamir
October 4, 2026
How to report cybercrime in Nepal Cyber Bureau complaint guide
Awareness

How to Report Cybercrime in Nepal: Step-by-Step Guide (2026)

cybersamir
By cybersamir
September 27, 2026
Nepal Data Breach: 462,600 Citizens' IDs Allegedly Leaked," subtext "Dark web forum post claims mass PII theft from a .gov.np portal
News

Nepal Government Portal Allegedly Breached: 462,600 Citizens’ Data Reportedly Listed for Sale on Dark Web

cybersamir
By cybersamir
September 24, 2026
Cybersecurity

Top 10 Security Mistakes Nepali Websites Still Make in 2026

cybersamir
By cybersamir
September 23, 2026
News Cybersecurity

Nepal Data Hub Ransomware Attack: NEPSE Shutdown Explained

cybersamir
By cybersamir
September 23, 2026
News

Nepal Cyber Shield 2026: Everything You Need to Know About Nepal’s National CTF Championship

cybersamir
By cybersamir
September 19, 2026
CS

CYBERSAMIR

Explore. Hack. Secure. Learn.

About Us

CyberSamir provides cutting-edge insights into ethical hacking, penetration testing, and cybersecurity defense strategies for professionals and enthusiasts alike.

500+ Articles
15K+ Members
30+ Tools

Resources

  • Tutorials
  • Our Services
  • Tools
  • CTF Walkthroughs
  • Security News

Community

  • WhatsApp Group
  • Discord Server
  • Telegram Group
  • Upcoming Events
  • Certifications

Follow Us

Cyber Security Events Worldwide

© CyberSamir. All Rights Reserved.

Copyright 2026 — Cyber Samir. All rights reserved. Blogsy WordPress Theme