-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #229 from GoSecure/credssp
feat: Added CredSSP support when private key is known
- Loading branch information
Showing
6 changed files
with
77 additions
and
8 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Extracting Windows Server Remote Desktop Certificate | ||
|
||
This procedure is useful when running honeypots to support CredSSP (using `--auth ssp`). | ||
It requires Administrative privileges on the target server and the use of Mimikatz, so it assumes that you are able to deactivate the Anti-Virus on the target server. | ||
|
||
|
||
> **WARNING**: Cloning the certificate of the RDP server does not mean that the certificate will be trusted. Certificate trust requires a signed certificate from a CA that is **trusted** by the client. This is not likely to be the case in most scenarios. If you want to do that, you are on your own. | ||
## Steps | ||
|
||
1. Turn off AV so mimikatz doesn't get flagged. (Or use excluded directory) | ||
2. Download mimikatz latest release. | ||
3. Go to `Start > Run... > certlm.msc` (optional) | ||
4. Identify the valid certificate under `Remote Desktop > Certificates` and note the thumbprint (optional) | ||
5. Export the Remote Desktop certificates using Mimikatz: | ||
|
||
``` | ||
crypto::capi | ||
privilege::debug | ||
crypto::cng | ||
crypto::certificates /systemstore:LOCAL_MACHINE /store:"Remote Desktop" /export | ||
``` | ||
|
||
6. Convert public key to `.pem` using openssl: | ||
|
||
``` | ||
openssl x509 -inform DER -outform PEM -in pubkey.der -out pubkey.pem | ||
``` | ||
|
||
7. Remove private key password (password for `.pfx` is "mimikatz") | ||
|
||
``` | ||
openssl pkcs12 -nodes -in privkey.pfx -out privkey.key | ||
``` | ||
|
||
You can now run `pyrdp-mitm.py` by specifying `-k privkey.key -c pubkey.pem` and PyRDP will serve the same certificate as the server. |
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