Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      June 5, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 5, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 5, 2025

      In MCP era API discoverability is now more important than ever

      June 5, 2025

      Google’s DeepMind CEO lists 2 AGI existential risks to society keeping him up at night — but claims “today’s AI systems” don’t warrant a pause on development

      June 5, 2025

      Anthropic researchers say next-generation AI models will reduce humans to “meat robots” in a spectrum of crazy futures

      June 5, 2025

      Xbox just quietly added two of the best RPGs of all time to Game Pass

      June 5, 2025

      7 reasons The Division 2 is a game you should be playing in 2025

      June 5, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Mastering TypeScript: How Complex Should Your Types Be?

      June 5, 2025
      Recent

      Mastering TypeScript: How Complex Should Your Types Be?

      June 5, 2025

      IDMC – CDI Best Practices

      June 5, 2025

      PWC-IDMC Migration Gaps

      June 5, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Google’s DeepMind CEO lists 2 AGI existential risks to society keeping him up at night — but claims “today’s AI systems” don’t warrant a pause on development

      June 5, 2025
      Recent

      Google’s DeepMind CEO lists 2 AGI existential risks to society keeping him up at night — but claims “today’s AI systems” don’t warrant a pause on development

      June 5, 2025

      Anthropic researchers say next-generation AI models will reduce humans to “meat robots” in a spectrum of crazy futures

      June 5, 2025

      Xbox just quietly added two of the best RPGs of all time to Game Pass

      June 5, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»How to Discover Hidden Subdomains as an Ethical Hacker

    How to Discover Hidden Subdomains as an Ethical Hacker

    January 7, 2025

    Subdomains are an essential part of a website’s infrastructure. They provide additional functions in a web application, such as APIs, admin portals, and staging environments.

    As an ethical hacker, discovering subdomains is a critical step in learning the attack surface of a target. Subdomains might not be protected well, unlike the main domain. So they can be a great entry point for security auditing or bug bounty programs.

    In this article, I’ll walk you through how to find subdomains using multiple methods. We will use tesla.com as our example in subdomain research.

    Note: tesla.com is part of bug bounty programs, so we have permission to scan it for subdomains. If you are doing this in another web application, make sure you have permission.

    Crt.sh

    One of the easiest ways to start is by checking Certificate Transparency (CT) logs using crt.sh. This website records every SSL/TLS certificate issued for a domain, including subdomains.

    To search for Tesla’s subdomains, visit crt.sh and enter %.tesla.com as the query. The % acts as a wildcard to match any subdomains.

    Let’s look at the results:

    tesla.com subdomain research - results of running tesla.com through crt.sh

    We can see a lot of interesting subdomains listed in the results. These subdomains may belong to different parts of Tesla’s infrastructure.

    For example, shop.tesla.com is likely for their online store, while api.tesla.com could host application programming interfaces.

    Using crt.sh is passive, meaning it doesn’t interact with the target, making it both safe and stealthy.

    Note that crt.sh will only display subdomains that have valid certificates. If a subdomain uses self-signed certificates or doesn’t use SSL/TLS at all, it may not appear in these logs. Despite this limitation, crt.sh remains a quick and efficient starting point for subdomain enumeration.

    Sublist3r

    Sublist3r is an open-source tool to automate finding subdomains. It’s helpful in both security assessments and general reconnaissance.

    By using multiple search engines (like Google, Bing, Yahoo, and more) Sublist3r finds subdomains that might otherwise remain hidden.

    Sublist3r’s command-line interface is simple to use — you give it a domain, and Sublist3r goes to work.

    Thanks to its open-source nature, it’s actively maintained and improved by the security community.

    Sublist3r is not pre-installed on Kali, so lets go ahead and install it. First, clone the repository and install the requirements:

    git clone https://github.com/aboul3la/Sublist3r.git
    cd Sublist3r
    sudo pip install -r requirements.txt
    

    Now we are ready to use the sublist3r tool. Here is the syntax to use sublist3r:

    python sublist3r.py -d tesla.com
    

    After a few minutes, Sublist3r will return a list of discovered subdomains. The -d flag tells sublist3r that the domain to use is tesla.com

    sublist3r response

    You can see that sublist3r has found more than 300 subdomains of tesla.com. Sublist3r is an excellent way to jump-start the recon process, especially if you want to automate the collection of subdomains without installing numerous separate tools.

    Note that Sublist3r relies on the APIs of these search engines and other data sources. So it can sometimes miss subdomains that haven’t been crawled or indexed.

    Google Dorking

    Google dorking (sometimes called “Google hacking”) refers to the practice of using special search queries on Google. These operators help to find hidden information, sensitive data, or other resources that would otherwise be hard to locate.

    Common operators include site:, inurl:, filetype:, and intitle:, among many others. Let’s start with the site: operator:

    site:*.tesla.com
    

    This query searches for any subdomain of tesla.com. Here are some search results.

    tesla.com google dork

    To dig deeper, try combining site: with other operators. For example, we can use the inurl operator with the keyword ‘admin’ to find URLs containing the word admin.

    site:*.tesla.com inurl:admi
    

    02c44cdd-1bc3-4c8c-822a-16f883b6c166

    By using these operators (known as Google dorks), you can filter search results to find specific file types, directories, or even private information that may be unintentionally exposed on the internet.

    Dorking can produce a lot of data, so you may need to carefully filter your searches to avoid getting flooded with irrelevant information.

    Here is a full tutorial on Google dorking.

    Fuzzing with GoBuster

    Now what if the subdomains of a target are not listed anywhere on the internet? We fuzz for it.

    Fuzzing is simply brute-forcing potential subdomain names by trying combinations from a wordlist. A wordlist is a list of words that we will use along with the fuzzing tool to see if a subdomain exists.

    A subdomain wordlist can contain words like:

    ftp
    root
    admin
    portal
    api
    

    Tools like Gobuster and Ffuf can use a wordlist to check whether these subdomains exist. Here is a sample subdomain wordlist.

    How Gobuster Works

    Gobuster is a fast brute-force tool for discovering hidden URLs, files, and directories within websites.

    Ffuf is a wonderful web fuzzer, but Gobuster is a faster and more flexible alternative. Gobuster has support for extensions with which we can increase its capabilities.

    Gobuster also can scale using multiple threads and perform parallel scans to speed up results.

    Gobuster comes pre-installed in Kali Linux. Let’s run the following command to look for subdomains. You can find the word list under /usr/share/wordlists/SecLists in Kali Linux.

    gobuster dns -d tesla.com -w /usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-110000.txt
    

    The above command checks each word in the wordlist to see if it resolves to a valid subdomain. Here’s a sample output:

    46b3d437-9918-416c-a510-f647e9ac303e

    Gobuster’s results show valid subdomains, including some that might not appear in public databases, like staging.tesla.com or dev.tesla.com.

    Fuzzing should be combined with other methods since the results are only as good as the wordlist. For example, prod-version-2.tesla.com can be a subdomain which may not be a part of the wordlist.

    Other Methods for Subdomain Discovery

    DNS Zone Transfers

    While rare, misconfigured DNS servers can allow zone transfers, revealing all subdomains at once. You can test this using dig:

    dig axfr @ns1.tesla.com tesla.com
    

    If the server is properly secured, it won’t allow a zone transfer. But if it’s misconfigured, you might uncover every subdomain Tesla uses.

    Online Tools

    Websites like SecurityTrails, Shodan, and Censys aggregate subdomain data. These tools provide a centralized view of publicly available information.

    Inspecting JavaScript Files

    Subdomains often appear in a website’s JavaScript files. By examining Tesla’s website, you might find references to API endpoints or other subdomains.

    Post-Subdomain Discovery

    Once you have a list of subdomains, we can probe them further. We may discover sign-in portals, development pages, or API endpoints.

    Ethical hackers typically use port scanning and service enumeration tools like Nmap and Nikto to find the open ports and running services on each subdomain. Identifying outdated software, insecure protocols, or default credentials is often the next critical step, as these are common weak points in any environment.

    Subdomains often show us the broader infrastructure of the website if they are left unprotected.

    Conclusion

    Subdomain discovery is a critical skill for ethical hackers. It helps us understand the complete picture of a web application. The more we know, the better entry points we have to gain access.

    Before using these techniques, always ensure you have proper authorization. Subdomain discovery helps with security audits by uncovering hidden assets and helping organizations protect themselves from potential threats.

    For more practical tutorials on cybersecurity, join our weekly newsletter. If you want to practice these subdomain discovery techniques through a hands-on lab, join us at the Hacker’s Hub.

    Source: freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleTwo OTC continuous glucose monitors won awards at CES – and you can try them now
    Next Article How to Help Someone with Their Code Using the Socratic Method

    Related Posts

    Security

    High-Severity Flaw in MIM Medical Imaging Software Allows Code Execution!

    June 5, 2025
    Security

    Amazon Alerts: High-Severity FreeRTOS-Plus-TCP Flaw Needs Immediate Patch!

    June 5, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    Advancing Vision-Language Reward Models: Challenges, Benchmarks, and the Role of Process-Supervised Learning

    Machine Learning

    CVE-2024-51099 – PHPGURUKUL Medical Card Generation System Reflected XSS

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-40579 – Siemens SCALANCE LPE9403 Stack-Based Buffer Overflow Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    How to Build a Simple Portfolio Website With HTML and CSS

    Development

    Highlights

    IT Staff Augmentation Trends in 2025- Build Agile Teams

    May 8, 2025

    Post Content Source: Read More 

    Three Judges, Five Minutes, Global Potential: Highlights from Our Demo Jam Events

    November 12, 2024

    Comprehensive guide for web and ADA compliance in shopify website

    June 25, 2024

    Iranian State Hackers Act as Access Brokers for Ransomware Gangs, Target U.S. and Allies’ Critical Infrastructure

    August 29, 2024
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.