Last active
July 12, 2024 14:42
-
-
Save k4lizen/5d27816d410013535f808835cc46d7ed to your computer and use it in GitHub Desktop.
kernel pwn: Compress initramfs with statically linked exploit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Compress initramfs with the included statically linked exploit | |
in=$1 | |
out=$(echo $in | awk '{ print substr( $0, 1, length($0)-2 ) }') | |
gcc $in -static -o $out || exit 255 | |
mv $out initramfs | |
pushd . && pushd initramfs | |
find . -print0 | cpio --null --format=newc -o 2>/dev/null | gzip -9 > ../initramfs.cpio.gz | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment