The CryptoPP ApplyFunction rule detects potential cryptographic operations that may be used to manipulate or process data in memory, which could indicate the use of cryptographic libraries for data encryption or exfiltration. SOC teams should proactively hunt for this behavior to identify potential data manipulation or covert communication channels in their Azure Sentinel environment.
YARA Rule
rule CryptoPP_ApplyFunction
{ meta:
author = "Maxx"
description = "CryptoPP ApplyFunction"
strings:
$c0 = { 51 8D 41 E4 56 8B 74 24 0C 83 C1 F0 50 51 8B 4C 24 18 C7 44 24 0C 00 00 00 00 51 56 E8 ?? ?? ?? ?? 83 C4 10 8B C6 5E 59 C2 08 00 }
$c1 = { 51 53 56 8B F1 57 6A 00 C7 44 24 10 00 00 00 00 8B 46 04 8B 48 04 8B 5C 31 04 8D 7C 31 04 E8 ?? ?? ?? ?? 50 8B CF FF 53 10 8B 44 24 18 8D 56 08 83 C6 1C 52 56 8B 74 24 1C 50 56 E8 ?? ?? ?? ?? 83 C4 10 8B C6 5F 5E 5B 59 C2 08 00 }
condition:
any of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 2 string patterns in its detection logic.
Scenario: System Update with CryptoPP Library
Description: A system update or patching process may include the use of the CryptoPP library for cryptographic operations.
Filter/Exclusion: process.name != "update.exe" OR process.name != "patchmgr.exe"
Scenario: Scheduled Job for Data Encryption
Description: A scheduled job may use CryptoPP to encrypt sensitive data as part of a compliance or security policy.
Filter/Exclusion: process.name != "scheduledtaskhost.exe" OR process.name != "encrypt_data_job.exe"
Scenario: Admin Task for Key Management
Description: An administrator may use a custom tool (e.g., keymgmt_tool.exe) that leverages CryptoPP for key generation or rotation.
Filter/Exclusion: process.name != "keymgmt_tool.exe" OR process.name != "admin_tool.exe"
Scenario: Log File Encryption Using CryptoPP
Description: A log management tool (e.g., log_encryptor.exe) may use CryptoPP to encrypt log files for secure storage.
Filter/Exclusion: process.name != "log_encryptor.exe" OR process.name != "logrotate.exe"
Scenario: Development Environment Testing
Description: Developers may run test scripts (e.g., test_crypto.exe) that use CryptoPP for testing cryptographic functions.
Filter/Exclusion: process.name != "test_crypto.exe" OR process.name != "dev_tool.exe"