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.002

Timeline: 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:

  1. Download .dmg files
  2. Double-click to mount
  3. 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.

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:

  1. Code signature validity
  2. Developer ID certificate status (not revoked)
  3. 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.quarantine commands
  • 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:

  1. Take legitimate open-source app
  2. Add malicious code
  3. Repackage as DMG
  4. 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:

  1. Isolate endpoint
  2. Check for persistence (LaunchAgents, LaunchDaemons)
  3. Review Keychain access logs
  4. Check browser extension installations
  5. Rotate credentials accessed from that machine
  6. 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