Skip to content

Commit 5340b73

Browse files
author
CelesteBlue-dev
authored
add 4.05 files
1 parent 343474d commit 5340b73

32 files changed

+4747
-0
lines changed

405/Makefile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
LIBPS4 := $(PS4SDK)/libPS4
2+
3+
TEXT := 0x926200000
4+
DATA := 0x926300000
5+
6+
CC := gcc
7+
AS := gcc
8+
OBJCOPY := objcopy
9+
ODIR := build
10+
SDIR := source
11+
IDIRS := -I$(LIBPS4)/include -I. -Iinclude
12+
LDIRS := -L$(LIBPS4) -L. -Llib
13+
CFLAGS := $(IDIRS) -O3 -std=gnu11 -fno-builtin -nostartfiles -nostdlib -Wall -masm=intel -march=btver2 -mtune=btver2 -m64 -mabi=sysv -mcmodel=large
14+
SFLAGS := -nostartfiles -nostdlib -masm=intel -march=btver2 -mtune=btver2 -m64 -mabi=sysv -mcmodel=large
15+
LFLAGS := $(LDIRS) -Xlinker -T $(LIBPS4)/linker.x -Wl,--build-id=none -Ttext=$(TEXT) -Tdata=$(DATA)
16+
CFILES := $(wildcard $(SDIR)/*.c)
17+
SFILES := $(wildcard $(SDIR)/*.s)
18+
OBJS := $(patsubst $(SDIR)/%.c, $(ODIR)/%.o, $(CFILES)) $(patsubst $(SDIR)/%.s, $(ODIR)/%.o, $(SFILES))
19+
20+
LIBS := -lPS4
21+
22+
TARGET = $(shell basename $(CURDIR)).bin
23+
24+
$(TARGET): $(ODIR) $(OBJS)
25+
$(CC) $(LIBPS4)/crt0.s $(ODIR)/*.o -o temp.t $(CFLAGS) $(LFLAGS) $(LIBS)
26+
$(OBJCOPY) -R .sc_rop temp.t temp.u
27+
$(OBJCOPY) -O binary temp.u $(TARGET)
28+
rm -f temp.t temp.u
29+
30+
$(ODIR)/%.o: $(SDIR)/%.c
31+
$(CC) -c -o $@ $< $(CFLAGS)
32+
33+
$(ODIR)/%.o: $(SDIR)/%.s
34+
$(AS) -c -o $@ $< $(SFLAGS)
35+
36+
$(ODIR):
37+
@mkdir $@
38+
39+
.PHONY: clean
40+
41+
clean:
42+
rm -f $(TARGET) $(ODIR)/*.o

405/build.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
pushd tool
6+
make
7+
popd
8+
9+
make
10+
11+
tool/bin2js ps4-pkg2usb.bin > exploit/payload.js

405/clean.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
pushd tool
4+
make clean
5+
popd
6+
7+
make clean
8+
9+
rm -f *.bin

405/exploit/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# PS4 4.05 Kernel Exploit
2+
---
3+
## Summary
4+
In this project you will find a full implementation of the "namedobj" kernel exploit for the PlayStation 4 on 4.05. It will allow you to run arbitrary code as kernel, to allow jailbreaking and kernel-level modifications to the system. This release contain game Dumper for PS4 payload code by Vortex
5+
6+
You can find fail0verflow's original write-up on the bug [here](https://fail0verflow.com/blog/2017/ps4-namedobj-exploit/), you can find my technical write-up which dives more into implementation specifics [here](https://github.com/Cryptogenic/Exploit-Writeups/blob/master/PS4/%22NamedObj%22%204.05%20Kernel%20Exploit%20Writeup.md).
7+
8+
## Patches Included
9+
The following patches are made by default in the kernel ROP chain:
10+
1) Disable kernel write protection
11+
2) Allow RWX (read-write-execute) memory mapping
12+
3) Dynamic Resolving (`sys_dynlib_dlsym`) allowed from any process
13+
4) Custom system call #11 (`kexec()`) to execute arbitrary code in kernel mode
14+
5) Allow unprivileged users to call `setuid(0)` successfully. Works as a status check, doubles as a privilege escalation.
15+
6) Game dumper for PS4 payload code by Vortex
16+
17+
## Notes
18+
- This exploit is actually incredibly stable at around 95% in my tests. WebKit very rarely crashes and the same is true with kernel.
19+
- I've built in a patch so the kernel exploit will only run once on the system. You can still make additional patches via payloads.
20+
- A custom syscall is added (#11) to execute any RWX memory in kernel mode, this can be used to execute payloads that want to do fun things like jailbreaking and patching the kernel.
21+
- An SDK is not provided in this release, however a barebones one to get started with may be released at a later date.
22+
23+
## Contributors
24+
I was not alone in this exploit's development, and would like to thank those who helped me along the way below.
25+
26+
- [qwertyoruiopz](https://twitter.com/qwertyoruiopz)
27+
- [Flatz](https://twitter.com/flat_z)
28+
- [CTurt](https://twitter.com/CTurtE)
29+
- [IDC](https://twitter.com/3226_2143)
30+
- Anonymous

0 commit comments

Comments
 (0)