Detection rules › Elastic
Suspicious Execution from an Oversized Executable
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
| Tactic | Techniques |
|---|---|
| Stealth |
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.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
file.path | starts_with | ?:\Program Files\, ?:\Program Files (x86)\ | excludes:file.path field:"file.path" value:"?:\Program Files\" field:"file.path" value:"?:\Program Files (x86)\" |
process.executable | wildcard | ?:\Users\*\AppData\Local\electron-builder\Cache\winCodeSign\winCodeSign-2.6.0\rcedit-x64.exe, ?:\Users\*\Electron\dist\StrigoTool-Electron Setup 1.0.0.exe | excludes: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.id | eq | S-1-5-18, S-1-5-19, S-1-5-20 | excludes: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.args | eq | C:\Prntdrvr\SFX\silent.vbs | excludes:process.args field:"process.args" value:"C:\Prntdrvr\SFX\silent.vbs" |
process.name | eq | wscript.exe | excludes:process.name field:"process.name" value:"wscript.exe" |
process.args | eq | 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 | excludes:process.args |
process.name | eq | cmd.exe | excludes:process.name field:"process.name" value:"cmd.exe" |
process.args | wildcard | *.bat, *.cmd, rmdir, *.bat , *.cmd | excludes:process.args |
process.args | wildcard | *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 | excludes:process.args |
process.command_line | eq | C:\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.name | eq | powershell.exe | excludes:process.name field:"process.name" value:"powershell.exe" |
process.parent.code_signature.subject_name | eq | KOBIL GmbH, Shenzhen Tuozhu Technology Co., Ltd., Bose Professional | excludes: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.trusted | eq | true | excludes:process.parent.code_signature.trusted field:"process.parent.code_signature.trusted" value:"true" |
process.command_line | wildcard | 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 | excludes:process.command_line |
process.parent.args | eq | --squirrel-firstrun | excludes:process.parent.args field:"process.parent.args" value:"--squirrel-firstrun" |
Indicators
These rows show field, operator, and value matches.