You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[**Common Phishing**](https://book.hacktricks.wiki/en/generic-methodologies-and-resources/phishing-methodology/index.html) for credentials or via [OAuth Apps](az-oauth-apps-phishing.md)
If a target uses **Exchange Online / EOP** but its public **MX** points to a **third-party mail gateway** (Mimecast, Proofpoint, Mailgun, on-prem filtering, etc.), test whether Exchange Online still accepts mail sent **directly** to the tenant host `*.mail.protection.outlook.com`. In that case, an attacker can **skip the external gateway** and submit phishing mail straight to EOP.
256
+
257
+
This is useful for **initial access / phishing** because delivery can still happen even when the spoofed sender fails **SPF**, **DKIM**, and **DMARC**. For internal senders, Outlook may also resolve the spoofed sender as a real employee, increasing trust.
258
+
259
+
**Recon / triage:**
260
+
261
+
```bash
262
+
# If the MX already points to Microsoft, this specific path is usually not the issue
263
+
dig +short MX target.com
264
+
265
+
# Typical vulnerable pattern: the MX points to a third-party filter
266
+
# 10 mxb.eu.mailgun.org.
267
+
```
268
+
269
+
The direct EOP host is usually the tenant-specific `mail.protection.outlook.com` name (for example `target-com.mail.protection.outlook.com`). You can often recover the tenant naming pattern from public tenant/domain enumeration and Exchange-related autodiscover responses.
- Mail is sent to `*.mail.protection.outlook.com` instead of the public MX host.
279
+
- The message is delivered even though headers show failures such as `spf=fail`, `dkim=none`, `dmarc=fail`, or `compauth=none`.
280
+
- A secure Partner connector usually rejects the `RCPT TO` stage with `5.7.51 TenantInboundAttribution; Rejecting.`
281
+
282
+
**Technical notes / defensive hunting:**
283
+
-**Enhanced Filtering for Connectors** helps Exchange attribute the original sender correctly, but by itself it is **not** the boundary that blocks direct-to-tenant delivery.
284
+
- Microsoft documents two practical controls when using an external MX in front of Exchange Online:
285
+
- Create a **Partner inbound connector** with `SenderDomains *` and `RestrictDomainsToCertificate` or `RestrictDomainsToIPAddresses` so only the approved gateway can deliver to the tenant.
286
+
- Create a **priority 0 transport rule** that quarantines inbound mail unless the sender IP belongs to approved gateway ranges **or**`X-MS-Exchange-Organization-AuthAs` contains `Internal`.
287
+
- Hunt for mail where **Received** shows `*.mail.protection.outlook.com` as the first Microsoft hop but sender-authentication headers still show **SPF/DKIM/DMARC failures**.
288
+
- If the target still allows **Direct Send**, disabling it mainly reduces **internal** sender spoofing; it doesn't replace the connector / transport-rule mitigation for arbitrary **external** spoofing.
289
+
253
290
## Filesystem Credentials
254
291
255
292
The **`az cli`** stores a lot of interesting information inside **`<HOME>/.Azure`**:
@@ -267,6 +304,10 @@ Note that in macOS and linux these files are **unprotected** stored in clear tex
0 commit comments