Detection rules › Sublime MQL

Attachment: Malicious OneNote commands

Severity
high
Type
rule
Source
github.com/sublime-security/sublime-rules

Scans for OneNote attachments that contain suspicious commands that may indicate malicious activity.

Threat classification

Sublime's own taxonomy (not MITRE ATT&CK).

CategoryValues
Attack typesMalware/Ransomware
Tactics and techniquesOneNote, Scripting

Event coverage

Rule body MQL

type.inbound
and any(attachments,
        (
          .file_extension in~ ("one")
          or .file_extension in~ $file_extensions_common_archives
        )
        and any(file.explode(.),
                "onenote_file" in .flavors.yara
                and any(.scan.strings.strings,
                        strings.ilike(.,
                                      "*WshShell*",
                                      "*ExecuteCmdAsync*",
                                      "*CreateObject*",
                                      "*Wscript.Shell*",
                                      "*schtasks*",
                                      "*CreateProcess*",
                                      "*winmgmts*",
                                      "*SetEnvironmentVariable*",
                                      "*powershell*",
                                      "*echo off*"
                        )
                )
        )
)

Detection logic

Scope: inbound message.

Scans for OneNote attachments that contain suspicious commands that may indicate malicious activity.

  1. inbound message
  2. any of attachments where all hold:
    • any of:
      • .file_extension in ('one')
      • .file_extension in $file_extensions_common_archives
    • any of file.explode(.) where all hold:
      • .flavors.yara contains 'onenote_file'
      • any of .scan.strings.strings where:
        • . matches any of 10 patterns
          • *WshShell*
          • *ExecuteCmdAsync*
          • *CreateObject*
          • *Wscript.Shell*
          • *schtasks*
          • *CreateProcess*
          • *winmgmts*
          • *SetEnvironmentVariable*
          • *powershell*
          • *echo off*

Inspects: attachments[].file_extension, type.inbound. Sensors: file.explode, strings.ilike. Reference lists: $file_extensions_common_archives.

Indicators matched (12)

FieldMatchValue
attachments[].file_extensionmemberone
file.explode(attachments[])[].flavors.yaracontainsonenote_file
strings.ilikesubstring*WshShell*
strings.ilikesubstring*ExecuteCmdAsync*
strings.ilikesubstring*CreateObject*
strings.ilikesubstring*Wscript.Shell*
strings.ilikesubstring*schtasks*
strings.ilikesubstring*CreateProcess*
strings.ilikesubstring*winmgmts*
strings.ilikesubstring*SetEnvironmentVariable*
strings.ilikesubstring*powershell*
strings.ilikesubstring*echo off*