Skip to content

Commit e32842a

Browse files
authored
Merge pull request #4 from SoftwareRat/LLA
Finally: pppwn_live with GoldHEN 2.4b18
2 parents 7c2ee71 + 5b42f15 commit e32842a

File tree

4 files changed

+147
-46
lines changed

4 files changed

+147
-46
lines changed

.github/workflows/ci.yaml

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ jobs:
2626
with:
2727
submodules: true
2828

29-
- name: Setup Alpine Linux for ${{ matrix.architecture }}
30-
uses: jirutka/setup-alpine@v1
29+
- name: Set up Alpine Linux environment
30+
uses: jirutka/setup-alpine@v1.2.0
3131
with:
3232
arch: ${{ matrix.architecture }}
33-
branch: edge
33+
branch: latest-stable
3434
packages: |
3535
alpine-sdk
3636
alpine-conf
@@ -47,55 +47,78 @@ jobs:
4747
wget
4848
mtools
4949
dosfstools
50+
7zip
51+
curl
52+
jq
5053
shell-name: alpine
5154

5255
- name: Prepare PPPwn binaries
5356
shell: alpine --root {0}
5457
env:
5558
ARCH: ${{ matrix.architecture }}
5659
run: |
57-
echo "ARCH is $ARCH"
60+
set -e
61+
echo "Preparing PPPwn binaries for ${ARCH}..."
5862
mkdir -p /tmp/pppwnlive
5963
cd /tmp/pppwnlive
60-
wget https://github.com/xfangfang/PPPwn_cpp/releases/latest/download/${ARCH}-linux-musl.zip
64+
65+
# Download and extract binaries with retries
66+
for attempt in {1..3}; do
67+
wget https://github.com/xfangfang/PPPwn_cpp/releases/latest/download/${ARCH}-linux-musl.zip && break || sleep 5
68+
done
6169
unzip -p ${ARCH}-linux-musl.zip | tar -xzOf - pppwn > pppwn && rm ${ARCH}-linux-musl.zip
70+
6271
wget https://github.com/B-Dem/PPPwnUI/raw/main/PPPwn/goldhen/1100/stage1.bin
63-
wget https://github.com/B-Dem/PPPwnUI/raw/main/PPPwn/goldhen/1100/stage2.bin
72+
curl -L -o GoldHEN.7z $(curl -s https://api.github.com/repos/GoldHEN/GoldHEN/releases | jq -r '.[0].assets[0].browser_download_url')
73+
7zz e GoldHEN.7z pppnw_stage2/stage2_v*.7z -r -aoa
74+
7zz e stage2_v*.7z stage2_11.00.bin -r -aoa
75+
mv stage2_11.00.bin stage2.bin
76+
rm GoldHEN.7z stage2_v*.7z
6477
cd /tmp
6578
tar -czf pppwn.tar.gz pppwnlive/*
6679
67-
- name: Install required packages
80+
- name: Install required packages and setup environment
6881
shell: alpine --root {0}
6982
env:
7083
ARCH: ${{ matrix.architecture }}
7184
run: |
85+
set -e
86+
echo "Installing required packages and setting up environment for ${ARCH}..."
7287
find /tmp -name "pppwn.tar.gz" -exec cp {} aports/scripts/pppwn.tar.gz \;
73-
echo "permit nopass root" | tee -a /etc/doas.conf
88+
echo "permit nopass root" > /etc/doas.conf
7489
abuild-keygen -i -a -n -q
75-
apk update
90+
91+
echo "http://dl-2.alpinelinux.org/alpine/latest-stable/main" > /etc/apk/repositories
92+
for i in {1..3}; do apk update && break || sleep 5; done
7693
mkdir -p ~/tmp ~/work/iso/${ARCH}
7794
export TMPDIR=~/tmp
7895
cp -rf custom/* aports/scripts/
7996
chmod +x aports/scripts/*
80-
ln -s /usr/lib/libalpine.sh /lib/libalpine.sh
8197
8298
- name: Build ISO
8399
shell: alpine --root {0}
84100
env:
85101
ARCH: ${{ matrix.architecture }}
86102
run: |
103+
set -e
87104
echo "Building ISO for ${ARCH}..."
88-
sh aports/scripts/mkimage.sh --tag edge --outdir ~/work/iso/${ARCH} --arch ${ARCH} --repository https://dl-cdn.alpinelinux.org/alpine/edge/main --profile pppwn
89-
mv ~/work/iso/${ARCH}/alpine-pppwn-edge-${ARCH}.iso ~/work/iso/${ARCH}/pppwn-live-${ARCH}.iso
105+
sh aports/scripts/mkimage.sh --tag stable --outdir ~/work/iso/${ARCH} --arch ${ARCH} --repository https://dl-cdn.alpinelinux.org/alpine/latest-stable/main --profile pppwn > /var/log/mkimage.log 2>&1 \
106+
|| (cat /var/log/mkimage.log || echo "No log found"; exit 1)
107+
ISO_PATH=$(find ~/work/iso/${ARCH} -name "alpine-*.iso" -print -quit)
108+
if [ -z "$ISO_PATH" ]; then
109+
echo "ISO not found!"
110+
exit 1
111+
fi
112+
mv "$ISO_PATH" ~/work/iso/${ARCH}/pppwn-live-${ARCH}.iso
90113
91114
- name: Upload ISO artifact
92115
uses: actions/upload-artifact@v4
93116
with:
94117
name: pppwn-live-${{ matrix.architecture }}-iso
95-
path: |
96-
~/work/iso/${{ matrix.architecture }}/*.iso
118+
path: ~/work/iso/${{ matrix.architecture }}/*.iso
97119

98120
create_release:
121+
if: github.ref == 'refs/heads/main'
99122
needs: build_iso
100123
runs-on: ubuntu-latest
101124
steps:
@@ -107,6 +130,7 @@ jobs:
107130
- name: Calculate SHA256 hashes
108131
id: sha256
109132
run: |
133+
echo "Calculating SHA256 checksums for each architecture..."
110134
SHA256_X86=$(sha256sum ./iso_images/pppwn-live-x86_64-iso/pppwn-live-x86_64.iso | awk '{print $1}')
111135
SHA256_AARCH64=$(sha256sum ./iso_images/pppwn-live-aarch64-iso/pppwn-live-aarch64.iso | awk '{print $1}')
112136
echo "sha256_x86=$SHA256_X86" >> $GITHUB_OUTPUT
@@ -121,12 +145,12 @@ jobs:
121145
122146
Changelog:
123147
${{ github.event.head_commit.message }}
124-
148+
125149
SHA256 Checksums:
126150
- x86_64: `${{ steps.sha256.outputs.sha256_x86 }}`
127151
- aarch64: `${{ steps.sha256.outputs.sha256_aarch64 }}`
128152
files: |
129153
./iso_images/pppwn-live-x86_64-iso/pppwn-live-x86_64.iso
130154
./iso_images/pppwn-live-aarch64-iso/pppwn-live-aarch64.iso
131155
env:
132-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
156+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# PPPwnLive
2-
# ⚠️ [Work is already underway on a new ISO for GoldHEN v2.4b18](https://github.com/SoftwareRat/pppwn_live/issues/3)
32

43
`pppwn_live` is a Linux live ISO based on Alpine Linux, designed to run [pppwn_cpp](https://github.com/xfangfang/PPPwn_cpp), a PS4 exploit, directly from the ISO on any PC. The system automatically shuts down after completing its tasks.
54

custom/genapkovl-pppwn.sh

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,42 @@
44
HOSTNAME="PPPwnLive"
55

66
cleanup() {
7-
rm -rf "$tmp"
7+
rm -rf "$tmp"
88
}
99

1010
makefile() {
11-
OWNER="$1"
12-
PERMS="$2"
13-
FILENAME="$3"
14-
cat > "$FILENAME"
15-
chown "$OWNER" "$FILENAME"
16-
chmod "$PERMS" "$FILENAME"
11+
OWNER="$1"
12+
PERMS="$2"
13+
FILENAME="$3"
14+
cat > "$FILENAME"
15+
chown "$OWNER" "$FILENAME"
16+
chmod "$PERMS" "$FILENAME"
1717
}
1818

1919
rc_add() {
20-
mkdir -p "$tmp"/etc/runlevels/"$2"
21-
ln -sf /etc/init.d/"$1" "$tmp"/etc/runlevels/"$2"/"$1"
20+
mkdir -p "$tmp"/etc/runlevels/"$2"
21+
ln -sf /etc/init.d/"$1" "$tmp"/etc/runlevels/"$2"/"$1"
2222
}
2323

2424
tmp="$(mktemp -d)"
2525
trap cleanup exit
2626

27+
# Create base directories
2728
mkdir -p "$tmp"/etc
2829
mkdir -p "$tmp"/etc/init.d
2930
mkdir -p "$tmp"/etc/profile.d
3031
mkdir -p "$tmp"/etc/apk
3132
mkdir -p "$tmp"/root
3233

33-
# WAR: Search for an aports/scripts/pppwn.tar.gz file in the home directory and copy it to "$tmp"/etc/
34+
# Copy PPPwn payload
3435
find ~ -path "*/aports/scripts/pppwn.tar.gz" -exec cp {} "$tmp"/etc/pppwn.tar.gz \;
3536

37+
# Create hostname file
3638
makefile root:root 0644 "$tmp"/etc/hostname <<EOF
3739
$HOSTNAME
3840
EOF
3941

42+
# Configure network interfaces
4043
mkdir -p "$tmp"/etc/network
4144
makefile root:root 0644 "$tmp"/etc/network/interfaces <<EOF
4245
auto lo
@@ -46,6 +49,7 @@ auto eth0
4649
iface eth0 inet dhcp
4750
EOF
4851

52+
# Set up package list
4953
makefile root:root 0644 "$tmp"/etc/apk/world <<EOF
5054
alpine-base
5155
busybox
@@ -54,7 +58,7 @@ bash
5458
agetty
5559
EOF
5660

57-
# Configure /etc/inittab for auto-login
61+
# Configure auto-login inittab
5862
mkdir -p "$tmp/etc"
5963
makefile root:root 0755 "$tmp"/etc/inittab <<EOF
6064
# /etc/inittab
@@ -71,6 +75,7 @@ tty2::respawn:/sbin/getty 38400 tty2
7175
ttyS0::respawn:/sbin/getty -L 0 ttyS0 vt100
7276
EOF
7377

78+
# Create welcome banner
7479
makefile root:root 0644 "$tmp"/etc/profile.d/motd.sh <<EOF
7580
#!/bin/bash
7681
clear
@@ -87,6 +92,7 @@ echo -e "- \033[1;34mxfangfang\033[0m (\033[4mhttps://github.com/xfangfang/PPPwn
8792
echo -e "- \033[1;34mTheFloW\033[0m (\033[4mhttps://github.com/TheOfficialFloW/PPPwn\033[0m) for the original discovery and creation of PPPwn"
8893
EOF
8994

95+
# Create setup script
9096
makefile root:root 0755 "$tmp"/etc/setup.sh <<EOF
9197
#!/bin/sh
9298
@@ -116,12 +122,12 @@ else
116122
fi
117123
EOF
118124

119-
# Use /root/.profile to automatically run /etc/setup.sh
125+
# Create profile for auto-execution
120126
makefile root:root 0644 "$tmp"/etc/.profile <<EOF
121127
/etc/setup.sh
122128
EOF
123129

124-
# WAR: Create an OpenRC service to move the profile
130+
# Create profile mover service
125131
makefile root:root 0755 "$tmp"/etc/init.d/move-profile <<EOF
126132
#!/sbin/openrc-run
127133
@@ -135,11 +141,11 @@ depend() {
135141
start() {
136142
ebegin "Moving /etc/.profile to /root/.profile"
137143
mv /etc/.profile /root/.profile 2>/dev/null
138-
eend $?
144+
eend \$?
139145
}
140146
EOF
141147

142-
# Enable necessary services for networking
148+
# Enable necessary services
143149
rc_add devfs sysinit
144150
rc_add dmesg sysinit
145151
rc_add mdev sysinit
@@ -157,4 +163,6 @@ rc_add move-profile boot
157163
rc_add mount-ro shutdown
158164
rc_add killprocs shutdown
159165
rc_add savecache shutdown
160-
tar -c -C "$tmp" etc | gzip -9n > $HOSTNAME.apkovl.tar.gz
166+
167+
# Create final archive
168+
tar -c -C "$tmp" etc | gzip -9n > $HOSTNAME.apkovl.tar.gz

custom/mkimg.pppwn.sh

Lines changed: 83 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,103 @@
11
#!/bin/sh
22

3+
# Add this function to handle kernel module compression
4+
generate_modloop() {
5+
local kernel_ver="$1"
6+
local modloop="$2"
7+
8+
# Create a temporary directory for modules
9+
mkdir -p /tmp/modloop
10+
11+
# Copy modules to the temporary directory
12+
cp -a /lib/modules/${kernel_ver} /tmp/modloop/
13+
14+
# Compress modules using xz with maximum compression
15+
cd /tmp/modloop
16+
if ! tar -cJf "$modloop" lib/modules/${kernel_ver}; then
17+
echo "Error: Failed to create modloop tarball"
18+
ls -l /tmp/modloop
19+
exit 1
20+
fi
21+
22+
# Clean up
23+
rm -rf /tmp/modloop
24+
}
25+
326
profile_pppwn() {
427
profile_standard
528
profile_abbrev="pppwn"
6-
title="Extended"
7-
desc="Contains only the minimal.
8-
Designed to run the PPPwn jailbreak.
9-
For the PlayStation 4"
10-
kernel_cmdline="unionfs_size=512M console=tty0 console=ttyS0,115200"
11-
boot_addons=""
29+
kernel_cmdline="unionfs_size=128M console=tty0 console=ttyS0,115200 quiet loglevel=0 rd.systemd.show_status=auto nowatchdog rd.plymouth=0 plymouth.enable=0 mitigations=off nospectre_v2"
30+
title="Nano"
31+
desc="Hyper-minimal profile for PS4 PPPwn jailbreak
32+
Absolute bare-metal footprint, optimized for single-purpose exploit"
1233
apks="alpine-base busybox openrc bash agetty"
34+
boot_addons=""
35+
1336
local _k _a
1437
for _k in $kernel_flavors; do
15-
apks="$apks linux-$_k"
38+
apks="$apks linux-$_k linux-firmware-none"
1639
for _a in $kernel_addons; do
17-
apks="$apks $_a-$_k"
40+
apks="$apks ${_a}-${_k}"
1841
done
1942
done
2043

21-
apks="$apks linux-firmware-none"
22-
2344
case "$ARCH" in
2445
x86*|amd64)
25-
boot_addons="amd-ucode intel-ucode"
26-
initrd_ucode="/boot/amd-ucode.img /boot/intel-ucode.img"
46+
boot_addons="intel-ucode amd-ucode"
47+
initrd_ucode="/boot/intel-ucode.img /boot/amd-ucode.img"
2748
syslinux_serial="0 115200"
2849
apks="$apks syslinux"
50+
kernel_cmdline="$kernel_cmdline idle=nomwait processor.max_cstate=1"
51+
;;
52+
aarch64)
53+
# Nothing (yet)
2954
;;
3055
esac
3156

3257
apkovl="aports/scripts/genapkovl-pppwn.sh"
33-
}
58+
apks="$apks --no-cache"
59+
60+
post_build() {
61+
rm -rf /usr/share/doc/* /usr/share/man/* /usr/share/info/*
62+
find / -type f -name "*.a" -delete
63+
find / -type f -name "*.la" -delete
64+
65+
local kernel_ver=$(ls /lib/modules | head -n1)
66+
generate_modloop "$kernel_ver" "/boot/modloop-lts"
67+
}
68+
}
69+
70+
filter_packages() {
71+
local keep_packages="
72+
alpine-base
73+
busybox
74+
bash
75+
linux-firmware-none
76+
syslinux
77+
openrc
78+
"
79+
80+
for pkg in $(apk search | grep -E '^(alpine-base|busybox|bash|linux-|syslinux|openrc)'); do
81+
if echo "$keep_packages" | grep -qw "${pkg%%=*}"; then
82+
echo "$pkg"
83+
fi
84+
done
85+
}
86+
87+
generate_minimal_initramfs() {
88+
local kernel_version="$1"
89+
mkdir -p /tmp/initramfs/{bin,dev,etc,lib,proc,sys}
90+
cp /bin/busybox /tmp/initramfs/bin/
91+
mknod -m 666 /tmp/initramfs/dev/null c 1 3
92+
mknod -m 666 /tmp/initramfs/dev/zero c 1 5
93+
94+
cat > /tmp/initramfs/init << 'EOF'
95+
#!/bin/busybox sh
96+
mount -t proc none /proc
97+
mount -t sysfs none /sys
98+
exec /bin/sh
99+
EOF
100+
chmod +x /tmp/initramfs/init
101+
cd /tmp/initramfs
102+
find . | cpio -H newc -o | gzip > "/boot/initramfs-${kernel_version}"
103+
}

0 commit comments

Comments
 (0)