Detectionmediumtest

ConvertTo-SecureString Cmdlet Usage Via CommandLine

Detects usage of the "ConvertTo-SecureString" cmdlet via the commandline. Which is fairly uncommon and could indicate potential suspicious activity

Open in Detection LabConvert ruleBuild Package
Teymur Kheirkhabarov, Vasiliy Burov, oscd.community, Tim SheltonCreated 2020-10-11Updated 2023-02-0174403157-20f5-415d-89a7-c505779585cfwindows
Log Source
WindowsProcess Creation
ProductWindows← raw: windows
CategoryProcess Creation← raw: process_creation

Events generated when a new process is spawned on the system. Covers command-line arguments, parent/child relationships, and process metadata.

Detection Logic
Detection Logic2 selectors
detection:
    selection_img:
        - Image|endswith:
              - '\powershell.exe'
              - '\pwsh.exe'
        - OriginalFileName:
              - 'PowerShell.EXE'
              - 'pwsh.dll'
    selection_cli:
        CommandLine|contains: 'ConvertTo-SecureString'
    condition: all of selection_*
False Positives

Legitimate use to pass password to different powershell commands

Testing & Validation

Regression Tests

by frack113
Positive Detection Test1 matchevtx

Microsoft-Windows-Sysmon

Rule Metadata
Rule ID
74403157-20f5-415d-89a7-c505779585cf
Status
test
Level
medium
Type
Detection
Created
2020-10-11
Modified
2023-02-01
Path
rules/windows/process_creation/proc_creation_win_powershell_cmdline_convertto_securestring.yml
Raw Tags
attack.stealthattack.t1027attack.executionattack.t1059.001
View on GitHub