How leebaird/discover works
Project type and purpose
• This is a modular, full-suite penetration-testing automation framework composed of Bash scripts.
• It orchestrates reconnaissance, scanning, enumeration, payload generation, listener setup, parsing, and report generation by invoking external tools (Nmap, Metasploit, Trivy, DNSRecon, etc.) on a Kali Linux host.
File structure
• Top-level “discover.sh” acts as the CLI launcher and menu controller.
• Discrete task scripts live alongside it (api-scanner.sh, domain.sh, listener.sh, etc.).
• “parsers/” contains Python scripts that transform XML/JSON from tools (Burp, Nessus, Nmap) into CSV.
• “resource/” holds Metasploit RC files for automated module execution.
• “config/” stores user and environment setup files.
• “report/” is the static site generator: assets (CSS, JS, fonts), data (HTML fragments), and pages.
• “misc/” provides assorted helper scripts and deployment templates (Ansible, Terraform).
• README describes major functional areas: RECON, SCANNING, WEB, MISC, DEV.
Key insights from the README
• A menu-driven CLI (discover.sh) dynamically invokes underlying modules.
• External dependencies: Nmap, Metasploit, Burp, DNSRecon, dnstwist, subfinder, etc., and cloud/container scanners (Trivy, Kubernetes APIs).
• Reports are generated as a local HTML site under “report/”.
Main components
a. CLI Frontend
• discover.sh (menu dispatcher)
• domain.sh, generateTargets.sh, cve.sh, etc.
b. Module Executors
• Recon modules (domain.sh, person.sh)
• Scanning modules (api-scanner.sh, web-api-scanner.sh, ssl.sh, nikto.sh, waf-detect.sh, etc.)
• Payload modules (payload.sh, msf-aux.sh)
• Dev security scanners (container-scanner.sh, cloud-scanner.sh, oauth-jwt-scanner.sh)
c. Parsers
• Python scripts in “parsers/”
d. Resource Store
• Metasploit RC files in “resource/”
e. Configuration
• dotfiles and installer in “config/”
f. External Tools & Services
• Nmap, Metasploit, Burp, Trivy, DNSRecon, shodan, cloud APIs, Kubernetes API
g. Report Generator
• report.sh and the static directory under “report/”
Relationships and data flows
• User invokes discover.sh → presents menu → user selects task → discover.sh calls the corresponding module script.
• Module script invokes external tool or calls parser, passing input/output file paths.
• Parsers transform tool output into CSV/HTML fragments.
• Resource files (Metasploit RC) are fed into Metasploit console.
• Final report.sh assembles data fragments into the “report/” directory, producing a self-contained HTML site.
• Config files and environment variables are loaded at startup.
Architectural patterns and design principles
• Plugin pattern: each task is a standalone script that conforms to a common menu-driven interface.
• Separation of concerns: reconnaissance, scanning, parsing, report generation are distinct layers.
• Convention-based configuration: “config/” for user settings, API keys, environment tweaks.
• Static site generation for reports (no database).