MITRE ATT&CK TTPs
Requirements
Coercion
- Valid Active Directory domain credentials
- Connectivity to SMB (TCP/445) on a coercion target:
- TAKEOVER-2.1: Coerce primary site server
- TAKEOVER-2.2: Coerce passive site server
- Connectivity from the coercion target to SMB (TCP/445) on the relay server
- Coercion target settings:
BlockNTLM=0or not present, or =1andBlockNTLMServerExceptionListcontains attacker relay server [DEFAULT]RestrictSendingNTLMTraffic=0,1, or not present, or =2andClientAllowedNTLMServerscontains attacker relay server [DEFAULT]- Domain computer account is not in
Protected Users[DEFAULT]
- Domain controller settings:
RestrictNTLMInDomain=0or not present, or is configured with any value andDCAllowedNTLMServerscontains coercion target [DEFAULT]
Relay
- Connectivity from the relay server to SMB (TCP/445) on the relay target, the site database
- Relay target settings:
RequireSecuritySignature=0or not present [DEFAULT]RestrictReceivingNTLMTraffic=0or not present [DEFAULT]- Coercion target is local admin (to access RPC/admin shares)
- Domain controller settings:
RestrictNTLMInDomain=0or not present, or is configured with any value andDCAllowedNTLMServerscontains relay target [DEFAULT]LmCompatibilityLevel<5or not present, or =5and LmCompatibilityLevel >=3on the coercion target [DEFAULT]
Summary
By default, the Active Directory domain computer accounts for primary site servers (including CAS site servers) and passive site servers are granted membership in their respective site database server’s local Administrators group. An attacker who is able to successfully coerce NTLM authentication from one of these accounts and relay it to the site database server via SMB can use these permissions to access the system and database, then grant an arbitrary domain account the SCCM “Full Administrator” role.Impact
The “Full Administrator” security role is granted all permissions in Configuration Manager for all scopes and all collections. An attacker with this privilege can execute arbitrary programs on any client device that is online as SYSTEM, the currently logged on user, or as a specific user when they next log on. They can also leverage tools such as CMPivot and Run Script to query or execute scripts on client devices in real-time using the AdminService or WMI on an SMS Provider.Defensive IDs
- DETECT-1: Monitor site server domain computer accounts authenticating from another source
- PREVENT-12: Require SMB signing on site systems
- PREVENT-20: Block unnecessary connections to site systems
Subtechniques
- TAKEOVER-2.1: Coerce primary site server
- TAKEOVER-2.2: Coerce passive site server
Examples
The steps to execute TAKEOVER-2.1 and TAKEOVER-2.2 are the same except that a different system is targeted for coercion of NTLM authentication.Windows
-
On the attacker relay server, start
ntlmrelayx, targeting the IP address of the site database server and starting a SOCKS proxy: -
Coerce authentication from the site server’s domain computer account:
Observe that a connection is received on the relay server and a SOCKS proxy the site database server is started with the relayed credentials:
-
Proxy in secretsdump to obtain credentials for the MSSQL database, which may be running as
LocalSystemor a domain service account: -
Get a shell/agent on the system as SYSTEM:
At this point, if the service is running in the context of
LocalSystem, you can access the database to grant a user theFull Administratorrole (see TAKEOVER-1). If the database is running in the context of a domain service account, further steps are needed. -
Identify the account running the sqlservr.exe service. In this example, the site database is running in the context of
MAYYHEM\sqlsvc: -
Get the SPN for the database service account:
From another Windows system:
-
Get a TGT for the SQL service account running the site database:
-
Get a TGS for the MSSQLSvc SPN using S4U2self, impersonating the primary site server:
-
Start a sacrificial logon session for the Kerberos ticket:
-
Import the ticket into the sacrificial logon session:
-
Launch SQL Server Management Studio, connect to the site database, and grant the “Full Administrator” role to an arbitrary account (see TAKEOVER-1):
Note that it may be possible to conduct this attack entirely from the site database server if the attacker can force the use of Kerberos authentication locally (e.g., using tradecraft similar to KrbRelayUp).
Linux
-
Start
ntlmrelayxwith a SOCKS proxy -
Coerce auth
-
Receive connection on relay server
-
Proxy in secretsdump
-
Get TGT for SQL service account running the site database
-
S4U
-
Auth to MSSQL
References
- Elad Shamir, Wagging the Dog: Abusing Resource-Based Constrained Delegation to Attack Active Directory
- Charlie Clark, Revisiting ‘Delegate 2 Thyself’
- Charlie Bromberg, S4U2self Abuse