Detection rules › Elastic

Suspicious Microsoft Office Child Process

Source
github.com/elastic/protections-artifacts

Identifies suspicious child processes of frequently targeted Microsoft Office applications (Word, PowerPoint, Excel). These child processes are often launched during exploitation of Office applications or from documents with malicious macros.

MITRE ATT&CK coverage

TacticTechniques
Initial Access

Rule body

[rule]
description = """
Identifies suspicious child processes of frequently targeted Microsoft Office applications (Word, PowerPoint, Excel).
These child processes are often launched during exploitation of Office applications or from documents with malicious
macros.
"""
id = "c34a9dca-66cf-4283-944d-1800b28ae690"
license = "Elastic License v2"
name = "Suspicious Microsoft Office Child Process"
os_list = ["windows"]
reference = ["https://lolbas-project.github.io/"]
version = "1.0.39"

query = '''
process where event.action == "start" and
  process.parent.name : ("excel.exe", "powerpnt.exe", "winword.exe") and
  (
		(process.pe.original_file_name : (
		    "rundll32.exe", 
		    "regsvr32.exe", 
		    "bitsadmin.exe",
		    "certutil.exe", 
		    "installutil.exe", 
		    "schtasks.exe", 
		    "wmic.exe", 
		    "cscript.exe",
		    "cmstp.exe", 
		    "Microsoft.Workflow.Compiler.exe", 
		    "regasm.exe", 
		    "regsvcs.exe", 
		    "mshta.exe", 
		    "msxsl.exe", 
		    "ieexec.exe", 
		    "sc.exe",
		    "javaw.exe",
		    "pcalua.exe",
		    "curl.exe",
		    "ScriptRunner.exe",
		    "CertOC.exe",
		    "Workfolders.exe",
		    "odbcconf.exe",
		    "extrac32.exe",
		    "expand"
		   ) and
		not process.args : ("-Embedding", "-hashfile")
		) or
		
		(process.pe.original_file_name : "wscript.exe" and
		 process.command_line : ("*:\\ProgramData\\*",
		                         "*:\\Users\\Public\\*",
		                         "*\\AppData\\*",
		                         "*\\Windows\\Temp\\*",
		                         /* CVE-2021-40444 */
		                         "*../../..*", "*..\\..\\*", "*js:..*", "*vbs:..*", "*wsf:..*", "*jse:..*", "*vbe:..*")) or
		
		(process.pe.original_file_name : "msiexec.exe" and process.args : "http*") or
		/* Issue #439 */
		(process.name : "explorer.exe" and
		 process.args : ("*.hta*", "*.vb*", "*.wsh*", "*.js*", "*.ps*", "*.scr*", "*.pif*", "*bat*", "*.cmd*") and
		 /* FPs related to execution from file share */
		 not process.working_directory : "\\\\*"
		 ) or

		/* Masquerading as WerFault or Splwow64 both of which are common MS Office Child Processes */
		(process.name : ("WerFault.exe", "splwow64.exe") and process.args_count == 1) or

        /* in the wild 0 day - 52945af1def85b171870b31fa4782e52 */
		(process.pe.original_file_name == "msdt.exe" and process.command_line : "*IT_BrowseForFile*")

  ) and

	/* FP related to printing */
	not (process.name : "rundll32.exe" and process.command_line : "*\\system32\\spool\\*") and

	/* Issue #458 */
	not (process.name : "rundll32.exe" and
	     process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*", "ndfapi.dll,NdfRunDllDiagnoseWithAnswerFile", "shwebsvc.dll,AddNetPlaceRunDll")) and

    /* Issue #568 */
	not (process.name : "schtasks.exe" and process.args : "/change" and process.args : "Microsoft\\Office\\Office Serviceability Manager") and

	/* Issue #568 */
	not (process.name : "regsvr32.exe" and
	     process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*", "?:\\Windows\\system32\\*.dll", "?:\\Windows\\system32\\*.ocx")) and

	not (process.executable : "?:\\Windows\\hh.exe" and process.args : "-mapid") and
	not (process.executable : "?:\\Windows\\System32\\sc.exe" and process.args : "queryex") and
	not (process.name : "rundll32.exe" and process.command_line : ("?:\\Windows\\SysWOW64\\rundll32.exe --eoim", "*--enable-speech-input --auto-scan-plugin --lang=*")) and
	not (process.name : "RegAsm.exe" and process.args :  "?:\\Program Files (x86)\\Thomson Reuters\\WSF\\*.dll") and
	not (process.name : "rundll32.exe" and
	     process.args : ("?:\\WINDOWS\\system32\\hotplug.dll,HotPlugSafeRemovalDriveNotification",
	                     "printui.dll,PrintUIEntry",
	                     "InetCpl.cpl,ClearMyTracksByProcess",
	                     "url.dll,FileProtocolHandler")) and
	not (process.name : "hh.exe" and process.args : ("?:\\Program Files (x86)\\*", "?:\\Program Files (x86)\\*")) and
	not (process.name : "rundll32.exe" and process.command_line : "\"C:\\WINDOWS\\SysWOW64\\rundll32.exe\" --eoim") and
	not (process.name : "rundll32.exe" and process.args : "?:\\PROGRA~2\\MICROS~*\\Office*\\GrooveUtil.DLL,GetResourceModulePath") and
	not (process.name : "hh.exe" and process.args : ("*:\\Program Files\\*", "*:\\Program Files (x86)\\*")) and
	not (process.name : "javaw.exe" and process.args : "?:\\PROGRA~2\\Andar\\ANDARP~1\\bin\\andar.jar") and
	not (process.name : "rundll32.exe" and
	     process.args : ("?:\\Windows\\System32\\LogiLDA.dll,LogiFetch", "?:\\Windows\\System32\\dfshim.dll,ShOpenVerbShortcut")) and
	not (process.name : "rundll32.exe" and process.args : "-localserver" and process.args : "22d8c27b-47a1-48d1-ad08-7da7abd79617") and
	not process.executable : "?:\\Program Files (x86)\\Andar\\Jre*\\bin\\javaw.exe" and
	not (process.name : "mshta.exe" and process.args : "vbscript:close(CreateObject(WScript.Shell).Popup(Works only at day level,1,Warning))") and
	not (process.name : "rundll32.exe" and process.command_line : "\"C:\\Windows\\system32\\rundll32.exe\" --eoim")
'''

min_endpoint_version = "7.15.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"
[[threat.technique.subtechnique]]
id = "T1566.001"
name = "Spearphishing Attachment"
reference = "https://attack.mitre.org/techniques/T1566/001/"



[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
  process.parent.name : ("excel.exe", "powerpnt.exe", "winword.exe") and
  (
		(process.pe.original_file_name : (
		    "rundll32.exe",
		    "regsvr32.exe",
		    "bitsadmin.exe",
		    "certutil.exe",
		    "installutil.exe",
		    "schtasks.exe",
		    "wmic.exe",
		    "cscript.exe",
		    "cmstp.exe",
		    "Microsoft.Workflow.Compiler.exe",
		    "regasm.exe",
		    "regsvcs.exe",
		    "mshta.exe",
		    "msxsl.exe",
		    "ieexec.exe",
		    "sc.exe",
		    "javaw.exe",
		    "pcalua.exe",
		    "curl.exe",
		    "ScriptRunner.exe",
		    "CertOC.exe",
		    "Workfolders.exe",
		    "odbcconf.exe",
		    "extrac32.exe",
		    "expand"
		   ) and
		not process.args : ("-Embedding", "-hashfile")
		) or
		(process.pe.original_file_name : "wscript.exe" and
		 process.command_line : ("*:\\ProgramData\\*",
		                         "*:\\Users\\Public\\*",
		                         "*\\AppData\\*",
		                         "*\\Windows\\Temp\\*",
		                         "*../../..*", "*..\\..\\*", "*js:..*", "*vbs:..*", "*wsf:..*", "*jse:..*", "*vbe:..*")) or
		(process.pe.original_file_name : "msiexec.exe" and process.args : "http*") or
		(process.name : "explorer.exe" and
		 process.args : ("*.hta*", "*.vb*", "*.wsh*", "*.js*", "*.ps*", "*.scr*", "*.pif*", "*bat*", "*.cmd*") and
		 not process.working_directory : "\\\\*"
		 ) or
		(process.name : ("WerFault.exe", "splwow64.exe") and process.args_count == 1) or
		(process.pe.original_file_name == "msdt.exe" and process.command_line : "*IT_BrowseForFile*")
  ) and
	not (process.name : "rundll32.exe" and process.command_line : "*\\system32\\spool\\*") and
	not (process.name : "rundll32.exe" and
	     process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*", "ndfapi.dll,NdfRunDllDiagnoseWithAnswerFile", "shwebsvc.dll,AddNetPlaceRunDll")) and
	not (process.name : "schtasks.exe" and process.args : "/change" and process.args : "Microsoft\\Office\\Office Serviceability Manager") and
	not (process.name : "regsvr32.exe" and
	     process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*", "?:\\Windows\\system32\\*.dll", "?:\\Windows\\system32\\*.ocx")) and
	not (process.executable : "?:\\Windows\\hh.exe" and process.args : "-mapid") and
	not (process.executable : "?:\\Windows\\System32\\sc.exe" and process.args : "queryex") and
	not (process.name : "rundll32.exe" and process.command_line : ("?:\\Windows\\SysWOW64\\rundll32.exe --eoim", "*--enable-speech-input --auto-scan-plugin --lang=*")) and
	not (process.name : "RegAsm.exe" and process.args :  "?:\\Program Files (x86)\\Thomson Reuters\\WSF\\*.dll") and
	not (process.name : "rundll32.exe" and
	     process.args : ("?:\\WINDOWS\\system32\\hotplug.dll,HotPlugSafeRemovalDriveNotification",
	                     "printui.dll,PrintUIEntry",
	                     "InetCpl.cpl,ClearMyTracksByProcess",
	                     "url.dll,FileProtocolHandler")) and
	not (process.name : "hh.exe" and process.args : ("?:\\Program Files (x86)\\*", "?:\\Program Files (x86)\\*")) and
	not (process.name : "rundll32.exe" and process.command_line : "\"C:\\WINDOWS\\SysWOW64\\rundll32.exe\" --eoim") and
	not (process.name : "rundll32.exe" and process.args : "?:\\PROGRA~2\\MICROS~*\\Office*\\GrooveUtil.DLL,GetResourceModulePath") and
	not (process.name : "hh.exe" and process.args : ("*:\\Program Files\\*", "*:\\Program Files (x86)\\*")) and
	not (process.name : "javaw.exe" and process.args : "?:\\PROGRA~2\\Andar\\ANDARP~1\\bin\\andar.jar") and
	not (process.name : "rundll32.exe" and
	     process.args : ("?:\\Windows\\System32\\LogiLDA.dll,LogiFetch", "?:\\Windows\\System32\\dfshim.dll,ShOpenVerbShortcut")) and
	not (process.name : "rundll32.exe" and process.args : "-localserver" and process.args : "22d8c27b-47a1-48d1-ad08-7da7abd79617") and
	not process.executable : "?:\\Program Files (x86)\\Andar\\Jre*\\bin\\javaw.exe" and
	not (process.name : "mshta.exe" and process.args : "vbscript:close(CreateObject(WScript.Shell).Popup(Works only at day level,1,Warning))") and
	not (process.name : "rundll32.exe" and process.command_line : "\"C:\\Windows\\system32\\rundll32.exe\" --eoim")

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseq-localserverexcludes:process.args field:"process.args" value:"-localserver"
process.argseq22d8c27b-47a1-48d1-ad08-7da7abd79617excludes:process.args field:"process.args" value:"22d8c27b-47a1-48d1-ad08-7da7abd79617"
process.nameeqrundll32.exeexcludes:process.name field:"process.name" value:"rundll32.exe"
process.argseq-mapidexcludes:process.args field:"process.args" value:"-mapid"
process.executableeq?:\Windows\hh.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\hh.exe"
process.argseq/changeexcludes:process.args field:"process.args" value:"/change"
process.argseqMicrosoft\Office\Office Serviceability Managerexcludes:process.args field:"process.args" value:"Microsoft\Office\Office Serviceability Manager"
process.nameeqschtasks.exeexcludes:process.name field:"process.name" value:"schtasks.exe"
process.argseq?:\PROGRA~2\Andar\ANDARP~1\bin\andar.jarexcludes:process.args field:"process.args" value:"?:\PROGRA~2\Andar\ANDARP~1\bin\andar.jar"
process.nameeqjavaw.exeexcludes:process.name field:"process.name" value:"javaw.exe"
process.argseq?:\WINDOWS\system32\hotplug.dll,HotPlugSafeRemovalDriveNotification, printui.dll,PrintUIEntry, InetCpl.cpl,ClearMyTracksByProcess, url.dll,FileProtocolHandlerexcludes:process.args
process.argseq?:\Windows\System32\LogiLDA.dll,LogiFetch, ?:\Windows\System32\dfshim.dll,ShOpenVerbShortcutexcludes:process.args field:"process.args" value:"?:\Windows\System32\LogiLDA.dll,LogiFetch" field:"process.args" value:"?:\Windows\System32\dfshim.dll,ShOpenVerbShortcut"
process.argseqqueryexexcludes:process.args field:"process.args" value:"queryex"
process.executableeq?:\Windows\System32\sc.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\sc.exe"
process.argseqvbscript:close(CreateObject(WScript.Shell).Popup(Works only at day level,1,Warning))excludes:process.args field:"process.args" value:"vbscript:close(CreateObject(WScript.Shell).Popup(Works only at day level,1,Warning))"
process.nameeqmshta.exeexcludes:process.name field:"process.name" value:"mshta.exe"
process.argsmatch:\Program Files\, :\Program Files (x86)\excludes:process.args field:"process.args" value:":\Program Files\" field:"process.args" value:":\Program Files (x86)\"
process.nameeqhh.exeexcludes:process.name field:"process.name" value:"hh.exe"
process.argsstarts_with?:\Program Files (x86)\, ?:\Program Files (x86)\excludes:process.args field:"process.args" value:"?:\Program Files (x86)\" field:"process.args" value:"?:\Program Files (x86)\"
process.argswildcard?:\PROGRA~2\MICROS~*\Office*\GrooveUtil.DLL,GetResourceModulePathexcludes:process.args field:"process.args" value:"?:\PROGRA~2\MICROS~*\Office*\GrooveUtil.DLL,GetResourceModulePath"
process.argswildcard?:\Program Files (x86)\Thomson Reuters\WSF\*.dllexcludes:process.args field:"process.args" value:"?:\Program Files (x86)\Thomson Reuters\WSF\*.dll"
process.nameeqRegAsm.exeexcludes:process.name field:"process.name" value:"RegAsm.exe"
process.argswildcard?:\Program Files\*, ?:\Program Files (x86)\*, ?:\Windows\system32\*.dll, ?:\Windows\system32\*.ocxexcludes:process.args
process.nameeqregsvr32.exeexcludes:process.name field:"process.name" value:"regsvr32.exe"
process.argswildcard?:\Program Files\*, ?:\Program Files (x86)\*, ndfapi.dll,NdfRunDllDiagnoseWithAnswerFile, shwebsvc.dll,AddNetPlaceRunDllexcludes:process.args
process.command_lineeq"C:\WINDOWS\SysWOW64\rundll32.exe" --eoimexcludes:process.command_line
process.command_lineeq"C:\Windows\system32\rundll32.exe" --eoimexcludes:process.command_line
process.command_linematch\system32\spool\excludes:process.command_line field:"process.command_line" value:"\system32\spool\"
process.command_linewildcard?:\Windows\SysWOW64\rundll32.exe --eoim, *--enable-speech-input --auto-scan-plugin --lang=*excludes:process.command_line field:"process.command_line" value:"?:\Windows\SysWOW64\rundll32.exe --eoim" field:"process.command_line" value:"*--enable-speech-input --auto-scan-plugin --lang=*"
process.executablewildcard?:\Program Files (x86)\Andar\Jre*\bin\javaw.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files (x86)\Andar\Jre*\bin\javaw.exe"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq value:"start"
process.argswildcard
  • *.cmd* corpus 2 (elastic 2)
  • *.hta* corpus 2 (elastic 2)
  • *.js* corpus 2 (elastic 2)
  • *.pif* corpus 2 (elastic 2)
  • *.ps* corpus 2 (elastic 2)
  • *.scr* corpus 2 (elastic 2)
  • *.vb* corpus 2 (elastic 2)
  • *.wsh* corpus 2 (elastic 2)
  • *bat* corpus 2 (elastic 2)
  • http* corpus 9 (elastic 9)
field:"process.args" kind:wildcard
process.args_counteq
  • 1 transforms: number corpus 49 (elastic 49)
field:"process.args_count" kind:eq value:"1"
process.command_linewildcard
  • *../../..*
  • *..\..\* corpus 2 (elastic 2)
  • *:\ProgramData\* corpus 11 (sigma 9, elastic 2)
  • *:\Users\Public\* corpus 20 (sigma 18, elastic 2)
  • *IT_BrowseForFile*
  • *\AppData\* corpus 11 (sigma 8, elastic 3)
  • *\Windows\Temp\* corpus 13 (sigma 12, elastic 1)
  • *js:..*
  • *jse:..*
  • *vbe:..*
  • *vbs:..*
  • *wsf:..*
field:"CommandLine" kind:wildcard
process.namewildcard
  • WerFault.exe corpus 7 (elastic 7)
  • explorer.exe corpus 21 (elastic 19, splunk 2)
  • splwow64.exe
field:"process_name" kind:wildcard
process.parent.namewildcard
  • excel.exe corpus 28 (elastic 27, splunk 1)
  • powerpnt.exe corpus 23 (elastic 23)
  • winword.exe corpus 26 (elastic 26)
field:"parent_process_name" kind:wildcard
process.pe.original_file_nameeq
  • msdt.exe corpus 10 (sigma 6, elastic 4)
field:"OriginalFileName" kind:eq value:"msdt.exe"
process.pe.original_file_namewildcard
  • CertOC.exe corpus 9 (sigma 6, elastic 3)
  • Microsoft.Workflow.Compiler.exe corpus 12 (elastic 7, sigma 3, splunk 2)
  • ScriptRunner.exe corpus 6 (sigma 3, elastic 3)
  • Workfolders.exe corpus 4 (sigma 2, elastic 2)
  • bitsadmin.exe corpus 20 (sigma 9, elastic 8, splunk 2, kusto 1)
  • certutil.exe corpus 30 (sigma 14, elastic 10, splunk 6)
  • cmstp.exe corpus 11 (elastic 6, sigma 5)
  • cscript.exe corpus 32 (sigma 17, elastic 15)
  • curl.exe corpus 24 (sigma 13, elastic 8, splunk 3)
  • expand
  • extrac32.exe corpus 2 (sigma 1, elastic 1)
  • ieexec.exe corpus 5 (sigma 3, elastic 2)
  • installutil.exe corpus 21 (elastic 11, sigma 6, splunk 4)
  • javaw.exe corpus 7 (elastic 5, sigma 2)
  • mshta.exe corpus 40 (elastic 21, sigma 13, splunk 6)
  • msiexec.exe corpus 20 (elastic 11, sigma 5, splunk 4)
  • msxsl.exe corpus 11 (elastic 8, sigma 3)
  • odbcconf.exe corpus 12 (sigma 9, elastic 3)
  • pcalua.exe corpus 4 (sigma 2, elastic 2)
  • regasm.exe corpus 14 (elastic 7, sigma 6, splunk 1)
  • regsvcs.exe corpus 13 (elastic 7, sigma 5, splunk 1)
  • regsvr32.exe corpus 37 (sigma 17, elastic 15, splunk 5)
  • rundll32.exe corpus 78 (sigma 35, elastic 22, splunk 21)
  • sc.exe corpus 30 (sigma 12, splunk 10, elastic 8)
  • schtasks.exe corpus 31 (sigma 18, elastic 9, splunk 4)
  • wmic.exe corpus 80 (sigma 38, elastic 24, splunk 18)
  • wscript.exe corpus 38 (elastic 21, sigma 17)
field:"OriginalFileName" kind:wildcard