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-4138-poc — A Python script to generate a malicious tar archive that exploits CVE-2025-4138 / CVE-2025-4517. | Kitploit
Tools/GitHubGitHub/kyakei/cve-2025-4138-poc
Privilege EscalationPayload GenerationVulnerability AnalysisExploitationPenetration TestingLearning & Education
GitHubkyakei/cve-2025-4138-poc

CVE-2025-4138-poc

A Python script to generate a malicious tar archive that exploits CVE-2025-4138 / CVE-2025-4517.

View Repository
116 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2025-4138 Auto-Sudo Generator

A Python script to generate a malicious tar archive that exploits CVE-2025-4138 / CVE-2025-4517 (Path Traversal via PATH_MAX Truncation).

Successfully exploiting this vulnerability allows an attacker to bypass tarfile extraction filters and write arbitrary files to the filesystem. This tool specifically targets /etc/sudoers.d/ to grant passwordless root privileges.

Usage

Generate the exploit payload:

root@kitploit:~
python3 exploit.py -o exploit.tar

Options

  • -o, --output: Required. The path to save the malicious tar file.
  • -u, --user: Optional. The target username to grant sudo privileges to. Defaults to the current user running the script.

Attack Workflow

  1. Generate: Run the script to create exploit.tar.
    root@kitploit:~
    python3 exploit.py -o exploit.tar
    
  2. Deploy: Transfer exploit.tar to the target machine.
  3. Trigger: Wait for a privileged process (e.g., system backup, update tool, or SUID binary) running a vulnerable Python version to extract the archive.
    root@kitploit:~
    sudo /usr/local/bin/python3 vulnerable.py -b exploit.tar -r restore_final
    
    • Vulnerable Versions: Python 3.12.0–3.12.10, 3.13.0–3.13.3.
  4. Escalate: Once extracted, the payload /etc/sudoers.d/<username> is created.
    root@kitploit:~
    sudo su
    # Enjoy root shell
    

Disclaimer

This tool is for educational purposes and authorized security research only. Misuse of this software violates the law. The author is not responsible for any damage caused by the use of this tool.


CVE-2025-4138 Auto-Sudo by kyakei

Download Tool