Skip to content

T1552.004 Private Keys

Adversaries may search for private key certificate files on compromised systems for insecurely stored credentials. Private cryptographic keys and certificates are used for authentication, encryption/decryption, and digital signatures.1 Common key and certificate file extensions include: .key, .pgp, .gpg, .ppk., .p12, .pem, .pfx, .cer, .p7b, .asc.

Adversaries may also look in common key directories, such as ~/.ssh for SSH keys on * nix-based systems or C:\Users\(username)\.ssh\ on Windows. These private keys can be used to authenticate to Remote Services like SSH or for use in decrypting other collected files such as email.

Adversary tools have been discovered that search compromised systems for file extensions relating to cryptographic keys and certificates.23

Some private keys require a password or passphrase for operation, so an adversary may also use Input Capture for keylogging or attempt to Brute Force the passphrase off-line.

Item Value
ID T1552.004
Sub-techniques T1552.001, T1552.002, T1552.003, T1552.004, T1552.005, T1552.006, T1552.007
Tactics TA0006
Platforms Linux, Windows, macOS
Permissions required User
Version 1.0
Created 04 February 2020
Last Modified 29 March 2020

Procedure Examples

ID Name Description
S0677 AADInternals AADInternals can gather encryption keys from Azure AD services such as ADSync and Active Directory Federated Services servers.4
G0016 APT29 APT29 obtained PKI keys, certificate files and the private encryption key from an Active Directory Federation Services (AD FS) container to decrypt corresponding SAML signing certificates.1516
S0377 Ebury Ebury has intercepted unencrypted private keys as well as private key pass-phrases.12
S0363 Empire Empire can use modules like Invoke-SessionGopher to extract private key and session information.5
S0661 FoggyWeb FoggyWeb can retrieve token signing certificates and token decryption certificates from a compromised AD FS server.7
S0601 Hildegard Hildegard has searched for private keys in .ssh.10
S0283 jRAT jRAT can steal keys for VPNs and cryptocurrency wallets.9
S0599 Kinsing Kinsing has searched for private keys.8
S0409 Machete Machete has scanned and looked for cryptographic keys and certificate file extensions.11
S0002 Mimikatz Mimikatz‘s CRYPTO::Extract module can extract keys by interacting with Windows cryptographic application programming interface (API) functions.6
G0116 Operation Wocao Operation Wocao has used Mimikatz to dump certificates and private keys from the Windows certificate store.17
G0106 Rocke Rocke has used SSH private keys on the infected machine to spread its coinminer throughout a network.18
G0139 TeamTNT TeamTNT has searched for unsecured SSH keys.1314

Mitigations

ID Mitigation Description
M1047 Audit Ensure only authorized keys are allowed access to critical resources and audit access lists regularly.
M1041 Encrypt Sensitive Information When possible, store keys on separate cryptographic hardware instead of on the local system.
M1027 Password Policies Use strong passphrases for private keys to make cracking difficult.
M1022 Restrict File and Directory Permissions Ensure permissions are properly set on folders containing sensitive private keys to prevent unintended access.

Detection

ID Data Source Data Component
DS0017 Command Command Execution
DS0022 File File Access

References


  1. Wikipedia. (2017, June 29). Public-key cryptography. Retrieved July 5, 2017. 

  2. Kaspersky Labs. (2014, February 11). Unveiling “Careto” - The Masked APT. Retrieved July 5, 2017. 

  3. Bar, T., Conant, S., Efraim, L. (2016, June 28). Prince of Persia – Game Over. Retrieved July 5, 2017. 

  4. Dr. Nestori Syynimaa. (2018, October 25). AADInternals. Retrieved February 18, 2022. 

  5. Schroeder, W., Warner, J., Nelson, M. (n.d.). Github PowerShellEmpire. Retrieved April 28, 2016. 

  6. Metcalf, S. (2015, November 13). Unofficial Guide to Mimikatz & Command Reference. Retrieved December 23, 2015. 

  7. Ramin Nafisi. (2021, September 27). FoggyWeb: Targeted NOBELIUM malware leads to persistent backdoor. Retrieved October 4, 2021. 

  8. Singer, G. (2020, April 3). Threat Alert: Kinsing Malware Attacks Targeting Container Environments. Retrieved April 1, 2021. 

  9. Kamluk, V. & Gostev, A. (2016, February). Adwind - A Cross-Platform RAT. Retrieved April 23, 2019. 

  10. Chen, J. et al. (2021, February 3). Hildegard: New TeamTNT Cryptojacking Malware Targeting Kubernetes. Retrieved April 5, 2021. 

  11. ESET. (2019, July). MACHETE JUST GOT SHARPER Venezuelan government institutions under attack. Retrieved September 13, 2019. 

  12. M.Léveillé, M.. (2014, February 21). An In-depth Analysis of Linux/Ebury. Retrieved April 19, 2019. 

  13. Cado Security. (2020, August 16). Team TNT – The First Crypto-Mining Worm to Steal AWS Credentials. Retrieved September 22, 2021. 

  14. Fiser, D. Oliveira, A. (n.d.). Tracking the Activities of TeamTNT A Closer Look at a Cloud-Focused Malicious Actor Group. Retrieved September 22, 2021. 

  15. Microsoft 365 Defender Team. (2020, December 28). Using Microsoft 365 Defender to protect against Solorigate. Retrieved January 7, 2021. 

  16. NCSC, CISA, FBI, NSA. (2021, May 7). Further TTPs associated with SVR cyber actors. Retrieved July 29, 2021. 

  17. Dantzig, M. v., Schamper, E. (2019, December 19). Operation Wocao: Shining a light on one of China’s hidden hacking groups. Retrieved October 8, 2020. 

  18. Anomali Labs. (2019, March 15). Rocke Evolves Its Arsenal With a New Malware Family Written in Golang. Retrieved April 24, 2019. 

Back to top