Listen to this Post

Introduction:
In the ever-evolving landscape of cybersecurity, the reconnaissance phase—often referred to as “recon”—is the cornerstone of any successful penetration test or bug bounty engagement. Attackers and defenders alike understand that the attack surface begins with discovering every possible entry point, and subdomains often represent the most overlooked yet critical vulnerabilities. The challenge lies in the sheer volume of data; manually enumerating subdomains is not only time-consuming but also prone to human error. To address this, security researchers are increasingly turning to automated, passive enumeration pipelines that leverage multiple OSINT sources, recursive discovery, and intelligent validation—transforming what was once a tedious task into a streamlined, data-driven process.
Learning Objectives:
- Understand the architecture and benefits of a passive subdomain enumeration pipeline, including recursive discovery and plugin-based modularity.
- Learn to configure and deploy an automated reconnaissance tool that integrates with over ten third-party APIs for maximum coverage.
- Master the step-by-step process of setting up the environment, managing API keys securely, and executing scans with different performance profiles.
- Gain practical skills in validating, exporting, and resuming enumeration sessions for large-scale, enterprise-level targets.
You Should Know:
- The Core Architecture: Passive Enumeration, Recursive Discovery, and Plugin Systems
This repository introduces a sophisticated pipeline designed for deep, recursive subdomain discovery. Unlike active enumeration techniques that send probes to the target (which can be detected and blocked), this tool relies entirely on passive sources. It aggregates data from public datasets, certificate transparency logs, search engines, and DNS histories to build a comprehensive map of an organization’s digital footprint.
The pipeline is built on a modular plugin architecture, allowing each data source to function as an independent module. This design offers several advantages: it enables parallel processing, simplifies the addition of new sources, and ensures that if one API fails or is rate-limited, the rest of the scan continues uninterrupted. The tool supports deep recursive discovery, meaning it doesn’t stop at the first level of subdomains; it can recursively dig through multiple levels (from level 2 up to level 8) to uncover deeply nested subdomains that are often missed by simpler tools.
Furthermore, the inclusion of resume functionality and caching mechanisms is a game-changer for long-running engagements. If a scan is interrupted, it can be resumed from the last checkpoint without losing progress, saving valuable time and computational resources.
Step-by-Step Guide: Installation and Initial Configuration
Before diving into scans, you must set up the environment correctly. This process is streamlined but requires attention to detail, especially regarding API key management.
Step 1: Clone the Repository and Install Dependencies
Begin by cloning the repository to your local machine. Navigate to the project directory and install the required Python packages.
git clone https://github.com/sazzadul007/Passive-enumeration-by-Sazzad007.git cd Passive-enumeration-by-Sazzad007 pip install -r requirements.txt
Note: On some systems, you may need to use `–break-system-packages` if you encounter externally-managed-environment errors.
Step 2: Create the Local Environment File
The tool uses a `.env` file to store sensitive API credentials. Never hardcode keys in the source code. Copy the example configuration file to create your local environment file.
cp .env.example .env
Step 3: Configure API Credentials
Open the `.env` file with your preferred text editor (e.g., nano .env) and populate the fields with your API keys. The tool supports a wide range of services:
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx SHODAN_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx SECURITYTRAILS_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CHAOS_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CENSYS_API_ID=xxxxxxxxxxxxxxxx CENSYS_API_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx VIRUSTOTAL_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx URLSCAN_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CERTSPOTTER_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx FULLHUNT_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Each API key is optional; if a key is not provided, the corresponding module will be gracefully skipped. This flexibility allows you to start with a minimal setup and gradually integrate more sources.
Step 4: Verify the Configuration
Before running a full scan, verify that your API keys are correctly detected.
python3 run.py --list-plugins
The output will display a list of modules with their status (Yes/No) based on whether the API key is configured and valid.
- Executing Scans: Profiles, Deep Discovery, and Resume Functionality
With the environment configured, you can now execute scans. The tool offers multiple profiles to balance speed and thoroughness, catering to different use cases from quick assessments to deep-dive investigations.
Step-by-Step Guide: Running Your First Scan
Step 1: Choose a Profile
- Balanced Profile: This is the default setting, offering a good mix of speed and coverage. It’s ideal for initial reconnaissance.
python3 run.py -d example.com --profile balanced
-
Thorough Profile: This profile enables deeper recursion (up to level 8) and more aggressive enumeration. It is best suited for comprehensive assessments where time is not a constraint.
python3 run.py -d example.com --profile thorough
Step 2: Leverage Resume for Long Scans
For large targets, scans can take hours or even days. The resume feature ensures you can pick up where you left off.
python3 run.py -d example.com --profile thorough --resume
This command will check for existing checkpoint files and continue the enumeration from the last saved state.
Step 3: Export and Analyze Results
The tool automatically saves results in the `output/` directory. Depending on your configuration, results can be exported in multiple formats (JSON, CSV, etc.) for further analysis or integration with other tools.
3. Security Best Practices and Common Pitfalls
Working with API keys and reconnaissance tools requires a strict security discipline. A single misstep can expose sensitive credentials, leading to account compromise or data breaches.
Step-by-Step Guide: Securing Your Environment
Step 1: Never Commit the `.env` File
The `.env` file contains plaintext API keys and must never be pushed to version control. Ensure it is listed in your `.gitignore` file.
echo ".env" >> .gitignore
Step 2: Use `.env.example` for Distribution
When sharing the project or collaborating with others, always provide the `.env.example` template with empty values. This allows others to set up their environment without exposing your keys.
Step 3: Revoke Exposed Keys Immediately
If you accidentally commit or expose an API key, revoke it immediately through the service provider’s dashboard and generate a new one.
Common Mistake to Avoid:
- ❌ Incorrect: Repository contains `.env` with real keys.
- ✅ Correct: Repository contains `.env.example` (template) and `.env` is local-only (ignored by Git).
4. Plugin Architecture and Extending Functionality
One of the most powerful aspects of this tool is its plugin architecture. Each data source is implemented as a plugin, making it easy to add new sources or modify existing ones.
Understanding the Plugin Structure
Plugins are located in the `subdomain_recon/` directory. Each plugin typically handles authentication, querying the API, and parsing the response. The tool’s core engine dynamically loads these plugins based on the configuration.
Adding a Custom Plugin
To add a new data source:
- Create a new Python file in the `subdomain_recon/` directory.
2. Implement the required interface (e.g., `fetch()` method).
- Update the configuration to include the new API key.
- The tool will automatically detect and load the new plugin on the next run.
This modularity ensures the tool remains future-proof and adaptable to new OSINT sources as they emerge.
5. Integrating with Other Security Tools
Subdomain discovery is rarely an isolated activity; it is typically the first step in a larger workflow. The output from this tool can be seamlessly integrated with other security tools for vulnerability scanning, port scanning, and exploitation.
Example Workflow:
- Passive Enumeration: Run the tool to generate a comprehensive list of subdomains.
python3 run.py -d target.com --profile thorough -o subdomains.json
-
Active Validation: Use tools like `httpx` or `nmap` to check which subdomains are live.
cat subdomains.json | jq -r '.subdomains[]' | httpx -silent -o live_hosts.txt
-
Vulnerability Scanning: Feed the live hosts into a vulnerability scanner like `nuclei` or
nikto.nuclei -l live_hosts.txt -t cves/
This pipeline transforms raw data into actionable intelligence, significantly accelerating the penetration testing lifecycle.
What Undercode Say:
- Key Takeaway 1: Passive subdomain enumeration is a force multiplier in reconnaissance. By leveraging multiple OSINT sources and recursive discovery, security professionals can uncover hidden assets that are often missed by active scanning techniques. The modular plugin architecture ensures the tool remains adaptable and scalable for both small-scale bug bounty hunters and large enterprise security teams.
-
Key Takeaway 2: Security hygiene in automation is non-1egotiable. The practice of using `.env` files, avoiding hardcoded credentials, and implementing strict `.gitignore` rules is not just a recommendation—it is a fundamental requirement. A single leaked API key can expose an entire infrastructure, turning a powerful tool into a significant liability.
Prediction:
-
+1 The adoption of AI-driven, passive reconnaissance pipelines will become standard in both offensive and defensive security operations within the next 18 months. As attack surfaces expand with cloud adoption and microservices, automated tools that can passively map these environments will be indispensable.
-
-1 The increasing reliance on third-party APIs for reconnaissance introduces a single point of failure. As API providers tighten security or deprecate endpoints, tools like this will require constant maintenance. Organizations that fail to diversify their data sources may find their reconnaissance capabilities severely degraded.
-
+1 The open-source nature of this project and others like it will democratize advanced reconnaissance techniques, enabling smaller security teams and independent researchers to compete with well-funded adversaries. This shift will lead to a more resilient and transparent security ecosystem.
-
-1 As passive enumeration tools become more accessible, malicious actors will also leverage them to map attack surfaces more efficiently. This could lead to an increase in targeted attacks, especially against organizations with poor subdomain hygiene or misconfigured cloud environments. Proactive monitoring and continuous asset discovery will become essential defensive measures.
▶️ Related Video (82% Match):
https://www.youtube.com/watch?v=-bpTe1HQxu4
🎯Let’s Practice For Free:
🎓 Live Courses & Certifications:
Join Undercode Academy for Verified Certifications
🚀 Request a Custom Project:
Secure, high-velocity infrastructure and disruptive technological engineering. Contact our engineering team for high-tier development and proprietary systems:
[email protected]
💎 Smart Architecture | 🛡️ Secure by Design | ⭐ Trusted by Thousands
IT/Security Reporter URL:
Reported By: Md Sazzadul – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅


