Skip to main content

Overview

The rdg command searches for and decrypts saved RDP passwords from RDCMan.settings files and .rdg/.RDC files. These files contain Remote Desktop connection profiles with saved credentials for administrators managing multiple systems.
RDCMan (Remote Desktop Connection Manager) is a popular tool for managing multiple RDP connections. The rdg command can decrypt both the settings file and individual .rdg group files.

Basic Usage

Command Arguments

Decryption Methods

This method works without needing masterkeys if run from the user context who saved the passwords. No LSASS access required!

Targeting Options

When using /target with a file, you must provide either /unprotect or :SHA1 masterkey mappings. When using /target with a folder, the folder must contain DPAPI masterkeys if using /pvk.

What Gets Decrypted

The rdg command decrypts passwords from:
1

RDCMan.settings File

Located at: %LOCALAPPDATA%\Microsoft\Remote Desktop Connection Manager\RDCMan.settingsContains:
  • Credential profiles
  • Default logon credentials
  • Recent server connections
2

Referenced .rdg Files

Group files referenced by RDCMan.settingsContains:
  • Individual server entries
  • Per-server credentials
  • Connection settings

Execution Context

When run with administrative privileges:
  • Triages all users on the system
  • Accesses RDCMan files in all user profiles
  • Decrypts all RDP credential profiles

Example: Using /unprotect

Output:
The /unprotect method is preferred when possible - it’s unprivileged, doesn’t require masterkeys, and doesn’t touch LSASS.

Example: Using Masterkey Mappings

Output:

Example: Using Domain Backup Key

Output:

Common Scenarios

After obtaining domain admin and backup key:
Extract masterkeys and decrypt RDG files:
Analyzing copied RDG files:

RDCMan File Locations

Settings File:
Group Files (.rdg):
  • Typically stored in user’s Documents folder
  • Can be anywhere on the file system
  • Referenced paths shown in RDCMan.settings output
Individual Connection Files (.RDC):
  • Standard RDP connection files
  • Can contain saved credentials
  • Found in various user locations

Why Use /unprotect?

The /unprotect flag uses CryptUnprotectData() instead of manual masterkey decryption:

No Masterkeys

Doesn’t require extracting or providing masterkeys

Unprivileged

Works without elevation or admin rights

No LSASS

Doesn’t need to access LSASS process

Stealth

Minimal detection footprint
This approach isn’t used for credentials/vaults because of how Windows Credential Manager protects data. See Benjamin’s documentation for details.

Detection Considerations

Host-Based Indicators:
  • Reading RDCMan.settings file
  • Access to .rdg files in user directories
  • Non-standard processes accessing RDP credential files
  • Bulk enumeration of RDCMan files
Defensive Monitoring:
  • Monitor access to %LOCALAPPDATA%\Microsoft\Remote Desktop Connection Manager\
  • Alert on RDCMan.settings file access by non-RDCMan processes
  • Track .rdg file access patterns
  • Detect bulk RDP credential file enumeration
  • Monitor for LSASS access (when not using /unprotect)
Event Log Indicators:

credentials

Decrypt Credential Manager RDP credentials

triage

Comprehensive user DPAPI triage

masterkeys

Decrypt user masterkeys

backupkey

Retrieve domain backup key

Tips

  • Prefer /unprotect when running as the target user
  • Look for RDCMan on administrator workstations and jump boxes
  • Check both RDCMan.settings and referenced .rdg files
  • Correlate server names with network infrastructure
  • Look for privileged account credentials (domain admins, service accounts)
  • Use /unprotect for minimal detection footprint
  • Run without elevation when possible
  • Target specific files instead of bulk enumeration
  • Redirect output to file with /consoleoutfile
  • Avoid using /pvk if /unprotect will work
No RDCMan files found:
  • User may not use RDCMan (check for .rdg files manually)
  • Files may be stored in non-standard locations
  • Look for .RDC files as alternative
  • Check Documents folder for .rdg files
Decryption fails with /unprotect:
  • Must run from the user context who saved passwords
  • Try using masterkeys or backup key instead
  • Verify you’re running as the correct user
  • File may be corrupted or invalid format
Partial decryption:
  • Different credential profiles may use different masterkeys
  • Try using domain backup key for complete coverage
  • Extract additional masterkeys with Mimikatz