MITRE ATT&CK TTPs
Requirements
One of the following:- Network access to SCCM SMB service (445/TCP) on a DP
- Network access to SCCM HTTP service (80/TCP or 443/TCP) on a DP
Summary
A distribution point (DPs) is a server role used by SCCM to host the various files used in software installs, patches, script deployments, etc. By default, these servers allow access via SMB (TCP/445) and HTTP/S (TCP/80 and/or TCP/443) and require some type of Windows authentication (i.e. NTLM). IT professionals and software engineers have a tendency of hardcoding credentials in scripts, configuration files, software, etc. Therefore, we can loot the SCCM DP and extract valid credentials as authenticated (and sometimes unauthenticated) attackers.SMB
TheC:\SCCMContentLib folder is shared via SMB as the SCCMContentLib$ SMB share and is accessible to any member of the Domain Users or Domain Computers groups. The file structure of the C:\SCCMContentLib folder is explained here
HTTP
The IIS web server hosted on the distribution point defines a virtual directory,SMS_DP_SMSPKG$, which maps to the C:\SCCMContentLib folder explained above. The web server will perform all the file structure processing for us, allowing to retrieve resources belonging to a package through HTTP (that are by default domain-authenticated with Kerberos/NTLM, as all interactions to fetch external resources from the distribution point).
URL format to list the subdirectories and files in a package: http://<DP>/sms_dp_smspkg$/<PackageID>/
Retrieving a file in a package: http://<DP>/sms_dp_smspkg$/<PackageID>/<filename>
Impact
If anonymous authentication (no credentials required) is enabled, an attacker can dump the DP files and analyze its contents for valid credentials. NTLM relaying is still possible under proper conditions. If authentication is required: An internal attacker can use existing credentials to authenticate to the SMB/HTTP services to loot the Distribution Points.Defensive IDs
- PREVENT-10: Enforce the principle of least privilege for accounts
- PREVENT-20: Block unnecessary connections to site systems
Examples
HTTP DP Looting (Anonymous Authentication Enabled)
HTTP DP Looting (NTLMRelayx to HTTP endpoint)
Currently, you can use the following version of impacket. There is a pending Pull Request (as of 14 August, 2024) to include this into the mainimpacket repository.
Just run your server and wait for authentication to take place.
SMB DP Looting (With Domain Credentials)
References
- Tomas Rzepka, Looting Microsoft Configuration Manager
- Tomas Rzepka, CMLoot
- Erik Hunstad, sccm-http-looter
- Alberto Rodriguez, ntlmrelayx
- Quentin Roland, sccmsecrets.py
- Shelltrail CMLoot.py & this blog