Horizontall
Horizontall
Platform: HackTheBox | Difficulty: Easy | OS: Ubuntu Author: D3v0o0Nu11 | Date: 2026-02-10 | Status: Solved
Summary
Walkthrough of the HackTheBox machine Horizontall (Ubuntu, attack surface: OpenSSH 7.6p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0) (22), nginx 1.14.0 (Ubuntu) (80)). Foothold via the vulnerable entry point; direct root access from the foothold. Both flags captured and redacted.
Recon
Port scan
bash read-only • copy allowednmap -p- -sVC 10.10.11.105 --min-rate 1000
| Port | Service | Version | Notes |
|---|---|---|---|
| 22 | ssh | OpenSSH 7.6p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0) | |
| 80 | http | nginx 1.14.0 (Ubuntu) |
Enumeration highlights
- Detected OS: Ubuntu.
- Open services: http (80), ssh (22).
- Scan used:
nmap -p- -sVC 10.10.11.105 --min-rate 1000.
Foothold
Vulnerability / Misconfiguration
┌──(D3v0o0Nu11㉿htb)-[~]
└─$ nmap -p- -sVC 10.10.11.105 --min-rate 1000
Starting Nmap 7.93 ( https://nmap.org ) at 2023-09-14 04:24 PDT
Nmap scan report for 10.10.11.105
Host is up (0.031s latency).
Not shown: 65533 closed tcp ports (conn-refused)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 ee774143d482bd3e6e6e50cdff6b0dd5 (RSA)
| 256 3ad589d5da9559d9df016837cad510b0 (ECDSA)
|_ 256 4a0004b49d29e7af37161b4f802d9894 (ED25519)
80/tcp open http nginx 1.14.0 (Ubuntu)
|_http-title: Did not follow redirect to http://horizontall.htb
|_http-server-header: nginx/1.14.0 (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 29.63 seconds
-
Based from the nmap results, the machine runs a web application and opens a ssh login.
-
After clicking and checking every feature available there, none of the button redirecting us to a homepage.
-
Then I ran dirbuster.
-
http://horizontall.htb/js/app.c68eb462.jsshould be our interest. -
Let's deobfuscate the js with --> https://deobfuscate.io/
DEOBFUSCATE RESULT -> Found a subdomain that could be our interest.
-
Found nothing, let's run dirbuster.
-
This could be our foothold, strapi is an open source node.js Headless CMS (separates the presentation layer
where content is presentedfrom the backendwhere content is managed.
use searchsploit
- Seems we need to identify the strapi version used. The problem is, I already used burpsuite and
whatwebto do information gathering.
┌──(D3v0o0Nu11㉿htb)-[~]
└─$ whatweb http://api-prod.horizontall.htb/admin/auth/login
http://api-prod.horizontall.htb/admin/auth/login [200 OK] Country[RESERVED][ZZ], HTML5, HTTPServer[Ubuntu Linux][nginx/1.14.0 (Ubuntu)], IP[10.10.11.105], Script[text/javascript], Strict-Transport-Security[max-age=31536000; includeSubDomains], Title[Strapi Admin], UncommonHeaders[content-security-policy], X-Frame-Options[SAMEORIGIN], X-Powered-By[Strapi <strapi.io>], X-XSS-Protection[1; mode=block], nginx[1.14.0]
-
Anyway we can make an interpretation, since we don't have any cred. Our interest shall be around the 3rd and 4th exploit.
-
To copy the script to our current directory, run -->
searchsploit -m 50239.py. -
Reading the script at glance, seems we can check the strapi version by changing the url to --> /admin/init.
-
Great we found the version -->
3.0.0-beta.17.4. -
Based from the
main()function we can run -->python3 script urlto execute the script (because there'ssys.argv[1]). -
Great! Let's run a listener to do reverse shell and send our template bash reverse shell.
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
- Generating ssh-keygen to get a stable shell at the remote server.
- Port forwarding from remote server to local server.
- Exploiting Laravel 8.4.2