Vulnversity
Tasks:
- Deploy the machine.
- Reconnaissance:
- Do nmap version scan , find port used by apache and also OS(Ubuntu)
- Answer all questions based on nmap output.
- Locating directories using GoBuster:
- Use gobuster to bruteforce directories using any directory word list, There will be /internal/ directory.
- /internal/ directory has file upload functionality.
- Compromise the webserver:
- Try to upload php shell with various extensions such as .php,.php3,.php4,.php5,.phtml - only .phtml succeeds.
- Do one more directory search in /internal/ directory - You will find /internal/uploads/ directory which has uploaded shell in it.
- Connect to reverse shell by using nc in linux or ncat in windows - You have got local access to machine now . (you answer all the questions in the task now after cd to /home/ directory)
- Privilege Escalation:
- Search for binaries with suid permission
- systemctl has suid permission
- make a service which copies /root/root.txt to /tmp/ or make a service which startes reverse shell to attacker machine, make sure User is set as root for service.
- Enable and start the service using systemctl - you are now root !!!
- Report root flag in /tmp/root.txt or /root/root.txt(reverse shell case).
References: