-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…ypto Namespace Usage new: Invocation Of Crypto-Classes From The "Cryptography" PowerShell Namespace new: Registry Set With Crypto-Classes From The "Cryptography" PowerShell Namespace fix: Import New Module Via PowerShell CommandLine - Fix typo in condition --------- Co-authored-by: nasbench <[email protected]> Co-authored-by: phantinuss <[email protected]>
- Loading branch information
1 parent
3990060
commit c9054fa
Showing
3 changed files
with
90 additions
and
2 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
...threat-hunting/windows/process_creation/proc_creation_win_powershell_crypto_namespace.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
title: Invocation Of Crypto-Classes From The "Cryptography" PowerShell Namespace | ||
id: ad856965-f44d-42a8-945e-bbf7bd03d05a | ||
status: experimental | ||
description: | | ||
Detects the invocation of PowerShell commands with references to classes from the "System.Security.Cryptography" namespace. | ||
The PowerShell namespace "System.Security.Cryptography" provides classes for on-the-fly encryption and decryption. | ||
These can be used for example in decrypting malicious payload for defense evasion. | ||
references: | ||
- https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography?view=net-8.0 | ||
- https://blogs.vmware.com/security/2023/11/jupyter-rising-an-update-on-jupyter-infostealer.html | ||
- https://www.virustotal.com/gui/file/39102fb7bb6a74a9c8cb6d46419f9015b381199ea8524c1376672b30fffd69d2 | ||
author: Andreas Braathen (mnemonic.io) | ||
date: 2023/12/01 | ||
tags: | ||
- attack.defense_evasion | ||
- attack.t1059.001 | ||
- attack.t1027.010 | ||
- detection.threat_hunting | ||
logsource: | ||
product: windows | ||
category: process_creation | ||
detection: | ||
selection_img: | ||
- Image|endswith: | ||
- '\powershell.exe' | ||
- '\pwsh.exe' | ||
- OriginalFileName: | ||
- 'PowerShell.EXE' | ||
- 'pwsh.dll' | ||
selection_cmdlet_namespace: | ||
CommandLine|contains: 'System.Security.Cryptography.' | ||
selection_cmdlet_classes: | ||
CommandLine|contains: | ||
- '.AesCryptoServiceProvider' | ||
- '.DESCryptoServiceProvider' | ||
- '.DSACryptoServiceProvider' | ||
- '.RC2CryptoServiceProvider' | ||
- '.Rijndael' | ||
- '.RSACryptoServiceProvider' | ||
- '.TripleDESCryptoServiceProvider' | ||
condition: all of selection_* | ||
falsepositives: | ||
- Classes are legitimately used, but less so when e.g. parents with low prevalence or decryption of content in temporary folders. | ||
level: medium |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...threat-hunting/windows/registry/registry_set/registry_set_powershell_crypto_namespace.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
title: Registry Set With Crypto-Classes From The "Cryptography" PowerShell Namespace | ||
id: 1c2a3268-3881-414a-80af-a5b313b14c0e | ||
status: experimental | ||
description: | | ||
Detects the setting of a registry inside the "\Shell\Open\Command" value with PowerShell classes from the "System.Security.Cryptography" namespace. | ||
The PowerShell namespace "System.Security.Cryptography" provides classes for on-the-fly encryption and decryption. | ||
These can be used for example in decrypting malicious payload for defense evasion. | ||
references: | ||
- https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography?view=net-8.0 | ||
- https://squiblydoo.blog/2023/11/07/october-2023-solarmarker/ | ||
author: Andreas Braathen (mnemonic.io) | ||
date: 2023/12/01 | ||
tags: | ||
- attack.defense_evasion | ||
- attack.t1059.001 | ||
- attack.t1027.010 | ||
- attack.t1547.001 | ||
- detection.threat_hunting | ||
logsource: | ||
product: windows | ||
category: registry_set | ||
detection: | ||
selection_key: | ||
EventType: SetValue | ||
TargetObject|contains: '\Shell\Open\Command' | ||
selection_value_img: | ||
Details|contains: | ||
- 'powershell' | ||
- 'pwsh' | ||
selection_value_namespace: | ||
Details|contains: 'System.Security.Cryptography.' | ||
selection_value_classes: | ||
Details|contains: | ||
- '.AesCryptoServiceProvider' | ||
- '.DESCryptoServiceProvider' | ||
- '.DSACryptoServiceProvider' | ||
- '.RC2CryptoServiceProvider' | ||
- '.Rijndael' | ||
- '.RSACryptoServiceProvider' | ||
- '.TripleDESCryptoServiceProvider' | ||
condition: all of selection_* | ||
falsepositives: | ||
- Classes are legitimately used, but less so when e.g. parents with low prevalence or decryption of content in temporary folders. | ||
level: medium |