Query: write Sigma for Adversaries may search for private key certificate files on compromised systems for insecurely stored credential
Matching passage: Sigma rule: Adversaries may search for private key certificate files on compromised systems for insecurely stored credential. Logsource: windows / process_creation. Rule: title: Private Keys Reconnaissance Via CommandLine Tools id: 213d6a77-3d55-4ce8-ba74-fcfef741974e status: test description: Adversaries may search for private key certificate files on compromised systems for insecurely stored credential references: - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1552.004/T1552.004.md author: frack113, Nasreddine Bencherchali (Nextron Systems) date: 2021-07-20 modified: 2023-03-06 tags: - attack.credential-access - attack.t1552.004 logsource: category: process_creation product: windows detection: selection_cmd_img: - Image|endswith: \cmd.exe - OriginalFileName: Cmd.Exe selection_cmd_cli: CommandLine|contains: 'dir ' selection_pwsh_img: - Image|endswith: - \powershell.exe - \pwsh.exe - OriginalFileName: - PowerShell.EXE - pwsh.dll selection_pwsh_cli: CommandLine|contains: 'Get-ChildItem ' selection_findstr: - Image|endswith: \findstr.exe - OriginalFileName: FINDSTR.EXE selection_ext: CommandLine|contains: - .key - .pgp - .gpg - .ppk - .p12 - .pem - .pfx - .cer - .p7b - .asc condition: selection_ext and (all of selection_cmd_* or all of selection_pwsh_* or selection_findstr) falsepositives: - Unknown level: medium
Near-miss passage: Sigma rule: Detects the use of WinAPI Functions via the commandline. As seen used by threat actors via the tool winapiexec. Logsource: windows / process_creation. Rule: title: Potential WinAPI Calls Via CommandLine id: ba3f5c1b-6272-4119-9dbd-0bc8d21c2702 related: - id: 03d83090-8cba-44a0-b02f-0b756a050306 type: derived status: test description: Detects the use of WinAPI Functions via the commandline. As seen used by threat actors via the tool winapiexec references: - https://twitter.com/m417z/status/1566674631788007425 author: Nasreddine Bencherchali (Nextron Systems) date: 2022-09-06 modified: 2025-03-06 tags: - attack.execution - attack.t1106 logsource: category: process_creation product: windows detection: selection: CommandLine|contains: - AddSecurityPackage - AdjustTokenPrivileges - Advapi32 - CloseHandle - CreateProcessWithToken - CreatePseudoConsole - CreateRemoteThread - CreateThread - CreateUserThread - DangerousGetHandle - DuplicateTokenEx - EnumerateSecurityPackages - FreeHGlobal - FreeLibrary - GetDelegateForFunctionPointer - GetLogonSessionData - GetModuleHandle - GetProcAddress - GetProcessHandle - GetTokenInformation - ImpersonateLoggedOnUser - kernel32 - LoadLibrary - memcpy - MiniDumpWriteDump - ntdll - OpenDesktop - OpenProcess - OpenProcessToken - OpenThreadToken - OpenWindowStation - PtrToString - QueueUserApc - ReadProcessMemory - RevertToSelf - RtlCreateUserThread - secur32 - SetThreadToken - VirtualAlloc - VirtualFree - VirtualProtect - WaitForSingleObject - WriteInt32 - WriteProcessMemory - ZeroFreeGlobalAllocUnicode filter_optional_mpcmdrun: Image|endswith: \MpCmdRun.exe CommandLine|contains: GetLoadLibraryWAddress32 filter_optional_compatTelRunner: ParentImage|endswith: \CompatTelRunner.exe CommandLine|contains: - FreeHGlobal - PtrToString - kernel32 - CloseHandle condition: selection and not 1 of filter_optional_* falsepositives: - Some legitimate action or applications may use these functions. Investigate further to determine the legitimacy of the activity. level: high