Detection rules › Splunk
Discovery using CHCP (Sysmon)
CHCP ("Change Code Page" ) is a legitimate Windows command-line utility used to display or set the active console's code page. When run without parameters, chcp displays the number of the active console code page, providing information about the environment's locale and language. Threat actors have used been observed using chcp during discovery activities during intrusions involving IcedID and Conti ransomware. This use case detects chcp executions with no command line parameters and a parent process of cmd or PowerShell executed by a non-system account
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Discovery |
References
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
Rule body
id: '27700.50350'
title: Discovery using CHCP
description: 'CHCP ("Change Code Page" ) is a legitimate Windows command-line utility
used to display or set the active console''s code page. When run without parameters,
chcp displays the number of the active console code page, providing information
about the environment''s locale and language. Threat actors have used been observed
using chcp during discovery activities during intrusions involving IcedID and Conti
ransomware. This use case detects chcp executions with no command line parameters
and a parent process of cmd or PowerShell executed by a non-system account. -- Threat
Actor Association: APT28 (aka. Fancy Bear, Forest Blizzard, Strontium, Tsar Team)
-- Living Off the Land Binary and Scripts (LOLBAS) (LOLBIN)'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_sysmon` (TERM(EventCode=1) OR "<EventID>1<")
("chcp" OR "chcp.com") ("pwsh.exe" OR "powershell.exe" OR "cmd.exe") | where match(process_name,
"(?i)chcp\.com") and match(process, "(?i)chcp\s+?$") and match(parent_process_name,
"(?i)(powershell|pwsh|cmd)\.exe") and not match(user, "\$$") | table _time, host,
user, process, process_*, parent_process_name, parent_process_* | bin span=1s |
stats values(*) as * by _time, host '
techniques:
- discovery:system location discovery:system language discovery
technique_id:
- T1614.001
data_category:
- Windows Sysmon
references:
- https://thedfirreport.com/2022/04/04/stolen-images-campaign-ends-in-conti-ransomware/
- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/chcp
Stages and Predicates
Stage 1: search
`get_endpoint_data` `get_endpoint_data_sysmon` (TERM(EventCode=1) OR "<EventID>1<") ("chcp" OR "chcp.com") ("pwsh.exe" OR "powershell.exe" OR "cmd.exe")
Stage 2: where
| where match(process_name, "(?i)chcp\.com") and match(process, "(?i)chcp\s+?$") and match(parent_process_name, "(?i)(powershell|pwsh|cmd)\.exe") and not match(user, "\$$")
Stage 3: table
| table _time, host, user, process, process_*, parent_process_name, parent_process_*
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 |
|---|---|---|---|
user | regex_match | "$$" | excludes:user |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
EventCode | eq |
| field:"EventID" kind:eq value:"1" |
parent_process_name | regex_match |
| field:"parent_process_name" kind:regex_match |
process | regex_match |
| field:"CommandLine" kind:regex_match |
process_name | regex_match |
| field:"process_name" kind:regex_match |
Search terms
These SPL tokens match against raw event text.
| Stage | Term |
|---|---|
| 1 | "<EventID>1<" |
| 1 | "chcp" |
| 1 | "chcp.com" |
| 1 | "pwsh.exe" |
| 1 | "powershell.exe" |
| 1 | "cmd.exe" |