Detection rules › Splunk

Remote Thread Created by Uncommon Process (Sysmon)

Group by
_time, host
Source
github.com/anvilogic-forge/armory

Remote thread creation involves a process initiating a thread within the address space of another process. While this activity can occur during normal system operation, threat actors may abuse remote threads to attempt privilege escalation, defense evasion, or code injection. This use case detects remote threads created by LOLBINs that do not typically create remote threads. Some known benign combinations of source and target images have been filtered out to reduce noise. Sysmon event 8 logging is required for detection. LOLBINS/LOLBAS

MITRE ATT&CK coverage

TacticTechniques
Privilege EscalationT1055 Process Injection
StealthT1055 Process Injection

References

Event coverage

ProviderEventTitle
SysmonEvent ID 8CreateRemoteThread

Rule body yaml

id: '22461.40120'
title: Remote Thread Created by Uncommon Process
description: Remote thread creation involves a process initiating a thread within
  the address space of another process. While this activity can occur during normal
  system operation, threat actors may abuse remote threads to attempt privilege escalation,
  defense evasion, or code injection. This use case detects remote threads created
  by LOLBINs that do not typically create remote threads. Some known benign combinations
  of source and target images have been filtered out to reduce noise. Sysmon event
  8 logging is required for detection. LOLBINS/LOLBAS
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_sysmon` (TERM(EventCode=8) OR "<EventID>8<")
  ("bash.exe" OR "cscript.exe" OR "cvtres.exe" OR "defrag.exe" OR "dnx.exe" OR "esentutl.exe"
  OR "excel.exe" OR "expand.exe" OR "explorer.exe" OR "find.exe" OR "findstr.exe"
  OR "forfiles.exe" OR "gpupdate.exe" OR "hh.exe" OR "iexplore.exe" OR "installutil.exe"
  OR "lync.exe" OR "makecab.exe" OR "mDNSResponder.exe" OR "monitoringhost.exe" OR
  "msbuild.exe" OR "mshta.exe" OR "msiexec.exe" OR "mspaint.exe" OR "outlook.exe"
  OR "ping.exe" OR "powerpnt.exe" OR "provtool.exe" OR "python.exe" OR "regsvr32.exe"
  OR "robocopy.exe" OR "runonce.exe" OR "sapcimc.exe" OR "schtasks.exe" OR "smartscreen.exe"
  OR "spoolsv.exe" OR "tstheme.exe" OR "userinit.exe" OR "vssadmin.exe" OR "vssvc.exe"
  OR "w3wp.exe" OR "winlogon.exe" OR "winscp.exe" OR "winword.exe" OR "wmic.exe" OR
  "wscript.exe") | rex field=SourceImage "\x5c(?<source_image>[^\x5c]+)$"| rex field=TargetImage
  "\x5c(?<target_image>[^\x5c]+)$"| regex source_image="(?i)(bash|cscript|cvtres|defrag|dnx|esentutl|excel|expand|explorer|find|findstr|forfiles|gpupdate|hh|iexplore|installutil|lync|makecab|mDNSResponder|monitoringhost|msbuild|mshta|msiexec|mspaint|outlook|ping|powerpnt|provtool|python|regsvr32|robocopy|runonce|sapcimc|schtasks|smartscreen|spoolsv|tstheme|userinit|vssadmin|vssvc|w3wp|winlogon|winscp|winword|wmic|wscript)\.exe"|
  where NOT ((match(source_image, "(?i)\x5cwinlogon\.exe") AND match(target_image,
  "(?i)\x5c(services|wininit|csrss)\.exe")) OR (match(source_image, "(?i)\x5cwinlogon\.exe")
  AND TargetParentImage="System" AND TargetParentProcessId=4) OR (match(source_image,
  "(?i)\x5cprovtool\.exe") AND TargetParentProcessId=0) OR (match(source_image, "(?i)\x5cVSSVC\.exe")
  AND match(target_image, "System")) OR (match(source_image, "(?i)\x5cschtasks\.exe")
  AND match(target_image, "(?i)\x5cconhost\.exe")) OR (match(source_image, "(?i)\x5cexplorer\.exe")
  AND match(target_image, "(?i)\x5cNVIDIA\sGeForce\sExperience\.exe"))) | table _time,
  host, user host, process, process_*, parent_process_*, source_image, target_image
  | bin span=1s | stats values(*) as * by _time, host '
techniques:
- defense-evasion:process injection
- privilege-escalation:process injection
technique_id: 
- T1055
data_category:
- Windows Sysmon
references:
- https://github.com/SigmaHQ/sigma/blob/62d4fd26b05f4d81973e7c8e80d7c1a0c6a29d0e/rules/windows/create_remote_thread/create_remote_thread_win_uncommon_source_image.yml
- https://lolbas-project.github.io

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_sysmon` (TERM(EventCode=8) OR "<EventID>8<") ("bash.exe" OR "cscript.exe" OR "cvtres.exe" OR "defrag.exe" OR "dnx.exe" OR "esentutl.exe" OR "excel.exe" OR "expand.exe" OR "explorer.exe" OR "find.exe" OR "findstr.exe" OR "forfiles.exe" OR "gpupdate.exe" OR "hh.exe" OR "iexplore.exe" OR "installutil.exe" OR "lync.exe" OR "makecab.exe" OR "mDNSResponder.exe" OR "monitoringhost.exe" OR "msbuild.exe" OR "mshta.exe" OR "msiexec.exe" OR "mspaint.exe" OR "outlook.exe" OR "ping.exe" OR "powerpnt.exe" OR "provtool.exe" OR "python.exe" OR "regsvr32.exe" OR "robocopy.exe" OR "runonce.exe" OR "sapcimc.exe" OR "schtasks.exe" OR "smartscreen.exe" OR "spoolsv.exe" OR "tstheme.exe" OR "userinit.exe" OR "vssadmin.exe" OR "vssvc.exe" OR "w3wp.exe" OR "winlogon.exe" OR "winscp.exe" OR "winword.exe" OR "wmic.exe" OR "wscript.exe")

Stage 2: eval

| rex field=SourceImage "\x5c(?<source_image>[^\x5c]+)$"

Stage 3: eval

| rex field=TargetImage "\x5c(?<target_image>[^\x5c]+)$"

Stage 4: regex

| regex source_image="(?i)(bash|cscript|cvtres|defrag|dnx|esentutl|excel|expand|explorer|find|findstr|forfiles|gpupdate|hh|iexplore|installutil|lync|makecab|mDNSResponder|monitoringhost|msbuild|mshta|msiexec|mspaint|outlook|ping|powerpnt|provtool|python|regsvr32|robocopy|runonce|sapcimc|schtasks|smartscreen|spoolsv|tstheme|userinit|vssadmin|vssvc|w3wp|winlogon|winscp|winword|wmic|wscript)\.exe"

Stage 5: where

| where NOT ((match(source_image, "(?i)\x5cwinlogon\.exe") AND match(target_image, "(?i)\x5c(services|wininit|csrss)\.exe")) OR (match(source_image, "(?i)\x5cwinlogon\.exe") AND TargetParentImage="System" AND TargetParentProcessId=4) OR (match(source_image, "(?i)\x5cprovtool\.exe") AND TargetParentProcessId=0) OR (match(source_image, "(?i)\x5cVSSVC\.exe") AND match(target_image, "System")) OR (match(source_image, "(?i)\x5cschtasks\.exe") AND match(target_image, "(?i)\x5cconhost\.exe")) OR (match(source_image, "(?i)\x5cexplorer\.exe") AND match(target_image, "(?i)\x5cNVIDIA\sGeForce\sExperience\.exe")))

Stage 6: table

| table _time, host, user host, process, process_*, parent_process_*, source_image, target_image

Stage 7: bucket

| bin span=1s

Stage 8: stats

| stats values(*) as * by _time, host

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
TargetParentImageeq"System"
TargetParentProcessIdeq4
source_imagematch"(?i)\x5cwinlogon\.exe"
TargetParentProcessIdeq0
source_imagematch"(?i)\x5cprovtool\.exe"
source_imagematch"(?i)\x5cVSSVC\.exe"
target_imagematch"System"
source_imagematch"(?i)\x5cexplorer\.exe"
target_imagematch"(?i)\x5cNVIDIA\sGeForce\sExperience\.exe"
source_imagematch"(?i)\x5cschtasks\.exe"
target_imagematch"(?i)\x5cconhost\.exe"
source_imagematch"(?i)\x5cwinlogon\.exe"
target_imagematch"(?i)\x5c(services|wininit|csrss)\.exe"

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
EventCodeeq
  • 8 corpus 11 (splunk 11)
source_imageregex_match
  • "(?i)(bash|cscript|cvtres|defrag|dnx|esentutl|excel|expand|explorer|find|findstr|forfiles|gpupdate|hh|iexplore|installutil|lync|makecab|mDNSResponder|monitoringhost|msbuild|mshta|msiexec|mspaint|outlook|ping|powerpnt|provtool|python|regsvr32|robocopy|runonce|sapcimc|schtasks|smartscreen|spoolsv|tstheme|userinit|vssadmin|vssvc|w3wp|winlogon|winscp|winword|wmic|wscript).exe"

Search terms

Bare-string tokens in the SPL search body. Splunk matches each token against _raw (the untyped raw event text) anywhere it appears, not against a specific field. These don't surface in the Indicators table because they aren't predicates on a known field.

StageTerm
1TERM
1"<EventID>8<"
1"bash.exe"
1"cscript.exe"
1"cvtres.exe"
1"defrag.exe"
1"dnx.exe"
1"esentutl.exe"
1"excel.exe"
1"expand.exe"
1"explorer.exe"
1"find.exe"
1"findstr.exe"
1"forfiles.exe"
1"gpupdate.exe"
1"hh.exe"
1"iexplore.exe"
1"installutil.exe"
1"lync.exe"
1"makecab.exe"
1"mDNSResponder.exe"
1"monitoringhost.exe"
1"msbuild.exe"
1"mshta.exe"
1"msiexec.exe"
1"mspaint.exe"
1"outlook.exe"
1"ping.exe"
1"powerpnt.exe"
1"provtool.exe"
1"python.exe"
1"regsvr32.exe"
1"robocopy.exe"
1"runonce.exe"
1"sapcimc.exe"
1"schtasks.exe"
1"smartscreen.exe"
1"spoolsv.exe"
1"tstheme.exe"
1"userinit.exe"
1"vssadmin.exe"
1"vssvc.exe"
1"w3wp.exe"
1"winlogon.exe"
1"winscp.exe"
1"winword.exe"
1"wmic.exe"
1"wscript.exe"