How sensepost/gowitness works
Main Components Identification
The system can be broken down into these major components:
a. Command Line Interface (CLI)
• Located in /cmd directory
• Handles different commands like scan, report, version
b. Core Screenshot Engine
• Located in /pkg/runner
• Supports multiple drivers (Chrome Headless via chromedp and go-rod)
c. Input Processing System
• Located in /pkg/readers
• Handles multiple input sources (CIDR, file, Nessus, Nmap)
d. Output Management System
• Located in /pkg/writers
• Supports multiple output formats (CSV, JSON, SQLite, stdout)
e. Web Interface
• Located in /web directory
• Contains both API and UI components
User Interaction Layer
• CLI Interface
• Web UI (React/TypeScript based)
• REST API endpoints
Core Processing Layer
• Screenshot Engine
• Driver Management
• Input Processing
• Output Management
Storage Layer
• File System (screenshots)
• Database (SQLite)
Component Relationships
User Input -> CLI/Web UI
• v
Input Processing (pkg/readers) -> Screenshot Engine (pkg/runner)
• v
• Driver Interface
• / \
• ChromeDP Go-Rod
• /
• v v
• Screenshot Capture
• v
Output Management (pkg/writers) -> Storage Systems
• v
• Web Interface (Viewing)
Important Elements
a. Input Sources:
• CIDR Ranges
• URL Lists
• Nmap Scans
• Nessus Results
• Single URLs
b. Output Formats:
• SQLite Database
• JSON Lines
• CSV
• Screenshots Directory
c. Web Interface Components:
• REST API Endpoints
• React Frontend
• Gallery View
• Detail View
• Search Functionality
Technical Details to Note
• Built in Go
• Uses Chrome Headless
• Supports multiple browser automation drivers
• Includes a full REST API
• React/TypeScript frontend
• SQLite database for data persistence