MITRE ATT&CK TTPs
Requirements
- Unauthenticated network access
- Line of sight to DHCP server (optional, but helps)
- Line of sight to PXE-enabled distribution point
Summary
SCCM contains a preboot execution environment (PXE) feature which allows systems to load a specific operating system image on boot. When PXE is configured, SCCM will make various configuration changes to the distribution point (DP). Most notably, thePxeInstalled and IsPxe values under the HKLM\Software\Microsoft\SMS\DP registry key are set to 1.
The boot images are then deployed from the site server to the DP’s file system at C:\RemoteInstall\.
The three required components for PXE boot to work are: a PXE client, a DHCP server, and a PXE-enabled DP. A non-domain-joined computer (the PXE client in this case) that has network access could initiate the DHCP process, resulting in the PXE client receiving a DHCPPACK request containing the BootFileName location and Windows Deployment Services (WDS) network boot program (NBP). Next, the client initiates a TFTP session to download the NBP. The NBP contains several files and and programs that are used to boot the computer into a Windows Preinstallation Environment (WinPE).
To Summarize this process, how PXE works in SCCM:
- PXE client gets an IP from DHCP server
- Client sends new DHCPREQUEST to DP, DP responds with DHCPACK that contains the BootFileName
- Client starts TFTP session targeting the boot file
- Client downloads the network boot program (NBP)
- NBP downloads the operating system loader and boot files
- The WinPE image is loaded into a RAMDISK in memory
- WinPE boots, loading a task sequence (TS) boot shell, TS manager boot strap (TsPxe.dll)
- TS environment variables and a client certificate are downloaded via TFTP
- TSPXE locates the MP and downloads policy assignments
- Collection and machine variables are downloaded
NAAConfig (network access account(NAA)), TaskSequence, and CollectionSettings (collection variables) policies.
Impact
Attackers may recover domain credentials from this process, the difficulty of which is a direct function of the complexity of the password set on the PXE media file. If a weak password is set, cracking the password is relatively computionally “easy,” depending on the hardware. With these credentials, attackers may transition from an unauthenticated context on the network to a domain-authenticated context. If any of the credentials recovered are privileged, it may also enable privilege escalation and lateral movement vectors.Defensive IDs
- DETECT-7: Monitor read access to the SMSTemp directory
- PREVENT-3: Harden or disable network access accounts
- PREVENT-6: Configure a strong PXE boot password
- PREVENT-7: Disable command support in PXE boot configuration
- PREVENT-21: Restrict PXE boot to authorized VLANs
Examples
PXEThief
It is now possible to locate a PXE-enabled DP, download the encrypted media variables file, recover the certificate and management point URL from the variables file, and request and deobfuscate policy secrets in one command from a Linux box with this PR to PXEThief by Nic Losby @Blurbdust: https://github.com/MWR-CyberSec/PXEThief/pull/11Pxethiefy.py
Using pxethiefy from a Linux machine with network access to retrieve a PXE media file with no password set:Cred1py
Using Cred1py from a Linux machine over a UDP SOCKS5 proxy to retrieve the decryption key for a PXE media file: On Cobalt Strike, enable UDP SOCKS5 proxy on port 9090:References
- Christopher Panayi, Identifying and Retrieving Credentials From SCCM/MECM Task Sequences
- Christopher Panayi, Pulling Passwords Out of Configuration Manager
- Christopher Panayi, PXEThief
- Christopher Panayi, AES-128 ConfigMgr CryptDeriveKey Hashcat Module
- Carsten Sandker, pxethiefy
- Microsoft, Understanding PXE Boot
- SpecterOps, Cred1py
- Nic Losby, PXEThief PR 11