Skip to content

Quick fix for fuzzying iOS on MacOS ? #61

@rainbowcardiod

Description

@rainbowcardiod

Using p0tools I am able to run a simple program compiled for iOS, with a manual trick[1] though, because the amfi part does not seem to work anymore.
I patched TinyInst to use posix_spawnattr_set_platform_np(..., PLATFORM_IOS, ...) and jackalope is able to spawn the program, and with the manual trick, everything runs[2]. However, tinyinst does not ever detect the target function to be called, and if the program exits it complains with WARNING: Target function not reached, retrying with a clean process.

My question is if there is a simple fix for continuing this experiment, or if the nature of TinyInst does not allow to fuzz iOS-on-Mac binaries.

Thank you in advance.

[1] Manual trick: after the target program has been spawned in paused mode, keep Jackalope paused (using a getc() after the posix_spawn), and do the following with lldb:

  1. attach to the target program
  2. break set -n xpc_copy_entitlements_for_self, continue and hit the breakpoint
  3. get the address of my_xpc_copy_entitlements_for_self (from interpose.c of p0tools )
  4. re write $pc 0x100dce000 -- where the address is from step 2
  5. continue and detach, tell Jackalope to continue
  6. last note: for doing step 4. the program must wait some seconds to give time to jacklope to attach before starting the target function

[2] ./fuzzer -t 1000 -in in -out out -delivery shmem -target_module testcrashme -instrument_module crashme2_ios.dylib -target_method __Z4fuzzPc -nargs 1 -iterations 10000 -persist -loop -cmp_coverage -- ./testcrashme -m @@

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions