Phase 5: Final integration — fix imports, full module discovery, interactive menu

- Fix pyserial import error in cellular_backup.py (lazy import with fallback)
- Replace stealth-only module discovery with discover_all_modules() across all
  5 categories (stealth, passive, active, intel, connectivity)
- Wire up interactive menu options 5-8:
  - View Credentials: query credential_db SQLite, Rich table with stats
  - View Intelligence: host count, cred stats, security posture summary
  - Network Topology: host table from topology_mapper state data
  - Timeline: recent entries from operator_audit HMAC-chained log
- Update start command to discover+register all enabled modules (not just stealth)
- Update modules/activate/selftest commands to use full module discovery
- Add is_module_enabled() config-aware helper for per-category defaults
- Fix modules.yaml module count headers (16->17 passive, 8->9 active/intel)
- Set bettercap_mgr enabled=false (all active modules disabled by default)
- Add tests/test_all_modules.py: 179 parametrized tests covering import,
  BaseModule subclass, attributes, and instantiation for all 55 modules
  across passive, active, intel, and connectivity categories
- All 256 tests passing
This commit is contained in:
n0mad1k
2026-03-18 13:59:27 -04:00
parent ba5143b560
commit 56cca8ac3d
4 changed files with 847 additions and 40 deletions
+4 -4
View File
@@ -3,7 +3,7 @@
# Modules gated by hardware tier and engagement phase.
# ---------------------------------------------------------------------------
# Passive Modules (16) — metadata extraction, zero network noise
# Passive Modules (17) — metadata extraction, zero network noise
# ---------------------------------------------------------------------------
passive:
packet_capture:
@@ -103,12 +103,12 @@ passive:
- mongodb
# ---------------------------------------------------------------------------
# Active Modules (8) — operator-enabled, bettercap + tool wrappers
# Active Modules (9) — operator-enabled, bettercap + tool wrappers
# Gated by engagement_phase.mode == active_allowed
# ---------------------------------------------------------------------------
active:
bettercap_mgr:
enabled: true
enabled: false
description: "Central bettercap orchestrator (REST API lifecycle)"
max_restarts: 3
health_poll_interval_s: 10
@@ -220,7 +220,7 @@ stealth:
description: "Read-only root FS + tmpfs overlay (zero SD writes)"
# ---------------------------------------------------------------------------
# Intelligence Modules (8) — on-device analysis + aggregation
# Intelligence Modules (9) — on-device analysis + aggregation
# ---------------------------------------------------------------------------
intel:
credential_db: