Suspicious PowerShell ConvertTo-SecureString Cmdlet Usage
Detection of the ConvertTo-SecureString cmdlet usage via command-line, which is often used in adversarial scripts to handle credentials or obfuscated strings.
The usage of the 'ConvertTo-SecureString' cmdlet via the PowerShell command-line is often considered an uncommon operational pattern for standard administrative tasks. Adversaries frequently leverage this cmdlet to convert plain-text passwords into secure strings, facilitating their use in automated scripts or obfuscating credentials intended for downstream malicious processes. While legitimate administrative scripts may employ this cmdlet to pass credentials across different PowerShell sessions or modules, its direct invocation via a command-line interface warrants investigation, particularly when paired with encoded commands or non-standard parent processes. Defenders should treat this activity as a signal to inspect the broader context of the PowerShell execution chain, as it is a common precursor to credential materialization or privilege escalation activities.
Impact
Successful exploitation of credential handling via this cmdlet may lead to unauthorized access to secured system resources, sensitive data exfiltration, or lateral movement within an organization's network if automated scripts are compromised.
Recommendation
Deploy the provided Sigma rule to identify direct invocation of ConvertTo-SecureString and correlate these events with parent process activity to identify unauthorized credential handling.
- Enable PowerShell script block logging to augment command-line telemetry and provide deeper visibility into the execution context.
- Review and baseline existing administrative automation scripts that rely on this cmdlet to reduce false positives in the SIEM.
- Investigate any command-line execution where ConvertTo-SecureString is followed by execution of secondary processes or web-based network connections.
Threat Hunt
Search command-line logs for ConvertTo-SecureString occurrences across the enterprise.
Data: Process creation events (Event ID 1)
Detection coverage 1
Detect ConvertTo-SecureString Cmdlet Usage
mediumDetects usage of the 'ConvertTo-SecureString' cmdlet via the command-line, which is fairly uncommon and could indicate potential suspicious activity
Detection queries are available on the platform. Get full rules →