Callback phishing in body or attachment (untrusted sender)

Detects callback scams by analyzing text within images of receipts or invoices from untrusted senders.

Sublime rule (View on GitHub)

  1name: "Callback phishing in body or attachment (untrusted sender)"
  2description: |
  3    Detects callback scams by analyzing text within images of receipts or invoices from untrusted senders.
  4type: "rule"
  5severity: "medium"
  6source: |
  7  type.inbound
  8  and (
  9    length(attachments) < 5
 10    or (
 11      length(body.current_thread.text) == 0
 12      and length(body.previous_threads) == 0
 13      and 15 < length(attachments) < 20
 14    )
 15  )
 16  and (
 17    any(attachments,
 18        (
 19          .file_type in $file_types_images
 20          or .file_type in ("pdf", "xlsx", "docx")
 21        )
 22        and (
 23          any(ml.nlu_classifier(beta.ocr(.).text).intents,
 24              .name == "callback_scam" and .confidence in ("medium", "high")
 25          )
 26          or any(file.explode(.),
 27  
 28                 // exclude images taken with mobile cameras and screenshots from android
 29                 not any(.scan.exiftool.fields,
 30                         .key == "Model"
 31                         or (
 32                           .key == "Software"
 33                           and strings.starts_with(.value, "Android")
 34                         )
 35                         or (.key == "UserComment" and .value == "Screenshot")
 36                 )
 37                 and any(ml.nlu_classifier(.scan.ocr.raw).intents,
 38                         .name == "callback_scam"
 39                         and .confidence in ("medium", "high")
 40                 )
 41          )
 42        )
 43        and (
 44          // negate noreply unless a logo is found in the attachment
 45          (
 46            sender.email.local_part in ("no_reply", "noreply")
 47            and any(ml.logo_detect(.).brands,
 48                    .name in ("PayPal", "Norton", "GeekSquad", "Ebay", "McAfee")
 49            )
 50          )
 51          or sender.email.local_part not in ("no_reply", "noreply")
 52        )
 53    )
 54    or (
 55      any(ml.nlu_classifier(body.current_thread.text).intents,
 56          .name in ("callback_scam") and .confidence in ("medium", "high")
 57      )
 58      and (
 59        (
 60          270 < length(body.current_thread.text) < 1750
 61          or (
 62            75 < length(body.current_thread.text) < 1750
 63            and (
 64              strings.ilike(body.current_thread.text,
 65                            "*PayPal*",
 66                            "*Norton*",
 67                            "*GeekSquad*",
 68                            "*Ebay*",
 69                            "*McAfee*",
 70                            "*=1"
 71              )
 72              // phone number regex
 73              or regex.icontains(body.current_thread.text,
 74                                 '\+?([ilo0-9]{1}.)?\(?[ilo0-9]{3}?\)?.[ilo0-9]{3}.?[ilo0-9]{4}',
 75                                 '\+?([ilo0-9]{1,2})?\s?\(?\d{3}\)?[\s\.\-⋅]{0,5}[ilo0-9]{3}[\s\.\-⋅]{0,5}[ilo0-9]{4}'
 76              )
 77              or 1 of (
 78                strings.icontains(beta.ocr(file.message_screenshot()).text,
 79                                  "geek squad"
 80                ),
 81                strings.icontains(beta.ocr(file.message_screenshot()).text,
 82                                  "lifelock"
 83                ),
 84                strings.icontains(beta.ocr(file.message_screenshot()).text,
 85                                  "best buy"
 86                ),
 87                strings.icontains(beta.ocr(file.message_screenshot()).text,
 88                                  "mcafee"
 89                ),
 90                strings.icontains(beta.ocr(file.message_screenshot()).text,
 91                                  "norton"
 92                ),
 93                strings.icontains(beta.ocr(file.message_screenshot()).text,
 94                                  "ebay"
 95                ),
 96                strings.icontains(beta.ocr(file.message_screenshot()).text,
 97                                  "paypal"
 98                ),
 99                strings.icontains(beta.ocr(file.message_screenshot()).text,
100                                  "virus"
101                ),
102              )
103            )
104          )
105        )
106      )
107    )
108  )
109  and not (
110    any(headers.domains, .domain == "smtp-out.gcp.bigcommerce.net")
111    and strings.icontains(body.html.raw, "bigcommerce.com")
112  )
113  and (
114    not profile.by_sender_email().solicited
115    or (
116      profile.by_sender_email().any_messages_malicious_or_spam
117      and not profile.by_sender_email().any_messages_benign
118    )
119  )
120  
121  // negate highly trusted sender domains unless they fail DMARC authentication
122  and not (
123    sender.email.domain.root_domain in $high_trust_sender_root_domains
124    and coalesce(headers.auth_summary.dmarc.pass, false)
125  )
126  // negate opsgenie email notifications
127  and not sender.email.email == 'opsgenie@opsgenie.net'  
128attack_types:
129  - "Callback Phishing"
130tactics_and_techniques:
131  - "Out of band pivot"
132  - "Social engineering"
133detection_methods:
134  - "Content analysis"
135  - "File analysis"
136  - "Optical Character Recognition"
137  - "Natural Language Understanding"
138  - "Sender analysis"
139id: "b93c6f94-c9a3-587a-8eb5-6856754f8222"
to-top