-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[New] ROT encoded Python Script Execution (#4084)
* [New] ROT encoded Python Script Execution * Update defense_evasion_encoding_rot13_python_script.toml * ++ * Update defense_evasion_encoding_rot13_python_script.toml --------- Co-authored-by: Colson Wilhoit <[email protected]> (cherry picked from commit def2a9e)
- Loading branch information
1 parent
0598d01
commit 3285549
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
rules/cross-platform/defense_evasion_encoding_rot13_python_script.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
[metadata] | ||
creation_date = "2024/09/17" | ||
integration = ["endpoint"] | ||
maturity = "production" | ||
updated_date = "2024/09/17" | ||
|
||
[rule] | ||
author = ["Elastic"] | ||
description = """ | ||
Identifies 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. | ||
""" | ||
from = "now-9m" | ||
index = ["logs-endpoint.events.process-*", "logs-endpoint.events.file-*"] | ||
language = "eql" | ||
license = "Elastic License v2" | ||
name = "ROT Encoded Python Script Execution" | ||
references = [ | ||
"https://www.elastic.co/security-labs/dprk-code-of-conduct", | ||
"https://www.reversinglabs.com/blog/fake-recruiter-coding-tests-target-devs-with-malicious-python-packages" | ||
] | ||
risk_score = 47 | ||
rule_id = "5ab49127-b1b3-46e6-8a38-9e8512a2a363" | ||
severity = "medium" | ||
tags = [ | ||
"Domain: Endpoint", | ||
"OS: Windows", | ||
"OS: macOS", | ||
"Use Case: Threat Detection", | ||
"Tactic: Defense Evasion", | ||
"Data Source: Elastic Defend", | ||
] | ||
type = "eql" | ||
|
||
query = ''' | ||
sequence 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*"] | ||
''' | ||
|
||
|
||
[[rule.threat]] | ||
framework = "MITRE ATT&CK" | ||
[[rule.threat.technique]] | ||
id = "T1140" | ||
name = "Deobfuscate/Decode Files or Information" | ||
reference = "https://attack.mitre.org/techniques/T1140/" | ||
[[rule.threat.technique]] | ||
id = "T1027" | ||
name = "Obfuscated Files or Information" | ||
reference = "https://attack.mitre.org/techniques/T1027/" | ||
[[rule.threat.technique.subtechnique]] | ||
id = "T1027.013" | ||
name = "Encrypted/Encoded File" | ||
reference = "https://attack.mitre.org/techniques/T1027/013/" | ||
|
||
|
||
[rule.threat.tactic] | ||
id = "TA0005" | ||
name = "Defense Evasion" | ||
reference = "https://attack.mitre.org/tactics/TA0005/" | ||
|