Detection rules › Elastic
Suspicious Mining Process Events
Identifies attempts to disable common mining services by name, which is a common pattern adopted by some mining malware droppers to remove competitors during installation time.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution |
Rule body
[rule]
description = """
Identifies attempts to disable common mining services by name, which is a common pattern adopted by some mining malware
droppers to remove competitors during installation time.
"""
id = "fbf9342e-3d1e-4fba-a828-92fa0fb4d21b"
license = "Elastic License v2"
name = "Suspicious Mining Process Events"
os_list = ["linux"]
version = "1.0.26"
query = '''
process where event.type == "start" and event.action == "exec" and (
(process.name == "service" and process.args == "stop") or
(process.name == "chkconfig" and process.args == "off") or
(process.name == "systemctl" and process.args in ("disable", "stop", "kill", "start", "reload", "restart"))
) and
process.args in ("moneroocean_miner.service", "c3pool_miner.service", "pnsd.service", "apache4.service", "pastebin.service", "xvf.service") and
not (
process.parent.command_line in ("bash", "-bash", "sh") or
process.parent.executable like "/usr/local/share/aliyun-assist/*/update_install" or
process.parent.args like "/usr/local/share/aliyun-assist/*"
)
'''
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.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and (
(process.name == "service" and process.args == "stop") or
(process.name == "chkconfig" and process.args == "off") or
(process.name == "systemctl" and process.args in ("disable", "stop", "kill", "start", "reload", "restart"))
) and
process.args in ("moneroocean_miner.service", "c3pool_miner.service", "pnsd.service", "apache4.service", "pastebin.service", "xvf.service") and
not (
process.parent.command_line in ("bash", "-bash", "sh") or
process.parent.executable like "/usr/local/share/aliyun-assist/*/update_install" or
process.parent.args like "/usr/local/share/aliyun-assist/*"
)
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.args | starts_with | /usr/local/share/aliyun-assist/ | excludes:process.parent.args field:"process.parent.args" value:"/usr/local/share/aliyun-assist/" |
process.parent.command_line | in | -bash, bash, sh | excludes:process.parent.command_line field:"process.parent.command_line" value:"-bash" field:"process.parent.command_line" value:"bash" field:"process.parent.command_line" value:"sh" |
process.parent.executable | wildcard | /usr/local/share/aliyun-assist/*/update_install | excludes:process.parent.executable field:"process.parent.executable" value:"/usr/local/share/aliyun-assist/*/update_install" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | eq |
| field:"process.args" kind:eq |
process.args | in |
| field:"process.args" kind:in |
process.name | eq |
| field:"process_name" kind:eq |