How to decode Safe Links and Proofpoint URLs
How Microsoft Defender Safe Links and Proofpoint URL Defense (v1, v2 and v3) rewrite links, how to decode each format by hand or with a tool, and what to check on the real destination before anyone clicks.
A user reports a suspicious email and you copy the link. What you get isn't the link the attacker wrote. It starts with nam12.safelinks.protection.outlook.com or urldefense.com/v3/__, runs to three hundred characters, and tells you nothing about where it goes. Sometimes it's both: Proofpoint at the edge, then Safe Links inside Microsoft 365, wrapping the same URL twice.
The good news is that both formats carry the original URL inside them. You can decode Microsoft Safe Links and Proofpoint URLs without clicking, which matters, because clicking a phishing link from an analyst workstation tells the attacker someone looked.
How does Microsoft Safe Links rewrite a URL?
Defender for Office 365 replaces each link with a redirect through its own service. The original sits in the url parameter, URL-encoded:
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmicrosoft-365-verify.support%2Flogin&data=05%7C02%7C...&sdata=...&reserved=0
Take the value of url and URL-decode it once: https://microsoft-365-verify.support/login. The data parameter holds the recipient address and tenant details, so don't paste whole Safe Links URLs into public tools or tickets without trimming it.
How do I decode Proofpoint URL Defense links?
Proofpoint has used three formats over the years, and you'll still see all of them in older mailboxes.
| Version | Looks like | How to decode |
|---|---|---|
| v1 | urldefense.proofpoint.com/v1/url?u=...&k=... | URL-decode the u parameter |
| v2 | urldefense.proofpoint.com/v2/url?u=https-3A__evil.com_login&d=... | In u, turn -XX into %XX, _ into /, then URL-decode |
| v3 | urldefense.com/v3/__https://evil.com/a*b__;Pw!!... | The URL sits between __ markers; each * is a character stored in the Base64 block after __; |
v2 trips people up because a literal hyphen in the original is written as -2D. If you replace every hyphen with a percent sign you'll break domains like paypa1-account.com. Only - followed by two hex digits is an encoded byte.
v3 is the clever one. Characters that would break the URL, such as ?, = and &, are replaced by *, and the real characters are Base64url-encoded after __;, up to the !!. A run like **A means "the next two characters". So __https://example.com/a*b*c__;Pz0!! decodes to https://example.com/a?b=c, because Pz0 is Base64 for ?=.
What about Mimecast, Cisco and link shorteners?
These can't be decoded offline. Mimecast's protect-*.mimecast.com/s/... links and Cisco Secure Email's rewritten links carry a token that only their servers can resolve; shorteners like bit.ly are the same. The safe move is to let a sandbox follow them: submit the link to urlscan.io or your own detonation service and read the result there. Don't expand them from your own browser.
What should I check once I have the real URL?
- The registered domain, not the brand words.
microsoft-365-verify.supportis owned by whoever registered.support, not Microsoft. Read the domain right to left. - Punycode. A host starting
xn--displays in another alphabet.xn--micrsoft-qbh.comshows as "micrоsoft.com" with a Cyrillic о. - Free hosting and file links.
pages.dev,web.app,blob.core.windows.netand links that end in.htmlor.svgare common homes for credential-harvesting pages. - The @ trick. In
https://login.microsoftonline.com@evil.example/everything before the @ is ignored; the browser goes toevil.example. - Another redirect. A parameter like
?url=or?redirect=on a legitimate site can bounce users onward. Keep unwrapping until there's nothing left.
Once you know the destination, the phishing triage checklist covers what to do with the message, and investigating a suspicious IP covers the hosting behind it.
FAQ
Is it safe to decode a Safe Links URL?
Yes. Decoding is just reading the text of the link; nothing is requested from Microsoft or the destination. Clicking it is what you want to avoid.
Why is the same link wrapped twice?
The message passed through two products, typically Proofpoint at the mail gateway and then Defender Safe Links in Microsoft 365. Decode the outer layer first, then the inner one.
Does Safe Links block the link if it's malicious?
Only if Microsoft's verdict says so at click time. A newly registered phishing domain often isn't known yet, so a clean Safe Links wrapper is no guarantee.
Can I decode Mimecast links without clicking?
No. The destination is stored on Mimecast's side. Use your Mimecast console's URL logs or a sandbox such as urlscan.io.
The Phishing Link Unwrapper peels Safe Links, Proofpoint and redirect chains off a URL offline and checks the real destination for lookalike brands and punycode.
IOC Triage, our free browser extension, unwraps links in webmail and gives the real destination a verdict from 15 threat-intel sources.