How 3mper0rr/scan-automation-engine-toolv2 works
Purpose and Entry Point
This is a Python 3.10 CLI security-scan automation engine. It scans a supplied target with Nmap, parses discovered services, recommends candidate Metasploit modules, optionally obtains AI analysis, and renders or exports a report.
Primary entry point: scan automation engine/main.py.
CLI Orchestration
main.py owns command-line flow: target selection, scan profile (quick, standard, aggressive), rule-layer enablement, AI prompting, and Markdown/JSON export selection. It coordinates scanner, advisor, and output layers rather than exposing a web or service API.
Paths:
• scan automation engine/main.py
• scan automation engine/config.py
Nmap Scan Boundary
The scanner layer is the system boundary to the locally installed Nmap executable. It converts the chosen profile into an Nmap invocation and collects scan output for downstream processing. Nmap is a required external runtime and likely requires network access and appropriate scan privileges.
Paths:
• scan automation engine/scanner/nmap_runner.py
• scan automation engine/config.py
Structured Scan Parsing
Nmap output is transformed into application-level findings—principally hosts, open ports, services, and version/context data. This parsing boundary isolates advisor logic from raw scanner output and provides the data model used for reporting and recommendations.
Paths:
• scan automation engine/scanner/report_parser.py
• scan automation engine/scanner/nmap_runner.py
Rule-Based Exploit Advisory
The advisory pipeline maps parsed service findings to candidate Metasploit modules. A local module database supports matching/filtering, while the recommender applies rules unless the user passes --no-rules. This produces actionable candidates, not exploit execution.
Paths:
• scan automation engine/advisor/msf_modules_db.py
• scan automation engine/advisor/recommender.py
Optional AI Analysis
When --ai is enabled, scan findings and recommended modules are supplied to an AI-analysis adapter, optionally augmented by a user prompt. The README describes multi-provider readiness for OpenAI, Anthropic, and Nvidia; provider credentials and request configuration are expected to be managed outside the scanning core.
Paths:
• scan automation engine/advisor/ai_analyst.py
• scan automation engine/config.py
Presentation and Export
The final aggregated report flows to terminal-oriented rich formatting and optional file export. Markdown is the default documented report style; JSON is selected with --fmt json. Output is downstream of scanning, rule evaluation, and optional AI enrichment.
Paths:
• scan automation engine/output/formatter.py
• scan automation engine/main.py
Primary Control Flow
main.py parses CLI options → nmap_runner.py executes the selected scan → report_parser.py normalizes findings → recommender.py consults msf_modules_db.py for module candidates → optional ai_analyst.py enriches conclusions → formatter.py prints and/or exports the consolidated report.
Main entry points: recommender.py Rule recommender · main.py CLI entry point · nmap_runner.py Nmap runner · ai_analyst.py AI analyst
Components 10
CLI orchestration
- CLI entry point · Selects target, profile, options, and report format.
scan automation engine/main.py - Runtime configuration · Supplies scan and AI-related settings.
scan automation engine/config.py
Scan pipeline
- Nmap runner · Builds profile-specific Nmap invocations and collects output.
scan automation engine/scanner/nmap_runner.py - Local Nmap · Performs network scanning with required access and privileges.
- Findings parser · Normalizes raw scan output into hosts, ports, services, and context.
scan automation engine/scanner/report_parser.py
Advisory pipeline
- Module database · Local data used to match service findings to Metasploit modules.
scan automation engine/advisor/msf_modules_db.py - Rule recommender · Produces candidate modules when rule evaluation is enabled.
scan automation engine/advisor/recommender.py - AI analyst · Enriches findings and module recommendations using a selected provider.
scan automation engine/advisor/ai_analyst.py - AI provider · Optional OpenAI, Anthropic, or Nvidia analysis backend.
Reporting
- Report formatter · Prints terminal output and exports Markdown or JSON reports.
scan automation engine/output/formatter.py
Connections 18
- CLI entry point → Runtime configuration: loads
- CLI entry point → Nmap runner: starts selected scan
- Runtime configuration → Nmap runner: scan settings
- Nmap runner → Local Nmap: executes
- Local Nmap → Nmap runner: raw scan output
- Nmap runner → Findings parser: scan output
- Findings parser → Rule recommender: normalized findings
- Rule recommender → Module database: matches against
- Module database → Rule recommender: module candidates
- CLI entry point → Rule recommender: enables rules
- Rule recommender → AI analyst: findings and recommendations
- CLI entry point → AI analyst: --ai prompt
- Runtime configuration → AI analyst: provider settings
- AI analyst → AI provider: analysis request
- Findings parser → Report formatter: findings
- Rule recommender → Report formatter: recommendations
- AI analyst → Report formatter: optional enrichment
- CLI entry point → Report formatter: format and export selection