Brand impersonation: USPS
Impersonation of the United States Postal Service.
Sublime rule (View on GitHub)
1name: "Brand impersonation: USPS"
2description: "Impersonation of the United States Postal Service."
3type: "rule"
4severity: "high"
5source: |
6 type.inbound
7 and (
8 any(ml.logo_detect(file.message_screenshot()).brands, .name == "USPS")
9 or strings.icontains(sender.display_name, "USPS")
10 or strings.icontains(sender.display_name, "United States Postal Service")
11 or regex.contains(body.html.display_text, 'USPS\s*\.\s*COM')
12 or strings.icontains(body.current_thread.text, 'USPS Delivery Team')
13 or any(ml.nlu_classifier(body.current_thread.text).entities,
14 .name == "org" and .text =~ "USPS"
15 )
16 )
17 and length(body.links) > 0
18 and 3 of (
19 any(body.links,
20 strings.ilike(.display_text,
21 "*check now*",
22 "*track*",
23 "*package*",
24 '*view your order*',
25 "*update*",
26 '*delivery address*',
27 "*parcel allocation*",
28 "*claim your parcel*",
29 "*delivery details*"
30 )
31 ),
32 strings.ilike(body.current_thread.text,
33 "*returned*to*sender*",
34 "*redelivery*",
35 '*USPS promotions*',
36 '*review your package*',
37 '*receiver address*',
38 '*package details*',
39 '*sorry tolet*',
40 '*Due to an incorrect*',
41 '*remain undeliverable*',
42 "*service updates*"
43 ),
44 // impersonal greeting
45 any(ml.nlu_classifier(body.current_thread.text).entities,
46 .name == "recipient" and .text =~ "Customer"
47 ),
48 any(ml.nlu_classifier(body.current_thread.text).intents,
49 .name == "cred_theft" and .confidence != "low"
50 ),
51 // free email sender
52 sender.email.domain.root_domain in $free_email_providers,
53 network.whois(sender.email.domain).days_old < 30,
54 not network.whois(sender.email.domain).found,
55
56 // contains link to recently registered domain
57 any(body.links, network.whois(.href_url.domain).days_old < 15),
58 (
59 regex.icontains(strings.replace_confusables(body.html.display_text),
60 '\b(?:u.?s.?p.?s|shipping|delivery)\b'
61 )
62 and not regex.icontains(body.html.display_text,
63 '\b(?:usps|shipping|delivery)\b'
64 )
65 ),
66 any(body.links, regex.icontains(.href_url.url, 'https?://[0-9]{7,12}/.+')),
67 (
68 any(body.links,
69 strings.icontains(.display_url.domain.root_domain, 'usps')
70 and .mismatched
71 )
72 )
73 )
74 and (
75 sender.email.domain.root_domain not in (
76 "usps.com",
77 "opinions-inmoment.com", // https://faq.usps.com/s/article/USPS-Customer-Experience-Surveys
78 "shipup.co", // third party shipping company
79 "withings.com" // third party shipping company
80 )
81 or (
82 sender.email.domain.root_domain in (
83 "usps.com",
84 "opinions-inmoment.com" // https://faq.usps.com/s/article/USPS-Customer-Experience-Surveys
85 )
86 and not headers.auth_summary.dmarc.pass
87 )
88 )
89 // negate newsletters
90 and not (
91 length(filter(body.links, .visible == true)) > 20
92 or any(ml.nlu_classifier(body.html.display_text).topics,
93 .name == "Newsletters and Digests"
94 )
95 )
96 // not all links to usps.com
97 and not all(body.links, .href_url.domain.root_domain == "usps.com")
98 // negate legit forwards and replies
99 and not (
100 (subject.is_reply or subject.is_forward)
101 and length(body.previous_threads) > 0
102 and (length(headers.references) > 0 or headers.in_reply_to is not null)
103 )
104 // negate highly trusted sender domains unless they fail DMARC authentication
105 and (
106 (
107 sender.email.domain.root_domain in $high_trust_sender_root_domains
108 and not headers.auth_summary.dmarc.pass
109 )
110 or sender.email.domain.root_domain not in $high_trust_sender_root_domains
111 )
112 and not any(body.links,
113 regex.icontains(.display_text, 'Track (?:Your Order|Shipment)')
114 and .href_url.domain.domain == 'tools.usps.com'
115 )
116 and not sender.email.domain.root_domain in ('shopifyemail.com')
117attack_types:
118 - "Credential Phishing"
119tactics_and_techniques:
120 - "Image as content"
121 - "Impersonation: Brand"
122 - "Social engineering"
123detection_methods:
124 - "Computer Vision"
125 - "Content analysis"
126 - "Natural Language Understanding"
127 - "Sender analysis"
128id: "28b9130a-d8e0-50af-97c9-c1b8f4c46d68"