Detection rules › Sigma
Python One-Liners with Base64 Decoding
Detects Python one-liners that use base64 decoding functions in command line executions. Malicious scripts or attackers often use python one-liners to decode and execute base64-encoded payloads, which is a common technique for obfuscation and evasion.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution | T1059.006 Command and Scripting Interpreter: Python |
| Defense Evasion | T1027.010 Obfuscated Files or Information: Command Obfuscation |
Event coverage
| Provider | Event ID | Title |
|---|---|---|
| Sysmon | 1 | Process creation |
Stages and Predicates
Stage 1: all of selection_img
or:
Image|contains: '\python'
OriginalFileName|contains: python
Stage 2: all of selection_cli
or:
CommandLine|contains: .decode
CommandLine|contains: b16decode
CommandLine|contains: b32decode
CommandLine|contains: b32hexdecode
CommandLine|contains: b64decode
CommandLine|contains: b85decode
CommandLine|contains: z85decode
CommandLine|contains: ' -c'
CommandLine|contains: base64
CommandLine|contains: import
Indicators
Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.
| Field | Kind | Values |
|---|---|---|
CommandLine | match |
|
Image | match |
|
OriginalFileName | match |
|