Skip to main content

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 = 0 or not present, or = 1 and BlockNTLMServerExceptionList contains attacker relay server [DEFAULT]
    • RestrictSendingNTLMTraffic = 0, 1, or not present, or = 2 and ClientAllowedNTLMServers contains attacker relay server [DEFAULT]
    • Domain computer account is not in Protected Users [DEFAULT]
  • Domain controller settings:
    • RestrictNTLMInDomain = 0 or not present, or is configured with any value and DCAllowedNTLMServers contains coercion target [DEFAULT]

Relay

  • Connectivity from the relay server to SMB (TCP/445) on the relay target, the site database
  • Relay target settings:
    • RequireSecuritySignature = 0 or not present [DEFAULT]
    • RestrictReceivingNTLMTraffic = 0 or not present [DEFAULT]
    • Coercion target is local admin (to access RPC/admin shares)
  • Domain controller settings:
    • RestrictNTLMInDomain = 0 or not present, or is configured with any value and DCAllowedNTLMServers contains relay target [DEFAULT]
    • LmCompatibilityLevel < 5 or not present, or = 5 and LmCompatibilityLevel >= 3 on 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

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

  1. On the attacker relay server, start ntlmrelayx, targeting the IP address of the site database server and starting a SOCKS proxy:
  2. 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:
  3. Proxy in secretsdump to obtain credentials for the MSSQL database, which may be running as LocalSystem or a domain service account:
  4. 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 the Full Administrator role (see TAKEOVER-1). If the database is running in the context of a domain service account, further steps are needed.
  5. Identify the account running the sqlservr.exe service. In this example, the site database is running in the context of MAYYHEM\sqlsvc:
  6. Get the SPN for the database service account:
    From another Windows system:
  7. Get a TGT for the SQL service account running the site database:
  8. Get a TGS for the MSSQLSvc SPN using S4U2self, impersonating the primary site server:
  9. Start a sacrificial logon session for the Kerberos ticket:
  10. Import the ticket into the sacrificial logon session:
  11. 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

  1. Start ntlmrelayx with a SOCKS proxy
  2. Coerce auth
  3. Receive connection on relay server
  4. Proxy in secretsdump
  5. Get TGT for SQL service account running the site database
  6. S4U
  7. Auth to MSSQL

References