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 4, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 4, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 4, 2025

      Smashing Animations Part 4: Optimising SVGs

      June 4, 2025

      I test AI tools for a living. Here are 3 image generators I actually use and how

      June 4, 2025

      The world’s smallest 65W USB-C charger is my latest travel essential

      June 4, 2025

      This Spotlight alternative for Mac is my secret weapon for AI-powered search

      June 4, 2025

      Tech prophet Mary Meeker just dropped a massive report on AI trends – here’s your TL;DR

      June 4, 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

      Beyond AEM: How Adobe Sensei Powers the Full Enterprise Experience

      June 4, 2025
      Recent

      Beyond AEM: How Adobe Sensei Powers the Full Enterprise Experience

      June 4, 2025

      Simplify Negative Relation Queries with Laravel’s whereDoesntHaveRelation Methods

      June 4, 2025

      Cast Model Properties to a Uri Instance in 12.17

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

      My Favorite Obsidian Plugins and Their Hidden Settings

      June 4, 2025
      Recent

      My Favorite Obsidian Plugins and Their Hidden Settings

      June 4, 2025

      Rilasciata /e/OS 3.0: Nuova Vita per Android Senza Google, Più Privacy e Controllo per l’Utente

      June 4, 2025

      Rilasciata Oracle Linux 9.6: Scopri le Novità e i Miglioramenti nella Sicurezza e nelle Prestazioni

      June 4, 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 

    Hostinger
    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

    HPE StoreOnce Faces Critical CVE-2025-37093 Vulnerability — Urges Immediate Patch Upgrade

    June 4, 2025
    Security

    Google fixes Chrome zero-day with in-the-wild exploit (CVE-2025-5419)

    June 4, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    Derive generative AI-powered insights from ServiceNow with Amazon Q Business

    Development

    I tested the tri-foldable mini projector that’s got the internet buzzing – here’s my verdict after a week

    News & Updates

    The Future of AngularJS: What to Expect in the Next Few Years

    Web Development

    Amazon’s Starlink challenger set for launch – here’s when you’ll be able to use it

    News & Updates

    Highlights

    Development

    What Are Scripts and How Do They Work? Improve Your Productivity with Scripting

    January 27, 2025

    Developers who have a lot of experience building rigid, quality software tend to automate most…

    Streamline custom model creation and deployment for Amazon Bedrock with Provisioned Throughput using Terraform

    June 4, 2024

    Accelerating MongoDB Migration to Azure with Microsoft Migration Factory

    November 19, 2024

    Rad AI reduces real-time inference latency by 50% using Amazon SageMaker

    November 26, 2024
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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