I use a Mac every day alongside Linux and Windows, and I'll admit I rarely looked at what was running in the background until recently. Then a Reddit user's Mac made the news when Claude Code found a hidden crypto miner on it while building a temperature app. The miner had been eating about a dozen CPU cores for weeks.
You don't need an AI agent to find something like that. macOS already gives you everything you need, both in the GUI and in Terminal. This guide walks through the checks I now run when a Mac feels hot, loud or slow, from the quick five-minute look to tracking down exactly where a process comes from and switching it off safely.
Prerequisites
- A Mac running a recent macOS. Menu names below are from macOS 13 Ventura and later. Older versions call it System Preferences rather than System Settings.
- An admin account for the
sudocommands. - Terminal (Applications > Utilities > Terminal).
- About 20 minutes, ideally with every app closed so the Mac is idle.
Signs that justify a check: fans running or the case hot while you're doing nothing, battery draining far faster than usual, or everything feeling sluggish. None of those prove malware, but a miner causes all of them.
Step 1: Activity Monitor
Open Activity Monitor (Applications > Utilities), then:
- Choose View > All Processes so you're not just seeing your own apps.
- On the CPU tab, click the % CPU column to sort highest first.
- Leave it for a minute while the Mac is idle. Apple's own processes spike briefly; a miner sits near the top and stays there.
macOS counts each core as 100%, so a process at 400% is keeping four cores busy. Also check CPU Time: a process that has racked up hours of CPU time while you've only been using a browser deserves a look.
Double-click a suspicious process and use Open Files and Ports to see where its executable lives and what it's connected to. Apple's Activity Monitor user guide explains every column.
One catch: some miners are built to pause as soon as Activity Monitor opens. If the Mac is hot but Activity Monitor looks clean, use Terminal instead.
Step 2: top and ps in Terminal
top is the Terminal version of Activity Monitor, and it's less likely to be dodged. This takes two samples (the first one always shows zero CPU) and lists the 15 busiest processes:
top -l 2 -o cpu -n 15 -stats pid,command,cpu,time,user | tail -16
For a snapshot with more detail, use ps. On macOS, -r sorts by CPU:
ps -Ao pid,ppid,user,%cpu,%mem,etime,comm -r | head -20
The comm column shows the full path to each program, which is often the giveaway. Real apps live in /Applications, /System or /usr. Be suspicious of executables running from:
/tmp,/private/tmpor/private/var/folders/...(temporary folders)/Users/Shared- hidden folders in your home directory (names starting with a dot)
- randomly named folders in
~/Library/Application Support
To see the full command line of a process, including the arguments a miner often uses for its pool address:
ps -o pid,args -p <PID>
Replace <PID> with the number from the first column.
Step 3: Check what it's talking to with lsof
Miners have to talk to a mining pool. lsof shows every network connection and which process owns it:
sudo lsof -i -P -n | grep ESTABLISHED
-P and -n show raw port numbers and IP addresses instead of names, which is faster and harder to disguise. To see what's listening for incoming connections:
sudo lsof -iTCP -sTCP:LISTEN -P -n
For one suspicious process:
sudo lsof -i -P -n -p <PID>
Mining traffic often uses dedicated "stratum" ports, but it can also hide on 443 like normal web traffic, so focus on which process is connecting rather than the port.
Step 4: Is it signed?
Legitimate Mac software is almost always signed by an identified developer. Check the executable path you found:
codesign -dv --verbose=2 /path/to/the/program 2>&1 | grep -E "Authority|Identifier|TeamIdentifier"
No authority lines, or "code object is not signed at all", isn't proof of malware (plenty of command-line tools are unsigned), but an unsigned binary in a temp folder using 1,000% CPU is about as clear as it gets.
Step 5: Find what keeps relaunching it
Killing a miner isn't enough if something restarts it. On macOS, things start automatically in a few places.
Login Items and background items. Open System Settings > General > Login Items & Extensions (just Login Items on macOS 13 and 14). Check both the items that open at login and the Allow in the Background list. Apple explains this screen in Open items automatically when you log in. Turn off anything you don't recognise.
LaunchAgents and LaunchDaemons. These are small .plist files that tell launchd to start a program. The ones to check are:
ls -la ~/Library/LaunchAgents /Library/LaunchAgents /Library/LaunchDaemons
~/Library/LaunchAgents is per-user, /Library/LaunchAgents applies to all users, and /Library/LaunchDaemons runs as root before anyone logs in. You can ignore /System/Library/..., which belongs to Apple and is protected by the system. Most legitimate entries are named after their vendor (com.google..., com.microsoft..., us.zoom...). Random strings, or names that imitate Apple's com.apple. style outside /System, deserve a closer look.
To read one:
plutil -p ~/Library/LaunchAgents/<name>.plist
Look at ProgramArguments (what it runs), and RunAtLoad and KeepAlive (whether it starts at login and restarts when killed). Apple's launchd documentation is old but still explains these keys.
What launchd has loaded right now:
launchctl list | grep -v com.apple sudo launchctl list | grep -v com.apple
On macOS 13 and later, this dumps everything registered for background launch, including the developer and the path behind each item:
sudo sfltool dumpbtm | less
Step 6: Remove it safely
Don't just start deleting files. Stop it, quarantine it, then confirm:
1. Unload the launch item so it can't restart. For a user agent:
launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/<name>.plist
For a system daemon:
sudo launchctl bootout system /Library/LaunchDaemons/<name>.plist
2. Stop the process with kill <PID>, or sudo kill -9 <PID> if it ignores you.
3. Quarantine, don't delete. Move the plist and the program into a folder of their own, so you can undo a mistake:
mkdir -p ~/Quarantine && mv ~/Library/LaunchAgents/<name>.plist ~/Quarantine/
4. Restart and re-check. Restart the Mac and repeat Steps 1 to 5. If it's back, something else is reinstalling it.
5. Get a second opinion from a reputable malware scanner.
Step 7: Assume the account was exposed
Anything that could run a miner as you could also read your files and browser sessions. From a clean device, change important passwords, sign out of other sessions, and revoke tokens you had saved on that Mac: GitHub, cloud consoles, SSH keys and AI API keys. Then think about how it got in. In the Reddit case, the user blamed cracked audio plugins, and pirated software is the classic route.
Troubleshooting
sfltool: command not foundor no output: you're on macOS 12 or earlier. Use the LaunchAgents folders andlaunchctl listinstead.- "Operation not permitted" in Terminal: some folders need Full Disk Access for Terminal (System Settings > Privacy & Security > Full Disk Access). Give it temporarily and remove it when you're done.
bootoutsays "No such process": it wasn't loaded. Move the plist out anyway so it doesn't load at the next login.- A process comes back with a new name: check the parent with
ps -o ppid= -p <PID>and investigate that instead. - High CPU from
kernel_task,WindowServerormds_stores: these are Apple processes.mds_storesis Spotlight indexing and settles down after a while.kernel_taskcan rise when the Mac is managing heat.
Prevention
- Don't install cracked apps or plugins. "Free" software that asks you to bypass Gatekeeper is how most Mac miners arrive.
- Keep macOS updated. Apple's malware protection overview explains how Gatekeeper and XProtect help.
- Consider Objective-See's free tools: KnockKnock lists persistent items, BlockBlock alerts when something new installs itself, and LuLu is an outbound firewall. They're listed on the Objective-See tools page.
Wrapping up
Five minutes with top, lsof and the LaunchAgents folders will tell you more about your Mac than most people ever look at. I now run through this whenever one of my machines gets unexpectedly hot. Usually it's Spotlight or a browser tab, but it's worth knowing for sure.
Comments (0)
No comments yet. Be the first to leave one!
Leave a Comment