Skip to content

Privilege Rights Audit

belettetimoree edited this page Nov 1, 2026 · 1 revision

Privilege Rights Audit

Soaphound.py extracts privilege assignments from every GptTmpl.inf reached under SYSVOL during a Default-preset collection, correlates them to the SIDs they are granted to, and emits a privilege_rights.json document next to the BloodHound JSONs. The focus is Potato-family preconditions and non-baseline holders of Tier-0-adjacent rights.

Status: shipped in v1.5 as the --priv-rights-audit flag. Produces <timestamp>_Soaphound_PrivilegeRightsAudit.txt alongside the standard privilege_rights.json from -c Default.

Audited rights

The following rights from [Privilege Rights] are kept when seen in any GptTmpl.inf in scope. Values are compared case-insensitively against the Microsoft constants:

  • Logon rights:
    • SeInteractiveLogonRight
    • SeRemoteInteractiveLogonRight
    • SeNetworkLogonRight
    • SeServiceLogonRight
    • SeBatchLogonRight
  • Potato family:
    • SeImpersonatePrivilege
    • SeAssignPrimaryTokenPrivilege
  • Tier-0 adjacent:
    • SeDebugPrivilege
    • SeBackupPrivilege
    • SeRestorePrivilege
    • SeTakeOwnershipPrivilege
    • SeLoadDriverPrivilege
    • SeTcbPrivilege

Every other [Privilege Rights] entry is intentionally dropped — the point of the audit is signal, not completeness.

Flagged conditions

Finding Trigger
Potato precondition A single principal holds both SeImpersonatePrivilege and SeAssignPrimaryTokenPrivilege. Any Potato-family local-priv-esc (JuicyPotato, PrintSpoofer, GodPotato, DcomPotato) runs with those two primitives.
Non-baseline holder A principal outside the Microsoft "User Rights Assignment" baseline for a given right (e.g. SeDebugPrivilege granted to a service account instead of the Administrators group).
Interactive logon on service accounts SeInteractiveLogonRight or SeRemoteInteractiveLogonRight granted to accounts whose UAC flags mark them as a service account.

CLI Flags

Flag Purpose
-c Default Required. Privilege rights come from SYSVOL — Stealth cannot see them.
--output-dir DIR Target folder for privilege_rights.json.
-op PREFIX Prefix prepended to the filename.

Example

soaphound \
  -c Default \
  -u alice -p 'Password123!' \
  -d corp.local \
  -dc dc01.corp.local -dc-ip 10.0.0.10 \
  -op CORP \
  --output-dir /tmp/corp-run

Resulting document /tmp/corp-run/CORP20261101170312_privilege_rights.json:

{
  "domain": "corp.local",
  "data": {
    "SeImpersonatePrivilege": [
      "S-1-5-21-123-1-500",
      "S-1-5-21-123-1-513",
      "S-1-5-21-123-1-1109"
    ],
    "SeAssignPrimaryTokenPrivilege": [
      "S-1-5-21-123-1-513",
      "S-1-5-21-123-1-1109"
    ],
    "SeDebugPrivilege": ["S-1-5-21-123-1-512"]
  }
}

The intersection of the two first lists gives the Potato-precondition set — in the example above, S-1-5-21-123-1-1109 is the actionable finding (both rights, non-baseline SID).

OpSec Notes

  • Transport: this feature piggybacks on the Default preset's SMB SYSVOL enrichment. tcp/9389 for the AD CS/GPO scope and tcp/445 to SYSVOL on the DC.
  • DC-side events: 5156 on tcp/9389 and tcp/445; 5145 SMB share access on SYSVOL; 4624/4634 for the SMB logon.
  • Reading [Privilege Rights] happens from GptTmpl.inf under \\<domain>\SYSVOL\<domain>\Policies\{GUID}\Machine\Microsoft\Windows NT\SecEdit\.
  • The audit is read-only; no 5136/5137.

References

Clone this wiki locally