Detections · Harmful behavior

Privilege escalation on a Mac: from your account to root

Most programs run with your own rights, which limits what they can touch. Privilege escalation is how malware gets administrator or root rights instead, so it can install system services, read other accounts’ files and change protections. Once it has root, removing it gets much harder.

Updated November 25, 2026 · 74 detections in this category

In short

Ways to obtain administrator or root rights: sudo, authorization requests, setuid programs, account changes.

MacVigil has 74 detections in this category. It reads the file to find them and never runs it.

What privilege escalation is

macOS separates what you can do as a normal user from what the system and administrators can do. Escalation crosses that line: by getting your password and handing it to sudo, by creating an account with administrator or root rights, by planting a program that always runs as its owner, or by abusing a privileged helper that trusts too many callers. The attacker gains lasting control over the whole Mac rather than one account.

How Mac malware does it

What MacVigil looks for

MacVigil reads the file and never runs it. It looks for the request together with what makes it dangerous: the same function that copies a shell and requests setuid on that same copy; several commands that give the same non-root account root’s identity; a sudoers rule written for a copied script that is then run; a password value piped into sudo -S.

In packages, it checks what is installed and with which permissions: setuid programs, executables or launch configurations anyone can modify, rules in /etc/sudoers.d. A string such as sudo -S or with administrator privileges on its own is a clue, and when the pieces are only separate mentions, MacVigil says so and does not claim they ran.

When it is normal

Installers ask for administrator rights all the time, and apps legitimately install privileged helper tools. Administrator request apps and remote administration tools add accounts to the admin group or write sudo rules, and real authentication plug-ins live in the same places as malicious ones. A permissions mistake can leave a folder writable by everyone without any bad intent.

How to check your Mac

On the blog

Know what a file does before you open it

MacVigil reads any app, disk image, installer or script without running it, and shows the evidence behind every finding. Nothing leaves your Mac.

Download free for Mac

More: all detection categories · what MacVigil detects · the blog