Detect Potential Cleartext Credentials in Command Line
KQL Queries
KQL (Kusto Query Language) query to identify potential cleartext credentials in command lines, leveraging Microsoft Defender for Endpoint or other platforms like Azure Monitor Logs:
Key Features of the Query:
Filters Suspicious Command Lines:
Targets command lines with keywords commonly associated with credentials like
password
,pwd
,secret
, etc.
Extracts Potential Credentials:
Uses regex to extract possible key-value pairs (e.g.,
password=1234
).
Aggregation for Context:
Groups occurrences by
DeviceName
,AccountDomain
, andUsername
to provide context.
Summarization and Ordering:
Highlights accounts and devices with the highest occurrences of potential issues.
How It Works:
Extract_all Function: This regex extracts any matching patterns from the command line that indicate potential cleartext credentials.
Dynamic Analysis: Produces a dynamic array of potential matches, ensuring flexibility in parsing varying formats.
Adjustable Time Frame: Allows tuning for recent or historical analysis.
Use Case Scenarios:
Detect accidental or intentional exposure of credentials in scripts or commands.
Investigate potential misuse by attackers or internal personnel.
Last updated