Skip to content

renaudallard/deobfuscator

Repository files navigation

πŸ”— Thunderbird Deobfuscator

A powerful Thunderbird extension that reveals the real destination of obfuscated email security links and shortened URLs with privacy-preserving resolution options.

Version License Thunderbird


✨ Features

🎯 Universal Protection Coverage

Supports 18+ email security services including Microsoft, Proofpoint, Mimecast, Barracuda, Cisco, AWS SES, and more.

πŸ”„ Multi-Layer URL Rewriting Support

Automatically peels off multiple layers of URL rewriting when attackers chain several protection services together (e.g., Safe Links wrapping Proofpoint wrapping the real URL). The popup shows the full chain of services that were removed.

πŸ”— URL Shortener Support with Privacy Controls

Detects and resolves shortened URLs (bit.ly, tinyurl.com, t.co, etc.) with clear privacy warnings.

  • πŸš€ Direct Resolution (fast, <1s) - Available now
  • πŸ§… Tor Resolution (private, in development) - Anonymous via embedded Tor

⚠️ Automatic Detection & Warning

Warning button automatically appears in the message toolbar when opening emails containing obfuscated links, showing the exact count of protected URLs detected.

πŸ–±οΈ Simple Right-Click Interface

Right-click any protected or shortened link β†’ Select "Deobfuscate Link" β†’ See the real destination or choose resolution method.

🎨 Beautiful Theme-Aware Popup

  • Clean, modern interface that respects your system theme (light/dark mode)
  • Shows both original and decoded URLs side-by-side
  • One-click copy buttons for easy URL sharing
  • Clear privacy warnings before any network requests

πŸ”’ Privacy-First Design

  • All protection service processing happens locally in Thunderbird
  • No automatic URL resolution - always requires user consent
  • Clear privacy warnings explain what information is exposed
  • No external servers or tracking for protection services
  • Original emails remain completely unchanged

🌐 Opens in Your Browser

Decoded URLs open in Firefox (or your default browser), not within Thunderbird.


πŸ›‘οΈ Supported Services

Email Security Services (18+)

Enterprise Solutions

  • βœ… Microsoft Safe Links
  • βœ… Proofpoint URL Defense (v2 & v3)
  • βœ… Mimecast URL Protect
  • βœ… Barracuda Link Protection
  • βœ… Cisco Secure Email
  • βœ… Check Point Harmony Email
  • βœ… Symantec/Broadcom Messaging Gateway
  • βœ… Trend Micro Email Security
  • βœ… FireEye/Trellix
  • βœ… AWS SES Click Tracking (awstrack.me)

Additional Services

  • βœ… Sophos Email Security
  • βœ… Trustwave MailMarshal
  • βœ… Egress Defend
  • βœ… Hornetsecurity ATP
  • βœ… OpenText/EdgePilot
  • βœ… Intermedia
  • βœ… PostOffice
  • βœ… Generic URL protection services

URL Shorteners (27+)

Popular Services

  • βœ… bit.ly / bitly.com
  • βœ… TinyURL (tinyurl.com)
  • βœ… Twitter (t.co)
  • βœ… Google (goo.gl)
  • βœ… Ow.ly
  • βœ… is.gd
  • βœ… Buff.ly

Social Media & Enterprise

  • βœ… LinkedIn (lnkd.in)
  • βœ… YouTube (youtu.be)
  • βœ… Facebook (fb.me)
  • βœ… Amazon (amzn.to)
  • βœ… eBay (ebay.us)
  • βœ… Rebrandly (rebrand.ly)

Privacy-Focused Services

  • βœ… URLVanish (urlvanish.com)

Email Click Trackers

  • βœ… Action Network (click.actionnetwork.org)

Additional Shorteners

  • βœ… adf.ly, bc.vc, clck.ru, db.tt, ity.im, q.gs, qr.ae, qr.net, smarturl.it, su.pr, trib.al, u.to, v.gd, x.co, zip.net, zpr.io, and more!

πŸ“¦ Installation

For Users

  1. Download deobfuscator.xpi from Releases
  2. Open Thunderbird
  3. Go to Add-ons and Themes (≑ menu β†’ Add-ons and Themes)
  4. Click the gear icon βš™οΈ β†’ Install Add-on From File…
  5. Select the downloaded deobfuscator.xpi file

For Developers

  1. Clone this repository
  2. Open Thunderbird β†’ Add-ons and Themes
  3. Click gear icon βš™οΈ β†’ Debug Add-ons
  4. Click Load Temporary Add-on…
  5. Navigate to the src/ folder and select manifest.json

πŸš€ Usage

For Email Security Links (Instant Deobfuscation)

  1. Open an email with a protected link
  2. Look for the warning β€” A warning button automatically appears in the message toolbar showing:
    ⚠️ Warning: 3 Obfuscated Links ⚠️
    
  3. Right-click on any obfuscated URL
  4. Select "Deobfuscate Link" from the context menu
  5. Review the popup showing:
    • πŸ“„ Original link: The wrapped/protected URL
    • βœ… Clean URL: The real destination
  6. Choose an action:
    • 🟒 Open Clean Link β€” Opens the decoded URL (recommended)
    • πŸ”΄ Open Original Link β€” Opens the wrapped URL (if needed)
    • βšͺ Cancel β€” Close without action
    • πŸ“‹ Copy β€” One-click copy either URL to clipboard

Example:

Before: https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fexample.com

After: https://example.com

Multi-layer example:

Before: https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-3A__example.com

After: https://example.com (2 layers removed: Microsoft Safe Links, Proofpoint URL Defense)


For URL Shorteners (Privacy-Aware Resolution)

  1. Open an email with a shortened link (bit.ly, tinyurl.com, etc.)

  2. Right-click on the shortened URL

  3. Select "Deobfuscate Link" from the context menu

  4. Review the warning β€” Extension detects shortener and shows:

    ⚠️ URL Shortener Detected
    Service: bit.ly (URL shortener)
    ⚠️ Destination Unknown
    
  5. Choose resolution method:

    πŸš€ Direct Resolution (Fast)

    • Exposes to shortener: Your IP address, timestamp, that you checked this link
    • Speed: Usually <1 second
    • Click: "Resolve Directly"

    πŸ§… Tor Resolution (Private) β€” In development

    • Will hide your real IP (uses Tor exit node)
    • Anonymous resolution via embedded Tor
    • Expected speed: 3-10 seconds
    • Status: Not yet available
  6. After resolution, see the final destination:

  7. Choose an action:

    • 🟒 Open Destination β€” Opens the resolved URL (recommended)
    • πŸ”΄ Open Shortened Link β€” Opens the shortener URL
    • βšͺ Cancel β€” Close without action

Example:

Before: https://bit.ly/3xY2zQ

Privacy Warning β†’ User Confirms β†’ Resolution

After: https://example.com/real/destination/page


Privacy Guarantees

Email Security Links:

  • βœ… 100% local processing
  • βœ… No network requests
  • βœ… Instant results

URL Shorteners:

  • βœ… Detection happens locally (no network)
  • ⚠️ Resolution requires network request
  • βœ… Always asks permission first
  • βœ… Clear warnings about privacy trade-offs
  • βœ… User chooses between speed and privacy
  • 🚫 Never resolves automatically

πŸ› οΈ Building from Source

A build script is included for your convenience:

./build.sh

This creates deobfuscator.xpi from the src/ directory with all necessary files.

Manual build:

cd src
zip -r ../deobfuscator.xpi *

πŸ“ Project Structure

deobfuscator/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ background.js              # Core deobfuscation logic, shortener detection & resolution
β”‚   β”œβ”€β”€ popup.html                 # Popup UI with multiple views (protection/shortener/resolved)
β”‚   β”œβ”€β”€ popup.js                   # Popup behavior, resolution flow & clipboard functionality
β”‚   └── manifest.json              # Extension manifest (v2)
β”œβ”€β”€ build.sh                       # Build script
β”œβ”€β”€ deobfuscator.xpi               # Packaged extension
└── README.md                      # This file

πŸ”§ Technical Details

Architecture

The extension uses a multi-tier detection and resolution system:

Tier 1: Automatic Detection (Zero Privacy Cost)

  1. Message Monitoring: Listens for messageDisplay.onMessageDisplayed events
  2. Content Scanning: Fetches and scans message body for obfuscated link patterns
  3. Visual Warning: Displays warning button in message toolbar with link count
  4. Real-time Updates: Warning appears/disappears as you switch messages
  5. Shortener Detection: Identifies 25+ URL shortener services by domain pattern

Tier 2a: Email Security Service Deobfuscation (Local)

  1. Right-Click: User right-clicks any link in the message
  2. Analysis: Background script identifies the protection service or shortener
  3. Multi-Layer Unwrapping: Iteratively peels off nested protection layers (up to 10 deep) until the real URL or a shortener is reached
  4. Display: Shows both URLs in themed popup window, with the full chain of services removed
  5. Action: Opens selected URL in default browser

Tier 2b: URL Shortener Resolution (Privacy-Aware)

  1. Detection: Identifies shortened URL (bit.ly, tinyurl, etc.)
  2. Privacy Warning: Shows clear warning about what data will be exposed
  3. User Consent: User explicitly chooses resolution method
  4. Direct Resolution:
    • First tries HTTP HEAD request (minimal data transfer)
    • Falls back to GET only if needed
    • Follows redirects automatically
    • Parses HTML for meta refresh/JavaScript redirects as last resort
  5. Tor Resolution (in development): Will use embedded Tor (anonymous, slower)
  6. Display: Shows original and resolved URLs
  7. Action: User decides which URL to open

This approach works around Thunderbird's security restrictions on owl:// and imap:// protocols.

Deobfuscation Methods

Email Security Services:

  • Microsoft Safe Links: Extracts url parameter
  • Proofpoint v2: Custom character substitution decode
  • Proofpoint v3: Path-based extraction
  • Generic Services: Tries common parameter names (url, u, dest, target, etc.)
  • Multi-Layer: Iterative unwrapping of nested protection services (up to 10 layers deep), with full service chain displayed in the popup

URL Shorteners:

  • Detection: Domain pattern matching (local, no network)
  • Direct Resolution:
    • Tries HTTP HEAD request first (minimal data transfer, privacy-friendly)
    • Falls back to GET only if HEAD doesn't work
    • Follows HTTP redirects automatically
    • Parses HTML for meta refresh and JavaScript redirects as last resort
  • Tor Resolution (in development): Arti (Tor in WebAssembly) for anonymous resolution

Security & Privacy

Email Security Links:

  • βœ… All processing is local
  • βœ… No network requests
  • βœ… No data collection
  • βœ… Instant results

URL Shorteners:

  • βœ… Detection is local (no network)
  • ⚠️ Third-Party Querying: Resolution involves the add-on querying the shortener service directly. This is functionally equivalent to clicking the original link, but the action is triggered by the add-on without the user clicking the link in the email body.
  • ⚠️ Resolution requires network request (exposes your IP)
  • βœ… Always asks permission first
  • βœ… Clear warnings about privacy trade-offs
  • βœ… User chooses between speed and privacy
  • 🚫 Never resolves automatically

General:

  • βœ… Minimal permissions required
  • βœ… No external servers or tracking
  • βœ… Open source and auditable

🎨 Screenshots

Popup Window (Light Mode)

Clean, modern interface showing original and decoded URLs with action buttons.

Popup Window Light Mode

Popup Window (Dark Mode)

Automatically adapts to your system theme for comfortable viewing.

Popup Window Dark Mode


βš™οΈ Configuration

No configuration needed! The extension works out of the box with sensible defaults.


🀝 Contributing

Contributions are welcome!

Adding Email Security Service Support

  1. Edit src/background.js
  2. Add hostname detection in deobfuscateUrl()
  3. Add service name in identifyService()
  4. Test with sample URLs
  5. Submit a pull request

Adding URL Shortener Support

  1. Edit src/background.js
  2. Add domain to SHORTENER_DOMAINS array
  3. Test detection and resolution
  4. Submit a pull request

πŸ“ Version History

v0.1.0 (Current)

  • ✨ Initial release
  • πŸ›‘οΈ Support for 17+ email security services
  • πŸ”— URL shortener detection (26+ services including URLVanish)
  • πŸš€ Direct shortener resolution with privacy warnings
  • πŸ”’ Privacy-friendly HTTP HEAD requests (minimal data transfer)
  • ⚠️ Automatic detection with warning indicator in message toolbar
  • 🎨 Theme-aware popup interface with multiple views
  • πŸ“‹ Copy-to-clipboard functionality
  • 🌐 Opens URLs in default browser
  • πŸ” Privacy-first design with explicit user consent

v0.2.0 (In Development)

  • πŸ”„ Multi-layer URL rewriting support: iteratively unwraps nested protection services
  • πŸ§… Embedded Tor support for anonymous shortener resolution (via Arti WebAssembly)
  • βš™οΈ User preferences and settings page
  • πŸ“Š Bulk shortener resolution for multiple links in one email
  • 🎯 Improved resolution success rate

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • Built for Thunderbird 102+
  • Designed with privacy and security in mind
  • Community-driven development

πŸ’¬ Support


Made with ❀️ for the Thunderbird community

⬆ Back to Top

About

Thunderbird extension which allows showing the real URL behind obfuscated links before opening them.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors