mirror of
https://github.com/splunk/security_content
synced 2026-06-08 17:32:49 +00:00
79 lines
3.5 KiB
YAML
79 lines
3.5 KiB
YAML
name: Windows Command Shell Fetch Env Variables
|
|
id: 048839e4-1eaa-43ff-8a22-86d17f6fcc13
|
|
version: 1
|
|
date: '2022-10-27'
|
|
author: Teoderick Contreras, Splunk
|
|
status: production
|
|
type: TTP
|
|
description: The following analytic identifies a suspicious process command line fetching
|
|
the environment variables with a non-shell parent process. This technique was seen
|
|
in qakbot malware where it fetches the environment variable in the target or compromised
|
|
host. This TTP detection is a good pivot of possible malicious behavior since the
|
|
command line is executed by a common non-shell process like cmd.exe , powershell.exe
|
|
and many more. This can also be a good sign that the parent process has a malicious
|
|
code injected to it to execute this command.
|
|
data_source:
|
|
- Sysmon Event ID 1
|
|
search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time)
|
|
as lastTime from datamodel=Endpoint.Processes where Processes.process = "*cmd /c
|
|
set" OR Processes.process = "*cmd.exe /c set" AND NOT (Processes.parent_process_name
|
|
= "cmd.exe" OR Processes.parent_process_name = "powershell*" OR Processes.parent_process_name="pwsh.exe"
|
|
OR Processes.parent_process_name = "explorer.exe") by Processes.dest Processes.user
|
|
Processes.parent_process_name Processes.process_name Processes.process Processes.process_id
|
|
Processes.parent_process_id Processes.original_file_name | `drop_dm_object_name(Processes)`
|
|
| `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `windows_command_shell_fetch_env_variables_filter`'
|
|
how_to_implement: The detection is based on data that originates from Endpoint Detection
|
|
and Response (EDR) agents. These agents are designed to provide security-related
|
|
telemetry from the endpoints where the agent is installed. To implement this search,
|
|
you must ingest logs that contain the process GUID, process name, and parent process.
|
|
Additionally, you must ingest complete command-line executions. These logs must
|
|
be processed using the appropriate Splunk Technology Add-ons that are specific to
|
|
the EDR product. The logs must also be mapped to the `Processes` node of the `Endpoint`
|
|
data model. Use the Splunk Common Information Model (CIM) to normalize the field
|
|
names and speed up the data modeling process.
|
|
known_false_positives: shell process that are not included in this search may cause
|
|
False positive. Filter is needed.
|
|
references:
|
|
- https://twitter.com/pr0xylife/status/1585612370441031680?s=46&t=Dc3CJi4AnM-8rNoacLbScg
|
|
tags:
|
|
analytic_story:
|
|
- Qakbot
|
|
asset_type: Endpoint
|
|
confidence: 70
|
|
impact: 80
|
|
message: non-shell parent process has a child process $process_name$ with a commandline
|
|
$process$ to fetch env variables in $dest$
|
|
mitre_attack_id:
|
|
- T1055
|
|
observable:
|
|
- name: dest
|
|
type: Endpoint
|
|
role:
|
|
- Victim
|
|
product:
|
|
- Splunk Enterprise
|
|
- Splunk Enterprise Security
|
|
- Splunk Cloud
|
|
required_fields:
|
|
- _time
|
|
- Processes.dest
|
|
- Processes.user
|
|
- Processes.parent_process_name
|
|
- Processes.parent_process
|
|
- Processes.original_file_name
|
|
- Processes.process_name
|
|
- Processes.process
|
|
- Processes.process_id
|
|
- Processes.parent_process_path
|
|
- Processes.process_path
|
|
- Processes.parent_process_id
|
|
risk_score: 56
|
|
security_domain: endpoint
|
|
tests:
|
|
- name: True Positive Test
|
|
attack_data:
|
|
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/qakbot/qbot_wermgr/sysmon_wermgr.log
|
|
source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational
|
|
sourcetype: xmlwineventlog
|
|
update_timestamp: true
|