Join Us and become a Member for a Verified Badge to access private areas with the latest PS4 PKGs.
PS5 Jailbreaking       Thread starter PSXHAX       Start date Oct 4, 2022 at 4:40 PM       22      
Status
Not open for further replies.
Following the recently released 4.03 PS5 IPV6 Kernel Exploit & Rootvnode Listdir PoC comes a PS5 4.03 / 4.50 Kernel Exploit update via @SpecterDev on Twitter with reverse-engineering help from ChendoChap and testing by @DizzRL on Twitter alongside a BD-JB PlayStation 5 Payload Loader by @sleirsgoevy on Twitter and a PS5 FTP Payload via @zecoxao on Twitter allowing for a 4.03 PS5 Full Directory Listing as shown by LeGenD_ArMoUR_ in the PS5Scene! :geek:

Download: PS5-4.03-Kernel-Exploit-main.zip / GIT / bd-jb-ps5-payload.iso (8.0 MB - port 9019) / FTPS4.7z (0.38 MB) / ret.bin (1 Bytes) / payload.bin (0.5 MB - 4.03 only - MD5: 9AFDDEA3A9443284A23E5D7CC81938A5) / bd-jb-ps5-payload-2.iso (8.0 MB - Updated payload server, now also cleans up after exploit) by sleirsgoevy / trophy.zip (58.9 MB - All PS5 trophy animations with sounds) / PS5_Controller_FW.rar (800 KB - includes bond_fw_info.json and bond_fw_series_0004_001.bin) by LeGenD_ArMoUR_ / 00000.jar (0.05 MB - for 4.50 kqueue address updated, replace in iso and burn) via notzecoxao / Updated PS5 FTP Payload

From the updated README.md: PS5 4.03 + 4.50 Kernel Exploit

An experimental webkit-based kernel exploit (Arb. R/W) for the PS5 on 4.03FW/4.50FW

Summary

This repo contains an experimental WebKit ROP implementation of a PS5 kernel exploit based on TheFlow's IPV6 Use-After-Free (UAF), which was reported on HackerOne. The exploit strategy is for the most part based on TheFlow's BSD/PS4 PoC with some changes to accommodate the annoying PS5 memory layout (for more see Research Notes section). It establishes an arbitrary read / (semi-arbitrary) write primitive. This exploit and its capabilities have a lot of limitations, and as such, it's mostly intended for developers to play with to reverse engineer some parts of the system.

Also note; stability is fairly low, especially compared to PS4 exploits. This is due to the bug's nature of being tied to a race condition as well as the mitigations and memory layout of the PS5. This document will contain research info about the PS5, and this exploit will undergo continued development and improvements as time goes on.

This should now work on 4.03 as well as 4.50 firmware.

Those interested in contributing to PS5 research/dev can join a discord I have setup here.

Currently Included
  • Obtains arbitrary read/write and can run a basic RPC server for reads/writes (or a dump server for large reads) (must edit your own address/port into the exploit file on lines 673-677)
  • Enables debug settings menu (note: you will have to fully exit settings and go back in to see it).
  • Gets root privileges
Limitations
  • This exploit achieves read/write, but not code execution. This is because we cannot currently dump kernel code for gadgets, as kernel .text pages are marked as eXecute Only Memory (XOM). Attempting to read kernel .text pointers will panic!
  • As per the above + the hypervisor (HV) enforcing kernel write protection, this exploit also cannot install any patches or hooks into kernel space, which means no homebrew-related code for the time being.
  • Clang-based fine-grained Control Flow Integrity (CFI) is present and enforced.
  • Supervisor Mode Access Prevention/Execution (SMAP/SMEP) cannot be disabled, due to the HV.
  • The write primitive is somewhat constrained, as bytes 0x10-0x14 must be zero (or a valid network interface).
  • The exploit's stability is currently poor. More on this below.
  • On successful run, exit the browser with circle button, PS button panics for a currently unknown reason.
How to use
  1. Configure fakedns via dns.conf to point manuals.playstation.net to your PCs IP address
  2. Run fake dns: python fakedns.py -c dns.conf
  3. Run HTTPS server: python host.py
  4. Go into PS5 advanced network settings and set primary DNS to your PCs IP address and leave secondary at 0.0.0.0
    • Sometimes the manual still won't load and a restart is needed, unsure why it's really weird
  5. Go to user manual in settings and accept untrusted certificate prompt, run
  6. Optional: Run rpc/dump server scripts (note: address/port must be substituted in binary form into exploit.js).
Future work
  • Fix-up sockets to exit browser cleanly (top prio)
  • Write some data patches (second prio)
    • Enable debug settings
    • Patch creds for uid0
    • Jailbreak w/ cr_prison overwrite
  • Improve UAF reliability
  • Improve victim socket reliability (third prio)
  • Use a better / more consistent leak target than kqueue
Using RPC and Dumping Kernel .data

RPC


RPC is a very simple and limited setup.
  1. Edit your IP+port (if changed) into exploit.js.
  2. Run the server via python rpcserver.py, allow the PS5 to connect when the exploit finishes. The PS5 will send the kernel .data base address in ASCII and you can then send read and write commands. Example is below.
Code:
[RPC] Connection from: ('10.0.0.169', 59335)
[RPC] Received kernel .data base: 0x0xffffffff88530000
> r 0xffff81ce0334f000
42 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00
> w 0xffff81ce0334f004 0x1337
Wrote qword.
This setup is somewhat jank and a better system will be in place soon.

Dump
  1. Edit your IP+port (if changed) into exploit.js.
  2. Comment the RPC code in exploit.js and uncomment dumper code.
  3. Run the server via python dumpserver.py, allow the PS5 to connect and start dumping when exploit finishes. It will continue to dump data from the kernel base until it panics due to hitting unmapped memory. Note: read is somewhat slow at ~200kbps, so it may take 10 minutes or so to complete.
Exploit Stages

This exploit works in 5 stages, and for the most part follows the same exploit strategy as theflow's poc.
  1. Trigger the initial UAF on ip6_pktopts and get two sockets to point to the same pktopts / overlap (master socket <-> overlap spray socket)
  2. Free the pktopts on the master socket and fake it with an ip6_rthdr spray containing a tagged tclass overlap.
  3. Infoleak step. Use pktopts/rthdr overlap to leak a kqueue from the 0x200 slab and pktopts from the 0x100 slab.
  4. Arbitrary read/write step. Fake pktopts again and find the overlap socket to use IPV6_RTHDR as a read/write primitive.
  5. Cleanup + patch step. Increase refcount on corrupted sockets for successful browser exit + patch data to enable debug menu and patch ucreds for uid0.
Stability Notes

Stability for this exploit is at about 30%, and has multiple potential points of failure. In order of observed descending liklihood:
  1. Stage 1 causes more than one UAF due to failing to catch one or more in the reclaim, causing latent corruption that causes a panic some time later on.
  2. Stage 4 finds the overlap/victim socket, but the pktopts is the same as the master socket's, causing the "read" primitive to just read back the pointer you attempt to read instead of that pointer's contents. This needs some improvement and to be fixed if possible because it's really annoying.
  3. Stage 1's attempt to reclaim the UAF fails and something else steals the pointer, causing immediate panic.
  4. The kqueue leak fails and it fails to find a recognized kernel .data pointer.
  5. Leaving the browser through "unusual" means such as PS button, share button, or browser crash, will panic the kernel. Needs to be investigated.
Research Notes
  • It appears based on various testing and dumping with the read primitive, that the PS5 has reverted back to 0x1000 page size compared to the PS4's 0x4000.
  • It also seems on PS5 that adjacent pages rarely belong to the same slab, as you'll get vastly different data in adjacent pages. Memory layout seems more scattered.
  • Often when the PS5 panics (at least in webkit context), there will be awful audio output as the audio buffer gets corrupted in some way.
  • Sometimes this audio corruption persists to the next boot, unsure why.
  • Similar to PS4, the PS5 will require the power button to be manually pressed on the console twice to restart after a panic.
  • It is normal for the PS5 to take an absurd amount of time to reboot from a panic if it's isolated from the internet (unfortunately). Expect boot to take 3-4 minutes.
Contributors / Special Thanks
Thanks to testers
  • Dizz (4.50)
:arrow: Related Tweets

Cheers to LeGenD_ArMoUR_ and @tecniqueza on Twitter for sharing the images below! šŸ»
PS5 4.03 4.50 Kernel Exploit, BD-JB PS5 Loader & PS5 FTP Payload!.png

PS5 4.03 4.50 Kernel Exploit, BD-JB PS5 Loader & PS5 FTP Payload!.jpg
 

Comments

kevinj93

Staff Member
Moderator
Verified
Amazing work and a very fast progress! Will this make dumping PS4 games with newer firmware possible? I know great job is being done dumping the games using some hidden methods, but I'm just curious if that's the case with this ftp payload for the PS5.
 

Doyle444

Senior Member
Contributor
Verified
@kevinj93
I think this JB has been out in the wild for some people and has been kept under wraps.

I think there's more too it and the people doing the games have whats needed, hopefully not long until more user content comes.
 

gaugeisgod

Senior Member
Contributor
Verified
Does the bd-j not have debug menu? I got it to finally let me go back onto the home screen keeping the player open on the final prompt and it added no debug.
 
Status
Not open for further replies.
Top