Detectionmediumtest
Certificate Exported Via PowerShell - ScriptBlock
Detects calls to cmdlets inside of PowerShell scripts that are used to export certificates from the local certificate store. Threat actors were seen abusing this to steal private keys from compromised machines.
Florian Roth (Nextron Systems)Created 2021-04-23Updated 2023-05-18aa7a3fce-bef5-4311-9cc1-5f04bb8c308cwindows
Log Source
WindowsPowerShell Script
ProductWindows← raw: windows
CategoryPowerShell Script← raw: ps_script
Definition
Requirements: Script Block Logging must be enabled
Detection Logic
Detection Logic2 selectors
detection:
selection:
ScriptBlockText|contains:
- 'Export-PfxCertificate'
- 'Export-Certificate'
filter_optional_module_export:
ScriptBlockText|contains: 'CmdletsToExport = @('
condition: selection and not 1 of filter_optional_*False Positives
Legitimate certificate exports by administrators. Additional filters might be required.
MITRE ATT&CK
Tactics
Sub-techniques
Rule Metadata
Rule ID
aa7a3fce-bef5-4311-9cc1-5f04bb8c308c
Status
test
Level
medium
Type
Detection
Created
2021-04-23
Modified
2023-05-18
Path
rules/windows/powershell/powershell_script/posh_ps_export_certificate.yml
Raw Tags
attack.credential-accessattack.t1552.004