A comprehensive Python-based OSINT reconnaissance platform that combines Google Search API, GitHub leak detection, subdomain enumeration, port scanning, and intelligent correlation analysis to identify an organization's complete attack surface.
Attack Surface Mapper automates professional security reconnaissance by discovering exposure patterns that traditional scanners miss. It performs deep reconnaissance on target domains without direct interaction with internal systems, making it fully external and ethical OSINT-driven - perfect for VAPT engagements, bug bounty hunting, and security audits.
- Intelligent Google dorking through official API
- Detects admin panels, login pages, and debug interfaces
- Identifies exposed files (PDF, DOCX, SQL, ENV, LOG)
- Finds publicly indexed API documentation
- Discovers cloud storage misconfigurations (AWS S3, Azure Blob, GCS)
- Automatic severity classification
- Scans public repositories for sensitive information
- Detects hardcoded credentials and API keys
- Identifies exposed environment variables
- Analyzes commit history for leaked secrets
- Pattern-based detection for 15+ secret types
- AWS keys, database credentials, JWT tokens, etc.
- Certificate Transparency log queries (crt.sh)
- DNS brute-force on common subdomains
- Wildcard DNS detection
- Intelligent categorization by purpose:
- Admin panels & management interfaces
- Development/staging environments
- API endpoints
- Mail servers & webmail
- CDN resources
- VPN/Remote access points
- Multi-threaded concurrent scanning
- 24+ common service ports detection
- Service identification and banner grabbing
- Discovers: Web servers, SSH, databases, RDP, VNC, etc.
- Fast and efficient scanning
- Merges findings from all reconnaissance sources
- Identifies critical combinations (endpoints + leaked credentials)
- Correlates login panels with exposed passwords
- Links cloud storage URLs with GitHub configs
- Intelligent risk scoring (0-100)
- Professional, styled HTML output
- Executive summary with statistics
- Color-coded severity indicators
- Comprehensive findings breakdown
- Actionable security recommendations
- Client-ready presentation format
- Python 3.8 or higher
- Google Custom Search API key and CSE ID
- GitHub Personal Access Token
- Clone the repository:
git clone https://github.com/LingeshwarKulal/attack-surface-mapper.git
cd attack-surface-mapper- Install dependencies:
pip install -r requirements.txt- Configure API keys:
cp .env.example .env
# Edit .env with your API credentials- Go to Google Cloud Console
- Create a new project or select existing
- Enable "Custom Search API"
- Create credentials (API Key)
- Create a Custom Search Engine at Programmable Search Engine
- Note your CSE ID from the setup page
- Go to GitHub Settings > Tokens
- Generate new token (classic)
- Required scopes:
public_repo,read:user - Copy the generated token
python src/main.py -t example.compython src/main.py -t example.com --with-subdomains --with-portscan --html-reportpython src/main.py -t example.com --with-subdomains --skip-google --skip-githubpython src/main.py -t example.com --skip-google --with-subdomains --html-report# Specify output directory
python src/main.py -t example.com -o ./custom-output
# Run only Google dorking
python src/main.py -t example.com --google-only
# Run only GitHub scanning
python src/main.py -t example.com --github-only
# Verbose logging
python src/main.py -t example.com -v
# Generate HTML report
python src/main.py -t example.com --html-reportRequired:
-t, --target Target domain (e.g., example.com)
Optional:
-c, --config Path to configuration file
-o, --output Output directory (default: output/)
-v, --verbose Enable verbose logging
Scan Control:
--skip-google Skip Google dorking
--skip-github Skip GitHub scanning
--google-only Run only Google dorking
--github-only Run only GitHub scanning
New Features:
--with-subdomains Enable subdomain enumeration
--with-portscan Enable port scanning
--html-report Generate beautiful HTML report
The tool generates comprehensive output in the output/ directory:
-
google_recon_<target>_<timestamp>.json- Google dorking results by category
- Severity classifications (Critical/High/Medium/Low)
- Risk indicators and snippets
-
github_leaks_<target>_<timestamp>.json- GitHub repository scan results
- Detected secrets and leaked credentials
- Commit history analysis
-
subdomains_<target>_<timestamp>.json(NEW)- All discovered subdomains
- Categorized by purpose (admin, dev, api, mail, etc.)
- Wildcard DNS detection status
-
port_scan_<target>_<timestamp>.json(NEW)- Open ports per host
- Service identification
- Banner information
-
correlated_report_<target>_<timestamp>.json- Cross-referenced findings from all sources
- Risk scores (0-100)
- Severity-based prioritization
- Actionable security recommendations
-
report_<target>_<timestamp>.html(NEW)- Beautiful, professional HTML report
- Executive summary with statistics
- All findings in one place
- Ready for client presentation
{
"target": "example.com",
"timestamp": "2025-11-29T10:30:00Z",
"correlations": [
{
"type": "api_endpoint_credential_leak",
"risk_score": 95,
"severity": "critical",
"description": "Exposed API endpoint with leaked credentials",
"impact": "Attackers can potentially access the API using leaked credentials"
}
],
"risk_summary": {
"total_correlations": 15,
"by_severity": {
"critical": 3,
"high": 7,
"medium": 4,
"low": 1
}
},
"recommendations": [...]
}- VAPT Engagements: Initial reconnaissance phase
- Bug Bounty Hunting: Asset discovery and exposure detection
- Red Team Operations: External attack surface mapping
- Security Audits: Identifying public data leaks
- Continuous Monitoring: Regular security posture assessment
- Authorized security assessments
- Bug bounty programs with proper scope
- Your own organization's assets
- Educational and research purposes
DO NOT use this tool to:
- Target organizations without permission
- Violate terms of service
- Engage in illegal activities
attack-surface-mapper/
βββ src/
β βββ __init__.py
β βββ main.py # Main entry point
β βββ reconnaissance/
β β βββ __init__.py
β β βββ google_dorking.py # Google Search API module
β βββ github/
β β βββ __init__.py
β β βββ leak_scanner.py # GitHub API scanner
β βββ subdomain/ # NEW
β β βββ __init__.py
β β βββ subdomain_enum.py # Subdomain enumeration
β βββ ports/ # NEW
β β βββ __init__.py
β β βββ port_scanner.py # Port scanning module
β βββ correlation/
β β βββ __init__.py
β β βββ analyzer.py # Correlation engine
β βββ reporting/ # NEW
β β βββ __init__.py
β β βββ report_generator.py # HTML report generator
β βββ utils/
β βββ __init__.py
β βββ config.py # Configuration management
βββ tests/ # Unit tests
βββ docs/
β βββ PRD.md # Product Requirements
β βββ QUICKSTART.md # Quick start guide
βββ examples/
β βββ usage_examples.py
βββ output/ # Scan results (gitignored)
βββ requirements.txt
βββ setup.py
βββ .env.example # Example config
βββ .gitignore
βββ README.md
Run the test suite:
pytest tests/With coverage:
pytest tests/ --cov=src --cov-report=htmlDeveloper: Lingeshwar Kulal
GitHub: @LingeshwarKulal
Project Repository: attack-surface-mapper
For questions, issues, or feature requests:
- π Open an issue on GitHub Issues
- π¬ Start a discussion on GitHub Discussions
- β Star the repo if you find it useful!
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests for new features
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License. See LICENSE file for details.
- Google Custom Search API
- GitHub REST API
- Certificate Transparency Project (crt.sh)
- Python security and OSINT community
This tool is provided for educational and authorized security testing purposes only.
Legal Notice:
- Only use on targets you own or have explicit written permission to test
- Respect all applicable laws and regulations
- Follow responsible disclosure practices
- The authors are not responsible for misuse or damage caused by this program
Always ensure you have explicit authorization before scanning any target.
Made with β€οΈ by Lingeshwar Kulal
β Star this repo if you find it useful! β