Skip to content

Commit

Permalink
[New] ROT encoded Python Script Execution (#4084)
Browse files Browse the repository at this point in the history
* [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
Samirbous authored and github-actions[bot] committed Sep 17, 2024
1 parent a6bd8df commit 21053fc
Showing 1 changed file with 63 additions and 0 deletions.
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/"

0 comments on commit 21053fc

Please sign in to comment.