Skip to content

Call any native function on a remote machine, from Python.

A tiny C server runs on the target. The rpcclient shell on your machine turns every symbol, ObjC class and system API over there into something you can call, poke and script.

python3 -m pip install -U rpcclient
rpcclient 127.0.0.1 -p 5910 iPhone · iOS
In [1]: symbols.getpid()
Out[1]: 2741
In [2]: p.fs.listdir('/var/mobile/Media')
Out[2]: ['DCIM', 'Downloads', 'iTunes_Control', 'Books']
In [3]: d = NSMutableDictionary.new()
In [4]: d.setObject_forKey_(p.cf('hello'), p.cf('from python'))
In [5]: d.py()
Out[5]: {'from python': 'hello'}
In [6]: p.processes.get_by_basename('SpringBoard').pid
Out[6]: 34
In [7]: 

rpc-project

rpc-project is a simple, powerful RPC service for controlling every aspect of a remote machine. A small C server exposes a protocol for calling native functions; a Python client turns that into a rich, scriptable API. Use it for QA automation, for testing your APIs straight from Python, and for software research: found an interesting OS API? Try it with no compilation required.

How it fits together

Your machine

rpcclient, written in Python 3. An IPython shell (or a library) that builds high-level APIs on top of native calls.

The target

rpcserver, a small binary written in C that exposes a protocol for calling native C functions. Runs on macOS, iOS and Linux.

What you can reach

Each platform adds to the one around it: everything that works everywhere also works on Darwin, and everything on Darwin also works on iOS.

Every platform

  • Remote system commands: p.spawn()
  • Remote shell: p.shell()
  • Filesystem: p.fs.*
  • Network (Wi-Fi scan, TCP connect, …): p.network.*
  • Sysctl: p.sysctl.*

Darwin (macOS and iOS)

  • Multimedia record and play: p.media.*
  • Preferences (CFPreferences, SCPreferences): p.preferences.*
  • Process management: p.processes.*
  • Location: p.location.*
  • HID simulation (touch, keyboard, battery): p.hid.*
  • IORegistry: p.ioregistry.*
  • Logs and crash reports: p.reports.*
  • Time, Bluetooth, XPC: p.time.*, p.bluetooth.*, p.xpc.*

iOS only

  • MobileGestalt: p.mobile_gestalt.*
  • Backlight: p.backlight.*
  • Dump decrypted apps: p.processes.get_by_basename(name).dump_app('/path')

Where to go next