Command and Scripting Interpreter: Python T1059.006
Tactic: Execution
Adversaries may abuse Python commands and scripts for execution. Python is a very popular scripting/programming language, with capabilities to perform many functions. Python can be executed interactively from the command-line (via the python.exe interpreter) or via scripts (.py) that can be written and distributed to different systems. Python code can also be compiled into binary executables.
Events covered
12 catalog events are tagged with this technique by at least one rule.
| Provider | Event | Title |
|---|---|---|
| Sysmon | Event ID 1 | Process creation |
| Sysmon | Event ID 11 | FileCreate |
| Security-Auditing | Event ID 4688 | A new process has been created. |
| ESF | exec | Process Execution (Notify) |
| ESF | create | File or Directory Create (NOTIFY) |
| ESF | write | File Write (NOTIFY) |
| AppLocker | Event ID 8004 | FilePathBuffer was prevented from running. |
| AppLocker | Event ID 8007 | FilePathBuffer was prevented from running. |
| AppLocker | Event ID 8022 | PackageBuffer was prevented from running. |
| AppLocker | Event ID 8025 | PackageBuffer was prevented from running. |
| Sysmon-for-Linux | Event ID 1 | Process Create |
| Sysmon-for-Linux | Event ID 11 | File created |
Authoring guide
Patterns shared across the 54 rules above: which fields they filter on, what specific values they look for, and what they exclude. The catalog normalizes field names across vendors so Sigma's Image, Elastic's process.name, and Splunk's process_name collapse into one row. Each rule contributes at most once per row.
Fields filtered most (54 distinct)
The fields most rules look at when detecting this technique. The How column shows the operators authors use (eq, wildcard, regex_match, match) and how often each appears. Sample values are concrete examples to start from, not an exhaustive list.
Top indicator values (787 distinct)
Specific (field, operator, value) combinations the rules check for, ranked by how many rules under this technique use each one. The Corpus reach column counts how many rules across the entire catalog (any technique) check the same combination. High numbers point to widely-used indicators that are likely noisy on their own; combine them with another condition for useful signal. Blank means the combination is specific to rules under this technique. Click a value to expand the rules under this technique that use it.
Exclusions (223 distinct)
Field/operator/value combinations excluded by rules under this technique (top-level not() clauses), sorted by how many rules exclude each. These are the false-positive paths the community has learned to filter out. A new rule that ignores the high-count entries here will likely fire on the same noisy paths. Click a value to expand the rules under this technique that exclude it.
Rules under this technique
Every rule in the catalog tagged with this technique, grouped by vendor. Click a rule title for its full predicates, exclusions, and indicators.
Sigma 11 rules
- AppLocker Prevented Application or Script from Running
- Axios NPM Compromise Indicators - Linux
- Emotet Loader Execution Via .LNK File
- Potential CVE-2022-22954 Exploitation Attempt - VMware Workspace ONE Access Remote Code Execution
- Python One-Liners with Base64 Decoding
- Python One-Liners with Base64 Decoding - Linux
- Python Path Configuration File Creation - Linux
- Python Path Configuration File Creation - MacOS
- Python Path Configuration File Creation - Windows
- Serpent Backdoor Payload Execution Via Scheduled Task
- Suspicious File Characteristics Due to Missing Fields
Elastic 42 rules
- Base64 Decoded Payload Piped to Interpreter
- Decoded Payload Piped to Interpreter Detected via Defend for Containers
- Deprecated - EggShell Backdoor Execution
- Deprecated - Unusual Process Spawned from Web Server Parent
- Encoded Payload Detected via Defend for Containers
- Execution via GitHub Actions Runner
- Execution via OpenClaw Agent
- Execution with Explicit Credentials via Scripting
- First Time Python Spawned a Shell on Host
- Google Calendar C2 via Script Interpreter
- Interactive Terminal Spawned via Python
- Long Base64 Encoded Command via Scripting Interpreter
- Payload Execution via Shell Pipe Detected by Defend for Containers
- Perl Outbound Network Connection
- Potential Etherhiding C2 via Blockchain Connection
- Potential Hex Payload Execution via Common Utility
- Potential JAVA/JNDI Exploitation Attempt
- Potential Privilege Escalation via Python cap_setuid
- Potential Reverse Shell via Suspicious Child Process
- Potential Reverse Shell via UDP
- Potential SAP NetWeaver Exploitation
- Process Spawned from Message-of-the-Day (MOTD)
- Python Path File (pth) Creation
- Python Site or User Customize File Creation
- ROT Encoded Python Script Execution
- Script Interpreter Connection to Non-Standard Port
- Simple HTTP Web Server Connection
- Simple HTTP Web Server Creation
- Suspicious APT Package Manager Execution
- Suspicious AWS S3 Connection via Script Interpreter
- Suspicious Browser Child Process
- Suspicious Curl to Jamf Endpoint
- Suspicious Emond Child Process
- Suspicious Installer Package Spawns Network Event
- Suspicious Interpreter Execution Detected via Defend for Containers
- Suspicious macOS MS Office Child Process
- Suspicious Python Shell Command Execution
- Suspicious React Server Child Process
- Unusual Base64 Encoding/Decoding Activity
- Unusual Library Load via Python
- Web Server Potential Command Injection Request
- Web Server Spawned via Python