Hack The Box: DoubleTake Machine Walkthrough – Easy Difficulity

Another Hack The Box Doubletake machine completed!

This machine provided an interesting look at two vulnerabilities and how they can be chained to achieve full system compromise.

The initial foothold involved CVE-2026-123158 (SSHole), an OpenSSH authentication vulnerability that allowed access to an Alpine Linux container. Further investigation uncovered stored Firefox credentials, which provided SSH access as `bob`.

For privilege escalation, I explored CVE-2026-41567, a Docker Engine vulnerability involving malicious decompression executables. By abusing the archive deployment functionality, I achieved a container escape and obtained root access on the host.

Key Takeaways:
- OpenSSH authentication vulnerabilities
- Linux container enumeration
- Firefox credential extraction
- Docker archive extraction abuse
- Container escape and privilege escalation

Another great opportunity to practise Linux enumeration, vulnerability research, and container security.

#HackTheBox #HTB #DoubleTake #CyberSecurity #PenetrationTesting #Linux #Docker #OpenSSH #CVE-2026-123158 #CVE-2026-41567 #PrivilegeEscalation #RedTeam

Reading Time: 9 minutes

Introduction to DoubleTake:

In this writeup, we will explore the “DoubleTake” machine from Hack The Box, categorized as an easy difficulty challenge. This walkthrough will cover the reconnaissance, exploitation, and privilege escalation steps required to capture the flag.

Objective:

The goal of this walkthrough is to complete the “DoubleTake” machine from Hack The Box by achieving the following objectives:

User Flag:

Initial access to DoubleTake involved exploiting CVE-2026-123158 (SSHole), a password authentication vulnerability affecting specific OpenSSH configurations. Successful exploitation provided access to the Alpine Linux container. Further investigation uncovered stored Zentara credentials in the Firefox profile, which enabled SSH access as bob and provided access to the user flag in the home directory.

Root Flag

Investigation uncovered CVE-2026-41567, a Docker Engine vulnerability affecting the archive extraction process in Zentara’s deployment feature. Uploading a malicious xz executable and triggering archive decompression caused Docker to execute the payload with daemon privileges. This established a reverse shell as root on the DoubleTake host and enabled retrieval of the root flag.

Enumerating the DoubleTake Machine

Reconnaissance:

Nmap Scan:

Begin with a network scan to identify open ports and running services on the target machine.

nmap -sC -sV -oA initial 10.129.177.119

Nmap Output:

┌─[dark@parrot]─[~/Documents/htb/doubletake]
└──╼ $nmap -sC -sV -oA initial 10.129.177.119
# Nmap 7.95 scan initiated Thu Nov 19 00:35:01 2026 as: nmap -sC -sV -oA initial 10.129.177.119
Nmap scan report for 10.129.177.119
Host is up (0.24s latency).
Not shown: 998 closed tcp ports (conn-refused)
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 10.6 (protocol 2.0)
80/tcp open  http    nginx 1.24.0 (Ubuntu)
|_http-title: Site doesn't have a title (text/html; charset=utf-8).
| http-auth: 
| HTTP/1.1 401 UNAUTHORIZED\x0D
|_  Basic realm=Zentara
|_http-server-header: nginx/1.24.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 at Thu Nov 19 00:36:07 2026 -- 1 IP address (1 host up) scanned in 65.80 seconds

Analysis:

  • Port 22 (SSH): OpenSSH 10.6 provides remote shell access.
  • Port 80 (HTTP): Nginx 1.24.0 running on Ubuntu hosts the Zentara web application. HTTP Basic Authentication protects access, as indicated by the 401 UNAUTHORIZED response and Basic realm=Zentara header.

Opening the target in a browser immediately triggered a native HTTP Basic Authentication prompt. Without valid credentials, access to the web application remained blocked, leaving no further progress through the browser at this stage.

CVE-2026-123158 SSHole Authentication Bypass

While investigating OpenSSH 10.6, I came across CVE-2026-123158, also known as SSHole. This vulnerability affects certain Linux systems that use the musl C library and run OpenSSH without PAM authentication. Alpine Linux is one example of an affected system.

For a more detailed breakdown of this vulnerability, including its exploitation process and technical analysis, refer to these two writeups:

Under specific configurations, an attacker can take advantage of a password-handling flaw by submitting an unusually long password (between 256 and 1024 characters). This can cause the system to incorrectly accept a password even when it is wrong, potentially allowing unauthorized access to an account.

A quick Python one-liner produced a 300-character string of A’s. This payload was prepared for potential buffer or input-length testing against the authentication endpoint.

Gaining Initial Access to the Alpine Container

After accepting the new host key, SSH authentication as alpine@10.129.177.119 succeeded on the second attempt. The session dropped into a clean Alpine Linux shell with the familiar motd banner.

Running ls -la / revealed a .dockerenv file alongside the standard Alpine directory structure, confirming that the current environment was a Docker container rather than the host system.

Checking /etc/os-release returned NAME="Alpine Linux". The lightweight distribution matched the container indicators already observed.

The uname -a output displayed an Ubuntu 6.8.0 kernel. Consequently the Alpine container was running on top of an Ubuntu host, explaining the kernel mismatch.

Extracting Stored Firefox Credentials

Expanding the search to all *.json files uncovered both logins.json and signedInUser.json within the same Firefox profile directory.

After copying the file to the attack host and parsing it with jq, the JSON revealed a stored login for http://172.17.0.1 under the realm “Zentara”, complete with base64-encoded username and password fields.

Piping the encryptedUsername value through base64 -d immediately produced the cleartext string “bob”, providing the first usable credential for the internal service.

Next, the longer encryptedPassword field was decoded using the same method, revealing CorrectHorseBatteryStaple, which provided a valid password for subsequent authentication attempts.

Gaining SSH Access as bob

With the recovered credentials, an SSH session as bob@10.129.177.119 succeeded without issue. The resulting shell ran under uid=1001(bob) inside the same Alpine container.

Listing the home directory revealed a readable user.txt owned by bob. Reading the file yielded the first flag

Escalate to Root Privileges Access on Doubletake machine

Privilege Escalation:

Returning to the browser, I entered the recovered bob / CorrectHorseBatteryStaple credentials into the HTTP Basic Authentication prompt. The credentials worked, granting access to the Zentara application.

Enumerating the Zentara Application

After login the interface presented a dark-themed AI chat workspace titled Zentara. Multiple previous conversations with the CodePilot agent appeared in the left sidebar.

Reviewing one of the chat threads showed the agent recommending slowapi for rate-limiting FastAPI endpoints and explaining the use of the X-Forwarded-For header behind a reverse proxy.

Another conversation revealed a complete FastAPI and SQLAlchemy project scaffold generated by CodePilot, featuring JWT authentication, database models, API routers, and an Alembic migration directory under /workspace/api-service.

Navigating to /status revealed the platform was running Docker 29.5.0 with a live zentara-alpine workspace container. The API connection token, however, had already expired.

Research into Docker version 29.5.0 led to a Tenable security advisory identifying CVE-2026-41567, an arbitrary code execution vulnerability affecting Docker Engine versions earlier than 29.5.1.

While reviewing Tenable’s security advisory, I found that Docker Engine versions earlier than 29.5.1 are vulnerable to CVE-2026-41567.

CVE-2026-41567 Docker Engine Arbitrary Code Execution

According to the advisory, an attacker can exploit a specially crafted container by uploading a malicious compressed archive. Docker may then execute the attacker’s decompression program with daemon privileges, potentially allowing root-level access to the host system.

Investigation of Docker version 29.5.0 revealed a potential vulnerability associated with CVE-2026-41567. This flaw may allow attackers to execute malicious code with Docker daemon privileges by uploading a compressed archive containing a malicious decompression executable.

Since the Docker daemon typically runs as root on Linux systems, successful exploitation could allow attackers to execute commands on the host and potentially gain full system control.

Identifying the Vulnerable Archive Deployment Feature

The /deploy endpoint provided an upload form that accepted tar, tar.gz, and tar.xz archives. Below the form, a deployment history section displayed previously successful uploads of api-service packages.

Examining /usr/bin inside the Alpine container showed a large collection of BusyBox symlinks mixed with a handful of real binaries. Notably, a standalone xz executable was present among the tools.

Scrolling further through the directory listing confirmed the presence of the real xz binary along with its related helpers such as xzcat, xzdiff and xzgrep.

Preparing the Malicious xz Executable on Doubletake machine

A minimal C program was developed to mount /proc, enter the host filesystem through /proc/1/root using chroot, and launch a reverse shell. The payload was designed to remain lightweight and mimic the xz utility during execution.

Compiling the escape payload with gcc -static -o xz test.c produced a fully self-contained binary. The static link ensured it would run inside the Alpine container without depending on external libraries.

A directory structure mimicking /usr/bin was created and the malicious xz was placed inside it. Archiving the tree as dark.tar prepared a clean payload ready for deployment through the Zentara interface.

Selecting dark.tar on the Deploy page and setting the target path to /workspace allowed the archive to be submitted. The platform accepted the upload without additional validation.

Once the upload finished, the Deployment History table displayed dark.tar with a successful status, confirming that the platform had extracted the malicious binary into the workspace.

Bypassing the Expired API Token

Attempting to upload via the Files section triggered an “API key expired” error. The interface required a valid token, blocking that particular upload path.

Bypassing the web interface, a direct curl request with the recovered bob credentials successfully deployed dark.tar to the workspace root. The JSON response confirmed that the platform extracted the archive successfully.

A minimal trigger was prepared by piping a dummy file through tar and xz to generate trigger.tar.xz. The archive was designed to invoke the previously planted malicious xz binary during decompression.

Submitting trigger.tar.xz through curl returned an “Engine returned 404” error. I needed to adjust the workspace path or archive structure before the platform could execute the malicious binary.

I successfully uploaded a larger archive named rev-shell.tar using curl. The JSON response confirmed extraction into the workspace root, placing the malicious xz binary where the engine could locate and execute it later.

I created and deployed a refined trigger.tar.xz archive containing a dummy file and a test text file. This archive was designed to trigger the platform’s decompression routine and execute the previously planted malicious xz binary.

A netcat listener on port 9007 immediately caught an incoming connection. The shell dropped in as root@doubletake, confirming the container escape had succeeded.

The root shell provided unrestricted access to root.txt. Reading the file revealed the root flag, completing the DoubleTake machine.

darknite
darknite
Articles: 396