ROT Encoded Python Script Execution
editROT Encoded Python Script Execution
editIdentifies the execution of a Python script that uses the ROT cipher for letters substitution. Adversaries may use this method to encode and obfuscate part of their malicious code in legit python packages.
Rule type: eql
Rule indices:
- logs-endpoint.events.process-*
- logs-endpoint.events.file-*
Severity: medium
Risk score: 47
Runs every: 5m
Searches indices from: now-9m (Date Math format, see also Additional look-back time
)
Maximum alerts per execution: 100
References:
Tags:
- Domain: Endpoint
- OS: Windows
- OS: macOS
- Use Case: Threat Detection
- Tactic: Defense Evasion
- Data Source: Elastic Defend
Version: 1
Rule authors:
- Elastic
Rule license: Elastic License v2
Rule query
editsequence by process.entity_id with maxspan=1m [process where host.os.type in ("windows", "macos") and event.type == "start" and process.name : "python*"] [file where host.os.type in ("windows", "macos") and event.action != "deletion" and process.name : "python*" and file.name : "rot_??.cpython-*.pyc*"]
Framework: MITRE ATT&CKTM
-
Tactic:
- Name: Defense Evasion
- ID: TA0005
- Reference URL: https://attack.mitre.org/tactics/TA0005/
-
Technique:
- Name: Deobfuscate/Decode Files or Information
- ID: T1140
- Reference URL: https://attack.mitre.org/techniques/T1140/
-
Technique:
- Name: Obfuscated Files or Information
- ID: T1027
- Reference URL: https://attack.mitre.org/techniques/T1027/
-
Sub-technique:
- Name: Encrypted/Encoded File
- ID: T1027.013
- Reference URL: https://attack.mitre.org/techniques/T1027/013/