Skip to main content

MITRE ATT&CK Tactics

Requirements

Coercion

  • Valid Active Directory domain credentials
  • Ability to create/join computer account within AD domain.
  • Ability to create a DNS A record
  • Connectivity from the primary site server to SMB (TCP/445) on the relay server
  • Primary site server settings:
    • Automatic site-wide client push installation is enabled [NON-DEFAULT]
    • Automatic site assignment is enabled [NON-DEFAULT]
    • AD System Discovery is enabled with newly created computer accounts within search path or below if search resursive child objects is enabled. [NON-DEFAULT]
    • Allow connection fallback to NTLM is enabled for client push installation or Hotfix KB15599094 is missing on older SCCM deployments [DEFAULT if installation version < 2103 OR KB15599094 is not installed]
    • 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

  • Relay target settings:
    • Connectivity from the relay server to SMB (TCP/445) on the relay target
    • 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

When SCCM automatic site assignment, automatic client push installation, and AD System Discovery are enabled, and newly created computer accounts are within the system discovery search path, it’s possible to coerce NTLM authentication from the site server’s installation and machine accounts to an arbitrary NetBIOS name, FQDN, or IP address, allowing the credentials to be relayed or cracked. This can be done using a low-privileged domain account if the default configuration is present which allows every domain user to create DNS records and join up to 10 computer accounts to AD.

Impact

Client push installation accounts require local admin privileges to install software on systems in an SCCM site, so it is often possible to relay the credentials and execute actions in the context of a local admin on other SCCM clients in the site. Many organizations use a member of highly privileged groups such as “Domain Admins” for client push installation for the sake of convenience. If all configured accounts fail when the site server tries to authenticate to a system to install the client, or if no specific installation accounts are configured, the server tries to authenticate with its domain computer account. If SMB is used, TAKEOVER-1 and TAKEOVER-2 may be possible. If further AD misconfigurations are present allowing downgrade to NTLMv1, this may allow relay to LDAP to conduct attacks such as Shadow Credentials, Resource-based Constrained Delegation. If the AD CS ESC8 vulnerability is present in the environment, this can be used to take over the server (TAKEOVER-3 or TAKEOVER-4).

Defensive IDs

Examples

It is not possible to identify whether automatic site-wide client push installation, automatic site assignment, AD System Discovery and Allow connection fallback to NTLM are enabled without attempting this attack.
  1. On the attacker relay server, using dnstool.py, create a DNS A record for an not yet existent computer.
  2. Use ntlmrelayx to either point at a list of servers without SMB signing, AD CS Web enrollment or another SCCM site server without smb signing depending on goals. If ntlmv1 is in use within AD, it may be possible to relay to LDAPS and execute RBCD or shadow credential based attacks.
  3. Join a windows machine to the domain by doing the following:
    • Navigate to Control Panel then “System and Security”
    • Select “See the name of this computer”
    • Select “Rename this PC (Advanced)
    • Click “Change” to rename this computer or change its domain or Workgroup
    • change the domain of your Windows PC to your target domain and change the computer name to what you desire.
    • Enter credentials when prompted and restart when prompted.
  4. After restarting, the computer, sign in with the user you joined the computer to the domain with and use setspn.exe to remove the host SPN’s for the machine account
  5. After a few minutes (in a default configuration an “delta discovery” takes place every 5 minutes. shortly after authentication attempts should happen.), ntlmrelayx should receive a connection from the configured client push installation account(s) and the site server’s machine account:

Cleanup

AD Computer Account cleanup

Prior to cleaning up the DDR from SCCM, its important to delete the computer account from Active Directory, otherwise, during the next full poll, the computer account may be re-discovered and a corresponding DDR may be recreated resulting in further authentication attempts. This will require administrative privileges within the domain. Using addcomputer.py from the impacket library to delete the computer account is one potential method.

AD DNS Record Cleanup

Using dnstool.py to remove the A record is one potential method. This will require administrative privileges.

SCCM DDR Cleanup

It is not possible to remotely delete device records or remove CCRs in the retry queue that are created by System Discovery generated DDRs without having Full Administrator privileges to SCCM. By default, the site will retry client push installation every 60 minutes for 7 days, and if a newly discovered device sits in the client push installation retry queue for more than 24 hours, an error message may be displayed in the console to administrators. With Full Administrator access to SCCM, artifacts can be removed from the site server and database through the ConfigMgr console or using SharpSCCM. The following command can be used to identify the device’s ResourceId:
The following command can be used to remove a device with a specified GUID:

References