Detection rules › Splunk
Potential Cryptomining Commands (Sysmon)
Adversaries may leverage the resources of co-opted systems in order to solve resource intensive problems, which may impact system and/or hosted service availability. One common purpose for Resource Hijacking is to validate transactions of cryptocurrency networks and earn virtual currency. This use case detects common plaintext and base64 encoded commands for cryptomining activity.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Impact |
References
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
Rule body
id: '19129.34163'
title: Potential Cryptomining Commands
description: Adversaries may leverage the resources of co-opted systems in order to
solve resource intensive problems, which may impact system and/or hosted service
availability. One common purpose for Resource Hijacking is to validate transactions
of cryptocurrency networks and earn virtual currency. This use case detects common
plaintext and base64 encoded commands for cryptomining activity.
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_sysmon` (TERM(EventCode=1) OR "<EventID>1<")
("--cpu-priority=" OR "--donate-level=" OR " -o pool." OR " --nicehash" OR " --algo="
OR "stratum+tcp://" OR "stratum+udp://" OR "LS1kb25hdGUtbGV2ZWw9" OR "0tZG9uYXRlLWxldmVsP"
OR "tLWRvbmF0ZS1sZXZlbD" OR "c3RyYXR1bSt0Y3A6Ly" OR "N0cmF0dW0rdGNwOi8v" OR "zdHJhdHVtK3RjcDovL"
OR "c3RyYXR1bSt1ZHA6Ly" OR "N0cmF0dW0rdWRwOi8v" OR "zdHJhdHVtK3VkcDovL") | regex
process!="(?i)(pool\.(c|o))\s|gcc\s-" | table _time, host, user, process, process_*,
parent_process_name | bin span=1s | stats values(*) as * by _time, host '
techniques:
- impact:resource hijacking
technique_id:
- T1496
data_category:
- Windows Sysmon
- Process command-line parameters
references:
- https://xmrig.com/docs/miner/command-line-options
- https://www.trendmicro.com/en_us/research/24/j/unmasking-prometei-a-deep-dive-into-our-mxdr-findings.html
Stages and Predicates
Stage 1: search
`get_endpoint_data` `get_endpoint_data_sysmon` (TERM(EventCode=1) OR "<EventID>1<") ("--cpu-priority=" OR "--donate-level=" OR " -o pool." OR " --nicehash" OR " --algo=" OR "stratum+tcp://" OR "stratum+udp://" OR "LS1kb25hdGUtbGV2ZWw9" OR "0tZG9uYXRlLWxldmVsP" OR "tLWRvbmF0ZS1sZXZlbD" OR "c3RyYXR1bSt0Y3A6Ly" OR "N0cmF0dW0rdGNwOi8v" OR "zdHJhdHVtK3RjcDovL" OR "c3RyYXR1bSt1ZHA6Ly" OR "N0cmF0dW0rdWRwOi8v" OR "zdHJhdHVtK3VkcDovL")
Stage 2: regex
| regex process!="(?i)(pool\.(c|o))\s|gcc\s-"
Stage 3: table
| table _time, host, user, process, process_*, parent_process_name
Stage 4: bucket
| bin span=1s
Stage 5: stats
| stats values(*) as * by _time, host
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process | regex_match | "(?i)(pool.(c|o))\s, gcc\s-" | excludes:process |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
EventCode | eq |
| field:"EventID" kind:eq value:"1" |
Search terms
These SPL tokens match against raw event text.
| Stage | Term |
|---|---|
| 1 | "<EventID>1<" |
| 1 | "--cpu-priority=" |
| 1 | "--donate-level=" |
| 1 | " -o pool." |
| 1 | " --nicehash" |
| 1 | " --algo=" |
| 1 | "stratum+tcp://" |
| 1 | "stratum+udp://" |
| 1 | "LS1kb25hdGUtbGV2ZWw9" |
| 1 | "0tZG9uYXRlLWxldmVsP" |
| 1 | "tLWRvbmF0ZS1sZXZlbD" |
| 1 | "c3RyYXR1bSt0Y3A6Ly" |
| 1 | "N0cmF0dW0rdGNwOi8v" |
| 1 | "zdHJhdHVtK3RjcDovL" |
| 1 | "c3RyYXR1bSt1ZHA6Ly" |
| 1 | "N0cmF0dW0rdWRwOi8v" |
| 1 | "zdHJhdHVtK3VkcDovL" |