Potential Credential Harvesting via Python


Description

Identifies Python interpreters started with -c (inline code) where the command line suggests looking up credentials from a browser's password store.

Query · eql

process where event.type == "start" and event.action in ("start", "exec") and
process.name like~ ("python*", "py.exe", "py", "pypy*") and process.args == "-c" and
process.command_line like~ "*Secret.password_lookup_sync*" and
process.command_line like~ ("*microsoft-edge*", "*brave*", "*chromium*", "*chrome*", "*vivaldi*", "*opera*")
Raw source Potential Credential Harvesting via Python · Elastic TOML
Esc
Published by elastic/protections-artifacts ↗, licensed under Elastic License 2.0 ↗. Reproduced here unmodified.
[rule]
description = """
Identifies Python interpreters started with -c (inline code) where the command line suggests looking up credentials from
a browser's password store.
"""
id = "d2f85eb5-4ea2-484e-82a1-98399a532f97"
license = "Elastic License v2"
name = "Potential Credential Harvesting via Python"
os_list = ["macos"]
reference = ["https://www.wiz.io/blog/threat-actors-target-crypto-orgs"]
version = "1.0.1"

query = '''
process where event.type == "start" and event.action in ("start", "exec") and
process.name like~ ("python*", "py.exe", "py", "pypy*") and process.args == "-c" and
process.command_line like~ "*Secret.password_lookup_sync*" and
process.command_line like~ ("*microsoft-edge*", "*brave*", "*chromium*", "*chrome*", "*vivaldi*", "*opera*")
'''

min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.006"
name = "Python"
reference = "https://attack.mitre.org/techniques/T1059/006/"



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1555"
name = "Credentials from Password Stores"
reference = "https://attack.mitre.org/techniques/T1555/"


[threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"

[internal]
min_endpoint_version = "7.15.0"

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.