How cr0nica1/p2o-bot-updater works
Pwn2Own Target Updater is a Discord bot and CLI for managing target records, collecting vulnerability and firmware/version information, and presenting search results or scheduled notifications. The main workflow enters through Discord commands, which dispatch application use cases; those use repositories and external-source/browser adapters, with MongoDB as persistent storage. The README documents additional target import, vendor configuration, export, and scheduled workflows. Some of those implementation paths were not excerpted, so their documented links are marked unverified rather than inferred from module names.
Main entry points: commands.py Slash commands · bot.py Discord bot · firmware_lookup.py Firmware lookup · sync_vulnerabilities.py Vulnerability sync
Components 30
User interfaces
- Discord bot
src/updater/presentation/discord_bot/bot.py - Slash commands
src/updater/presentation/discord_bot/commands.py - Bot configuration
src/updater/presentation/discord_bot/config.py - Response formatting
src/updater/presentation/discord_bot/formatting.py - Job scheduler
src/updater/presentation/discord_bot/scheduler.py - Firmware CLI
src/updater/cli/firmware_lookup.py - Vendor config CLI
src/updater/cli/vendor_config.py
Application use cases
- Vulnerability sync
src/updater/application/sync_vulnerabilities.py - Firmware lookup
src/updater/application/firmware_lookup.py - Version scan
src/updater/application/version_scan.py - Target CSV import
src/updater/application/import_targets.py - JSON export
src/updater/application/export_json.py - Chroma purge
src/updater/application/purge_chroma.py
Adapters and storage
- MongoDB repositories
src/updater/infrastructure/mongo.py - CSV loader
src/updater/infrastructure/csv_loader.py - JSON output
src/updater/infrastructure/json_exporter.py - NVD source
src/updater/infrastructure/sources/nvd.py - ZDI source
src/updater/infrastructure/sources/zdi.py - Browser adapter
src/updater/infrastructure/browser/cloak.py - HTTP fetch adapter
src/updater/infrastructure/browser/http_fetch.py - Version-check seed
src/updater/infrastructure/seed/version_checks.py
Domain model
- Domain records
src/updater/domain/models.py - Repository protocols
src/updater/domain/repositories.py
Other components
- Discord user
- CLI user
- Discord service
- MongoDB service
- NIST NVD
- ZDI advisories
- Vendor web pages
Connections 35
- Discord user → Discord bot: invokes
README.md - Discord bot → Slash commands: dispatches
src/updater/presentation/discord_bot/bot.py - Slash commands → Vulnerability sync: runs sync
src/updater/presentation/discord_bot/commands.py - Slash commands → Firmware lookup: runs lookup
src/updater/presentation/discord_bot/commands.py - Slash commands → Version scan: runs scan
src/updater/presentation/discord_bot/commands.py - Slash commands → Target CSV import: imports targets
src/updater/presentation/discord_bot/commands.py - Slash commands → JSON export: exports data
src/updater/presentation/discord_bot/commands.py - Discord bot → Bot configuration: loads settings
src/updater/presentation/discord_bot/bot.py - Discord bot → Response formatting: formats replies
src/updater/presentation/discord_bot/bot.py - Discord bot → Job scheduler: runs scheduled jobs
src/updater/presentation/discord_bot/bot.py - Discord bot → Discord service: connects to
README.md - CLI user → Firmware CLI: invokes
README.md - CLI user → Vendor config CLI: invokes
README.md - Firmware CLI → Firmware lookup: runs lookup
src/updater/cli/firmware_lookup.py - Vendor config CLI → MongoDB repositories: manages config
src/updater/cli/vendor_config.py - Vulnerability sync → NVD source: queries source
README.md - Vulnerability sync → ZDI source: queries source
README.md - NVD source → NIST NVD: fetches advisories
README.md - ZDI source → ZDI advisories: fetches advisories
src/updater/infrastructure/sources/zdi.py - Firmware lookup → Browser adapter: fetches page content
src/updater/application/firmware_lookup.py - Firmware lookup → HTTP fetch adapter: optionally fetches
src/updater/application/firmware_lookup.py - Browser adapter → Vendor web pages: loads page
src/updater/infrastructure/browser/cloak.py - HTTP fetch adapter → Vendor web pages: fetches page
- Target CSV import → CSV loader: loads CSV
- JSON export → JSON output: writes JSON
- Vulnerability sync → MongoDB repositories: persists records
- Firmware lookup → MongoDB repositories: reads target config
- Version scan → MongoDB repositories: stores versions
- MongoDB repositories → MongoDB service: reads and writes
README.md - Vulnerability sync → Domain records: builds domain records
src/updater/application/sync_vulnerabilities.py - Firmware lookup → Domain records: uses target config
src/updater/application/firmware_lookup.py - Repository protocols → Domain records: specifies records
src/updater/domain/repositories.py - Version-check seed → Domain records: seeds version checks
src/updater/infrastructure/seed/version_checks.py - Job scheduler → Version scan: schedules daily scan
- Slash commands → Chroma purge: clears Chroma data