Skip to content

MS ADCAP

belettetimoree edited this page Nov 1, 2026 · 1 revision

MS-ADCAP TopologyManagement

MS-ADCAP (Active Directory Web Services: Custom Action Protocol) exposes RSAT-equivalent primitives on tcp/9389. Soaphound.py implements three of them from the TopologyManagement endpoint, enough to replicate the most common forest-management RSAT calls from a Linux attacker host.

Overview

The ADWS service hosts several logical endpoints, each with its own set of CustomActions. Soaphound.py currently ships only TopologyManagement:

Endpoint Typical RSAT equivalent Status in Soaphound.py
TopologyManagement Get-ADForest, Set-ADObject, Set-ADForestMode, Enable-ADOptionalFeature Implemented (--adcap-* flags)
AccountManagement New-ADUser, New-ADComputer, Set-ADAccountPassword Declared, not implemented (NotImplementedError)
Resource / ResourceFactory (WS-Transfer) Generic object create/delete over SOAP Partial — ADWSConnect.put() is used by the primitives above

The implementation lives under src/soaphound/ad/adws.py and src/soaphound/ad/soap_templates.py.

CLI Flags

Flag Purpose
--adcap-get-forest Call MS-ADCAP GetADForest and dump the full forest topology (sites, DCs, domains, UPN suffixes) as JSON on stdout.
--adcap-translate NAME Call MS-ADCAP TranslateName. Default is offered=NameSamCompatible (2), desired=NameFullyQualifiedDN (1) — effectively the WS version of IADsNameTranslate.
--adcap-change-feature GUID Call MS-ADCAP ChangeOptionalFeature on the forest feature identified by GUID. Enables the feature by default.
--adcap-change-feature-dn DN Distinguished name of the context used by --adcap-change-feature. Defaults to CN=Partitions,CN=Configuration,<rootDN>, which is the forest-level container for scope features such as the Recycle Bin.

The three mode flags above are mutually exclusive and short-circuit the BloodHound collect path.

Example — forest discovery

soaphound \
  -u alice -p 'Password123!' \
  -d corp.local \
  -dc dc01.corp.local -dc-ip 10.0.0.10 \
  --adcap-get-forest

Example output (abridged):

{
  "ForestName": "corp.local",
  "ForestMode": 7,
  "RootDomain": "corp.local",
  "Sites": ["Default-First-Site-Name", "Paris"],
  "GlobalCatalogs": ["dc01.corp.local", "dc02.corp.local"],
  "UPNSuffixes": ["corp.local", "corp.example"]
}

Example — translate name

Translate the SAM-compatible name CORP\alice to its full DN:

soaphound \
  -u alice -p 'Password123!' \
  -d corp.local \
  -dc dc01.corp.local -dc-ip 10.0.0.10 \
  --adcap-translate 'CORP\alice'

Example output:

CN=Alice Example,OU=Users,DC=corp,DC=local

Example — enable the Recycle Bin

The Active Directory Recycle Bin optional feature GUID is 766ddcd8-acd0-445e-f3b9-a7f9b6744f2a. Enabling it is a forest-level change written on the CN=Partitions,CN=Configuration,<rootDN> container, which is the default --adcap-change-feature-dn:

soaphound \
  -u domainadmin -p 'LongPass123!' \
  -d corp.local \
  -dc dc01.corp.local -dc-ip 10.0.0.10 \
  --adcap-change-feature '766ddcd8-acd0-445e-f3b9-a7f9b6744f2a'

A non-forest-level feature requires overriding the DN explicitly:

soaphound \
  --adcap-change-feature '<feature-guid>' \
  --adcap-change-feature-dn 'CN=NTDS Settings,CN=DC01,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=corp,DC=local' \
  -u domainadmin -p 'LongPass123!' \
  -d corp.local -dc dc01.corp.local -dc-ip 10.0.0.10

The call requires an identity with WRITE_PROPERTY on the target DN. For the Recycle Bin specifically, the forest-wide write is reserved to the Enterprise Admins group by default.

OpSec Notes

  • Transport: single tcp/9389 session, SOAP CustomAction with a wsa:Action of http://schemas.microsoft.com/2008/1/ActiveDirectory/.../ChangeOptionalFeature (or the matching GetADForest, TranslateName).
  • DC-side events: 5156 on connection; 5137 on container modification when ChangeOptionalFeature succeeds; 5136 on the attribute write.
  • GetADForest and TranslateName are read-only — no 5136/5137.
  • An ADWS detection stack that only inspects LDAP (tcp/389) will miss these writes entirely.

References

Clone this wiki locally