Skip to main content

HTB - OpenAdmin

OpenAdmin

Basic Nmap scan

Nmap command: nmap -Pn -n -sC -sV -oA scan_boxs/openadmin/nmap/10.10.10.171-d-scan 10.10.10.171
Nmap scan report for 10.10.10.171
Host is up (0.14s latency).
Not shown: 998 closed tcp ports (conn-refused)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 4b98df85d17ef03dda48cdbc9200b754 (RSA)
| 256 dceb3dc944d118b122b4cfdebd6c7a54 (ECDSA)
|_ 256 dcadca3c11315b6fe6a489347c9be550 (ED25519)
80/tcp open http Apache httpd 2.4.29 ((Ubuntu))
|_http-title: Apache2 Ubuntu Default Page: It works
|_http-server-header: Apache/2.4.29 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Open ports : 22,80

PORTSERVICEPRODUCTVERSIONEXTRAINFO
22sshOpenSSH7.6p1 Ubuntu 4ubuntu0.3Ubuntu Linux; protocol 2.0
80httpApache httpd2.4.29(Ubuntu)

Enum port 80

This is a default apache page. Not much information is available here

alt

Gobuster has discoverd some interesting urls.

http://10.10.10.171:80/index.html           (Status: 200) [Size: 10918]
http://10.10.10.171:80/music (Status: 301) [Size: 312] [--> http://10.10.10.171/music/]
http://10.10.10.171:80/artwork (Status: 301) [Size: 314] [--> http://10.10.10.171/artwork/]
http://10.10.10.171:80/sierra (Status: 301) [Size: 313] [--> http://10.10.10.171/sierra/]
http://10.10.10.171:80/server-status (Status: 403) [Size: 277]

artwork

alt

sierra

alt

Accessing the music page has an interesting page to ona when accessing login page.

alt

accessing ona page

alt

Here we find the critical information about the server and its running OpenNetAdmin with version 18.1.1

alt

Looking up if there is any exploit available in searchsploit and found exactly what we needed.

alt

Exploit

Analyzing the 47691.sh reveals that its curl command injection on the url 10.10.10.171/ona/ and has a possibility to have reverse shell.

alt

And successfully we have command execution on the system. Time to attempt reverse shell.

Reverse shell

Generate url encode reverse shell

Generating url encoding and sending request through the exploit.
alt

Executing the url encoded command.

alt

Catching the reverse shell with ncat.

alt

Privilege escalation

Exploring the local directories in the webserver reveals an interesting file database_settings

alt

Investigating the file reveals mysql user and password information.

alt

Lets connect to the database and see if we can find users and their hashes.

alt

Retrieving data from the users table.

alt

Cracking the hashes

alt

Users on the machine

alt

Lets see if we can use these password for the users on this machine.

Passwords discovered on the machine
n1nj4W4rri0R!
test
admin

Medusa was able to successfully discover user login with password

alt

login as jimmy

Using user jimmy credentials to login through ssh.

alt

Exploring the user access, we find that there is server running on port 52946

alt

Lets try finding the process running on the port.
From looking into the configuration the user is joanna and the server port on 52864

alt

Pivot the local port from 52864

alt

Accessing the port 9010 server

alt

Create php code in /var/www/internal

alt

switching to joanna

We have command execution as joanna.

alt

Create reverse shell on php.

alt

alt

user flag

alt

joanna ssh key

Digging deeper we found ssh key for joanna

alt

Cracking the secret key for the ssh id_rsa key with john.

alt

And the secret key is bloodninjas

Connecting to machine as joanna through ssh

alt

Checking the sudo privileges on the user.
alt

GTFOBin provides us info on privesc for nano.
alt

Exploiting nano
alt

Upgraded to root user.
alt

root flag

alt