Detection rules › Elastic

Suspicious Mining Process Events

Source
github.com/elastic/protections-artifacts

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

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.

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec
field:"EventType" kind:eq value:"exec"
event.typeeq
  • start
field:"event.type" kind:eq value:"start"
process.argseq
  • off
  • stop
field:"process.args" kind:eq
process.argsin
  • apache4.service
  • c3pool_miner.service
  • disable
  • kill
  • moneroocean_miner.service
  • pastebin.service
  • pnsd.service
  • reload
  • restart
  • start
  • stop
  • xvf.service
field:"process.args" kind:in
process.nameeq
  • chkconfig
  • service
  • systemctl
field:"process_name" kind:eq