Brand impersonation: SharePoint PDF attachment with credential theft language

PDF attachment contains SharePoint logo and high-confidence credential theft language detected via OCR analysis. The attachment includes URLs and originates from an unsolicited or low-reputation sender, excluding legitimate SharePoint file sharing notifications.

Sublime rule (View on GitHub)

  1name: "Brand impersonation: SharePoint PDF attachment with credential theft language"
  2description: "PDF attachment contains SharePoint logo and high-confidence credential theft language detected via OCR analysis. The attachment includes URLs and originates from an unsolicited or low-reputation sender, excluding legitimate SharePoint file sharing notifications."
  3type: "rule"
  4severity: "medium"
  5source: |
  6  type.inbound
  7  and (
  8    any(attachments,
  9        (
 10          .file_type == "pdf"
 11          and (
 12            (
 13              any(ml.logo_detect(.).brands, .name == "Microsoft SharePoint")
 14              and any(file.explode(.), length(.scan.url.urls) > 0)
 15            )
 16            // a kit share page saved from the browser... scans and exported how-to guides carry other producers
 17            or (
 18              beta.parse_exif(.).page_count <= 2
 19              and any(beta.parse_exif(.).fields,
 20                      .key == "Producer"
 21                      and (
 22                        strings.starts_with(.value, "Skia/PDF")
 23                        or .value == "Microsoft: Print To PDF"
 24                      )
 25              )
 26              and any(file.explode(.),
 27                      strings.icontains(.scan.ocr.raw, "sharepoint")
 28              )
 29              // a share page is a few lines of ui... printed documents that mention sharepoint run far longer
 30              and all(filter(file.explode(.), .scan.ocr.raw is not null),
 31                      length(.scan.ocr.raw) < 800
 32              )
 33            )
 34          )
 35          and any(file.explode(.),
 36                  any(ml.nlu_classifier(.scan.ocr.raw).intents,
 37                      .name == "cred_theft" and .confidence == "high"
 38                  )
 39          )
 40        )
 41    )
 42  )
 43  // negate sharepoint file share
 44  and not (
 45    // based on the message id format
 46    (
 47      (
 48        strings.starts_with(headers.message_id, '<Share-')
 49        and strings.ends_with(headers.message_id, '@odspnotify>')
 50      )
 51      // negate legitimate access request to file
 52      or (
 53        strings.starts_with(headers.message_id, '<Sharing')
 54        and strings.ends_with(headers.message_id, '@odspnotify>')
 55      )
 56      // deal with Google thinking the message ID is "broke"
 57      or (
 58        strings.icontains(headers.message_id, 'SMTPIN_ADDED_BROKEN')
 59        and any(headers.hops,
 60                any(.fields,
 61                    .name == "X-Google-Original-Message-ID"
 62                    and strings.starts_with(.value, '<Share-')
 63                    and strings.ends_with(.value, '@odspnotify>')
 64                )
 65        )
 66      )
 67    )
 68    // all of the "action" links are sharepoint/ms
 69    and all(filter(body.links,
 70                   strings.icontains(subject.subject, .display_text)
 71                   or .display_text == "Open"
 72            ),
 73            .href_url.domain.root_domain in ("sharepoint.com")
 74            or (
 75              .href_url.domain.tld == "ms"
 76              // Microsoft does not own the .ms TLD, this checks to ensure it is one of their domains
 77              and (
 78                network.whois(.href_url.domain).registrant_company == "Microsoft Corporation"
 79                or strings.ilike(network.whois(.href_url.domain).registrar_name,
 80                                 "*MarkMonitor*",
 81                                 "*CSC Corporate*",
 82                                 "*com laude*"
 83                )
 84              )
 85            )
 86    )
 87  )
 88  and not (
 89    (
 90      (subject.is_reply or subject.is_forward)
 91      and (
 92        (length(headers.references) > 0 or headers.in_reply_to is not null)
 93        // ensure that there are actual threads
 94        and (
 95          length(body.previous_threads) > 0
 96          or (length(body.html.display_text) - length(body.current_thread.text)) > 200
 97        )
 98      )
 99    )
100  )
101  // negate highly trusted sender domains unless they fail DMARC authentication
102  and not (
103    sender.email.domain.root_domain in $high_trust_sender_root_domains
104    and coalesce(headers.auth_summary.dmarc.pass, false)
105  )  
106attack_types:
107  - "Credential Phishing"
108tactics_and_techniques:
109  - "Impersonation: Brand"
110  - "Social engineering"
111  - "PDF"
112  - "Evasion"
113detection_methods:
114  - "Computer Vision"
115  - "File analysis"
116  - "Natural Language Understanding"
117  - "Optical Character Recognition"
118  - "Sender analysis"
119  - "URL analysis"
120  - "Header analysis"
121  - "Whois"
122id: "ae3756fa-3751-5fba-b68d-d91164fd359c"
to-top