Jake had gained some good knowledge and skills in the game development field, so he decided to enter the industry through a decent job. Little did he know that fake recruiters were waiting. A well-crafted phishing attack with a promising job offer compromised his Mac machine. The task: investigate Jake’s machine, determine the attack chain, and identify the full extent of the damage.

I’ll be fair, I’m a technology enthusiast. Even that feels like a dramatic understatement. As of late, I have a mix of all three major operating systems in front of my face and at arm’s reach at any given hour of the day.

Today’s configuration for this room is amusing: Kali VM running a Mac VM on MacOS. What a world.

Mounting the image

ls -la
ls -la output showing files in the working directory

Located the image in the /home/ubuntu/Jack_Mac folder:

Directory listing showing Jack_Mac.img file

Mount it, then switch to root:

sudo apfs-fuse -v 4 /home/ubuntu/Jack_Mac.img /home/ubuntu/mac
sudo su

Locate where Ubuntu mounted the image:

lsblk -f
mount | grep -Ei 'Jack|loop|apfs|hfs'

The last line of the grep output has the location of the mounted image.

grep output showing mounted APFS image location
ls -la /home/ubuntu/mac
ls -la of mounted mac directory showing root filesystem structure
ls -la /home/ubuntu/mac/root
ls -la of mac/root showing macOS root directory contents

plist files live in a user’s library. Navigate there:

ls -la /home/ubuntu/mac/root/Users
ls -la /home/ubuntu/mac/root/Users/jake
ls -la /home/ubuntu/mac/root/Users/jake/Library
ls -la of jake's Library directory

Most recently accessed folder

Windows has File Explorer. Kali has Thunar. On Mac, you have Finder. To find the most recently accessed folder, locate the Finder plist:

cd "/home/ubuntu/mac/root/Users/jake/Library/Preferences"
ls | grep -i finder
grep output locating com.apple.finder.plist

Check whether the plist is XML or binary:

file com.apple.finder.plist
file command output showing com.apple.finder.plist is binary format

Binary. With XML we could use cat and grep. Binary requires a different approach. plutil is not installed on this machine, so we will not be installing it. Python to the rescue:

python3 - <<'PY'
import plistlib, pprint

with open("com.apple.finder.plist", "rb") as f:
    data = plistlib.load(f)

print(data.keys())
PY

We’ve located the artifact: FXRecentFolders.

Python plistlib output showing plist keys including FXRecentFolders

Print the FXRecentFolders key:

python3 - <<'PY'
import plistlib, pprint

with open("com.apple.finder.plist", "rb") as f:
    data = plistlib.load(f)

pprint.pp(data["FXRecentFolders"])
PY

The output returns a file-bookmark blob (Apple’s encoded path and bookmark data) as a list. FXRecentFolders sorts by most recently accessed first. plistutil, which was flagged as unavailable earlier, is accessible from this part of the image. Running it makes the blob human-readable:

plistutil -p com.apple.finder.plist | less
plistutil output showing FXRecentFolders with Downloads as the first entry

Downloads is the first entry.

Most recently accessed folder: Downloads

Social platform used to deliver the document

Downloads is our most likely snitch:

ls -la "/home/ubuntu/mac/root/Users/jake/Downloads"
ls -la of Jake's Downloads folder showing the TechTHM Interview Instructions PDF
.localized
TechTHM Interview Instructions - Content Writer.pdf

As a Mac user, Jake likely uses Safari. Firefox is a close second guess. Any active Mac user who has tried Chrome knows it runs like a virus, at least on Intel-based Macs. Side note: if you have a Mac running like it’s dying and Google Chrome installed, look up how to cleanly uninstall it. There will be hidden files in the Mac library to axe as well. Take the time to find a reputable guide that covers removing all traces, and be amazed at how well your computer can actually run.

Back on track. Safari history:

ls -la "/home/ubuntu/mac/root/Users/jake/Library/Safari"
ls -la of jake's Safari directory showing History.db

History.db is what we’re looking for: Safari history in SQLite format. Query the tables:

python3 -c 'import sqlite3; db="/home/ubuntu/mac/root/Users/jake/Library/Safari/History.db"; con=sqlite3.connect(db); cur=con.cursor(); print("\n".join(r[0] for r in cur.execute("SELECT name FROM sqlite_master WHERE type=\'table\' ORDER BY name;"))); con.close()'
Python sqlite3 output listing tables in Safari History.db

The tables hath been found.

sqlite3 is unavailable in this environment for direct querying, so strings:

strings "/home/ubuntu/mac/root/Users/jake/Library/Safari/History.db" | grep -Ei 'linkedin|facebook|instagram|twitter|x\.com|discord|reddit|meetmelive|techthm|pdf|download'
strings grep output of Safari History.db showing LinkedIn results

I think we have a resounding answer.

Social platform used to deliver the document: LinkedIn

Attacker's download link

The PDF in Jake’s Downloads folder almost certainly contains the URL. Extract readable strings from it:

strings "/home/ubuntu/mac/root/Users/jake/Downloads/TechTHM Interview Instructions - Content Writer.pdf" | grep -Ei 'http|meetmelive|download|app|dmg|pkg|zip'

Bingo.

strings grep output of the PDF showing the malicious MeetMeLiveInstaller.pkg download URL

Attacker’s download link: http://files.techthm.careers.thm:8080/MeetMeLiveInstaller.pkg

Network Jake connected to

macOS stores known Wi-Fi networks in a plist. Check the system configuration directory:

ls -la "/home/ubuntu/mac/root/Library/Preferences/SystemConfiguration"
ls -la of SystemConfiguration showing com.apple.airport.preferences.plist

com.apple.airport.preferences.plist holds known networks. Inspect its keys with Python, then narrow to known-networks:

ls -la /home/ubuntu/mac/root/Library/Preferences | grep -i wifi
grep output locating com.apple.wifi.known-networks.plist
strings "/home/ubuntu/mac/root/Library/Preferences/com.apple.wifi.known-networks.plist" | less
strings output of wifi known-networks plist showing Jake M. iPhone network

Network Jake connected to: Jake M. iPhone

IP address assigned to Jake's system

Check the DHCP lease:

ls -la /home/ubuntu/mac/root/private/var/db/dhcpclient/leases
ls -la of DHCP leases directory showing en0.plist
cat /home/ubuntu/mac/root/private/var/db/dhcpclient/leases/en0.plist
DHCP lease plist contents showing assigned IP address 192.168.64.2

IP assigned to Jake’s system: 192.168.64.2

Application install timestamp

Check the Applications folder:

ls -la /home/ubuntu/mac/root/Applications | grep -i meet
ls output of Applications directory filtered to MeetMeLive.app

Pull the install history:

cat /home/ubuntu/mac/root/Library/Receipts/InstallHistory.plist | grep -A20 -B5 -i MeetMeLive
InstallHistory.plist entry for MeetMeLive showing install timestamp 2025-04-30 08:54:20

Application install timestamp: 2025-04-30 08:54:20

Permission explicitly granted by Jake

macOS TCC (Transparency, Consent, and Control) tracks what permissions users grant to applications. Check the TCC database:

ls -la /home/ubuntu/mac/root/Library/Application\ Support/com.apple.TCC
ls -la of com.apple.TCC directory showing TCC.db
strings "/home/ubuntu/mac/root/Library/Application Support/com.apple.TCC/TCC.db" | grep -i -A3 -B3 meet
strings grep output of TCC.db showing kTCCServiceSystemPolicyAllFiles for MeetMeLive

TCC found kTCCServiceSystemPolicyAllFiles. The human-readable name for that is Full Disk Access.

I’m on computers way too much, y’all. I could stand to be a little more readable myself.

Permission granted: Full Disk Access

Persistence mechanism

LaunchAgents is macOS’s mechanism for running programs at login. I learned that lesson once and once only. Thankfully not with malware.

ls -la /home/ubuntu/mac/root/Library/LaunchAgents
ls -la /home/ubuntu/mac/root/Users/jake/Library/LaunchAgents
ls -la of system LaunchAgents directory ls -la of jake's LaunchAgents directory showing MeetMeLive launch agent

Persistence mechanism: LaunchAgents

Exfiltration URL

Still on the LaunchAgents path:

cat /home/ubuntu/mac/root/Users/jake/Library/LaunchAgents/MeetMeLive.sh
MeetMeLive.sh contents showing exfiltration URL http://techthm.thm/exfil

Pretty darn sure that’s it.

Exfiltration URL: http://techthm.thm/exfil

Full Attack Chain

LinkedIn phishing message
  -> PDF delivered: TechTHM Interview Instructions
  -> PDF contained malicious URL: files.techthm.careers.thm:8080/MeetMeLiveInstaller.pkg
  -> Jake connected to iPhone hotspot (Jake M. iPhone)
  -> Jake's IP: 192.168.64.2
  -> MeetMeLive.app installed: 2025-04-30 08:54:20
  -> Jake granted Full Disk Access (kTCCServiceSystemPolicyAllFiles)
  -> LaunchAgent set for startup persistence
  -> Data exfiltrated to: http://techthm.thm/exfil