Suspicious Process Creation CallTrace

Identifies when a process is created and immediately accessed from an unknown memory code region and by the same parent process. This may indicate a code injection attempt.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2021/10/24"
 3integration = ["windows"]
 4maturity = "production"
 5min_stack_comments = "Build time field required_fields divergence between -8.7 and 8.8+ due to schema versions."
 6min_stack_version = "8.8.0"
 7updated_date = "2024/03/08"
 8
 9[rule]
10author = ["Elastic"]
11description = """
12Identifies when a process is created and immediately accessed from an unknown memory code region and by the same parent
13process. This may indicate a code injection attempt.
14"""
15from = "now-9m"
16index = ["winlogbeat-*", "logs-windows.sysmon_operational-*"]
17language = "eql"
18license = "Elastic License v2"
19name = "Suspicious Process Creation CallTrace"
20note = """## Triage and analysis
21
22### Investigating Suspicious Process Creation CallTrace
23
24Attackers may inject code into child processes' memory to hide their actual activity, evade detection mechanisms, and decrease discoverability during forensics. This rule looks for a spawned process by Microsoft Office, scripting, and command line applications, followed by a process access event for an unknown memory region by the parent process, which can indicate a code injection attempt.
25
26#### Possible investigation steps
27
28- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
29- Investigate any abnormal behavior by the subject process such as network connections, registry or file modifications, and any spawned child processes.
30- Investigate other alerts associated with the user/host during the past 48 hours.
31- Inspect the host for suspicious or abnormal behavior in the alert timeframe.
32- Create a memory dump of the child process for analysis.
33
34### False positive analysis
35
36- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
37
38### Response and remediation
39
40- Initiate the incident response process based on the outcome of the triage.
41- Isolate the involved host to prevent further post-compromise behavior.
42- Remove and block malicious artifacts identified during triage.
43- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
44- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
45- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
46- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
47"""
48risk_score = 47
49rule_id = "3ed032b2-45d8-4406-bc79-7ad1eabb2c72"
50severity = "medium"
51tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Defense Evasion", "Resources: Investigation Guide", "Data Source: Sysmon"]
52type = "eql"
53
54query = '''
55sequence by host.id with maxspan=1m
56  [process where host.os.type == "windows" and event.code == "1" and
57   /* sysmon process creation */
58   process.parent.name : ("winword.exe", "excel.exe", "outlook.exe", "powerpnt.exe", "eqnedt32.exe", "fltldr.exe",
59                          "mspub.exe", "msaccess.exe","cscript.exe", "wscript.exe", "rundll32.exe", "regsvr32.exe",
60                          "mshta.exe", "wmic.exe", "cmstp.exe", "msxsl.exe") and
61
62   /* noisy FP patterns */
63   not (process.parent.name : "EXCEL.EXE" and process.executable : "?:\\Program Files\\Microsoft Office\\root\\Office*\\ADDINS\\*.exe") and
64   not (process.executable : "?:\\Windows\\splwow64.exe" and process.args in ("8192", "12288") and process.parent.name : ("winword.exe", "excel.exe", "outlook.exe", "powerpnt.exe")) and
65   not (process.parent.name : "rundll32.exe" and process.parent.args : ("?:\\WINDOWS\\Installer\\MSI*.tmp,zzzzInvokeManagedCustomActionOutOfProc", "--no-sandbox")) and
66   not (process.executable :
67            ("?:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\*\\msedgewebview2.exe",
68             "?:\\Program Files\\Adobe\\Acrobat DC\\Acrobat\\Acrobat.exe",
69             "?:\\Windows\\SysWOW64\\DWWIN.EXE") and
70        process.parent.name : ("winword.exe", "excel.exe", "outlook.exe", "powerpnt.exe")) and
71   not (process.parent.name : "regsvr32.exe" and process.parent.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*"))
72   ] by process.parent.entity_id, process.entity_id
73  [process where host.os.type == "windows" and event.code == "10" and
74   /* Sysmon process access event from unknown module */
75   winlog.event_data.CallTrace : "*UNKNOWN*"] by process.entity_id, winlog.event_data.TargetProcessGUID
76'''
77
78
79[[rule.threat]]
80framework = "MITRE ATT&CK"
81[[rule.threat.technique]]
82id = "T1055"
83name = "Process Injection"
84reference = "https://attack.mitre.org/techniques/T1055/"
85
86
87[rule.threat.tactic]
88id = "TA0005"
89name = "Defense Evasion"
90reference = "https://attack.mitre.org/tactics/TA0005/"

Triage and analysis

Investigating Suspicious Process Creation CallTrace

Attackers may inject code into child processes' memory to hide their actual activity, evade detection mechanisms, and decrease discoverability during forensics. This rule looks for a spawned process by Microsoft Office, scripting, and command line applications, followed by a process access event for an unknown memory region by the parent process, which can indicate a code injection attempt.

Possible investigation steps

  • Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
  • Investigate any abnormal behavior by the subject process such as network connections, registry or file modifications, and any spawned child processes.
  • Investigate other alerts associated with the user/host during the past 48 hours.
  • Inspect the host for suspicious or abnormal behavior in the alert timeframe.
  • Create a memory dump of the child process for analysis.

False positive analysis

  • This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
  • Isolate the involved host to prevent further post-compromise behavior.
  • Remove and block malicious artifacts identified during triage.
  • Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
  • Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
  • Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
  • Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).

Related rules

to-top