Cannot export the private key from my Windows server


02-11-2015 00-30-11

  • Download the file https://articatech.net/download/mimikatz.zip ( some antivirus detect this package as unwanted program ) a tool that will extract the private key from installed certificates.
  • Extract the mimikatz files to a directory on your Active Directory server.
  • Run cmd.exe as an Administrator (you may need to navigate to C:\Windows\System32\ and right-click the cmd.exe file)
  • Run the mimikatz.exe from the command prompt
  • Run the following commands:

privilege::debug
crypto::capi
crypto::keys /export

  • The last one will export all certificates from the store. You can export only the ones you need by using different flags.
    But it is lot more easier to export all and then choose only the one that is needed.
  • You should have a .pvk (private key) file in the same directory as mimikatz.exe now—probably just the one you installed.
    If you see multiple private keys, you’ll have to determine which one is the one you installed.
  • Close the terminal and that folder where mimikatz was run has all the exported certificates.
    To secure private key mimikatz adds a password which again is “mimikatz”.

 

  • Next, continue on the exportation wizard to obtain the certificate.

02-11-2015 23-08-33
Set the certificate file name and finish exportation.
02-11-2015 23-11-24

 On Artica

  • Go to the Certificate Center.
  • Create a new certificate and choose “Upload Your Certificate”

03-11-2015 00-37-29

  • Set your certificate name and click on Create button.

03-11-2015 00-38-55

  • Click on the empty created certificate
  • Choose Import a PVK private key
  • Select your exported pvk key file trough the mimikatz tool.

03-11-2015 00-40-39

  • Select Certificates tab.
  • Click on Certificate link
  • Open the exported certificate CER file
  • paste the content in the text area and click on Apply

03-11-2015 00-45-10

Leave a comment