Hackthebox - Poison

  • FreeBsd (Unix)

Poison

Nmap

Port 80

  • If we go on the website we have this page Website

  • The listfiles.php seems interesting

  • Let's have a look at the password backup

It says the password has been encoded at list 13 times. Let's go to cyberchef and try to add the recipe "frombase64" 13 times or more until it gets decrypted. And it works!!

Poison decrypted
  • On the website using the form we can show /etc/passwd

Initial foothold

We can use the password to connect with ssh. and the user charix because it is less likely to work with root.

And it works

  • We can get the user flag now cat user.txt

  • when we list the files we have a secret.zip we can take in our machine and try to unzip it with the password

The file is not readable using cat

Privesc

  • With ps -aux we see a vnc process root 529 0.0 0.9 23620 8868 v0- I 00:08 0:00.02 Xvnc :1 -desktop X -httpd /usr/local/share/tightvnc/classes -auth /root/.Xauthority -geometry 1280x800 -depth 24 -rfbwait 120000 -rfbauth /root/.

  • With ps -auxww we get more information we see that it is running on port 5901.

  • We need to use ssh port forwarding to interact more easily with this process ssh -L 5901:127.0.0.1:5901 charix@10.10.10.84 I should be able to access vnc with my port 5901

  • With some research on vnc it seems like the password file we found in the zip can be used to access the process vncviewer 127.0.0.1:5901 -passwd secret

  • We get a root shell and can have the flag

Resources

Rana's writeup is very detailed because she shows 3 different way to gain initial foothold

Writeup Poison - Rana Khalil - Gitbook

Last updated