You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Combine with the **masquerading tricks above** to present a believable password dialog.
262
262
263
+
264
+
### Privileged helper / XPC triage
265
+
266
+
A lot of modern third-party macOS privescs follow the same pattern: a **root LaunchDaemon** exposes a **Mach/XPC service** from **`/Library/PrivilegedHelperTools`**, then the helper either **doesn't validate the client**, validates it **too late** (PID race), or exposes a **root method** that consumes a **user-controlled path/script**. This is the bug class behind many recent helper bugs in VPN clients, game launchers and updaters.
267
+
268
+
Quick triage checklist:
269
+
270
+
```bash
271
+
ls -l /Library/PrivilegedHelperTools /Library/LaunchDaemons
- keep accepting requests **after uninstall** because the job stayed loaded in `launchd`
283
+
- execute scripts or read configuration from **`/Applications/...`** or other paths writable by non-root users
284
+
- rely on **PID-based** or **bundle-id-only** peer validation that may be raceable
285
+
286
+
For more details on helper authorization bugs check [this page](macos-proces-abuse/macos-ipc-inter-process-communication/macos-xpc/macos-xpc-authorization.md).
Until Apple fixed it in **Sonoma 14.5**, **Ventura 13.6.7** and **Monterey 12.7.5**, user-initiated installs via **`Installer.app`** / **`PackageKit.framework`** could execute **PKG scripts as root inside the current user's environment**. That means a package using **`#!/bin/zsh`** would load the attacker's **`~/.zshenv`** and run it as **root** when the victim installed the package.
291
+
292
+
This is especially interesting as a **logic bomb**: you only need a foothold in the user's account and a writable shell startup file, then you wait for any vulnerable **zsh-based** installer to be executed by the user. This does **not** generally apply to **MDM/Munki** deployments because those run inside the root user's environment.
293
+
294
+
```bash
295
+
# inspect a vendor pkg for shell-based install scripts
296
+
pkgutil --expand-full Target.pkg /tmp/target-pkg
297
+
find /tmp/target-pkg -type f \( -name preinstall -o -name postinstall \) -exec head -n1 {} \;
298
+
rg -n '^#!/bin/(zsh|bash)' /tmp/target-pkg
299
+
300
+
# logic bomb example for vulnerable zsh-based installers
301
+
echo'id > /tmp/pkg-root'>>~/.zshenv
302
+
```
303
+
304
+
If you want a deeper dive into installer-specific abuse, also check [this page](macos-files-folders-and-binaries/macos-installers-abuse.md).
-[CVE-2024-30165: AWS Client VPN for macOS Local Privilege Escalation](https://blog.emkay64.com/macos/CVE-2024-30165-finding-and-exploiting-aws-client-vpn-on-macos-for-local-privilege-escalation/)
0 commit comments