Command-Line Credential Strings

Detects credentials passed as command-line arguments in Windows batch scripts, PowerShell, and shell scripts. Covers net use /user:, schtasks /rp, psexec -p, cmdkey, and bare password= assignments. Mirrors Snaffler rule KeepCmdCredentials.

Type
regex
Engine
boost_regex
Confidence
medium
Confidence justification
Medium confidence: these command forms are highly suggestive of hardcoded credentials but appear in legitimate automation scripts. Tiered gating with evidence at 75/85 reduces false positives in documentation and approved deployment scripts.
Jurisdictions
global
Regulations
Criminal Code Act 1995 (Cth)
Frameworks
CIS Controls, ISO 27001, NIST CSF, PCI-DSS
Data categories
credentials, security
Scope
specific
Platform compatibility
Purview: Compatible, GCP DLP: Compatible, Macie: Compatible, Zscaler: Compatible, Palo Alto: Compatible, Netskope: Compatible

Pattern

net use [\s\S]{0,300}/user:

Corroborative evidence keywords

net use, [object Object], runas, psexec, password, schtasks, cmdkey

Proximity: 300 characters

Should match

Should not match

Known false positives

Collections