googleprojectzero / googleprojectzero/Jackalope

Quick fix for fuzzying iOS on MacOS ?

Open
#61 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1.4k
Forks
157
PR merge metrics
No merged PRs in 30d

Description

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 @@

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report uses p0tools/iOSOnMac, TinyInst's posix_spawnattr_set_platform_np(... PLATFORM_IOS, ...) change, and the Jackalope fuzzer command shown in the issue. First reproduce the target-function detection failure and compare it with the documented LLDB steps; done means establishing a supported path with a passing reproduction or documenting the limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, ios, macos
Domain
operating-systems, reverse-engineering, testing-qa
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.