Repository navigation
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-auditflag. Produces<timestamp>_Soaphound_PrivilegeRightsAudit.txtalongside the standardprivilege_rights.jsonfrom-c Default.
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:
SeInteractiveLogonRightSeRemoteInteractiveLogonRightSeNetworkLogonRightSeServiceLogonRightSeBatchLogonRight
- Potato family:
SeImpersonatePrivilegeSeAssignPrimaryTokenPrivilege
- Tier-0 adjacent:
SeDebugPrivilegeSeBackupPrivilegeSeRestorePrivilegeSeTakeOwnershipPrivilegeSeLoadDriverPrivilegeSeTcbPrivilege
Every other [Privilege Rights] entry is intentionally dropped — the point of the audit is signal, not completeness.
| 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. |
| 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. |
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-runResulting 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).
- Transport: this feature piggybacks on the Default preset's SMB SYSVOL enrichment.
tcp/9389for the AD CS/GPO scope andtcp/445to SYSVOL on the DC. - DC-side events:
5156ontcp/9389andtcp/445;5145SMB share access onSYSVOL;4624/4634for the SMB logon. - Reading
[Privilege Rights]happens fromGptTmpl.infunder\\<domain>\SYSVOL\<domain>\Policies\{GUID}\Machine\Microsoft\Windows NT\SecEdit\. - The audit is read-only; no
5136/5137.
- gtworek, "Priv2Admin" — https://github.com/gtworek/Priv2Admin
- Microsoft, "User Rights Assignment" baseline — https://learn.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/user-rights-assignment
-
src/soaphound/ad/collectors/gpo_sysvol.py— in-tree parser, see_TRACKED_PRIVRIGHTS