Detection rules › Elastic
Potential Obfuscated Script Execution
Detection involves spotting the generation of a file exhibiting high entropy, which is subsequently executed using frequently abused script interpreters. Adversaries may employ script obfuscation techniques to evade static detection methods.
MITRE ATT&CK coverage
Rule body
[rule]
description = """
Detection involves spotting the generation of a file exhibiting high entropy, which is subsequently executed using
frequently abused script interpreters. Adversaries may employ script obfuscation techniques to evade static detection
methods.
"""
id = "a279fa6c-61eb-49ea-926e-704db27855e8"
license = "Elastic License v2"
name = "Potential Obfuscated Script Execution"
os_list = ["windows"]
version = "1.0.12"
query = '''
sequence with maxspan=1m
[file where event.action == "creation" and
not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-90") and
process.pid != 4 and
file.path : ("?:\\Users\\*", "?:\\ProgramData\\*", "?:\\Windows\\Temp\\*", "?:\\Windows\\Tasks\\*") and
file.Ext.entropy >= 6 and not file.Ext.header_bytes : "4d5a*" and
not (process.name : "ifa-PM.exe" and file.name : "ifa-PMS.hta") and
not (process.name : "Code.exe" and file.name : "aws-lsp-codewhisperer.js") and
not (process.name : ("Setup.exe", "vrpsetup.exe") and
file.Ext.header_bytes : ("53657420776d6953657276696365203d", "2720436865636b206c6963206265666f")) and
not (process.code_signature.subject_name : ("BizLink International Corp.", "Adobe Inc.", "Fabrice PARISOT", "Notepad++", "Argus Media Ltd", "Imprivata, Inc.")
and process.code_signature.trusted == true) and
not process.executable : ("?:\\Program Files (x86)\\Kovai Ltd\\BizTalk360\\Service\\BHMCollect.exe",
"?:\\Program Files (x86)\\BizTalkHealthMonitor\\BHMCollect.exe",
"?:\\Program Files\\Common Files\\Voltage Security\\VSManager2.exe",
"?:\\Program Files (x86)\\UPS\\CrossWare\\CrossWare.exe",
"?:\\Program Files\\Automation Anywhere\\Bot Agent\\jre\\bin\\javaw.exe",
"?:\\Program Files\\ForeScout SecureConnector\\SecureConnector.exe",
"?:\\Program Files (x86)\\Acronis\\BackupAndRecovery\\mms.exe",
"C:\\Program Files (x86)\\Delcam\\FeatureCAM\\Program\\ezfm.exe",
"C:\\Program Files\\IPA\\IPA.exe",
"?:\\Program Files\\EIZO\\ColorNavigator 7\\ColorNavigator 7.exe",
"?:\\Program Files (x86)\\Windev\\AD_Voyager\\AD_voyager.exe",
"?:\\Program Files\\BackupClient\\BackupAndRecovery\\mms.exe",
"?:\\Program Files\\Velneo\\vClient.exe",
"D:\\WINDEV\\AD_Voyager\\AD_voyager.exe",
"C:\\Program Files\\Java\\jre8\\bin\\java.exe",
"C:\\Program Files (x86)\\SofttechLLC\\FlightVector\\FlightVector.exe",
"?:\\Program Files\\Automation Anywhere\\Bot Agent\\jre\\bin\\BotLauncher.exe",
"C:\\Program Files\\Eclipse Adoptium\\jdk-*-hotspot\\bin\\java.exe",
"C:\\Program Files (x86)\\Imprivata\\OneSign Agent\\x64\\ISXAgent.exe",
"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\*\\msedgewebview2.exe")] as event0
[process where event.action == "start" and process.args_count >= 2 and
(
(process.Ext.relative_file_creation_time <= 500 and process.pe.original_file_name : ("node.exe", "AutoIt*.exe")) or
(process.pe.original_file_name : ("wscript.exe", "mshta.exe") and
event0.file.extension : ("js", "vbs", "wsh", "vbe", "jse", "hta"))
) and
stringcontains~(process.command_line, event0.file.name) and
not (process.parent.args : "%TEMP%\\Spiceworks\\spiceworks_upload.vbs" and process.parent.name : "cmd.exe") and
not (process.parent.name : "mshta.exe" and process.parent.args : "\\\\*\\netlogon\\ADSelfService_Enroll.hta") and
not (process.parent.name : "cmd.exe" and
process.parent.command_line : "C:\\WINDOWS\\SYSTEM32\\cmd.exe /c \"\"C:\\Program Files (x86)\\BluePoint Solutions\\BPAppLaunch\\ConsoleApp\\Command BPAppLaunch.bat\"\"") and
not process.parent.executable : ("C:\\Engineer\\Airlock Digital - Allowlisting Auditor v4.1.exe",
"C:\\Program Files (x86)\\Common Files\\Adobe\\Adobe Desktop Common\\HDBox\\Setup.exe")
]
'''
min_endpoint_version = "8.4.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
tree = true
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 1
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.005"
name = "Visual Basic"
reference = "https://attack.mitre.org/techniques/T1059/005/"
[[threat.technique.subtechnique]]
id = "T1059.007"
name = "JavaScript"
reference = "https://attack.mitre.org/techniques/T1059/007/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1027"
name = "Obfuscated Files or Information"
reference = "https://attack.mitre.org/techniques/T1027/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.4.0"
Stages and Predicates
Stage 1: file
[file where event.action == "creation" and
not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-90") and
process.pid != 4 and
file.path : ("?:\\Users\\*", "?:\\ProgramData\\*", "?:\\Windows\\Temp\\*", "?:\\Windows\\Tasks\\*") and
file.Ext.entropy >= 6 and not file.Ext.header_bytes : "4d5a*" and
not (process.name : "ifa-PM.exe" and file.name : "ifa-PMS.hta") and
not (process.name : "Code.exe" and file.name : "aws-lsp-codewhisperer.js") and
not (process.name : ("Setup.exe", "vrpsetup.exe") and
file.Ext.header_bytes : ("53657420776d6953657276696365203d", "2720436865636b206c6963206265666f")) and
not (process.code_signature.subject_name : ("BizLink International Corp.", "Adobe Inc.", "Fabrice PARISOT", "Notepad++", "Argus Media Ltd", "Imprivata, Inc.")
and process.code_signature.trusted == true) and
not process.executable : ("?:\\Program Files (x86)\\Kovai Ltd\\BizTalk360\\Service\\BHMCollect.exe",
"?:\\Program Files (x86)\\BizTalkHealthMonitor\\BHMCollect.exe",
"?:\\Program Files\\Common Files\\Voltage Security\\VSManager2.exe",
"?:\\Program Files (x86)\\UPS\\CrossWare\\CrossWare.exe",
"?:\\Program Files\\Automation Anywhere\\Bot Agent\\jre\\bin\\javaw.exe",
"?:\\Program Files\\ForeScout SecureConnector\\SecureConnector.exe",
"?:\\Program Files (x86)\\Acronis\\BackupAndRecovery\\mms.exe",
"C:\\Program Files (x86)\\Delcam\\FeatureCAM\\Program\\ezfm.exe",
"C:\\Program Files\\IPA\\IPA.exe",
"?:\\Program Files\\EIZO\\ColorNavigator 7\\ColorNavigator 7.exe",
"?:\\Program Files (x86)\\Windev\\AD_Voyager\\AD_voyager.exe",
"?:\\Program Files\\BackupClient\\BackupAndRecovery\\mms.exe",
"?:\\Program Files\\Velneo\\vClient.exe",
"D:\\WINDEV\\AD_Voyager\\AD_voyager.exe",
"C:\\Program Files\\Java\\jre8\\bin\\java.exe",
"C:\\Program Files (x86)\\SofttechLLC\\FlightVector\\FlightVector.exe",
"?:\\Program Files\\Automation Anywhere\\Bot Agent\\jre\\bin\\BotLauncher.exe",
"C:\\Program Files\\Eclipse Adoptium\\jdk-*-hotspot\\bin\\java.exe",
"C:\\Program Files (x86)\\Imprivata\\OneSign Agent\\x64\\ISXAgent.exe",
"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\*\\msedgewebview2.exe")] as event0
Stage 2: process
[process where event.action == "start" and process.args_count >= 2 and
(
(process.Ext.relative_file_creation_time <= 500 and process.pe.original_file_name : ("node.exe", "AutoIt*.exe")) or
(process.pe.original_file_name : ("wscript.exe", "mshta.exe") and
event0.file.extension : ("js", "vbs", "wsh", "vbe", "jse", "hta"))
) and
stringcontains~(process.command_line, event0.file.name) and
not (process.parent.args : "%TEMP%\\Spiceworks\\spiceworks_upload.vbs" and process.parent.name : "cmd.exe") and
not (process.parent.name : "mshta.exe" and process.parent.args : "\\\\*\\netlogon\\ADSelfService_Enroll.hta") and
not (process.parent.name : "cmd.exe" and
process.parent.command_line : "C:\\WINDOWS\\SYSTEM32\\cmd.exe /c \"\"C:\\Program Files (x86)\\BluePoint Solutions\\BPAppLaunch\\ConsoleApp\\Command BPAppLaunch.bat\"\"") and
not process.parent.executable : ("C:\\Engineer\\Airlock Digital - Allowlisting Auditor v4.1.exe",
"C:\\Program Files (x86)\\Common Files\\Adobe\\Adobe Desktop Common\\HDBox\\Setup.exe")
]
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
file.Ext.header_bytes | eq | 53657420776d6953657276696365203d, 2720436865636b206c6963206265666f | excludes:file.Ext.header_bytes field:"file.Ext.header_bytes" value:"53657420776d6953657276696365203d" field:"file.Ext.header_bytes" value:"2720436865636b206c6963206265666f" |
process.name | eq | Setup.exe, vrpsetup.exe | excludes:process.name field:"process.name" value:"Setup.exe" field:"process.name" value:"vrpsetup.exe" |
file.name | eq | aws-lsp-codewhisperer.js | excludes:file.name field:"file.name" value:"aws-lsp-codewhisperer.js" |
process.name | eq | Code.exe | excludes:process.name field:"process.name" value:"Code.exe" |
file.name | eq | ifa-PMS.hta | excludes:file.name field:"file.name" value:"ifa-PMS.hta" |
process.name | eq | ifa-PM.exe | excludes:process.name field:"process.name" value:"ifa-PM.exe" |
process.code_signature.subject_name | eq | BizLink International Corp., Adobe Inc., Fabrice PARISOT, Notepad++, Argus Media Ltd, Imprivata, Inc. | excludes:process.code_signature.subject_name |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
file.Ext.header_bytes | starts_with | 4d5a | excludes:file.Ext.header_bytes field:"file.Ext.header_bytes" value:"4d5a" |
process.executable | wildcard | ?:\Program Files (x86)\Kovai Ltd\BizTalk360\Service\BHMCollect.exe, ?:\Program Files (x86)\BizTalkHealthMonitor\BHMCollect.exe, ?:\Program Files\Common Files\Voltage Security\VSManager2.exe, ?:\Program Files (x86)\UPS\CrossWare\CrossWare.exe, ?:\Program Files\Automation Anywhere\Bot Agent\jre\bin\javaw.exe, ?:\Program Files\ForeScout SecureConnector\SecureConnector.exe, ?:\Program Files (x86)\Acronis\BackupAndRecovery\mms.exe, C:\Program Files (x86)\Delcam\FeatureCAM\Program\ezfm.exe, C:\Program Files\IPA\IPA.exe, ?:\Program Files\EIZO\ColorNavigator 7\ColorNavigator 7.exe, ?:\Program Files (x86)\Windev\AD_Voyager\AD_voyager.exe, ?:\Program Files\BackupClient\BackupAndRecovery\mms.exe, ?:\Program Files\Velneo\vClient.exe, D:\WINDEV\AD_Voyager\AD_voyager.exe, C:\Program Files\Java\jre8\bin\java.exe, C:\Program Files (x86)\SofttechLLC\FlightVector\FlightVector.exe, ?:\Program Files\Automation Anywhere\Bot Agent\jre\bin\BotLauncher.exe, C:\Program Files\Eclipse Adoptium\jdk-*-hotspot\bin\java.exe, C:\Program Files (x86)\Imprivata\OneSign Agent\x64\ISXAgent.exe, C:\Program Files (x86)\Microsoft\EdgeWebView\Application\*\msedgewebview2.exe | excludes:process.executable |
user.id | eq | S-1-5-18, S-1-5-19, S-1-5-90 | 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-90" |
process.parent.args | eq | %TEMP%\Spiceworks\spiceworks_upload.vbs | excludes:process.parent.args field:"process.parent.args" value:"%TEMP%\Spiceworks\spiceworks_upload.vbs" |
process.parent.name | eq | cmd.exe | excludes:process.parent.name field:"process.parent.name" value:"cmd.exe" |
process.parent.args | wildcard | \\*\netlogon\ADSelfService_Enroll.hta | excludes:process.parent.args field:"process.parent.args" value:"\\*\netlogon\ADSelfService_Enroll.hta" |
process.parent.name | eq | mshta.exe | excludes:process.parent.name field:"process.parent.name" value:"mshta.exe" |
process.parent.command_line | eq | C:\WINDOWS\SYSTEM32\cmd.exe /c ""C:\Program Files (x86)\BluePoint Solutions\BPAppLaunch\ConsoleApp\Command BPAppLaunch.bat"" | excludes:process.parent.command_line |
process.parent.executable | eq | C:\Engineer\Airlock Digital - Allowlisting Auditor v4.1.exe, C:\Program Files (x86)\Common Files\Adobe\Adobe Desktop Common\HDBox\Setup.exe | excludes:process.parent.executable field:"process.parent.executable" value:"C:\Engineer\Airlock Digital - Allowlisting Auditor v4.1.exe" field:"process.parent.executable" value:"C:\Program Files (x86)\Common Files\Adobe\Adobe Desktop Common\HDBox\Setup.exe" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq |
event0.file.extension | wildcard |
| field:"event0.file.extension" kind:wildcard |
file.Ext.entropy | ge |
| field:"file.Ext.entropy" kind:ge value:"6" |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard |
process.Ext.relative_file_creation_time | le |
| field:"process.Ext.relative_file_creation_time" kind:le value:"500" |
process.args_count | ge |
| field:"process.args_count" kind:ge value:"2" |
process.command_line | contains |
| field:"CommandLine" kind:contains value:"event0.file.name" |
process.pe.original_file_name | wildcard |
| field:"OriginalFileName" kind:wildcard |
process.pid | ne |
| field:"process_id" kind:ne value:"4" |