macOS DMG Disk Image Phishing
Attackers deliver malware via links to DMG disk images, exploiting user trust in the familiar macOS installation flow to bypass Gatekeeper protections.
MITRE ATT&CK: T1566.002Timeline: The Cat and Mouse
2019 β Attack emerges β 2022 β Explodes β 2024 β Defenses lag β Present
The Evolution
| Phase | Period | What Happened |
|---|---|---|
| CONTEXT | 2012 | Gatekeeper introduced; unsigned apps blocked by default |
| ATTACK | 2019-2021 | Occasional macOS malware; most attacks still Windows-focused |
| EXPLOSION | 2022 | Enterprise macOS adoption rises; attackers follow |
| Β | 2023 | MetaStealer, AMOS, Realst, MacStealer emerge |
| RESPONSE | 2019 | Notarization requirement for apps |
| Β | 2023 | XProtect updates for new stealer families |
| CURRENT | 2024+ | User-bypassable Gatekeeper remains fundamental weakness |
Key Events with Sources
| Date | Event | Significance | Source |
|---|---|---|---|
| 2012 | Gatekeeper introduced | macOS blocks unsigned apps by default | Apple |
| 2019 | Notarization required | Apps must be scanned by Apple for malware | Apple Developer |
| Sep 2023 | MetaStealer discovered | Go-based stealer targeting businesses via DMG | SentinelOne |
| 2023 | AMOS (Atomic Stealer) | MaaS stealer sold on Telegram; widespread distribution | Cyble |
| 2024 | Banshee stealer | Continues DMG delivery trend; targets crypto | Objective-See |
Overview
macOS disk image (DMG) phishing mirrors the Windows ISO/IMG container technique but exploits macOS-specific user behaviors and security gaps. Attackers send emails containing links to DMG files hosted externally. When users download, mount, and run the application inside, they often bypass Gatekeeper by following social engineering instructions to right-click and βOpenβ unsigned apps.
The Attack
Why DMG Files?
DMG is the standard macOS software distribution format. Users are conditioned to:
- Download
.dmgfiles - Double-click to mount
- Drag app to Applications (or double-click to run)
This familiarity is exploitedβusers donβt question DMG files the way they might question .exe files.
Attack Flow
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β EMAIL β
β β
β Subject: Updated Client Portal - Action Required β
β β
β Please download and install the updated client portal: β
β https://client-portal-update[.]com/ClientPortal.dmg β
β β
β [No attachment - link to external DMG] β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β USER DOWNLOADS DMG β
β β
β ~/Downloads/ClientPortal.dmg β
β Extended attribute: com.apple.quarantine (set by browser) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β USER MOUNTS DMG β
β β
β /Volumes/ClientPortal/ β
β βββ ClientPortal.app β Unsigned malicious app β
β βββ README.txt β "Right-click > Open to install" β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β GATEKEEPER BLOCKS (First Attempt) β
β β
β "ClientPortal.app" cannot be opened because it is from β
β an unidentified developer. β
β β
β [Move to Trash] [Cancel] β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β USER FOLLOWS INSTRUCTIONS (Right-click > Open) β
β β
β "ClientPortal.app" is from an unidentified developer. β
β Are you sure you want to open it? β
β β
β [Cancel] [Open] β User clicks Open β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
Malware executes with user privileges
Gatekeeper Bypass via Social Engineering
The key insight: Gatekeeper can always be bypassed by the user. Attackers simply instruct them how:
README.txt contents:
Installation Instructions:
--------------------------
If you see "cannot be opened" error:
1. Right-click (or Control-click) the application
2. Select "Open" from the menu
3. Click "Open" in the dialog
This is required for applications from verified partners.
Users trust these instructions because:
- Theyβve encountered Gatekeeper legitimately before
- The workaround is well-known
- The lure seems professional
macOS Security Model
Quarantine Attribute:
$ xattr -l ~/Downloads/malware.dmg
com.apple.quarantine: 0083;65a1234b;Safari;12345678-1234-1234-1234-123456789ABC
This attribute:
- Set automatically by browsers, email clients, and AirDrop
- Triggers Gatekeeper check on first execution
- Survives copy operations (usually)
Gatekeeper Levels: | Setting | Allows | |βββ|βββ| | App Store only | Only App Store apps | | App Store and identified developers | Signed + Notarized apps | | Anywhere (hidden) | Requires CLI to enable |
Default is βApp Store and identified developersβ - but right-click bypass works regardless.
MetaStealer Campaign
MetaStealer (2023-present) exemplifies this technique:
Delivery:
- Targets businesses via email
- Poses as client/vendor communication
- Links to DMG hosted on attacker infrastructure
Payload:
- Go-based infostealer
- Steals Keychain passwords
- Exfiltrates browser data, crypto wallets
- Targets Slack, Telegram credentials
DMG Contents:
/Volumes/MetaStealer-Lure/
βββ Adobe Photoshop 2023.app β Malicious, icon matches real Photoshop
βββ Install.txt β Right-click bypass instructions
Other macOS Stealers Using DMG Delivery
| Malware | First Seen | Target Data |
|---|---|---|
| MetaStealer | 2023 | Keychain, browsers, crypto |
| AMOS (Atomic) | 2023 | Keychain, browsers, crypto |
| Realst | 2023 | Crypto wallets |
| MacStealer | 2023 | Keychain, browser data |
| Banshee | 2024 | Keychain, browsers, crypto |
The 2023 surge in macOS stealers directly correlates with increased enterprise macOS adoption.
Why Links Instead of Attachments?
Email Gateway Evasion:
- DMG attachments increasingly blocked
- Links to external hosting bypass attachment scanning
- Hosting on compromised legitimate sites adds reputation
Payload Flexibility:
- Update malware without resending emails
- A/B test different payloads
- Take down quickly if detected
Common Hosting:
- Compromised WordPress sites
- Cloud storage (Google Drive, Dropbox)
- Attacker-controlled lookalike domains
- CDN/file sharing services
Defenses
Gatekeeper and Notarization
What Gatekeeper Checks:
- Code signature validity
- Developer ID certificate status (not revoked)
- Notarization ticket from Apple
Notarization (2019+):
- Developers submit apps to Apple for automated scanning
- Apple issues βticketβ if no malware detected
- Apps without notarization show strong warnings
Limitation: Users can still bypass with right-click > Open.
XProtect
Appleβs built-in malware signatures:
- Updated silently via background process
- Blocks known malware families
- Limited to signature-based detection
Limitation: New/obfuscated variants evade signatures.
Quarantine Enforcement
Ensure quarantine attributes propagate:
- Donβt disable Gatekeeper organization-wide
- Monitor for
xattr -d com.apple.quarantinecommands - Some apps strip quarantine on extraction
MDM Controls
Enterprise management can:
- Enforce Gatekeeper settings
- Block unsigned app execution
- Whitelist only approved applications
- Alert on Gatekeeper bypass attempts
User Training
Critical points for macOS users:
- Legitimate software doesnβt need right-click bypass
- Verify downloads through official channels
- Be suspicious of DMG links in email
- Report requests to bypass security warnings
Attacker Adaptation
Signed Malware
Attackers obtain Apple Developer IDs:
- Stolen credentials
- Fraudulent registrations
- Purchased accounts
Signed malware passes Gatekeeper until Apple revokes the certificate.
Response: Apple revokes certificates, but thereβs a window of exposure.
Notarization Abuse
Some attackers have successfully notarized malware:
- Appleβs automated scanning isnβt perfect
- Heavily obfuscated code may pass
- Apple revokes once discovered
Trojanized Legitimate Apps
Instead of obvious malware:
- Take legitimate open-source app
- Add malicious code
- Repackage as DMG
- Distribute via phishing
User gets working software + malware.
AppleScript Droppers
Instead of compiled apps:
/Volumes/Malicious/
βββ Install.app β AppleScript applet
βββ .hidden/payload β Actual malware
AppleScript runs shell commands, downloads/executes payload.
Current State
Status: Active
macOS phishing via DMG continues to grow:
| Factor | Impact |
|---|---|
| Enterprise macOS adoption | Larger target population |
| βMacs donβt get virusesβ myth | Users less cautious |
| User-bypassable Gatekeeper | Social engineering effective |
| Stealer-as-a-service market | Low barrier for attackers |
Platform Comparison
| Aspect | Windows (ISO) | macOS (DMG) |
|---|---|---|
| Container format | ISO, IMG, VHD | DMG, PKG |
| Security gate | SmartScreen, MOTW | Gatekeeper, Quarantine |
| User bypass | Click through warning | Right-click > Open |
| Enterprise control | AppLocker, WDAC | MDM, Gatekeeper policies |
| 2022 patch | MOTW propagation | N/A (user bypass remains) |
Detection Guidance
Email Indicators
Flag emails with:
- Links to DMG files (especially non-vendor domains)
- Software update themes targeting macOS users
- Instructions to bypass security warnings
Endpoint Detection
Process Monitoring:
# Suspicious: App launched from mounted DMG
process.executable.path CONTAINS "/Volumes/"
AND process.executable.path ENDS WITH ".app/Contents/MacOS/*"
Quarantine Bypass:
# User bypassed Gatekeeper
log show --predicate 'subsystem == "com.apple.launchservices"' | grep "override"
Unsigned App Execution:
# Apps without valid signatures
codesign -vv /path/to/suspicious.app 2>&1 | grep "not signed"
Network Indicators
- DMG downloads from non-standard sources
- POST requests shortly after DMG mount (C2 check-in)
- Exfiltration patterns (Keychain data, browser DBs)
SIEM Queries
event.type = "file_download"
AND file.extension = "dmg"
AND NOT url.domain IN (known_software_vendors)
AND user.email.received_recently = true
Response Actions
If DMG phishing suspected:
- Isolate endpoint
- Check for persistence (LaunchAgents, LaunchDaemons)
- Review Keychain access logs
- Check browser extension installations
- Rotate credentials accessed from that machine
- Image for forensics if stealer confirmed
What Killed It (or Weakened It)
| Defense | Introduced | Impact |
|---|---|---|
| Gatekeeper | 2012 | Blocks unsigned applications by default; requires user override |
| Notarization Requirement | 2019 | Apps must be notarized by Apple or users see strong warnings |
| Quarantine Attribute | 2007 | Downloaded files tagged; triggers Gatekeeper check on first launch |
| App Translocation | 2016 | Apps run from read-only randomized path until moved by user |