Detection: Windows Process Injection Remote Thread

Description

The following analytic detects suspicious remote thread execution in processes such as Taskmgr.exe, calc.exe, and notepad.exe, which may indicate process injection by malware like Qakbot. This detection leverages Sysmon EventCode 8 to identify remote thread creation in specific target processes. This activity is significant as it often signifies an attempt by malware to inject malicious code into legitimate processes, potentially leading to unauthorized code execution. If confirmed malicious, this could allow attackers to execute arbitrary code, escalate privileges, or maintain persistence on the compromised host.

 1`sysmon`
 2EventCode=8
 3TargetImage IN (
 4    "*\\calc.exe",
 5    "*\\CalculatorApp.exe",
 6    "*\\cmd.exe",
 7    "*\\dxdiag.exe",
 8    "*\\explorer.exe",
 9    "*\\mobsync.exe",
10    "*\\msra.exe",
11    "*\\notepad.exe",
12    "*\\OneDriveSetup.exe",
13    "*\\ping.exe",
14    "*\\powershell.exe",
15    "*\\rdpclip.exe",
16    "*\\Taskmgr.exe",
17    "*\\wermgr.exe",
18    "*\\win32calc.exe",
19    "*\\xwizard.exe"
20)
21
22| stats count min(_time) as firstTime
23              max(_time) as lastTime
24              values(NewThreadId) as "NewThreadId"
25              values(StartAddress) as "StartAddress"
26  by dest signature_id signature
27     SourceProcessGuid SourceProcessId SourceImage
28     TargetProcessGuid TargetProcessId TargetImage
29     StartModule StartFunction vendor_product
30
31| `security_content_ctime(firstTime)`
32
33| `security_content_ctime(lastTime)`
34
35| `windows_process_injection_remote_thread_filter`

Data Source

Name Platform Sourcetype Source
Sysmon EventID 8 Windows icon Windows 'XmlWinEventLog' 'XmlWinEventLog:Microsoft-Windows-Sysmon/Operational'

Macros Used

Name Value
security_content_ctime convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$)
windows_process_injection_remote_thread_filter search *
windows_process_injection_remote_thread_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1055.002 Portable Executable Injection Privilege Escalation
Exploitation
DE.CM
CIS 10

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Finding (Notable) Yes
Rule Title %name%
Rule Description %description%
Notable Event Fields user, dest
Creates Intermediate Finding (Risk Event) No
TTP detections generate a Finding (Notable) and may generate Intermediate Findings (Risk Events) for associated entities.

Implementation

To successfully implement this search, you must be ingesting data that records process activity from your hosts like remote thread EventCode=8 of sysmon. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA.

Known False Positives

No false positives have been identified at this time.

Associated Analytic Story

Finding

Title Entity Field Entity Type Risk Score
process $SourceImage$ created a remote thread in target process $TargetImage$ on host $dest$ dest system 50

Threat Objects

Field Type
SourceImage process

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset XmlWinEventLog:Microsoft-Windows-Sysmon/Operational XmlWinEventLog
Integration ✅ Passing Dataset XmlWinEventLog:Microsoft-Windows-Sysmon/Operational XmlWinEventLog

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub |

Version: 14