This website collects cookies to deliver better user experience
Writeup: HackTheBox OpenAdmin - Without Metasploit (OSCP Prep)
Writeup: HackTheBox OpenAdmin - Without Metasploit (OSCP Prep)
I recently completed the OpenAdmin box from Hackthebox. While this box was rated as being easy it was a little tricky to get my footing and working around the box.
Command:
nmap -sC -sV -O -T4 -p- -oN nmap.txt 10.10.10.171
Ports Open:
22 OpenSSH 7.6p1, Is the main tool for connecting remote login with SSH. SSH encrypts all the traffic as well as providing Securing tunneling plus some other cool things.
80 Apache httpD 2.4.29, This is a free and open-source cross-platform web server. Mostly these servers run on Linux but some of the current/up-to-date ones run on Windows.
Being that I like messing around the website first I will skip over the first port and head directly over to the site.
So nothing too interesting here for me. So lets, fire up some Directory Busting tools.
-o = Will capture this in an output so if you want to clear your screen after it runs you can.
After some time we should get a pretty long list for directories found.
After getting the results we can now head over to the sites that were discovered. It appears to be some landing pages that don't provide too much information for us.
But after we get to the /music location it appears to be a login section which wasn't on the other sites.
Clicking on the login button should bring up a new page called /ona.
Searching on the page brings up the below User Info page. It shows us as being logged in as an guest and that the Database is running on mysqli.
Searching around some and we are able to find the version information.
v18.1.1
When typing ona v18.1.1 into Google, it provides us with the following.
OpenNetAdmin v18.1.1
OpenNetAdmin provides a database managed inventory of your IP network. Each subnet, host, and IP can be tracked via a centralized AJAX enabled web interface that can help reduce tracking errors. A full CLI interface is available as well to use for scripting and bulk work.
Now that we have this key information let's check for any exploits on Kali that we can use for it.
The code above will push out a pseudo-shell for us.
Before running the code you will need to reformat it.
Command:
dos2unix 47691.sh
Command:
./47691.sh 10.10.10.171/ona/
This will bring up a limited shell on the machine. I decided to use another python script instead, so depending on what you want to do the option is yours.
I am going to check around on the box for any hidden files, while doing this I come across the following 2 users.
After some additional searches on the box I come across the following password for the localhost.
Save these creds to a file.
Now review the file to make sure.
Command:
cat password
Remember that there was a SSH port open before. I am going to try and use the usernames we found with the password we just discovered to login.
Something should have stuck out to you. When I copied that Password to my file I left out the ! by accident. Make sure you are paying close attention to this when you are running on a box.
No try this again with the !.
Let's look at what is running here.
Command:
netstat -a
We can see that a localhost:52846.
While looking at this directory, I see a file called main.php.
I tried to cat it but didn't show much from there so I am going to use Curl with the knowledge that netstat showed there is something running here at the localhost port 52846.