Has used malware to extract SSH and GPG keys from victim environments.123
- Tactic
- Credential Access
- Platforms
- Linux, macOS, Network Devices, Windows
- Version
- 1.3
- Created
- 04 February 2020
- Last modified
- 12 May 2026
- Contributors
- Itzik Kotler, SafeBreach; Austin Clark, @c2defense
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.
Private Keys MITRE reference T1552.004
7 groups have been recorded using this technique. Newest first; each entry carries MITRE’s procedure text and a link to the group’s full record. Click a name to filter the rules below.
Has leveraged the Azure Owner role to access and steal the Storage Account Access keys using the Microsoft.Storage/storageAccounts/listkeys/action operation.1
Has accessed a Local State file that contains the AES key used to encrypt passwords stored in the Chrome browser.1
Enumerate and exfiltrate code-signing certificates from a compromised host.1
Has used SSH private keys on the infected machine to spread its coinminer throughout a network.1
All 7 groups for this technique · 6 newest in this preview
2 campaigns have been recorded using this technique. Listed newest first; dates are year-granularity and attribution is MITRE’s.
During the SolarWinds Compromise, 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.12
During Operation Wocao, threat actors used Mimikatz to dump certificates and private keys from the Windows certificate store.1
All 2 campaigns for this technique
14 software entries are documented implementing this technique. MITRE files each as a tool or as malware; newest first, then by how many groups carry them.
Has gathered unsecured credentials to include SSH private keys within .ssh.123
Has gathered SSH private keys from the .ssh file.1
Collects all data in victim .ssh folders by creating a compressed copy that is subsequently exfiltrated to command and control infrastructure. Troll Stealer also collects key information associated with the Government Public Key Infrastructure (GPKI) service for South Korean government information systems.12
Can collect a Chrome encryption key used to protect browser cookies.1
Can gather encryption keys from Azure AD services such as ADSync and Active Directory Federated Services servers.1
All 14 software entries for this technique · 6 newest in this preview
Offense vs defense T1552.004
Is defensive coverage keeping up with adversary use? Eight counts, each ranked against all 697 ATT&CK techniques. Attack sits left, defense right, so a shape leaning left means adversaries are better documented here than defenders are equipped. Hover any spoke for its percentile and the share of techniques that have more. The timeline below shows when each side arrived.
How it got here
Adversary activity (campaign spans) over cumulative rule output. Each source is plotted independently from zero, so neither line includes the other. Campaign dates are year-granularity.
Private Keys detection strategy DET0549
MITRE names one behaviour worth catching for this technique and breaks it into 4 analytics, one per platform. Each carries the log sources it needs and the fields you tune per environment.
Detect Suspicious Access to Private Key Files and Export Attempts Across Platforms
AN1516 · Windows
A process (non-system or user-initiated) accesses private key files in user profile paths or system certificate stores followed by potential network connections or compression activity.
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| Process CreationDC0032 | WinEventLog:Sysmon | EventCode=1 |
| File CreationDC0039 | WinEventLog:Sysmon | EventCode=11 |
| Network Share AccessDC0102 | WinEventLog:Security | EventCode=5145 |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| FilePathRegex | Regex for matching key file extensions (.pem, .pfx, .ppk, etc.) or known certificate directories like C:\Users\*\.ssh\ |
| ParentProcessName | Set of known benign certificate management tools to exclude (e.g., certutil.exe, ssh.exe) |
AN1517 · Linux
User or script-based access to ~/.ssh or other directories containing private keys followed by unusual shell activity or network connections.
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| Process CreationDC0032 | auditd:EXECVE | execve |
| File AccessDC0055 | auditd:SYSCALL | openat |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| FilePathRegex | Directory/file path regex for ~/.ssh, *.pem, *.key, *.p12 |
| CommandLineMatch | Script or user agent seen accessing keys (e.g., cat ~/.ssh/id_rsa, tar ~/.gnupg) |
AN1518 · macOS
Access to user private key directories (e.g., /Users/*/.ssh) via Terminal, scripting engines, or non-default processes.
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| Process CreationDC0032 | macos:unifiedlog | launch of bash/zsh/python/osascript targeting key file locations |
| File AccessDC0055 | macos:unifiedlog | open/read access to private key files (id_rsa, *.pem, *.p12) |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| ProcessName | Processes reading key files (osascript, python, bash, etc.) |
| FileAccessPath | Private key and certificate paths like /Users/*/.ssh, /Library/Keychains/ |
AN1519 · Network Devices
CLI-based export of private key material (e.g., 'crypto pki export') with anomalous user session or AAA role escalation.
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| Command ExecutionDC0064 | networkdevice:syslog | Detected CLI command to export key material |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| CLICommandMatch | Regex for export commands (e.g., crypto pki export, export ssh-key) |
| AAAUserContext | Source username or role performing export — may tune for known admins |
Ensure only authorized keys are allowed access to critical resources and audit access lists regularly.
When possible, store keys on separate cryptographic hardware instead of on the local system. For example, on Windows systems use a TPM to secure keys and other sensitive credential material.
Use strong passphrases for private keys to make cracking difficult.
Ensure permissions are properly set on folders containing sensitive private keys to prevent unintended access. Additionally, on Cisco devices, set the nonexportable flag during RSA key pair generation.
Tests from Atomic Red Team (MIT licence) · technique definition