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
- Piping a password it obtained, often from a fake prompt, into
sudo -Sso the command never asks you. - Making
sudostop asking: writing a passwordless rule into/etc/sudoers.d, tampering with the timestamp record in/var/db/sudo, or defining a fakesudoalias in a shell startup file. - Creating a local account with
dscl . -createorsysadminctl -addUser, adding it to the admin group withdseditgroup, and hiding it from the login window. - Giving a second account user ID zero, the identity of root.
- Copying a system shell and setting the setuid bit on it, or installing setuid programs, so they run as their owner.
- Rewriting authorization rules with
security authorizationdb write, or installing an authentication module in/etc/pam.d. - Leaving files writable by everyone: a launch daemon configuration, an executable or a whole tree after
chmod -R 777, so any account can replace what root runs. - Privileged helper tools in
/Library/PrivilegedHelperToolsthat accept callers without checking who they are, or the deprecatedAuthorizationExecuteWithPrivileges.
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
- Open System Settings > Users & Groups and check every account listed as Admin. Run
dscl . list /Usersin Terminal to see accounts the login window may hide. - Run
sudo -lto see which commands your account may run without a password. - List extra sudo rules with
sudo ls -l /etc/sudoers.dand look for files you did not create. - In Finder, choose Go > Go to Folder and open
/Library/PrivilegedHelperTools; check each helper’s signature withcodesign -dv --verbose=4. - Be suspicious of any app that asks for your password more than once, or outside the standard macOS window.
Related categories
- Password phishing: Password requests the program draws itself, outside the system's own authentication window.
- Persistence: How a program arranges to start again on its own: launch agents and daemons, login items, scheduled jobs.
- Protection bypass: What turns off or sidesteps the checks macOS applies to software: Gatekeeper, quarantine, SIP, code signatures.
- What it asks macOS for: The permissions it declares to macOS: signed entitlements, the usage sentences shown in consent prompts, URL schemes, automation. A request, not proof that it was granted or used.
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.
Free for 7 days, then $29.95 a year for 2 Macs, a launch price: the regular price will be $59 a year. Requires macOS 15 Sequoia or later on a Mac with Apple silicon.
More: all detection categories · what MacVigil detects · the blog