SCCMSecrets.py 是一款 SCCM 策略利用工具。它不仅仅提取 NAA 凭据,还旨在提供一种针对 SCCM 策略利用的综合性方法。该工具可以在不同权限级别下执行,并尝试发现与策略分发相关的潜在错误配置。有关该工具及其用法的更多详细信息,请参阅相关文章: https://www.synacktiv.com/publications/sccmsecretspy-exploiting-sccm-policies-distribution-for-credentials-harvesting-initial
提供两个子命令:policies 和 files。
该子命令与 SCCM 管理点(Management Point)交互,以转储所有机密策略的内容(包括 NAA 配置、包含凭据的任务序列或集合变量)。为此,需要一台已批准的 SCCM 设备,这可以通过三种方式获得。
--altauth 标志,SCCMSecrets 将利用备用身份验证端点,从而绕过 mTLS 要求,并在没有凭据且不存在自动设备批准错误配置的情况下获得已批准设备(更多信息请参阅此处)。这仅在 MP 配置为使用 HTTPS,并且 SCCM 站点配置为在整个站点范围内强制使用 HTTPS 时才有效(如果 MP 使用 HTTPS 但站点允许 HTTP 或 HTTPS,设备不会自动获得批准)。--use-existing-device)。此参数需要一个包含 guid.txt 文件(设备 GUID)和 key.pem 文件(设备私钥)的目录。该设备可以是之前执行 SCCMSecrets 创建的设备,也可以是对应于已失陷的合法 SCCM 客户端的设备。请注意,SCCM 策略与集合相关联。注册新设备会将此设备放入默认集合中——因此,只会检索来自默认集合的机密策略。这就是为什么使用 --use-existing-device 模拟已失陷的合法 SCCM 客户端会很有意义。实际上,该合法客户端可能属于与额外机密策略关联的自定义集合。
输出将放置在 loot 目录的子目录中(格式:[timestamp]_policies)。
$ python3 SCCMSecrets.py policies -h
Usage: SCCMSecrets.py policies [OPTIONS]
Dump secret policies from an SCCM Management Point
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ * --management-point -mp TEXT The client's SCCM management point. Expects either a URL, or a hostname/IP (defaults to HTTP in the latter case) [required] │
│ * --client-name -cn TEXT [Optional] The name of the client that will be created in SCCM - or a random name if using an existing device [required] │
│ --machine-name -u TEXT [Optional] A machine account name. If not provided, SCCMSecrets will try to exploit automatic device approval │
│ --machine-pass -p TEXT [Optional] The password for the machine account │
│ --machine-hash -H TEXT [Optional] The NT hash for the machine account │
│ --registration-sleep -rs INTEGER [Optional] The amount of time, in seconds, that should be waited after registrating a new device. A few minutes is recommended so that the new device can be added to │
│ device collections (3 minutes by default, may need to be increased) │
│ [default: 180] │
│ --use-existing-device -d TEXT [Optional] This option can be used to re-run SCCMSecrets.py using a previously registered device ; or to impersonate a legitimate SCCM client. In both cases, it │
│ expects the path of a folder containing a guid.txt file (the SCCM device GUID) and the key.pem file (the client's private key). Note that a client-name value must also │
│ be provided to SCCMSecrets (but does not have to match the one of the existing device) │
│ --pki-cert -c TEXT [Optional] The path to a valid domain PKI certificate in PEM format. Required when the Management Point enforces HTTPS and thus client certificate authentication │
│ --pki-key -k TEXT [Optional] The path to the private key of the certificate in PEM format │
│ --altauth -a [Optional] Use the MP's alternate authentication endpoint. This endpoint bypasses mutual TLS requirements, and automatically approves devices registered through it. It │
│ only works when the MP uses HTTPS AND HTTPS is enforced site-wide │
│ --verbose -v [Optional] Enable verbose output │
│ --help -h Show this message and exit. │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
该子命令将索引存储在分发点(Distribution Point)上的文件,并下载感兴趣的文件。SCCMSecrets 首先会尝试判断是否启用了匿名访问(非默认配置)。如果是这样,则无需身份验证即可索引和下载文件。否则,将需要域凭据。
可以按扩展名下载文件。SCCMSecrets 将索引托管在分发点上的所有包中的文件(生成一个采用 Unix tree 格式的 index.txt 文件),并下载具有指定扩展名的文件。当提供空扩展名列表时,仅执行文件索引。
在这两种情况下,都可以使用生成的索引文件中的 --urls 标志来下载特定的感兴趣文件(无需重新索引)。
请注意,如果实施了 mTLS 要求,可以通过提供 --nocert 标志来绕过。
输出将放置在 loot 目录的子目录中(格式:[timestamp]_files)。