• Stars
    star
    192
  • Rank 195,341 (Top 4 %)
  • Language
    C
  • License
    Mozilla Public Li...
  • Created almost 7 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Dev tools for probing IOKit

IOKit Utils

Just some little dev tools to probe IOKit.
Makefile is designed to build all-in-one binaries for both iOS and macOS.

ioclass

Usage:

ioclass [-b] [Name]

Takes an IOKit class name as argument and, if -b is given, prints the bundle ID of the providing kext, otherwise prints its class hierarchy.

Example

bash$ ioclass RootDomainUserClient
RootDomainUserClient
 IOUserClient
  IOService
   IORegistryEntry
    OSObject

ioprint

Iterate over all entries in a registry plane and perform operations on them.

Usage:

ioprint [-d] [-j] [-k] [-o] [-h] [-p Plane] [-s] [Name]

All arguments are optional.
Class names of all considered objects as well as return values are always printed.

  • Name: Limit the performed operations to only objects that either extend a class Name, or whose name in the registry is Name. If none is given, all objects are processed.
  • -d: Print IOKit properties in XML format.
  • -h: Print a help and exit.
  • -j: Print IOKit properties in JSON format.
  • -k: Print IOKit properties in mix between JSON and hexdump.
  • -o: Print only IOKit properties and nothing else.
  • -s: Try to set properties <key>herp</key><string>derp</string> on all objects.
  • -p Plane: Iterate over registry plane Plane. Default is IOService.

Examples

List all entries of the IOService plane:

bash$ ioprint
# [ excessive output omitted ]

List all entries of the IOUSB plane:

bash$ ioprint -p IOUSB
IORegistryEntry(Root)
IOUSBRootHubDevice(Root Hub Simulation Simulation)
IOUSBDevice(Bluetooth USB Host Controller)

List all IOUserClient instances:

bash$ ioprint IOUserClient
# [ excessive output omitted ]

Print properties of all IOHIDUserClient instances:

bash$ ioprint -d IOHIDUserClient
IOHIDUserClient: (os/kern) successful (0x0)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>IOUserClientCreator</key>
    <string>pid 223, WindowServer</string>
    <key>IOUserClientCrossEndianCompatible</key>
    <true/>
</dict>
</plist>

List all properties of the registry root:

bash$ ioprint -d Root
# [ excessive output omitted ]

Try to set properties on all IOHIDUserClient instances:

bash$ ioprint -s IOHIDUserClient
IOHIDUserClient: (os/kern) successful (0x0)

(Note: The return value doesn't necessarily indicate that properties were actually set. Usually for user clients, they are not.)

ioscan

Iterate over all entries in a registry plane and try to spawn user clients.
Prints name and class of all services, whether spawning a client was successful, class of the spawned client, and whether multiple user clients have the same ID (i.e. are shared clients).

Usage:

ioscan [-h] [-p Plane] [-s] [Name [min [max]]]
  • Name: Limit the performed operations to only objects that either extend a class Name, or whose name in the registry is Name. If none is given, all objects are processed.
  • min and max: Try spawning user clients of certain types (can be given in base 8, 10 or 16). If both min and max are given, all types in that range will be tried. If only min is given, that one type will be tried. Defaults to 0.
  • -h: Print a help and exit.
  • -s: Only print entries where a user client was successfully spawned.
  • -p Plane: Iterate over registry plane Plane. Default is IOService.

All arguments are optional, but min and max can only be given if Name is given too.

Examples

Spawn a user client for every service:

bash$ ioscan
# [ excessive output omitted ]

Spawn an AMFI user client:

bash$ ioscan AppleMobileFileIntegrity
Class                    Name                     Type Spawn                UC                                   One   Two Equal
AppleMobileFileIntegrity AppleMobileFileIntegrity    0 (os/kern) successful AppleMobileFileIntegrityUserClient 23207 23107 !=   

Spawn an IOGraphicsDevice user client of type 1:

bash$ ioscan IOGraphicsDevice 1
Class                 Name                  Type Spawn                UC                             One  Two Equal
AppleIntelFramebuffer AppleIntelFramebuffer    1 (os/kern) successful IOFramebufferSharedUserClient 8307 8307 ==   
AppleIntelFramebuffer AppleIntelFramebuffer    1 (os/kern) successful IOFramebufferSharedUserClient 8d07 8d07 ==   
AppleIntelFramebuffer AppleIntelFramebuffer    1 (os/kern) successful IOFramebufferSharedUserClient 9407 9407 ==   

License

MPL2 with Exhibit B, except for iokit.h which is Public Domain.

More Repositories

1

ios-resources

Useful resources for iOS hacking
1,579
star
2

IOHIDeous

IOHIDFamily 0day
C
443
star
3

psychicpaper

iOS <13.5 sandbox escape/entitlement 0day
C
327
star
4

iometa

arm64 IOKit class dumper
C
256
star
5

v0rtex

IOSurface exploit
Objective-C
215
star
6

libkrw

Lib kernel r/w
C
188
star
7

imobax

iOS Mobile Backup Extractor
C
178
star
8

cl0ver

tfp0 for iOS 9.0-9.3.4
C
154
star
9

APRR

Apple hardware secrets
Assembly
111
star
10

PhoenixNonce

64-bit nonce setter for iOS 9.3.4-9.3.5
Objective-C
96
star
11

hsp4

macOS kext for host_special_port(4) patch
C
89
star
12

tbdump

Utility to create tbd's off dylibs
C
77
star
13

dt

DeviceTree
C
73
star
14

IOKernelRW

Insecurity as an IOService
C++
63
star
15

cuck00

Twenty-twenty, bugs aplenty!
C
53
star
16

ios-scripts

iOS-related command line goodies
Shell
50
star
17

nordump

Apple Silicon NOR dumper
C++
41
star
18

lz4dec

Tiny arm64 LZ4 decompressor
C
40
star
19

ld64

Apple ld64 for Debian
Makefile
40
star
20

ios-build

Build files for things related to iOS
C
36
star
21

misc

C
34
star
22

siguza.github.io

Siguza's Blog
HTML
28
star
23

fscmp

CLI frontend for com.apple.decmpfs / AppleFSCompression.framework
C
27
star
24

UserScripts

My Tampermonkey scripts
JavaScript
14
star
25

libprovision

Library for dealing with Apple provisioning profiles and code signatures
10
star
26

StackScripts

My Tampermonkey scripts I use on StackExchange sites
JavaScript
7
star
27

VirtualPack

Bukkit Plugin "VirtualPack"
Java
7
star
28

recfg

C
6
star
29

Stash

Random stuff
Shell
6
star
30

lz4hc

C
3
star
31

libcrippy-1

Forked from openjailbreak.org
Makefile
2
star
32

libpartialzip-1

Forked from openjailbreak.org
C
1
star
33

NBTLib

A version-presistent bridge between Bukkit and Minecraft
Java
1
star
34

InvisiNOT

Bukkit Plugin "InvisiNOT"
Java
1
star