Skip to main content

Getting Started

Building R4t

R4t uses a Makefile for cross-platform compilation with build-time version stamping.

Requirements

  • Go 1.21+
  • make

Build Commands

Binaries are output to ./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:
  1. Directory creation — Creates ~/.local/share/r4t/ with subdirectories for the database, logs, and file storage.
  2. Domain detection — Attempts to auto-detect the current AD domain from the system’s DNS configuration.
  3. Nameserver discovery — Identifies a suitable nameserver for LDAP and DNS queries.
  4. 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 set r4t 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.

Basic Workflow

A typical R4t engagement workflow:

1. Configure the environment

2. Add a target

3. Store credentials

4. Start enumerating


Authentication

R4t supports multiple authentication methods. You can supply them inline or via stored credentials.

Inline Authentication

Stored Credentials

See Credentials for full credential management documentation.

LDAP Server Selection

By default R4t resolves the LDAP server from the configured domain using DNS. You can override this:

Database Management

See Database for the full schema and storage details.