Detection rules › Elastic

Potential Mining Pool Command Detection

Source
github.com/elastic/protections-artifacts

This rule detects the execution of a process with potential mining pool commandline arguments. Adversaries may leverage the resources of compromised systems to mine cryptocurrency, to generate revenue. This activity may impact system performance and availability.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
This rule detects the execution of a process with potential mining pool commandline arguments. Adversaries may leverage
the resources of compromised systems to mine cryptocurrency, to generate revenue. This activity may impact system
performance and availability.
"""
id = "fcc42a61-4507-4918-867b-d673e5b065dc"
license = "Elastic License v2"
name = "Potential Mining Pool Command Detection"
os_list = ["linux"]
reference = ["https://falco.org/blog/falco-detect-cryptomining/"]
version = "1.0.11"

query = '''
process where event.type == "start" and event.action == "exec" and process.parent.executable != null and (
  process.name like (
    "telnet.netkit", "ping", "telnet", "xmrig", "dash", "bash", "sh", "zsh", "ash", "fish", "ksh", "tcsh",
    "csh", "nohup", "pgrep", "python*", "perl*", "ruby*", "php*", "lua*", "sed", "pkill", "docker", "dig",
    "nslookup", "inetutils-telnet", "nc", "ncat", "netcat", "netcat.openbsd", "netcat.traditional", "nc.openbsd",
    "nc.traditional", "curl", "wget", "sudo", "grep", ".*"
  ) or
  process.executable like (
    "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/boot/*", "./*", "/sys/*", "/lost+found/*", "/media/*", "/proc/*",
    "/var/backups/*", "/var/log/*", "/var/mail/*", "/var/spool/*"
  )
) and
process.command_line like (
  "*cnpool.cc*", "*lindon-pool.win*", "*supportxmr.com*", "*comgandalph3000.com*", "*minergate.com*",
  "*fjhan.club*", "*emercoin.com*", "*poolto.be*", "*520fjh.org*", "*xmrpool.xyz*", "*simka.pw*", "*noobxmr.com*",
  "*miner.rocks*", "*minerpool.pw*", "*minemonero.gq*", "*usxmrpool.com*", "*moneroocean.stream*", "*mypool.online*",
  "*xmrpool.de*", "*emergate.net*", "*ip28.net*", "*mine.bz*", "*dwarfpool.com*", "*xmrig.com*", "*koto-pool.work*",
  "*monerorx.com*", "*zarabotaibitok.ru*", "*mining-help.ru*", "*mine2gether.com*", "*moneropool.com*", "*viaxmr.com*",
  "*minerrocks.com*", "*miningpoolhub.com*", "*cortins.tk*", "*pooldd.com*", "*unmineable.com*", "*f2pool.com*",
  "*graef.in*", "*nanopool.org*", "*myxmr.pw*", "*ratchetmining.com*", "*cryptmonero.com*", "*xmrminer.cc*",
  "*riefly.id*", "*iwanttoearn.money*", "*herominers.com*", "*xmrpool.me*", "*miners.pro*", "*luckpool.net*",
  "*twotouchauthentication.online*", "*hashvault.pro*", "*4i7i.com*", "*miningocean.org*", "*2miners.com*",
  "*xmrpool.eu*", "*monerpool.org*", "*joulecoin.org*", "*suprnova.cc*", "*monerocean.stream*", "*bohemianpool.com*", 
  "*crypto-pool.fr*", "*xmr.pt*", "*alimabi.cn*", "*teracycle.net*", "*monerogb.com*", "*armornetwork.org*",
  "*emercoin.net*", "*poolmining.org*", "*minexmr.cn*", "*moriaxmr.com*", "*ethereumpool.co*", "*minercircle.com*",
  "*prohash.net*", "*zer0day.ru*", "*crypto-pool.info*", "*pool.support*", "*siamining.com*", "*5b6b7b.ru*",
  "*c3pool.com*", "*somec.cc*", "*hellominer.com*", "*usa-138.com*", "*mixpools.org*", "*xmrpool.net*",
  "*moneroworld.com*", "*minerxmr.ru*", "*d5pool.us*", "*hashcity.org*", "*hex7e4.ru*", "*zpool.ca*", "*minexmr.com*",
  "*monerohash.com*", "*multipool.us*", "*moneropool.nl*", "*nbminer.com*", "*ppxxmr.com*", "*xmrfast.com*",
  "*webhop.net*", "*ethpool.org*", "*slushpool.com*", "*antpool.com*", "*nicehash.com*", "*nicehash.net*",
  "*zergpool.com*", "*mining-dutch.nl*", "*blockmasters.co*", "*bsod.pw*", "*fairpool.xyz*", "*miningrigrentals.com*",
  "*hashing24.com*", "*ethermine.org*", "*flexpool.io*", "*hiveon.net*", "*sparkpool.com*", "*2miners.org*",
  "*poolin.com*", "*viabtc.com*", "*f2pool.org*", "*coinhive.com*", "*cryptoloot.pro*", "*webmine.cz*",
  "*minero.cc*", "*monerohash.org*", "*monerohash.net*", "*moneropool.ru*", "*moneroocean.stream*", "*rx.unmineable.com*"
) and not (
  process.parent.name in ("sendmail", "postfix-local", "check-quota", "zmcontrol", "find", "timeout", "php") or
  process.name in ("timeout", "host", "ptxas") or
  process.command_line like ("*zpool.cache*", "*app/jobs/ant-sec_observe-income.py*") or
  process.parent.args == "/scripts/run_certbot.sh" or
  process.parent.command_line == "runc init" or
  (process.parent.command_line == "/bin/bash /usr/local/bin/soc_guard.sh" and process.executable == "/usr/bin/grep") or
  (process.parent.name like "php*" and process.command_line like "*/var/tools/koalaping/bin/ping.php*") or
  (
    process.parent.command_line == "/bin/bash /root/nicehash/nicehash_api.sh /main/api/v2/mining/algo/stats" and
    process.command_line like "python3 /root/nicehash/nicehash.py -b https://api2.nicehash.com -o * -m GET -p /main/api/v2/mining/algo/stats"
  )
)
'''

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/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1496"
name = "Resource Hijacking"
reference = "https://attack.mitre.org/techniques/T1496/"


[threat.tactic]
id = "TA0040"
name = "Impact"
reference = "https://attack.mitre.org/tactics/TA0040/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "exec" and process.parent.executable != null and (
  process.name like (
    "telnet.netkit", "ping", "telnet", "xmrig", "dash", "bash", "sh", "zsh", "ash", "fish", "ksh", "tcsh",
    "csh", "nohup", "pgrep", "python*", "perl*", "ruby*", "php*", "lua*", "sed", "pkill", "docker", "dig",
    "nslookup", "inetutils-telnet", "nc", "ncat", "netcat", "netcat.openbsd", "netcat.traditional", "nc.openbsd",
    "nc.traditional", "curl", "wget", "sudo", "grep", ".*"
  ) or
  process.executable like (
    "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/boot/*", "./*", "/sys/*", "/lost+found/*", "/media/*", "/proc/*",
    "/var/backups/*", "/var/log/*", "/var/mail/*", "/var/spool/*"
  )
) and
process.command_line like (
  "*cnpool.cc*", "*lindon-pool.win*", "*supportxmr.com*", "*comgandalph3000.com*", "*minergate.com*",
  "*fjhan.club*", "*emercoin.com*", "*poolto.be*", "*520fjh.org*", "*xmrpool.xyz*", "*simka.pw*", "*noobxmr.com*",
  "*miner.rocks*", "*minerpool.pw*", "*minemonero.gq*", "*usxmrpool.com*", "*moneroocean.stream*", "*mypool.online*",
  "*xmrpool.de*", "*emergate.net*", "*ip28.net*", "*mine.bz*", "*dwarfpool.com*", "*xmrig.com*", "*koto-pool.work*",
  "*monerorx.com*", "*zarabotaibitok.ru*", "*mining-help.ru*", "*mine2gether.com*", "*moneropool.com*", "*viaxmr.com*",
  "*minerrocks.com*", "*miningpoolhub.com*", "*cortins.tk*", "*pooldd.com*", "*unmineable.com*", "*f2pool.com*",
  "*graef.in*", "*nanopool.org*", "*myxmr.pw*", "*ratchetmining.com*", "*cryptmonero.com*", "*xmrminer.cc*",
  "*riefly.id*", "*iwanttoearn.money*", "*herominers.com*", "*xmrpool.me*", "*miners.pro*", "*luckpool.net*",
  "*twotouchauthentication.online*", "*hashvault.pro*", "*4i7i.com*", "*miningocean.org*", "*2miners.com*",
  "*xmrpool.eu*", "*monerpool.org*", "*joulecoin.org*", "*suprnova.cc*", "*monerocean.stream*", "*bohemianpool.com*", 
  "*crypto-pool.fr*", "*xmr.pt*", "*alimabi.cn*", "*teracycle.net*", "*monerogb.com*", "*armornetwork.org*",
  "*emercoin.net*", "*poolmining.org*", "*minexmr.cn*", "*moriaxmr.com*", "*ethereumpool.co*", "*minercircle.com*",
  "*prohash.net*", "*zer0day.ru*", "*crypto-pool.info*", "*pool.support*", "*siamining.com*", "*5b6b7b.ru*",
  "*c3pool.com*", "*somec.cc*", "*hellominer.com*", "*usa-138.com*", "*mixpools.org*", "*xmrpool.net*",
  "*moneroworld.com*", "*minerxmr.ru*", "*d5pool.us*", "*hashcity.org*", "*hex7e4.ru*", "*zpool.ca*", "*minexmr.com*",
  "*monerohash.com*", "*multipool.us*", "*moneropool.nl*", "*nbminer.com*", "*ppxxmr.com*", "*xmrfast.com*",
  "*webhop.net*", "*ethpool.org*", "*slushpool.com*", "*antpool.com*", "*nicehash.com*", "*nicehash.net*",
  "*zergpool.com*", "*mining-dutch.nl*", "*blockmasters.co*", "*bsod.pw*", "*fairpool.xyz*", "*miningrigrentals.com*",
  "*hashing24.com*", "*ethermine.org*", "*flexpool.io*", "*hiveon.net*", "*sparkpool.com*", "*2miners.org*",
  "*poolin.com*", "*viabtc.com*", "*f2pool.org*", "*coinhive.com*", "*cryptoloot.pro*", "*webmine.cz*",
  "*minero.cc*", "*monerohash.org*", "*monerohash.net*", "*moneropool.ru*", "*moneroocean.stream*", "*rx.unmineable.com*"
) and not (
  process.parent.name in ("sendmail", "postfix-local", "check-quota", "zmcontrol", "find", "timeout", "php") or
  process.name in ("timeout", "host", "ptxas") or
  process.command_line like ("*zpool.cache*", "*app/jobs/ant-sec_observe-income.py*") or
  process.parent.args == "/scripts/run_certbot.sh" or
  process.parent.command_line == "runc init" or
  (process.parent.command_line == "/bin/bash /usr/local/bin/soc_guard.sh" and process.executable == "/usr/bin/grep") or
  (process.parent.name like "php*" and process.command_line like "*/var/tools/koalaping/bin/ping.php*") or
  (
    process.parent.command_line == "/bin/bash /root/nicehash/nicehash_api.sh /main/api/v2/mining/algo/stats" and
    process.command_line like "python3 /root/nicehash/nicehash.py -b https://api2.nicehash.com -o * -m GET -p /main/api/v2/mining/algo/stats"
  )
)

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.command_linematch/var/tools/koalaping/bin/ping.phpexcludes:process.command_line field:"process.command_line" value:"/var/tools/koalaping/bin/ping.php"
process.parent.namestarts_withphpexcludes:process.parent.name field:"process.parent.name" value:"php"
process.command_linewildcardpython3 /root/nicehash/nicehash.py -b https://api2.nicehash.com -o * -m GET -p /main/api/v2/mining/algo/statsexcludes:process.command_line field:"process.command_line" value:"python3 /root/nicehash/nicehash.py -b https://api2.nicehash.com -o * -m GET -p /main/api/v2/mining/algo/stats"
process.parent.command_lineeq/bin/bash /root/nicehash/nicehash_api.sh /main/api/v2/mining/algo/statsexcludes:process.parent.command_line field:"process.parent.command_line" value:"/bin/bash /root/nicehash/nicehash_api.sh /main/api/v2/mining/algo/stats"
process.executableeq/usr/bin/grepexcludes:process.executable field:"process.executable" value:"/usr/bin/grep"
process.parent.command_lineeq/bin/bash /usr/local/bin/soc_guard.shexcludes:process.parent.command_line field:"process.parent.command_line" value:"/bin/bash /usr/local/bin/soc_guard.sh"
process.command_linematchzpool.cache, app/jobs/ant-sec_observe-income.pyexcludes:process.command_line field:"process.command_line" value:"zpool.cache" field:"process.command_line" value:"app/jobs/ant-sec_observe-income.py"
process.nameinhost, ptxas, timeoutexcludes:process.name field:"process.name" value:"host" field:"process.name" value:"ptxas" field:"process.name" value:"timeout"
process.parent.argseq/scripts/run_certbot.shexcludes:process.parent.args field:"process.parent.args" value:"/scripts/run_certbot.sh"
process.parent.command_lineeqrunc initexcludes:process.parent.command_line field:"process.parent.command_line" value:"runc init"
process.parent.nameincheck-quota, find, php, postfix-local, sendmail, timeout, zmcontrolexcludes:process.parent.name

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.command_linewildcard
  • *2miners.com*
  • *2miners.org*
  • *4i7i.com*
  • *520fjh.org*
  • *5b6b7b.ru*
  • *alimabi.cn*
  • *antpool.com*
  • *armornetwork.org*
  • *blockmasters.co*
  • *bohemianpool.com*
  • *bsod.pw*
  • *c3pool.com*
  • *cnpool.cc*
  • *coinhive.com*
  • *comgandalph3000.com*
  • *cortins.tk*
  • *cryptmonero.com*
  • *crypto-pool.fr*
  • *crypto-pool.info*
  • *cryptoloot.pro*
  • *d5pool.us*
  • *dwarfpool.com*
  • *emercoin.com*
  • *emercoin.net*
  • *emergate.net*
  • *ethereumpool.co*
  • *ethermine.org*
  • *ethpool.org*
  • *f2pool.com*
  • *f2pool.org*
  • *fairpool.xyz*
  • *fjhan.club*
  • *flexpool.io*
  • *graef.in*
  • *hashcity.org*
  • *hashing24.com*
  • *hashvault.pro*
  • *hellominer.com*
  • *herominers.com*
  • *hex7e4.ru*
  • +86 more values (see full rule source)
field:"CommandLine" kind:wildcard
process.executablewildcard
  • ./*
  • /boot/*
  • /dev/shm/*
  • /lost+found/*
  • /media/*
  • /proc/*
  • /sys/*
  • /tmp/*
  • /var/backups/*
  • /var/log/*
  • /var/mail/*
  • /var/spool/*
  • /var/tmp/*
field:"Image" kind:wildcard
process.namewildcard
  • .*
  • ash
  • bash
  • csh
  • curl
  • dash
  • dig
  • docker
  • fish
  • grep
  • inetutils-telnet
  • ksh
  • lua*
  • nc
  • nc.openbsd
  • nc.traditional
  • ncat
  • netcat
  • netcat.openbsd
  • netcat.traditional
  • nohup
  • nslookup
  • perl*
  • pgrep
  • php*
  • ping
  • pkill
  • python*
  • ruby*
  • sed
  • sh
  • sudo
  • tcsh
  • telnet
  • telnet.netkit
  • wget
  • xmrig
  • zsh
field:"process_name" kind:wildcard
process.parent.executableis_not_null
  • (no value, null check)
field:"ParentImage" kind:is_not_null