OpenAdmin

#Windows #Enumeration #Web-Exploitation

OpenAdmin is an easy-rated Windows machine from HackTheBox created by del_KZx497Ju. In the current post, my IP is 10.10.14.76, and the target’s IP is 10.129.214.71.

This machine is straightforward once you find the Admin login page. It features an outdated OpenNetAdmin CMS. From here, you can move to enter the machine as a low privileged user, then jump to a second user by using its credentials located at a local application, then escalate by a sudo misconfiguration with nano.

Gather Information

Before doing anything, always start using ping to see if this is working

Local Terminal
ping -c 1 10.129.214.71
Output, the TTL is close to 64 so it is a Linux related machine
Nmap’s output, looks like a simple website.
Confirms the previous statement
Whatweb’s output, There is no domain.

Right now the best option is to explore the website content.

  • Browser: http://10.129.214.71

Default page

Definitively is just an Ubuntu Default Page, nothing special, unless you press CTRL+U

Still, default information, there is nothing relevant at https://launchpad.net/bugs/1288690

At this moment, we don’t have any important information, our best option is to search for resources. So we are going to use Wfuzz in colorized format (-c) with 200 threats (-t 200) using a dictionary (-w), while hiding the response status 404 (--hc=404), add try at FUZZ

Bugged output from WFuzz, will be fixed in future post.

Ok, there are three payloads that make sense, let’s try with “artwork”, then “music”, and “sierra”

  • Browser: http://10.129.214.71/artwork/

After exploring the website, I didn’t found anything.
  • Browser: http://10.129.214.71/music

After exploring, there was something only at Login, this looks like a Content Manager
Open Net Admin’s Interface

Let’s search if “OpenNetAdmin” have vulnerabilities at the database.

Part 1 from Searchploit
Part 2 from Searchploit

Weaponization and Exploitation

Look, there is a bash script for the version 18.1.1, this means that we can use that exploit. Copy and paste the code from https://www.exploit-db.com/exploits/47691 to a file called exploit.sh, and at URL, paste the target ONA URL and run the script.

It works, this bash prompt will be TargetTerminal as user www-data

And now, to improve our terminal, we need to create an html file and oblige the target to read it. Open two terminals, TermA and TermB.

Content of index.html

Read the file from 10.10.14.76 with bash

We are in, now the TermB is TargetTerminal as www-data

Now our best option is to do an tty treatment.

Now we need to hunt for their passwords to login

We found something with an interesting name.
Someone’s password: n1nj4W4rri0R!
List of users

We have a password, so now we can test that with every user

It was Jimmy’s password, now your Target Terminal is user Jimmy
There is nothing at Jimmy’s folder
Content of main.php, joanna’s id_rsa.

Ok, now we are going to check the configuration.

There is something in that port, let’s try a curl to prove is exist, if this exist, by using that location we will be able to execute commands as the user “Joanna” and execute main.php

Content of reverse.Shell.php
Output: Joanna

Is nice to know that, but previously we see that in main.php, we can call the RSA Private Key of the user Joanna, is an easier way.

Copy the RSA

Paste the content in a file in your local machine and open a Terminal.

But hey, it does not works, this is because the id_rsa is encrypted, you can see that in the second row {Proc-Type: 4, ENCRYPTED}, first we need to download the tool https://github.com/openwall/john/blob/bleeding-jumbo/run/ssh2john.py, and decrypt the id_rsa.

Now your LocalTerm is TargetJoanna

Privileges Scalation

File that can be executed as root using user joanna, in this case: Command nano

As you can see, we can execute the command nano to the file /opt/priv without passwords. This means that we can execute commands inside that file without requiring a password

Command to execute
Output

It works, this is a nice chance to give admin permission as root to the /bin/bash file for every user.

Done, and exit with CTRL + X

Last updated