USB Drive Data Exfiltration: How OpenDLP Encrypts Stolen Files on Removable Media | Case Study

USB Drive Exfiltration: 12 Attacks, 0 Data Leaked

Protected files copied to a SanDisk USB — detected in 5ms, encrypted with AES-256-GCM, keys destroyed forever

A USB flash drive was plugged in and sensitive files were copied from a protected vault to removable storage. OpenDLP detected the boundary crossing at the file system level, encrypted the data with an unreproducible entropy key, and logged full forensic evidence. The USB drive received only useless ciphertext.

12/12 Tests Passed 0 Data Leaked USB Boundary Detection AES-256-GCM March 2026

1. Full Data Flow: USB Exfiltration Through Neutralization

USB exfiltration data flow

Figure 1 — End-to-end: file copy to USB, boundary detection, AES-256 encryption, plaintext destruction on removable media

How OpenDLP Responds to USB Exfiltration

  • USB drive mounted — FSEvents detects new removable volume at /Volumes/
  • File copy initiated — User or process copies protected file to USB
  • Boundary crossing detected — File leaving protected vault to removable storage
  • Device identity check fails — USB drive has no matching device fingerprint
  • AES-256-GCM encryption triggered — Entropy-derived key encrypts the file
  • Plaintext on USB destroyed — Overwritten with random bytes, then deleted
  • Key discarded — Derived from unreproducible system entropy, used once, gone forever
Mount → Copy → Detect → Encrypt → Destroy

The USB drive gets ciphertext. The key is gone. The data never leaves readable.

2. Threat Model: Why USB Exfiltration Is Critical

USB drive exfiltration is one of the most dangerous attack vectors because it completely bypasses network-based security. No firewall, no DPI, no SIEM will see data walking out the door on a $5 flash drive.

Insider Threat

A disgruntled employee plugs in a personal USB and copies the entire project folder. Traditional DLP never sees it — no network traffic, no cloud logs.

Physical Access Attack

An attacker with brief physical access plugs in a USB while the machine is unlocked. 30 seconds is all it takes to copy gigabytes.

USB Dead Drop

A compromised insider copies data to USB and leaves it in a public location for an external actor to retrieve. No digital trail.

Supply Chain Attack

A malicious USB device with auto-copy firmware is left in a parking lot or mailed to the target. Once plugged in, it silently copies files.

Why Traditional DLP Fails at USB

Network-based DLP monitors traffic leaving the network. USB drives never cross the network — data physically walks out. Port-blocking breaks legitimate workflows. OpenDLP takes a different approach: let the copy happen, but ensure the data is useless.

3. Test Environment

OpenDLP Boundary Zone Classification

Figure 2 — OpenDLP's four storage boundary zones: Local, Removable, Network, and Cloud

ComponentDetails
Defender MachineMacBook Pro — macOS Sequoia 15.3 — OpenDLP v4.0
Device UUID30436CB6-7241-5620-AAB8-7FCAB6C08D06
USB DriveSanDisk Ultra 32GB — FAT32 — /Volumes/SANDISK/
Protected Vault~/Documents/ — auto-protected by OpenDLP on setup
Test Fileconfidential-project.txt — 847 bytes — SSNs, API keys, financials
MonitoringFSEvents watcher + NetworkBoundaryDetector.swift

Boundary Classification

OpenDLP classifies storage into four boundary zones. File movement between zones triggers detection:

  • Local (Protected) — ~/Documents, ~/Desktop, custom vault folders
  • Removable — /Volumes/* (USB drives, external HDDs, SD cards)
  • Network — SMB/NFS shares, AirDrop staging
  • Cloud — ~/Library/Mobile Documents/ (iCloud), ~/Dropbox/, ~/Google Drive/

4. Attack Scenario & Protected Data

An insider plugs in a personal USB flash drive and copies a sensitive project file from a protected vault. The most common physical exfiltration vector in enterprise environments.

Protected File Contents

=== CONFIDENTIAL PROJECT DATA ===
Project: Phoenix (Internal Only)
SSN: 987-65-4321
AWS Access Key: AKIAIOSFODNN7EXAMPLE
Database Password: prod_db_r00t_2026!
Revenue Q1 2026: $8.7M (unreleased)
Client List: Acme Corp, Wayne Enterprises, Stark Industries
Credit Card (Corp): 5500-0000-0000-0004
=== END CONFIDENTIAL ===

File Identity Tags (xattr)

com.opendlp.device:     30436CB6-7241-5620-AAB8-7FCAB6C08D06
com.opendlp.vault:      ~/Documents
com.opendlp.tracked:    true
com.opendlp.boundary:   local
com.opendlp.hash:       a7c3f2e891d4b567...9f0a1b3c5d7e

Attack Vector: USB File Copy

cp ~/Documents/confidential-project.txt /Volumes/SANDISK/

Standard file copy — no special tools, no elevated privileges, just drag and drop.

5. Phase 1: Boundary Crossing Detection

OpenDLP's FileSystemMonitor watches all protected directories via macOS FSEvents. When a file moves from a protected boundary to a different boundary, detection triggers instantly.

1a Volume Mount Detection

[2026-03-18T14:22:01-04:00] [INFO] [BOUNDARY] New volume mounted: /Volumes/SANDISK
  Type: removable
  Filesystem: FAT32
  Writable: true
  Classification: REMOVABLE_MEDIA
  Risk Level: HIGH

PASS — USB volume detected immediately on mount. Classified as removable media with HIGH risk.

1b File Copy Detection (FSEvents)

[2026-03-18T14:22:15-04:00] [ALERT] [BOUNDARY] Boundary crossing detected!
  File:        confidential-project.txt
  Source:      ~/Documents/ (LOCAL_PROTECTED)
  Destination: /Volumes/SANDISK/ (REMOVABLE_MEDIA)
  Process:     Finder (PID: 412)
  Action:      COPY

PASS — File copy detected in real-time via FSEvents. Source and destination boundaries correctly classified.

1c Device Identity Verification

[2026-03-18T14:22:15-04:00] [ERROR] [DEVICE_CHECK] Boundary violation!
  File device tag:     30436CB6-7241-5620-AAB8-7FCAB6C08D06  (MacBook Pro)
  Destination device:  NONE (removable media — no device identity)
  
  VERDICT: EXFILTRATION CONFIRMED
  Reason: File leaving protected boundary to unregistered storage

PASS — USB drives have no device identity. Any file movement to unregistered storage is flagged as exfiltration.

1d Multi-File Batch Detection

[2026-03-18T14:23:02-04:00] [ALERT] [BOUNDARY] Batch exfiltration detected!
  Files:       5 protected files copied to /Volumes/SANDISK/
  Total size:  4.2 MB
  Process:     cp (PID: 8834)
  Pattern:     BULK_COPY
  Risk Level:  CRITICAL

PASS — Batch copy operations detected and flagged with elevated risk. Pattern analysis identifies bulk exfiltration.

4 / 4 Passed

Volume mount, file copy, device check, and batch detection all working correctly.

6. Phase 2: Encryption Response

Once exfiltration is confirmed, OpenDLP's encryption engine activates. The file on the USB is encrypted in-place — the attacker never gets a readable copy.

Batch Encryption Pipeline

Figure 3 — Batch encryption pipeline: each file gets a unique entropy-derived key, all discarded after use

Entropy Sources

SourceDataWhy Unreproducible
Nanosecond timestampmach_absolute_time()Never repeats
System uptimeMicrosecond boot timeUnique to this boot session
Process PIDs847 running processesPID list changes every millisecond
/dev/urandom256 bytes kernel randomHardware-seeded CSPRNG
Secure EnclaveHardware random from SEPApple T2/M-series hardware entropy

2a AES-256-GCM Encryption

[2026-03-18T14:22:16-04:00] [ACTION] [ENCRYPTION] Encrypting exfiltrated file on USB
  Source:    /Volumes/SANDISK/confidential-project.txt (847 bytes)
  Output:    /Volumes/SANDISK/confidential-project.txt.enc (876 bytes)
  Algorithm: AES-256-GCM
  Nonce:     a4f8c2e1d7b3094e56a1f8c2
  Auth Tag:  e7d3a1c5f9b2084e (16 bytes)
  Key:       [entropy-derived, DISCARDED]

PASS — File encrypted with AES-256-GCM (authenticated encryption). 29-byte increase includes GCM nonce and auth tag.

2b Plaintext Destruction

  1. Overwrite — USB file contents replaced with random bytes from /dev/urandom
  2. Delete — Original file removed from USB filesystem
  3. Key discarded — Entropy key zeroed from memory
[2026-03-18T14:22:16-04:00] [SUCCESS] Exfiltrated file encrypted:
  confidential-project.txt → confidential-project.txt.enc
[2026-03-18T14:22:16-04:00] [INFO] Original destroyed on USB.
[2026-03-18T14:22:16-04:00] [INFO] Entropy key discarded from memory.

PASS — Original plaintext destroyed on USB. Entropy key discarded.

2c Batch Encryption

[2026-03-18T14:23:03-04:00] [ACTION] Batch encrypting 5 files on USB
  [1/5] project-roadmap.pdf        → .enc  ✓
  [2/5] client-database.csv        → .enc  ✓
  [3/5] financial-projections.xlsx  → .enc  ✓
  [4/5] source-code.zip            → .enc  ✓
  [5/5] employee-records.txt       → .enc  ✓
  
  Batch complete: 5/5 encrypted, 0 failures
  Each file uses a UNIQUE entropy key (all discarded)

PASS — Each file gets its own unique entropy key. Compromising one reveals nothing about the others.

3 / 3 Passed

Single file, plaintext destruction, and batch encryption all verified.

7. Phase 3: Verification

Encryption alone is not enough — we must prove the output is genuinely unreadable and no sensitive data leaked to the USB drive.

Plaintext Leakage Scan

TestSearch TermFound in Encrypted File?Result
3a-iCONFIDENTIALNoPASS
3a-iiSSN / 987-65NoPASS
3a-iiiAKIAIOSFODNN7NoPASS
3a-iv5500-0000NoPASS

Zero Plaintext Survived

No SSNs, no AWS keys, no passwords, no credit card numbers, no client names — the encrypted file on the USB contains only ciphertext.

Hash & Entropy Verification

  Original hash:  a7c3f2e891d4b567...9f0a1b3c5d7e
  Encrypted hash: 2f8e1a4c6d9b3f7e...7d9e1f2a
  
  File size:      876 bytes
  Unique bytes:   241 / 256
  Shannon entropy: 7.94 bits/byte (max: 8.0)

PASS — Different hashes. 7.94 bits/byte entropy — statistically indistinguishable from random noise.

3b GCM Authentication Tag Integrity

AES-256-GCM provides authenticated encryption. The ciphertext includes a cryptographic auth tag. If even a single bit is modified, decryption fails. The attacker cannot:

  • Modify ciphertext to probe for patterns
  • Perform bit-flipping attacks
  • Use padding oracle attacks (GCM has no padding)

PASS — GCM auth tag verified. Ciphertext integrity confirmed.

3c Wrong-Key Decryption

Decryption Impossible

Attempted decryption with a random key and nonce — GCM authentication failed as expected. Without the original entropy-derived key (destroyed), the data is permanently unrecoverable. No key escrow. No recovery. No backdoor.

5 / 5 Passed

Encrypted file on USB is provably unreadable. No data leaked. Decryption impossible.

8. Complete Results: 12/12 Tests Passed

USB Exfiltration 12-Test Results Dashboard

Figure 4 — Complete test structure: 12 tests across 3 phases, all passing

PhaseTestDescriptionResult
Detection1aUSB volume mount detectedPASS
1bFile copy to USB detected via FSEventsPASS
1cDevice identity verification (no match)PASS
1dMulti-file batch exfiltration detectedPASS
Encryption2aAES-256-GCM encryption with entropy keyPASS
2bPlaintext destroyed on USBPASS
2cBatch encryption (5 files, unique keys)PASS
Verification3aPlaintext leakage scan (4 patterns)PASS
3bGCM authentication tag integrityPASS
3cWrong-key decryption fails (GCM auth)PASS
3dSHA-256 hash differs from originalPASS
3eHigh entropy (7.94 bits/byte)PASS
12 / 12 — ALL TESTS PASSED

USB exfiltration detected, encrypted with unreproducible keys, and permanently neutralized.

What the Attacker Ends Up With

  1. Encrypted blobs on the USB — AES-256-GCM ciphertext with authentication tags
  2. No plaintext — overwritten with random bytes and deleted
  3. No decryption keys — each file encrypted with a unique entropy key, all discarded
  4. No way to tamper — GCM authentication prevents bit-flipping and oracle attacks
  5. Forensic evidence against them — every copy logged with timestamps and process info

9. USB Defense: Traditional DLP vs OpenDLP

Traditional DLP vs OpenDLP USB Comparison

Figure 5 — Traditional DLP blocks USB ports and breaks workflows. OpenDLP encrypts protected data and lets USB work normally.

Traditional DLP

  1. Block USB ports — Disable all removable media
  2. Whitelist devices — Allow only approved USB drives
  3. Alert — Send notification to IT
  4. Hope — Hope policy isn't bypassed

Breaks legitimate workflows. Users find workarounds. Data still leaks.

OpenDLP

  1. Allow USB access — No workflow disruption
  2. Detect boundary crossing — FSEvents + device identity
  3. Encrypt in-place — AES-256-GCM on the USB
  4. Destroy plaintext + key — Irreversible

USB works normally for non-protected files. Protected data is always encrypted.

USB Attack Vectors Covered

Attack VectorTraditional DLPOpenDLP
Drag-and-drop copy to USBBlocked (if ports disabled)Detected + encrypted
cp/mv command to /Volumes/Blocked (if ports disabled)Detected + encrypted
Finder "Copy Items" to USBBlocked (if ports disabled)Detected + encrypted
Automated script bulk copyMay bypass whitelistBatch detected + encrypted
USB with hidden partitionInvisible to port policyAll /Volumes/ monitored
USB dead drop (copy & leave)No network evidenceForensic log + encrypted

What We Proved

  • USB boundary crossing detection works in real-time
  • FSEvents catches all copy methods (Finder, cp, scripts)
  • AES-256-GCM with entropy keys is effective
  • Batch exfiltration is detected and encrypted per-file
  • Plaintext destruction on USB is complete
  • No workflow disruption for non-protected files

Related Case Studies

OpenDLP v4.0 — USB Drive Exfiltration Defense

12 attacks · 3 phases · 12 PASS · 0 files exfiltrated · AES-256-GCM

github.com/aimarketingflow/opendlp

© 2026 AIMF LLC