Skip to content

Instantly share code, notes, and snippets.

@brant-ruan
Created September 2, 2022 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brant-ruan/b67dc2fbae150e7bc76fda914816f534 to your computer and use it in GitHub Desktop.
Save brant-ruan/b67dc2fbae150e7bc76fda914816f534 to your computer and use it in GitHub Desktop.
#!/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