Getting Started
Building R4t
R4t uses aMakefile for cross-platform compilation with build-time version stamping.
Requirements
- Go 1.21+
make
Build Commands
./bin/ and named r4t-<os>-<arch> (e.g., r4t-linux-amd64).
Build flags strip debug symbols and enable size optimization (-s -w) for smaller binaries. Version information is injected at build time from the latest git tag.
First Run
On first launch R4t performs automatic initialization:- Directory creation — Creates
~/.local/share/r4t/with subdirectories for the database, logs, and file storage. - Domain detection — Attempts to auto-detect the current AD domain from the system’s DNS configuration.
- Nameserver discovery — Identifies a suitable nameserver for LDAP and DNS queries.
- Database initialization — Creates and migrates the SQLite schema and initializes the Badger KV store.
Directory Structure
R4t stores all persistent data in~/.local/share/r4t/:
Local DB Mode: If you setr4t set --local-db true, the SQLite file is created in the current working directory instead of~/.local/share/r4t/db/. Useful for per-engagement isolation.

