Skip to content
ADscan Docs

Credential Management

Manage and utilize discovered Active Directory credentials

ADscan automatically discovers and stores credentials during enumeration and exploitation. Use these commands to view and work with discovered credentials.

Commands

creds show

Display all discovered credentials in the current workspace.

Syntax:

bash
creds show

Example (Forest workspace):

Show discovered credentials
  (ADscan:htb_forest ~/.adscan/workspaces/htb_forest) > creds show
Output - Discovered Credentials (Forest)
  ╭─ htb.local · PWNED ───────────────────────────────────────────────────────────────────────────────╮
  │                                      Domain Credentials                                           │
  │ ╭───┬──────────────────────┬────────────┬──────────────────────────────────┬────────────────────╮ │
  │ │   │ User                 │ Kind       │ Credential                       │ Provenance         │ │
  │ ├───┼──────────────────────┼────────────┼──────────────────────────────────┼────────────────────┤ │
  │ │ ✓ │ Administrator        │ • hash     │ 32693b11e6aa90eb43d32c72a07ceea6 │ via DCSync         │ │
  │ │ ✓ │ krbtgt               │ • hash     │ 819af826bb148e603acb0f33d17632f8 │ via DCSync         │ │
  │ │ ✓ │ $331000-VK4ADACQNUCA │ • hash     │ 31d6cfe0d16ae931b73c59d7e0c089c0 │ via DCSync         │ │
  │ │ ✓ │ svc-alfresco         │ • pass     │ s3rvice                          │ via AS-REP roast   │ │
  │ │ ✓ │ andy                 │ • hash     │ 29dfccaf39618ff101de5165b19d524b │ via DCSync         │ │
  │ │ ✓ │ mark                 │ • hash     │ 9e63ebcb217bf3c6b27056fdcb6150f7 │ via DCSync         │ │
  │ ╰───┴──────────────────────┴────────────┴──────────────────────────────────┴────────────────────╯ │
  ╰───────────────────────────────────────────────────────────────────────────────────────────────────╯

What it shows:

  • Every credential ADscan holds for the domain, one row each
  • Kind — whether it is a cleartext password or a hash
  • The credential itself
  • Provenance — the technique that produced it (via DCSync, via AS-REP roast, via GPP cpassword, via password spray, …), or a neutral marker when nothing was recorded
  • Local-account credentials, listed separately under the host and service they belong to

Credentials are shown in the clear

creds show prints passwords and hashes verbatim. That is deliberate: the operator needs the credential, and a tool that hides its own loot is useless. Nothing is masked, blurred, or truncated on screen.

The telemetry side is separate. Every value on this panel is marked at the source so the export sanitizer replaces it with a deterministic pseudonym before any terminal output is uploaded as telemetry — see telemetry. Cleartext on your terminal, pseudonymized in anything that leaves the machine.

Treat a terminal running creds show the way you would treat the credentials themselves: no screen sharing, no screenshots into a ticket, no scrollback in a shared session.

creds select

Select a specific credential to use for further enumeration and exploitation.

Syntax:

bash
creds select <domain>

Parameters:

  • domain: The domain name of the credentials to select

Example (Forest workspace):

Select credential
  (ADscan:htb_forest ~/.adscan/workspaces/htb_forest) > creds select htb.local
Output - Credential Selection (Forest)
  ╭─ Domain ─────────╮
  │ ● htb.local      │
  ╰──────────────────╯
                    Available Users
  ╭────────┬───┬────────────────┬──────────────────────╮
  │   ID   │   │ Username       │ Provenance           │
  ├────────┼───┼────────────────┼──────────────────────┤
  │   1    │ ✓ │ svc-alfresco   │ via AS-REP roast     │
  ├────────┼───┼────────────────┼──────────────────────┤
  │   2    │ ✓ │ Administrator  │ via DCSync           │
  ├────────┼───┼────────────────┼──────────────────────┤
  │   3    │ ✓ │ andy           │ via DCSync           │
  ╰────────┴───┴────────────────┴──────────────────────╯
  ? Select credential for domain htb.local: Administrator
  ✓ Selected credential: Administrator@htb.local
  ℹ  Subsequent authenticated enumeration will use this account.

What it does: When you select credentials, ADscan will:

  1. Show available credentials for the specified domain
  2. Allow you to choose which credential to use
  3. Enumerate privileges and access for the selected user:
    • Accessible SMB shares
    • ACL permissions
    • Group memberships
    • Special privileges
    • Attack steps and paths, computed from the collected graph

Use cases:

  • Switch between different compromised accounts
  • Test access levels of different users
  • Enumerate lateral movement opportunities
  • Identify privilege escalation paths

creds save

Add a credential manually to continue an existing campaign.

Syntax:

bash
creds save <domain> <username> <password_or_hash> [host] [service]

Alias also supported:

bash
creds add <domain> <username> <password_or_hash> [host] [service]

Important workflow rule:

  • Initialize the domain first with start_auth.
  • Use creds save afterwards to add extra credentials you found outside ADscan.

If the domain is not initialized in the current workspace, ADscan will block the save and guide you to run start_auth first.

Examples:

bash
# 1) Initialize domain context first
start_auth

# 2) Later, add an additional domain credential
creds save htb.local svc-backup 'Winter2026!'

# 3) Optional local credential (host + service)
creds save htb.local administrator 'P@ssw0rd!' dc01.htb.local smb

Owned users and attack paths

In ADscan, “owned users” are users with a verified credential stored in the workspace. Once you have owned users, you can search for escalation chains from those entry points:

bash
attack_paths <domain> owned
attack_steps <domain>

This is especially useful after password spraying, roasting, or any technique that adds new valid credentials. See Attack Paths & Steps for the full workflow.

Cleanup-only account

ADscan undoes the changes it makes in the directory, such as a computer account it created or a key credential it added. Your client can provide an account reserved for that cleanup, for example one allowed only to delete computer objects. ADscan tries it first whenever it reverts a change and never uses it for the assessment. No attack step, credential sweep or attack path runs as it, and it never appears among the owned users.

When ADscan asks

start_unauth and start_auth ask once per workspace, before anything can change the directory. The default is No. ADscan does not ask when automatic reversion is off (set auto_revert off) or when the run is unattended. The answer is saved in the workspace either way, so the question does not come back. When an account is saved, the scan prints one line naming it.

cleanup_credential

CommandWhat it does
cleanup_credential set [<domain>]Saves the account for a domain, the current one by default. The secret is asked for at a masked prompt.
cleanup_credential showLists the cleanup accounts available. It never prints the secret.
cleanup_credential clear [<domain>|all]Removes the saved account for a domain, or every one.

The secret is never passed as an argument, so it stays out of your shell history.

Unattended runs

adscan ci takes the account by reference, never inline. Set ADSCAN_CLEANUP_USERNAME, ADSCAN_CLEANUP_SECRET and optionally ADSCAN_CLEANUP_DOMAIN, or add a cleanup_credential section to the scan configuration with username, domain and secret_env, the name of an ADSCAN_* environment variable that holds the secret. An account passed this way is used for that run only and is not saved.

When a run passes no account for a domain and the workspace has one saved, adscan ci uses the saved account and says so in the run output. The report's cleanup section then states that the account was saved with the engagement in an earlier session.

System Command

system

Execute shell commands in the environment where ADscan is running.

Syntax:

bash
system <command>

Parameters:

  • command: Any shell command to execute locally

Examples:

bash
# Check local user
(ADscan:workspace) > system whoami
kali

# View network interfaces
(ADscan:workspace) > system ip addr show

# Check VPN connection
(ADscan:workspace) > system ping -c 1 10.10.10.161

Important Notes:

  • By default, ADscan runs inside Docker, so system executes inside the ADscan container (with host networking)
  • system does NOT execute commands on the target domain
  • Useful for checking local system state, files, and network connectivity
  • All standard Linux/bash commands are available

Docker Mode Note

If you need to run commands on the host (for example docker ps), use a separate terminal on the host OS.

Common Use Cases:

bash
# Verify VPN connectivity
system ping <target_ip>

# Check available disk space
system df -h

# Check network routes
system ip route

# Verify tool installations
system which hashcat

To inspect workspace files on the host, use a separate terminal:

bash
ls -la ~/.adscan/workspaces/
cp ~/.adscan/workspaces/<workspace>/report.json /tmp/

Credential Storage

Credentials are automatically saved as part of the workspace state:

shell
~/.adscan/workspaces/<workspace>/
├── variables.json   # Structured state: domains, credentials, services, config
└── report.json      # JSON report of discovered issues and attack paths

Security:

  • variables.json contains discovered credentials (cleartext passwords and hashes), encrypted when the workspace is (see below)
  • A saved cleanup-only account lives in the same file, under its own cleanup_credentials key and outside the captured credentials. It is kept out of the terminal output sent as telemetry, and it is encrypted with the other credentials.
  • On Linux ADscan writes variables.json readable by your user only (600). On Windows it inherits the permissions of the ADscan folder in your user profile.
  • Cleartext passwords are only stored when explicitly cracked

Encryption at rest

A workspace can keep the credentials it stores encrypted. When you create a workspace for a real environment (the Audit or Production-sensitive policy), ADscan asks one question, "Encrypt the credentials stored in this workspace?", with three answers.

  • Yes, key kept on this machine (recommended). Each workspace gets its own key, and that key is protected by a machine key in ~/.adscan/state/engagement.kek (the ADscan folder under %LOCALAPPDATA% on Windows). There is nothing to type, so adscan ci runs unattended as before.
  • Yes, with a passphrase. ADscan asks for it once per session. For adscan ci, set ADSCAN_VAULT_PASSPHRASE.
  • No. Credentials are stored unencrypted, as in earlier versions.

A Lab / CTF workspace is not asked and is not encrypted. An unattended run that creates a workspace for a real environment takes the first answer and says so in one line. You can change the choice at any time with workspace encrypt, workspace decrypt and workspace rekey.

Passwords, NT hashes, Kerberos keys, the cleanup-only account and the password-spraying history are encrypted with AES-256-GCM. Account names, domains and the rest of the workspace stay readable. ADscan decrypts the values in memory when it needs them, and your terminal still shows recovered credentials in clear text.

If the key is not available (another machine, or a wrong passphrase), the workspace still opens. The stored credentials stay encrypted and are never overwritten, and ADscan asks for credentials where a step needs them. Run workspace unlock to try the passphrase again.

This protects a workspace that is zipped, backed up, copied to another machine or read by another account on this one. It does not protect against someone who can also read the machine key file, so keep ~/.adscan/state private, or choose a passphrase.

Some files a scan writes beside the credential store are not encrypted yet, such as hash lists prepared for cracking and the results of credential hunting in shares. Treat the workspace folder as sensitive either way.

An older version of ADscan cannot read an encrypted workspace. Run workspace decrypt first if you need to open it with one.

Credential Sources

ADscan discovers credentials through various techniques:

TechniqueDescriptionOutput
AS-REP RoastingPre-authentication disabled accountsPassword (cracked hash)
KerberoastingService accounts with SPNsPassword (cracked TGS)
DCSyncDomain replication rightsNTLM hashes (all users)
SAM DumpLocal account databaseNTLM hashes (local users)
LSA SecretsLSA cached credentialsPasswords or hashes
DPAPIData Protection API credentialsPasswords (decrypted)

Workflow Example

Complete credential management workflow (Forest example):

You can run start_auth in guided mode and enter the target details when prompted:

  • Domain: htb.local
  • DC IP: 10.129.2.124
  • Username: svc-alfresco
  • Password: s3rvice
1. Run authenticated scan
  (ADscan:htb_forest ~/.adscan/workspaces/htb_forest) > start_auth

If you prefer to skip the guided prompts, you can also run:

bash
(ADscan:workspace) > start_auth htb.local 10.129.2.124 svc-alfresco s3rvice
Output - Authenticated Scan (Forest)
  [+] Credentials validated successfully for svc-alfresco@htb.local
  ℹ  Enumerating domain privileges and ACLs for user svc-alfresco
  ⚠ There is an ACE with GenericAll on 'Exchange Windows Permissions'
  Do you want to exploit the GenericAll/GenericWrite privilege on Exchange Windows Permissions? [y/n] (y): y
  ℹ  Executing AddSelf attack
  ✓ User svc-alfresco successfully added to group Exchange Windows Permissions
  ℹ  Adding DCSync permissions to user svc-alfresco on the domain domain
  ✓ GenericAll added successfully
  ℹ  Performing DCSync for user Administrator
  ✓ Found credential: htb.local/Administrator with hash 32693b11e6aa90eb43d32c72a07ceea6
2. View all discovered credentials
  (ADscan:htb_forest ~/.adscan/workspaces/htb_forest) > creds show
Output - Discovered Credentials (Forest)
  [...same output as above 'Discovered Credentials (Forest)' example...]
3. Select high-privilege account
  (ADscan:htb_forest ~/.adscan/workspaces/htb_forest) > creds select htb.local
Output - Select Administrator Credential
  ╭─ Domain ─────────╮
  │ ● htb.local      │
  ╰──────────────────╯
                    Available Users
  ╭────────┬───┬────────────────┬──────────────────────╮
  │   ID   │   │ Username       │ Provenance           │
  ├────────┼───┼────────────────┼──────────────────────┤
  │   1    │ ✓ │ svc-alfresco   │ via AS-REP roast     │
  ├────────┼───┼────────────────┼──────────────────────┤
  │   2    │ ✓ │ Administrator  │ via DCSync           │
  ├────────┼───┼────────────────┼──────────────────────┤
  │   3    │ ✓ │ andy           │ via DCSync           │
  ╰────────┴───┴────────────────┴──────────────────────╯
  ? Select credential for domain htb.local: Administrator
  ✓ Selected credential: Administrator@htb.local
  ℹ  Subsequent authenticated enumeration will use this account.
bash
# On the host (separate terminal)
ls ~/.adscan/workspaces/htb_forest/

Best Practices

Credential Rotation

When you discover new credentials:

  1. Use creds show to view all accounts
  2. Test each credential with creds select
  3. Document which accounts have which access
  4. Prioritize high-privilege accounts for further exploitation

Secure Storage

  • Never share variables.json publicly
  • Encrypt workspace backups before transferring
  • Delete old workspaces after engagement completion
  • Use clear_all to wipe workspace data when done

Sensitive Data Protection

In a workspace that is not encrypted, variables.json contains cleartext passwords and NTLM hashes. Encrypt the workspace with workspace encrypt, keep restrictive permissions (600), encrypt backups before transfer, and securely delete workspace data after engagement completion using clear_all.

Credential Testing

bash
# Select different credentials to test access
creds select corp.local  # Test user1
creds select corp.local  # Test user2

# Compare access levels between accounts
# Identify which accounts have DA/EA privileges

Next Steps

After discovering credentials:

  1. Use creds show to view all credentials
  2. Select high-value credentials with creds select
  3. Enumerate privileges and accessible resources
  4. Follow BloodHound attack paths to escalate privileges
Share with your team lead
Forward a clean demo link to a lead who can approve a free team demo.
Find this useful?
Pass it to the next pentester running an AD engagement
Running 2+ AD engagements/year?
First PRO assessment free·Free in exchange for feedback
Automated PDF reports. Save ≥1 day per engagement.

ADscan — AD pentest automation for security consultants