Detection rules › Sublime MQL

Attachment: Office file with document sharing and browser instruction lures

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

Detects macro-enabled attachments containing document sharing language (sent, shared, forwarded) combined with browser interaction instructions (copy, right-click) or common email disclaimers. These tactics are often used to trick users into enabling macros or following malicious instructions.

Threat classification

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

CategoryValues
Attack typesCredential Phishing
Tactics and techniquesSocial engineering, Evasion

Event coverage

Rule body MQL

type.inbound
and any(filter(attachments,
               .file_extension in $file_extensions_macros
               // limit the size to reduce FPs, the larger the document, the more likely it is for FPs on benign automated reports
               and .size < 2000000
        ),
        // Detection Note: There are multiple regex patterns used in multiple places, it'll be important to keep them in sync
        any(file.explode(.),
            // document sharing lure
            (
              length(.scan.strings.raw, ) < 1000
              and regex.icontains(.scan.strings.raw,
                                  '(?:sent|shared|forwarded|provided|invited|received)(?:\s+\w+){0,9}\s+(?:document|file|attachment)',
              )
            )

            // ocr output
            or (
              length(.scan.ocr.raw) < 1000
              and regex.icontains(.scan.ocr.raw,
                                  '(?:sent|shared|forwarded|provided|invited|received)(?:\s+\w+){0,9}\s+(?:document|file|attachment)',
              )
            )
            or (
              length(.scan.ocr.raw) < 500
              and strings.ends_with(.scan.ocr.raw, 'REVIEW DOCUMENTS')
            )
        )
        // copy/paste stuff or disclaimer text in the OCR output
        and (
          any(file.explode(.),
              (
                length(.scan.strings.raw, ) < 1000
                and (
                  regex.icontains(.scan.strings.raw,
                                  '(?:copy (?:and paste)?|right.?click)(?:\s+\w+\s*){0,9}browser',
                                  'click.{0,50}(?:above|below|button) to (?:access|open)'
                  )
                )
              )

              // ocr output
              or (
                length(.scan.ocr.raw) < 1000
                and (
                  regex.icontains(.scan.ocr.raw,
                                  '(?:copy (?:and paste)?|right.?click)(?:\s+\w+\s*){0,9}browser',
                                  'click.{0,50}(?:above|below|button) to (?:access|open)'
                  )
                )
              )
              or 5 of (
                strings.icontains(.scan.ocr.raw,
                                  'confidential and intended solely'
                ),
                strings.icontains(.scan.ocr.raw,
                                  'intended solely for the use of'
                ),
                strings.icontains(.scan.ocr.raw, 'intended only for the people'),
                strings.icontains(.scan.ocr.raw, 'intended recipient'),
                strings.icontains(.scan.ocr.raw, 'received this email in error'),
                strings.icontains(.scan.ocr.raw,
                                  'notify the sender immediately'
                ),
                strings.icontains(.scan.ocr.raw, 'delete it from your system'),
                strings.icontains(.scan.ocr.raw, 'delete the email from'),
                strings.icontains(.scan.ocr.raw, 'virus-free'),
                strings.icontains(.scan.ocr.raw, 'scan for viruses'),
                strings.icontains(.scan.ocr.raw, 'legally binding agreement'),
                strings.icontains(.scan.ocr.raw, 'informational purposes only'),
                strings.icontains(.scan.ocr.raw,
                                  'any attachments are confidential'
                ),
                strings.icontains(.scan.ocr.raw, 'loss or damage arising'),
                strings.icontains(.scan.ocr.raw, 'responsibility for any loss'),
                strings.icontains(.scan.ocr.raw, 'unauthorised and prohibited'),
                strings.icontains(.scan.ocr.raw, 'subject to legal privilege'),
                strings.icontains(.scan.ocr.raw,
                                  'The information contained in or attached'
                ),
                strings.icontains(.scan.ocr.raw,
                                  'The information contained in this email'
                ),
                strings.icontains(.scan.ocr.raw,
                                  'people to whom it is addressed'
                ),
                strings.icontains(.scan.ocr.raw,
                                  'received this in error, please inform'
                ),
                strings.icontains(.scan.ocr.raw, 'inform the sender and/or'),
                strings.icontains(.scan.ocr.raw,
                                  'immediately and delete the material'
                ),
                strings.icontains(.scan.ocr.raw,
                                  'then delete the email from your inbox'
                ),
                strings.icontains(.scan.ocr.raw,
                                  'confidential and/or privileged material'
                ),
                strings.icontains(.scan.ocr.raw,
                                  'confidential and / or legally privileged'
                ),
                strings.icontains(.scan.ocr.raw,
                                  'The information transmitted is intended'
                ),
                strings.icontains(.scan.ocr.raw,
                                  'other than the intended recipient is prohibited'
                ),
                strings.icontains(.scan.ocr.raw,
                                  'intended for use by the addressee'
                ),
                strings.icontains(.scan.ocr.raw,
                                  'taking of any action in reliance upon'
                ),
                strings.icontains(.scan.ocr.raw,
                                  'distribution is strictly prohibited'
                ),
                strings.icontains(.scan.ocr.raw,
                                  'communication from the sender is confidential'
                ),
                strings.icontains(.scan.ocr.raw, 'use by the recipient'),
                strings.icontains(.scan.ocr.raw,
                                  'and others authorized to receive it'
                ),
                strings.icontains(.scan.ocr.raw, 'you are hereby notified'),
                strings.icontains(.scan.ocr.raw,
                                  'action in relation of the contents of this information'
                ),
                strings.icontains(.scan.ocr.raw,
                                  'The information contained in this'
                ),
                strings.icontains(.scan.ocr.raw, 'you are not the recipient'),
                strings.icontains(.scan.ocr.raw, 'may be unlawful'),
              )
          )
        )
)

Detection logic

Scope: inbound message.

Detects macro-enabled attachments containing document sharing language (sent, shared, forwarded) combined with browser interaction instructions (copy, right-click) or common email disclaimers. These tactics are often used to trick users into enabling macros or following malicious instructions.

  1. inbound message
  2. any of filter(attachments) where all hold:
    • any of file.explode(.) where any holds:
      • all of:
        • length(.scan.strings.raw) < 1000
        • .scan.strings.raw matches '(?:sent|shared|forwarded|provided|invited|received)(?:\\s+\\w+){0,9}\\s+(?:document|file|attachment)'
      • all of:
        • length(.scan.ocr.raw) < 1000
        • .scan.ocr.raw matches '(?:sent|shared|forwarded|provided|invited|received)(?:\\s+\\w+){0,9}\\s+(?:document|file|attachment)'
      • all of:
        • length(.scan.ocr.raw) < 500
        • .scan.ocr.raw ends with 'REVIEW DOCUMENTS'
    • any of file.explode(.) where any holds:
      • all of:
        • length(.scan.strings.raw) < 1000
        • .scan.strings.raw matches any of 2 patterns
          • (?:copy (?:and paste)?|right.?click)(?:\s+\w+\s*){0,9}browser
          • click.{0,50}(?:above|below|button) to (?:access|open)
      • all of:
        • length(.scan.ocr.raw) < 1000
        • .scan.ocr.raw matches any of 2 patterns
          • (?:copy (?:and paste)?|right.?click)(?:\s+\w+\s*){0,9}browser
          • click.{0,50}(?:above|below|button) to (?:access|open)
      • at least 5 of 39: .scan.ocr.raw contains any of 39 patterns
        • confidential and intended solely
        • intended solely for the use of
        • intended only for the people
        • intended recipient
        • received this email in error
        • notify the sender immediately
        • delete it from your system
        • delete the email from
        • virus-free
        • scan for viruses
        • legally binding agreement
        • informational purposes only
        • any attachments are confidential
        • loss or damage arising
        • responsibility for any loss
        • unauthorised and prohibited
        • subject to legal privilege
        • The information contained in or attached
        • The information contained in this email
        • people to whom it is addressed
        • received this in error, please inform
        • inform the sender and/or
        • immediately and delete the material
        • then delete the email from your inbox
        • confidential and/or privileged material
        • confidential and / or legally privileged
        • The information transmitted is intended
        • other than the intended recipient is prohibited
        • intended for use by the addressee
        • taking of any action in reliance upon
        • distribution is strictly prohibited
        • communication from the sender is confidential
        • use by the recipient
        • and others authorized to receive it
        • you are hereby notified
        • action in relation of the contents of this information
        • The information contained in this
        • you are not the recipient
        • may be unlawful

Inspects: attachments[].file_extension, attachments[].size, type.inbound. Sensors: file.explode, regex.icontains, strings.ends_with, strings.icontains. Reference lists: $file_extensions_macros.

Indicators matched (43)

FieldMatchValue
regex.icontainsregex(?:sent|shared|forwarded|provided|invited|received)(?:\s+\w+){0,9}\s+(?:document|file|attachment)
strings.ends_withsuffixREVIEW DOCUMENTS
regex.icontainsregex(?:copy (?:and paste)?|right.?click)(?:\s+\w+\s*){0,9}browser
regex.icontainsregexclick.{0,50}(?:above|below|button) to (?:access|open)
strings.icontainssubstringconfidential and intended solely
strings.icontainssubstringintended solely for the use of
strings.icontainssubstringintended only for the people
strings.icontainssubstringintended recipient
strings.icontainssubstringreceived this email in error
strings.icontainssubstringnotify the sender immediately
strings.icontainssubstringdelete it from your system
strings.icontainssubstringdelete the email from
31 more
strings.icontainssubstringvirus-free
strings.icontainssubstringscan for viruses
strings.icontainssubstringlegally binding agreement
strings.icontainssubstringinformational purposes only
strings.icontainssubstringany attachments are confidential
strings.icontainssubstringloss or damage arising
strings.icontainssubstringresponsibility for any loss
strings.icontainssubstringunauthorised and prohibited
strings.icontainssubstringsubject to legal privilege
strings.icontainssubstringThe information contained in or attached
strings.icontainssubstringThe information contained in this email
strings.icontainssubstringpeople to whom it is addressed
strings.icontainssubstringreceived this in error, please inform
strings.icontainssubstringinform the sender and/or
strings.icontainssubstringimmediately and delete the material
strings.icontainssubstringthen delete the email from your inbox
strings.icontainssubstringconfidential and/or privileged material
strings.icontainssubstringconfidential and / or legally privileged
strings.icontainssubstringThe information transmitted is intended
strings.icontainssubstringother than the intended recipient is prohibited
strings.icontainssubstringintended for use by the addressee
strings.icontainssubstringtaking of any action in reliance upon
strings.icontainssubstringdistribution is strictly prohibited
strings.icontainssubstringcommunication from the sender is confidential
strings.icontainssubstringuse by the recipient
strings.icontainssubstringand others authorized to receive it
strings.icontainssubstringyou are hereby notified
strings.icontainssubstringaction in relation of the contents of this information
strings.icontainssubstringThe information contained in this
strings.icontainssubstringyou are not the recipient
strings.icontainssubstringmay be unlawful