Since his
MUSL PS4 Port Low-Level Details and proceeding the recent
ipv6-df-3.c proof-of-concept (PoC), today
PlayStation 4 Scene developer
@SpecterDev shared via
Twitter PS4 KHook which is a minimalist kernel hooking payload he wrote for the
DayZeroSec Twitch Stream that's handy for exploit debugging!
Download:
PS4-KHook-master.zip /
GIT
Here's further details from the
README.md, to quote:
PS4 KHook
PS4 KHook is a minimalist kernel hooking payload. It targets 5.05 but it can be used with any firmware (or even non-PS4 systems) with modifications. It's primary intent is for exploit development / debugging though it can be used anywhere hooking is needed (though Mira is recommended for long-term hooks for things like homebrew). It doesn't require a daemon to run for state tracking as it uses a code cave and a dispatch table.
Warning: the implementation is pretty hacky and it's not yet complete. Feel free to fork and pull request any improvements or TODO items.
Building and running
To build this payload you'll need the
PS4 Payload *** from Scene Collective. Once installed, simply build this payload like so:
Code:
$ make clean
$ make
$ cat PS4-KHook.bin | nc [ps4ip:payloadport]
Important caveats
This hooking payload does have some caveats you need to be aware of before writing and installing hooks.
- Hooks must only have one return path, and it must return 0x1337. Additionally, the payload must be compiled without optimization (-O0). The reason for this is due to the runtime function size calculation for the hooks.
- Trampolines must be a minimum size of 10 bytes (0xA bytes).
- Trampolines cannot contain any instructions...