Skip to execution rack
AD-SWEEP
[0.1.0] RELEASE [RUST] 1.85+ CLI [NETEXEC] EXTERNAL NXC

AD-SWEEP

Runs isolated Active Directory enumeration with NetExec

A local-first Rust CLI wrapper around an installed nxc binary. Target specifications expand with arithmetic bounds before iteration, credentials run sequentially per target under an optional scan-wide failure budget, and each host owns an isolated, redacted record in an ordered JSON report. For authorized security testing with explicit written permission only.

[shell] cargo install nxc on PATH
git clone https://github.com/Real-Fruit-Snacks/ad-sweep.git
cd ad-sweep && cargo install --path .
# Verify implemented SMB modules without invoking NetExec
ad-sweep --list-modules
SMB Modules
4 verified
Target Cap
65,536 max
JSON Mode
0600 create-new

ISOLATED EXECUTION WORKBENCH

Target-Lane Rack & Per-Target JSON Inspector

[mock] LAB SIMULATION · NO NETWORK
SMB Modules (--module)
Isolated Target Lanes order preserved · click lane to inspect
[cli] ad-sweep live flags · src/cli.rs

                
[json] 10.0.0.1 · TargetReport schema_version 1 · redacted

                        

Redaction boundary: Real ad-sweep runs always replace supplied passwords, NT hashes, and AES keys with [REDACTED] in src/netexec.rs and src/credential.rs before serialization. Toggling Redact secrets off previews raw mocked lab output so you can verify what the boundary scrubs.

IMPLEMENTED SCOPE · SRC/CLI.RS

Four Verified SMB Modules

Pass --module (or --modules) repeatedly or comma-separated. Every module shares one centralized build_nxc_command boundary so SMB port, DNS server, DNS-over-TCP, verbosity, and process timeouts stay consistent across hosts.

[default] target-info [anon] no auth needed

target-info

NetExec flag: (base smb probe)

Captures SMB host identity, Windows build string, domain name, SMB signing posture, and SMBv1 exposure. Selected automatically when --module is omitted.

[--shares] shares [auth] anon or cred

shares

NetExec flag: --shares

Enumerates SMB share names, read/write access permissions, and share comments per target. Supports anonymous guest checks or authenticated domain and local sessions.

[--users] users [auth] cred required

users

NetExec flag: --users

Enumerates Active Directory or local user accounts over SMB using password (-p), NT/LM:NT hash (-H), Kerberos AES key (--aes-key), or credential cache (--use-kcache).

[--groups] groups [auth] cred required

groups

NetExec flag: --groups

Enumerates SMB security groups and domain group listings into each target's isolated modules array, preserving exit status, timing, and redacted output.

BOUNDED INPUTS & OPERATOR SAFETY

Target Syntax & Execution Guardrails

[targets] src/target.rs

Bounded Target Expansion

Expansion size is computed arithmetically before any address is allocated. Oversize networks fail fast with exit code 2 instead of exhausting memory. Results are deduplicated in original input order.

Single host
10.0.0.10 · 2001:db8::1 · dc01-prod
IPv4 short range
10.0.0.1-20 (last octet 0–255)
Full IP range
10.0.0.1-10.0.0.20 (same family)
CIDR network
10.0.0.0/24 (IPv4 /30 and wider omit net & broadcast)
Target file
targets.txt (UTF-8, skips blanks & # comments)
Default cap
65,536 hosts (lower via --max-targets 1..=65536)
[guardrails] src/app.rs · src/netexec.rs

Operator Safety Controls

Targets may run concurrently up to --workers (1..=64, default 4), while credential attempts stay strictly sequential per host. No direct-socket prescan or implicit roasting runs behind your back.

  • [--fail-limit] Auth budget

    Recorded auth failures (STATUS_LOGON_FAILURE, STATUS_ACCOUNT_LOCKED_OUT, STATUS_ACCOUNT_DISABLED, and related SMB errors) plus in-flight attempts never exceed COUNT. Setting --fail-limit 1 serializes attempts across workers.

  • [-C] Sequential credentials

    Tries user:password or user:hash lines one at a time per target, preserving password whitespace and stopping after the first credential completes all selected modules unless --continue-on-success is explicit.

  • [REDACTED] Secret scrubbing & reports

    Passwords, NT hashes, and AES keys are redacted at the central NetExec command and output boundaries. --output PATH uses create_new (0600 on Unix) and never overwrites an existing report.

  • [exit] Exit codes & Ctrl+C

    Exit 0 on complete success, 1 on runtime, partial, or cancelled runs, and 2 on invalid CLI usage. Ctrl+C stops queued work and terminates tracked direct children; NO_COLOR, TERM=dumb, and --no-color strip ANSI escapes.

VERIFICATION & KNOWN LIMITS

Tested On & Scope Boundaries

Automated checks validate the real binary against a mocked NetExec runner. Mocked tests prove argument handling, concurrency safety, redaction, and report structure, but do not substitute for live directory testing.

[ok] Verified checks

Tested Platforms & Gates

Windows · Rust 1.100.0
39 active tests passed (mocked runner)
Kali Linux WSL · Rust 1.100.0
40 active tests passed (incl. Unix 0600 mode)
Quality gates
cargo fmt · Clippy -D warnings · locked tests
Coverage areas
Target bounds, redaction, fail-limit, exit codes, Ctrl+C
[!] Open gaps & limits

Known Issues & Scope

  • Untested environments: Live Active Directory targets, runnable NetExec 1.5.x protocol behavior, proxied routing, and macOS builds are not yet verified.
  • Failure budget caveat: --fail-limit relies on recognized NetExec authentication error strings and is not an account-lockout prevention guarantee. Validate domain policy behavior in a dedicated lab.
  • Subprocess trees: Direct-child cancellation is tested; descendant subprocess trees and proxy wrappers still require Windows and Linux integration coverage.
  • Report sensitivity: Although passwords, hashes, and AES keys are redacted, saved JSON reports still contain usernames, hostnames, share names, and directory findings.