macOS Frida Setup

On an M1 Mac, Frida needs some extra steps to be able to attach to system processes. Mainly writing this down here because it was spread across multiple GitHub issues. Hope it helps some of you who are working with Frida on M1 Macs :)

Versions

  • macOS Ventura 13.0.1
  • Frida 16.0.2
  • Apple M1 Pro

Setup

  • Disable System Integrity Protection (SIP). Power off Mac, power on with very long press to get the advanced boot options, open the Terminal from the Utilities, enter
    csrutil disable
    ... and confirm that this bricks your system's security.
  • Disable some dialogues popping up and asking for permissions, further reducing the security of your system with
    sudo security authorizationdb write system.privilege.taskport allow
    ... this might be optional but needed if you use Frida via SSH.
  • Change boot arguments as follows:
    sudo nvram boot-args=-arm64e_preview_abi
    ... and reboot.

Now you should be able to attach to system services, e.g., run:

# frida identityservicesd

Debugging

The first two steps are currently also described on the Frida website. Without the adjusted boot arguments, Frida quits with the following error message - apparently on M1 Macs only:

Failed to attach: unexpected error while starting thread (set_thread_state returned '(os/kern) protection failure')

Looking for frida in the Console app, there are three matching messages. The first is the command I ran, the next one is a sandbox error for _frida.abi3.so, and the last one is the one that hints towards the missing boot argument, as it complains about the arm64e preview abi.


Comments

Popular posts from this blog

Always-on Processor magic: How Find My works while iPhone is powered off

Embedding Frida in iOS TestFlight Apps

BlueZ: Linux Bluetooth Stack Overview