Detection rules › Elastic

Suspicious Execution from an Oversized Executable

Time window
5m
Sequence by
file.path, process.parent.executable
Source
github.com/elastic/protections-artifacts

Identifies the execution of commonly abused Microsoft binaries from an oversized parent executable. Malwares tend to increase the size of the binary payload beyond what some security tools are capable of handling due to file size limitations.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies the execution of commonly abused Microsoft binaries from an oversized parent executable. Malwares tend to
increase the size of the binary payload beyond what some security tools are capable of handling due to file size
limitations.
"""
id = "7a804cf1-aec7-474d-a776-7e78f6b14658"
license = "Elastic License v2"
name = "Suspicious Execution from an Oversized Executable"
os_list = ["windows"]
reference = ["https://attack.mitre.org/techniques/T1027/001/"]
version = "1.0.8"

query = '''
sequence with maxspan=5m
[file where event.action != "deletion" and
  (file.extension : ("exe", "com", "pif", "scr", "dll", "cpl", "ocx") or file.Ext.header_bytes : "4d5a*") and

   /* larger than 10MB */
   file.size >= 100000000 and

  (
   /* common initial access and execution processes */
   process.name : ("winword.exe", "excel.exe", "powerpnt.exe", "cmd.exe", "powershell.exe", "cscript.exe", "wscript.exe",
                   "mshta.exe", "rundll32.exe", "regsvr32.exe", "certutil.exe", "CertReq.exe", "curl.exe", "msbuild.exe",
                   "installutil.exe", "regasm.exe", "expand.exe", "xcopy.exe", "chrome.exe", "brave.exe", "firefox.exe",
                   "msedge.exe", "whale.exe", "browser.exe", "dragon.exe", "vivaldi.exe", "opera.exe") or

    /* suspicious or user writable paths and unsigned processes */
   (process.executable : ("?:\\Users\\*", "?:\\ProgramData\\*", "?:\\Windows\\Temp\\*", "?:\\Windows\\Tasks\\*", "\\Device\\Mup\\*") and
    (process.code_signature.trusted == false or process.code_signature.exists == false))
   ) and

   /* excluding noisy patterns */
   not file.path : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*") and not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
   not process.executable :
              ("?:\\Users\\*\\AppData\\Local\\electron-builder\\Cache\\winCodeSign\\winCodeSign-2.6.0\\rcedit-x64.exe",
               "?:\\Users\\*\\Electron\\dist\\StrigoTool-Electron Setup 1.0.0.exe")
 ] by file.path
[process where event.action == "start" and 
 process.name : ("cmd.exe", "powershell.exe", "wscript.exe", "mshta.exe", "rundll32.exe", "regsvr32.exe",
                 "certutil.exe", "CertReq.exe", "curl.exe", "msbuild.exe") and
 not (process.name : "wscript.exe" and process.args : "C:\\Prntdrvr\\SFX\\silent.vbs") and
 not (process.name : "cmd.exe" and
      process.args : ("C:\\WINDOWS\\system32\\reg.exe ADD HKCU\\Software\\Classes\\GoSignDesktop.p7m /f",
                      "USERNAME eq %USERNAME%", "lms version --json", "--output-encoding=bser",
                      "imagename eq SteelSeriesGG.exe")) and
 not (process.parent.code_signature.subject_name : ("KOBIL GmbH", "Shenzhen Tuozhu Technology Co., Ltd.", "Bose Professional") and
      process.parent.code_signature.trusted == true) and
 not process.parent.code_signature.trusted == true and not process.parent.args == "--squirrel-firstrun" and
 not process.command_line :
               ("C:\\Windows\\system32\\cmd.exe /d /s /c \"node -v\"",
                "C:\\Windows\\system32\\cmd.exe /d /s /c \"chcp\"",
                "C:\\windows\\system32\\cmd.exe /c az version -o=json",
                "C:\\WINDOWS\\system32\\cmd.exe /d /s /c \"wmic CsProduct Get UUID\"",
                "C:\\windows\\system32\\cmd.exe /d /s /c \"wsl.exe -l -q\"",
                "C:\\WINDOWS\\system32\\cmd.exe /d /s /c *",
                "cmd /c dir") and
 not (process.name : "cmd.exe" and process.args : ("*.bat", "*.cmd", "rmdir", "*.bat ", "*.cmd ")) and
 not (process.name : "cmd.exe" and process.args : ("*reg.exe QUERY*", "netstat -r", "net session", "wsl.exe -l -q",
                                                   "C:\\Program Files (x86)\\Annke Vision Site\\Nginx",
                                                   "route print 0.0.0.0 mask 0.0.0.0",
                                                   "powershell -command Get-Culture",
                                                   "powershell -Command Get-Host")) and
 not (process.name : "powershell.exe" and
      process.command_line : "C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoProfile -NoLogo -InputFormat Text -NoExit -ExecutionPolicy Unrestricted -Command -")
 ] by process.parent.executable
'''

min_endpoint_version = "8.14.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1027"
name = "Obfuscated Files or Information"
reference = "https://attack.mitre.org/techniques/T1027/"
[[threat.technique.subtechnique]]
id = "T1027.001"
name = "Binary Padding"
reference = "https://attack.mitre.org/techniques/T1027/001/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "8.14.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 5m, correlated by file.path, process.parent.executable.

Stage 1: file

[file where event.action != "deletion" and
  (file.extension : ("exe", "com", "pif", "scr", "dll", "cpl", "ocx") or file.Ext.header_bytes : "4d5a*") and
   file.size >= 100000000 and
  (
   process.name : ("winword.exe", "excel.exe", "powerpnt.exe", "cmd.exe", "powershell.exe", "cscript.exe", "wscript.exe",
                   "mshta.exe", "rundll32.exe", "regsvr32.exe", "certutil.exe", "CertReq.exe", "curl.exe", "msbuild.exe",
                   "installutil.exe", "regasm.exe", "expand.exe", "xcopy.exe", "chrome.exe", "brave.exe", "firefox.exe",
                   "msedge.exe", "whale.exe", "browser.exe", "dragon.exe", "vivaldi.exe", "opera.exe") or
   (process.executable : ("?:\\Users\\*", "?:\\ProgramData\\*", "?:\\Windows\\Temp\\*", "?:\\Windows\\Tasks\\*", "\\Device\\Mup\\*") and
    (process.code_signature.trusted == false or process.code_signature.exists == false))
   ) and
   not file.path : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*") and not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
   not process.executable :
              ("?:\\Users\\*\\AppData\\Local\\electron-builder\\Cache\\winCodeSign\\winCodeSign-2.6.0\\rcedit-x64.exe",
               "?:\\Users\\*\\Electron\\dist\\StrigoTool-Electron Setup 1.0.0.exe")
 ] by file.path

Stage 2: process

[process where event.action == "start" and 
 process.name : ("cmd.exe", "powershell.exe", "wscript.exe", "mshta.exe", "rundll32.exe", "regsvr32.exe",
                 "certutil.exe", "CertReq.exe", "curl.exe", "msbuild.exe") and
 not (process.name : "wscript.exe" and process.args : "C:\\Prntdrvr\\SFX\\silent.vbs") and
 not (process.name : "cmd.exe" and
      process.args : ("C:\\WINDOWS\\system32\\reg.exe ADD HKCU\\Software\\Classes\\GoSignDesktop.p7m /f",
                      "USERNAME eq %USERNAME%", "lms version --json", "--output-encoding=bser",
                      "imagename eq SteelSeriesGG.exe")) and
 not (process.parent.code_signature.subject_name : ("KOBIL GmbH", "Shenzhen Tuozhu Technology Co., Ltd.", "Bose Professional") and
      process.parent.code_signature.trusted == true) and
 not process.parent.code_signature.trusted == true and not process.parent.args == "--squirrel-firstrun" and
 not process.command_line :
               ("C:\\Windows\\system32\\cmd.exe /d /s /c \"node -v\"",
                "C:\\Windows\\system32\\cmd.exe /d /s /c \"chcp\"",
                "C:\\windows\\system32\\cmd.exe /c az version -o=json",
                "C:\\WINDOWS\\system32\\cmd.exe /d /s /c \"wmic CsProduct Get UUID\"",
                "C:\\windows\\system32\\cmd.exe /d /s /c \"wsl.exe -l -q\"",
                "C:\\WINDOWS\\system32\\cmd.exe /d /s /c *",
                "cmd /c dir") and
 not (process.name : "cmd.exe" and process.args : ("*.bat", "*.cmd", "rmdir", "*.bat ", "*.cmd ")) and
 not (process.name : "cmd.exe" and process.args : ("*reg.exe QUERY*", "netstat -r", "net session", "wsl.exe -l -q",
                                                   "C:\\Program Files (x86)\\Annke Vision Site\\Nginx",
                                                   "route print 0.0.0.0 mask 0.0.0.0",
                                                   "powershell -command Get-Culture",
                                                   "powershell -Command Get-Host")) and
 not (process.name : "powershell.exe" and
      process.command_line : "C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoProfile -NoLogo -InputFormat Text -NoExit -ExecutionPolicy Unrestricted -Command -")
 ] by process.parent.executable

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.pathstarts_with?:\Program Files\, ?:\Program Files (x86)\excludes:file.path field:"file.path" value:"?:\Program Files\" field:"file.path" value:"?:\Program Files (x86)\"
process.executablewildcard?:\Users\*\AppData\Local\electron-builder\Cache\winCodeSign\winCodeSign-2.6.0\rcedit-x64.exe, ?:\Users\*\Electron\dist\StrigoTool-Electron Setup 1.0.0.exeexcludes:process.executable field:"process.executable" value:"?:\Users\*\AppData\Local\electron-builder\Cache\winCodeSign\winCodeSign-2.6.0\rcedit-x64.exe" field:"process.executable" value:"?:\Users\*\Electron\dist\StrigoTool-Electron Setup 1.0.0.exe"
user.ideqS-1-5-18, S-1-5-19, S-1-5-20excludes:user.id field:"user.id" value:"S-1-5-18" field:"user.id" value:"S-1-5-19" field:"user.id" value:"S-1-5-20"
process.argseqC:\Prntdrvr\SFX\silent.vbsexcludes:process.args field:"process.args" value:"C:\Prntdrvr\SFX\silent.vbs"
process.nameeqwscript.exeexcludes:process.name field:"process.name" value:"wscript.exe"
process.argseqC:\WINDOWS\system32\reg.exe ADD HKCU\Software\Classes\GoSignDesktop.p7m /f, USERNAME eq %USERNAME%, lms version --json, --output-encoding=bser, imagename eq SteelSeriesGG.exeexcludes:process.args
process.nameeqcmd.exeexcludes:process.name field:"process.name" value:"cmd.exe"
process.argswildcard*.bat, *.cmd, rmdir, *.bat , *.cmd excludes:process.args
process.argswildcard*reg.exe QUERY*, netstat -r, net session, wsl.exe -l -q, C:\Program Files (x86)\Annke Vision Site\Nginx, route print 0.0.0.0 mask 0.0.0.0, powershell -command Get-Culture, powershell -Command Get-Hostexcludes:process.args
process.command_lineeqC:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NoLogo -InputFormat Text -NoExit -ExecutionPolicy Unrestricted -Command -excludes:process.command_line field:"process.command_line" value:"C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NoLogo -InputFormat Text -NoExit -ExecutionPolicy Unrestricted -Command -"
process.nameeqpowershell.exeexcludes:process.name field:"process.name" value:"powershell.exe"
process.parent.code_signature.subject_nameeqKOBIL GmbH, Shenzhen Tuozhu Technology Co., Ltd., Bose Professionalexcludes:process.parent.code_signature.subject_name field:"process.parent.code_signature.subject_name" value:"KOBIL GmbH" field:"process.parent.code_signature.subject_name" value:"Shenzhen Tuozhu Technology Co., Ltd." field:"process.parent.code_signature.subject_name" value:"Bose Professional"
process.parent.code_signature.trustedeqtrueexcludes:process.parent.code_signature.trusted field:"process.parent.code_signature.trusted" value:"true"
process.command_linewildcardC:\Windows\system32\cmd.exe /d /s /c "node -v", C:\Windows\system32\cmd.exe /d /s /c "chcp", C:\windows\system32\cmd.exe /c az version -o=json, C:\WINDOWS\system32\cmd.exe /d /s /c "wmic CsProduct Get UUID", C:\windows\system32\cmd.exe /d /s /c "wsl.exe -l -q", C:\WINDOWS\system32\cmd.exe /d /s /c *, cmd /c direxcludes:process.command_line
process.parent.argseq--squirrel-firstrunexcludes:process.parent.args field:"process.parent.args" value:"--squirrel-firstrun"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq value:"start"
event.actionne
  • deletion corpus 86 (elastic 86)
field:"EventType" kind:ne value:"deletion"
file.Ext.header_byteswildcard
  • 4d5a* corpus 46 (elastic 46)
field:"file.Ext.header_bytes" kind:wildcard value:"4d5a*"
file.extensionwildcard
  • com corpus 16 (elastic 16)
  • cpl corpus 19 (elastic 19)
  • dll corpus 33 (elastic 33)
  • exe corpus 32 (elastic 32)
  • ocx corpus 6 (elastic 6)
  • pif corpus 18 (elastic 18)
  • scr corpus 17 (elastic 17)
field:"file.extension" kind:wildcard
file.sizege
  • 100000000 transforms: number corpus 2 (elastic 2)
field:"file.size" kind:ge value:"100000000"
process.code_signature.existseq
  • false transforms: boolean corpus 119 (elastic 119)
field:"process.code_signature.exists" kind:eq value:"false"
process.code_signature.trustedeq
  • false transforms: boolean corpus 115 (elastic 115)
field:"process.code_signature.trusted" kind:eq value:"false"
process.executablewildcard
  • ?:\ProgramData\* corpus 17 (elastic 17)
  • ?:\Users\* corpus 18 (elastic 18)
  • ?:\Windows\Tasks\* corpus 7 (elastic 7)
  • ?:\Windows\Temp\* corpus 9 (elastic 9)
  • \Device\Mup\* corpus 8 (elastic 8)
field:"Image" kind:wildcard
process.namewildcard
  • CertReq.exe corpus 20 (elastic 20)
  • brave.exe corpus 7 (elastic 7)
  • browser.exe corpus 7 (elastic 7)
  • certutil.exe corpus 44 (elastic 38, splunk 6)
  • chrome.exe corpus 16 (elastic 14, splunk 2)
  • cmd.exe corpus 121 (elastic 92, splunk 29)
  • cscript.exe corpus 67 (elastic 65, splunk 2)
  • curl.exe corpus 34 (elastic 31, splunk 3)
  • dragon.exe corpus 7 (elastic 7)
  • excel.exe corpus 34 (elastic 34)
  • expand.exe corpus 8 (elastic 7, splunk 1)
  • firefox.exe corpus 5 (elastic 5)
  • installutil.exe corpus 37 (elastic 32, splunk 5)
  • msbuild.exe corpus 39 (elastic 36, splunk 3)
  • msedge.exe corpus 12 (elastic 12)
  • mshta.exe corpus 84 (elastic 79, splunk 5)
  • opera.exe corpus 3 (elastic 3)
  • powerpnt.exe corpus 31 (elastic 31)
  • powershell.exe corpus 184 (elastic 140, splunk 44)
  • regasm.exe corpus 26 (elastic 24, splunk 2)
  • regsvr32.exe corpus 73 (elastic 68, splunk 5)
  • rundll32.exe corpus 126 (elastic 100, splunk 26)
  • vivaldi.exe corpus 6 (elastic 6)
  • whale.exe corpus 4 (elastic 4)
  • winword.exe corpus 35 (elastic 35)
  • wscript.exe corpus 83 (elastic 82, splunk 1)
  • xcopy.exe corpus 10 (elastic 10)
field:"process_name" kind:wildcard