Created
September 2, 2022 06:57
-
-
Save brant-ruan/b67dc2fbae150e7bc76fda914816f534 to your computer and use it in GitHub Desktop.
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