Create Remote Thread In Shell Application
Description
The following analytic detects suspicious process injection in command shell applications, specifically targeting cmd.exe and powershell.exe.
It leverages Sysmon EventCode 8 to identify the creation of remote threads within these shell processes.
This activity is significant because it is a common technique used by malware, such as IcedID, to inject malicious code and execute it within legitimate processes.
If confirmed malicious, this behavior could allow an attacker to execute arbitrary code, escalate privileges, or maintain persistence within the environment, posing a severe threat to system security.
Query · spl
`sysmon`
EventCode=8
TargetImage IN (
"*\\cmd.exe",
"*\\powershell_ise.exe",
"*\\powershell.exe",
"*\\pwsh.exe"
)
| stats count min(_time) as firstTime
max(_time) as lastTime
values(NewThreadId) as "NewThreadId"
values(StartAddress) as "StartAddress"
by dest signature_id signature
SourceProcessGuid SourceProcessId SourceImage
TargetProcessGuid TargetProcessId TargetImage
StartModule StartFunction vendor_product
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `create_remote_thread_in_shell_application_filter`
Implementation guide
To successfully implement this search, you need to be ingesting logs with the process name, parent process, and command-line executions from your endpoints. 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.
Analyst notes
Known false positives: No false positives have been identified at this time.