From nmap, there are ssh and http service.

Local Picture

This is the web page.

Local Picture

With gobuster, we found that there is a directory /ona/, which is running OpenNetAdmin.

Local Picture

I tried to use the shell script in searchsploit for OpenNetAdmin.

Local Picture

I input an urlencoded reverse shell command for ${cmd}.

Local Picture

And we get a reverse shell as www-data. However, we cannot access jimmy and joanna’s directory.

Local Picture

In /var/www/html/ona/local/config/database_settings.inc.php, I get the password.

Local Picture

With this password, I successfully connect to ssh as jimmy.

Local Picture

In /var/www/internal/, there is main.php, which will print joanna’s id_rsa.

Local Picture

With netstat, I found that it should be listened on port 52846 locally. I curl localhost at that port to get id_rsa.

Local Picture

I use john the ripper to get its passphrase bloodninjas.

Local Picture

I connect to ssh with that key and get user.txt. With sudo -l, I found that I can run /bin/nano /opt/priv with anyone’s privilege.

Local Picture

Run it, ^R^X, and type reset;sh 1>&0 2>&0. I get the shell as root.

Local Picture