Database
R4t uses a dual-storage system: a Badger KV store for fast configuration and session state, and a SQLite relational database for persistent findings, credentials, and enumeration results.Storage Locations
Local DB mode: Runr4t set --local-db trueto creater4t.sqlitein the current working directory instead. Useful for per-engagement database isolation.
Badger KV Store
Badger is an embedded key-value store used for fast access to global configuration and the current session state.Characteristics
- Encrypted with AES-256 using a hardware-derived ID as the key
- ZSTD compression enabled
- Daily encryption key rotation
- Keeps only 1 version of each key (no history)
- 10 GB index cache, 512 MB memtable size
Keys Stored in Badger
These values are read at startup and populated into the global
App struct. Changes made via r4t set are immediately persisted to Badger.
SQLite Database
SQLite is the primary long-term store for all findings, targets, credentials, and enumeration data. It is accessed via GORM with a pure-Go SQLite driver.Schema Management
- AutoMigrate runs on every startup β safe and additive only (never drops columns or tables)
- Composite unique indexes are created with
IF NOT EXISTSto avoid duplicate enforcement errors --migrate-dbforces an explicit migration pass--purge-dbdrops all tables and remigrates from scratch (requires interactive confirmation β destructive)
Tables
The schema contains 60+ tables organized by functional area.Domain & Forest
AD Objects
Credentials & Sessions
Vulnerabilities
ADCS (Active Directory Certificate Services)
Group Policy
Networking & Protocols
Operations
Payload System (future)
Credential Model (Full Schema)
Thecredentials table stores all supported authentication types in a single unified model:
Target Model (Full Schema)
Direct Database Queries
Thedbquery command lets you run raw SQL against the SQLite database:
Results are printed as a table to stdout.

