MITRE ATT&CK TTPs
Requirements
The site database is not hosted on the coercion targetCoercion
- Valid Active Directory domain credentials
- Connectivity to SMB (TCP/445) on a coercion target:
- TAKEOVER-1.1: Coerce primary site server
- TAKEOVER-1.2: Coerce SMS Provider
- TAKEOVER-1.3: 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 MSSQL (TCP/1433) on the relay target, the site database
- Extended protection for authentication not required on the site database [DEFAULT]
- 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), systems hosting the SMS Provider role, and passive site servers are granted thedb_owner role in their respective site’s MSSQL database. An attacker who is able to successfully coerce NTLM authentication from one of these accounts and relay it to the site database can use these permissions to 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-14: Require EPA on AD CS and site databases
- PREVENT-20: Block unnecessary connections to site systems
Subtechniques
- TAKEOVER-1.1: Coerce primary site server
- TAKEOVER-1.2: Coerce SMS Provider
- TAKEOVER-1.3: Coerce passive site server
Examples
The steps to execute TAKEOVER-1.1 through TAKEOVER-1.3 are the same except that a different system is targeted for coercion of NTLM authentication.-
(Linux) Use
sccmhunterto get the hex-formatted SID of the Active Directory user you’d like to grant the Full Administrator role in SCCM, as well as the MSSQL statements required to grant the role to the user:(Windows) UseSharpSCCMto get the hex-formatted SID of the Active Directory user you’d like to grant the Full Administrator role in SCCM, and assemble the query based on the output from the examplesccmhuntercommand above, substituting the user SID, domain, and site code (ps1in this example) where appropriate. -
On the attacker relay server, start
ntlmrelayx, targeting the IP address of the site database server and the MSSQL service using the SQL statements assembled in the previous step: -
From the attacker host, coerce NTLM authentication from the site server via SMB, targeting the relay server’s IP address:
After a few seconds, you should receive an SMB connection on the relay server that is forwarded to the site database server to execute the SQL statements:
-
Confirm that the account now has the
Full Administratorrole by querying WMI on an SMS Provider. On Linux, usingsccmhunter:On Windows, usingSharpSCCM:
References
- Chris Thompson, SCCM Site Takeover via Automatic Client Push Installation
- Chris Thompson, SCCM Hierarchy Takeover: One Site to Rule Them All
- Garrett Foster, SCCM Hierarchy Takeover with High Availability
- Garrett Foster, sccmhunter
- Chris Thompson, SharpSCCM