From nmap, there are several services opened.

Local Picture

Local Picture

Ftp accepts anonymous login. Base64 decode drupal.txt.enc, it’s openssl encoded data with salted password. I use bruteforce-salted-openssl to get the password friends.

Local Picture

Local Picture

Use openssl to decrypt data. I got the username and password of the portal.

Local Picture

This is the web page.

Local Picture

This is another web page at port 8082. Remote connection is disabled, maybe I’ll check it when I got a shell from the server.

Local Picture

After login to Drupal, I enabled the php module.

Local Picture

Local Picture

Create a php reverse shell in an article. Preview it, and got the reverse shell as www-data.

Local Picture

Local Picture

Local Picture

Local Picture

In settings.php, I got the drupal database credential.

Local Picture

Local Picture

I found that I can ssh to the server as daniel with the password from settings.php.

Local Picture

I forwarded port 8082 to local for better analysis.

Local Picture

It’s running H2 console, and I can use it to connect to drupal database.

Local Picture

Local Picture

Local Picture

I found a blog post about getting shell from H2 console.

Local Picture

Follow the blog post, I can do RCE as root. But I have trouble getting a reverse shell directly.

Local Picture

Local Picture

I create a reverse shell script on the server, and run it from H2 console.

Local Picture

Local Picture

After that, I got a reverse shell as root.

Local Picture