Detection rules › Sublime MQL
Attachment: SVG file execution
Detects file execution attempts in SVG files. ActiveXObject is used to invoke WScript.Shell and run a program.
Threat classification
Sublime's own taxonomy (not MITRE ATT&CK).
| Category | Values |
|---|---|
| Attack types | Malware/Ransomware |
| Tactics and techniques | Scripting |
Event coverage
| Message attribute |
|---|
| attachments (collection) |
| type |
Rule body MQL
type.inbound
and any(attachments,
(
.file_extension =~ "svg"
or .file_extension in $file_extensions_common_archives
or .file_type == "svg"
)
and any(file.explode(.),
.file_extension == "svg"
// Author Matt harr0ey @harr0ey
// Topic: SVG file Execution
// WScript inside SVG
// <script language="JScript">
// <![CDATA[
// var r = new ActiveXObject("WScript.Shell").Run("calc.exe")
// ]]>
// </script>
and any(.scan.strings.strings,
strings.icontains(., "ActiveXObject")
)
and any(.scan.strings.strings,
strings.icontains(., "WScript.Shell")
)
and any(.scan.strings.strings,
strings.like(., "*Run*", "*Execute*")
)
)
)
Detection logic
Scope: inbound message.
Detects file execution attempts in SVG files. ActiveXObject is used to invoke WScript.Shell and run a program.
- inbound message
any of
attachmentswhere all hold:any of:
- .file_extension is 'svg'
- .file_extension in $file_extensions_common_archives
- .file_type is 'svg'
any of
file.explode(.)where all hold:- .file_extension is 'svg'
any of
.scan.strings.stringswhere:- . contains 'ActiveXObject'
any of
.scan.strings.stringswhere:- . contains 'WScript.Shell'
any of
.scan.strings.stringswhere:. matches any of 2 patterns
*Run**Execute*
Inspects: attachments[].file_extension, attachments[].file_type, type.inbound. Sensors: file.explode, strings.icontains, strings.like. Reference lists: $file_extensions_common_archives.
Indicators matched (7)
| Field | Match | Value |
|---|---|---|
attachments[].file_extension | equals | svg |
attachments[].file_type | equals | svg |
file.explode(attachments[])[].file_extension | equals | svg |
strings.icontains | substring | ActiveXObject |
strings.icontains | substring | WScript.Shell |
strings.like | substring | *Run* |
strings.like | substring | *Execute* |