Hackthebox Waldo Writeup
19 Feb 2019
Explanation
Hackthebox is a website which has bunch of vulnerable machines in its own VPN.
This is a write-up of machine “Waldo” on that website.
Solution
1. Initial Enumeration
Port Scanning:
Gobuster HTTP:
2.Getting User
Sounds like an interesting web page is running on the server.
By inspecting with chrome development tool, we can find that it is html web page and controlled by “list.js”.
In that file, there are some interesting php path in some functions.
For instance, dirRead.php has Directory Traversal(?).
Which means we can see any directory on Waldo if we have a permission.
In addition, by taking advantage of fileRead.php, we can achieve one private key of private key for user nobody.
we can use it by command “ssh -i”
3.Getting root
We can find an interesting private key file in /home/monitor/.ssh
By following command, we can get out of docker container as user “monitor”.
Without doing something, even we can not do “cd”.
To bypass restricted shell, we can take advantage of red command.
Then, we can find a file which has weak permission (capability).
We found tac command.
Finally, what we have to do is specify full path of tac command and root.txt