Skip to main content

Targets

R4t maintains a list of target hosts in its SQLite database. A single target can be set as the default (“active target”) so you don’t have to specify --ldap-server or a target hostname on every command.

The targets Command


Subcommands

targets add

Add a target to the database.
Targets are stored in the targets table in SQLite with an auto-incremented ID, IP address, DNS hostname, and optional notes.

targets list

List all stored targets.
Output includes: ID, IP, DNS Hostname, Notes, and whether the target is the currently active default.

targets set

Set a target as the default (active) target. The active target is stored in the Badger KV store (cfg:target) and used automatically by commands that need a target server.
Takes the numeric ID from targets list.

targets remove

Remove a target from the database.

How Targets Are Used

When a command needs to connect to a server (LDAP, SMB, RPC, etc.), it resolves the target in this order:
  1. --ldap-server / explicit server flag — inline override takes highest priority
  2. --target-id flag — use a specific stored target by ID
  3. Active target — the target set via targets set (retrieved from Badger)
  4. Domain-based DNS resolution — if no target is stored, resolve the domain’s DC via DNS SRV records
This means once you run r4t targets set 1, you can run subsequent commands without specifying a server:

Target Data Model

Targets support soft deletion — removing a target marks it as deleted without erasing the database row.

Using a Specific Target Inline

You can bypass the stored default and use a specific target by ID or by flag:

Per-Engagement Isolation

If you use local DB mode, each engagement directory maintains its own target list. This prevents target lists from different engagements from mixing: