|
| 1 | +# Potential Spoofed `microsoftonline.com` via Fuzzy Match |
| 2 | + |
| 3 | +--- |
| 4 | + |
| 5 | +## Metadata |
| 6 | + |
| 7 | +- **Author:** Elastic |
| 8 | +- **Description:** This hunting query identifies potential spoofed domain activity targeting Microsoft online services by detecting fuzzy matches to the domain `microsoftonline.com`. The approach uses approximate string matching (fuzziness) on domain and URL fields, then scores each result by similarity. A static confidence threshold is applied to filter out high-confidence legitimate matches while surfacing potential typosquats and lookalikes. |
| 9 | + |
| 10 | +This technique is useful for identifying phishing campaigns, misconfigured infrastructure, or domain squatting activity targeting Microsoft users and applications. It relies on string similarity scoring and known-good domain exclusions to reduce false positives and focus the hunt on medium- to high-risk spoofed domains. |
| 11 | + |
| 12 | +- **UUID:** `e912f5c6-eed3-11ef-a5d7-6f9f7a1e2e00` |
| 13 | +- **Integration:** [endpoint](https://docs.elastic.co/integrations/endpoint), [network_traffic](https://docs.elastic.co/integrations/network_traffic), [system](https://docs.elastic.co/integrations/system), [azure](https://docs.elastic.co/integrations/azure), [o365](https://docs.elastic.co/integrations/o365), [windows](https://docs.elastic.co/integrations/windows) |
| 14 | +- **Language:** `[ES|QL]` |
| 15 | +- **Source File:** [Potential Spoofed `microsoftonline.com` via Fuzzy Match](../queries/potentially_spoofed_microsoft_authentication_domain.toml) |
| 16 | + |
| 17 | +## Query |
| 18 | + |
| 19 | +```sql |
| 20 | +FROM logs-* METADATA _score |
| 21 | +| WHERE ( |
| 22 | + url.domain IS NOT NULL OR |
| 23 | + url.original IS NOT NULL OR |
| 24 | + destination.domain IS NOT NULL OR |
| 25 | + dns.question.name IS NOT NULL |
| 26 | +) |
| 27 | +| EVAL domain = COALESCE(url.domain, url.original, destination.domain, dns.question.name)::STRING |
| 28 | +| WHERE NOT( |
| 29 | + domain RLIKE "^(login|portal|api)\\.microsoftonline\\.com$" OR |
| 30 | + domain RLIKE ".*\\.onmicrosoft\\.com$" OR |
| 31 | + domain == "microsoftonline.com") |
| 32 | +| WHERE ( |
| 33 | + match(url.domain, "microsoftonline.com", { "fuzziness": "AUTO", "max_expansions": 10 }) OR |
| 34 | + match(url.original, "microsoftonline.com", { "fuzziness": "AUTO", "max_expansions": 10 }) OR |
| 35 | + match(destination.domain, "microsoftonline.com", { "fuzziness": "AUTO", "max_expansions": 10 }) OR |
| 36 | + match(dns.question.name, "microsoftonline.com", { "fuzziness": "AUTO", "max_expansions": 10 }) |
| 37 | +) |
| 38 | +| EVAL confidence = CASE( |
| 39 | + _score >= 5.999, "low", |
| 40 | + _score > 4, "medium", |
| 41 | + "high" |
| 42 | +) |
| 43 | +| WHERE confidence != "low" |
| 44 | + OR domain IN ("micsrosoftonline.com", "outlook-office.micsrosoftonline.com") |
| 45 | +| SORT _score DESC |
| 46 | +| KEEP @timestamp, source.ip, user.id, domain, _score, confidence |
| 47 | +``` |
| 48 | + |
| 49 | +## Notes |
| 50 | + |
| 51 | +- Investigate domains that resemble `microsoftonline.com` but have slight character substitutions (e.g., `micros0ftonline.com`, `m1crosoftonline.com`). |
| 52 | +- Fuzzy matching assigns a `_score` based on edit distance. Higher scores mean a closer match to the legitimate domain. |
| 53 | +- Only medium- and high-confidence results are surfaced by excluding `_score >= 6`, which usually represents exact or near-exact matches. |
| 54 | +- Legitimate Microsoft domains like `login.microsoftonline.com`, `portal.microsoftonline.com`, and tenant domains ending in `.onmicrosoft.com` are excluded from results to reduce noise. |
| 55 | +- Results are ranked by `_score DESC` and tagged with a confidence level: `low`, `medium`, or `high`. |
| 56 | +- This query is best used interactively during hunts and may require tuning for specific environments with high Microsoft traffic. |
| 57 | + |
| 58 | +## MITRE ATT&CK Techniques |
| 59 | + |
| 60 | +- [T1566.002](https://attack.mitre.org/techniques/T1566/002) |
| 61 | +- [T1583.001](https://attack.mitre.org/techniques/T1583/001) |
| 62 | + |
| 63 | +## References |
| 64 | + |
| 65 | +- https://www.microsoft.com/en-us/security/blog/2025/05/27/new-russia-affiliated-actor-void-blizzard-targets-critical-sectors-for-espionage/ |
| 66 | + |
| 67 | +## License |
| 68 | + |
| 69 | +- `Elastic License v2` |
0 commit comments