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
Copy-Fail-CVE-2026-31431 — Proof-of-concept exploit for Linux kernel CVE-2026-31431 (Copy Fail) that abuses AF_ALG to corrupt setuid-root binaries in page cache, achieving privilege escalation. Includes backup/restore and integrity verification. | Kitploit
Tools/GitHubGitHub/mohamedkarrab/copy-fail-cve-2026-31431
Privilege EscalationExploit FrameworksVulnerability AnalysisExploitationLearning & EducationBinary Exploitation
GitHubmohamedkarrab/copy-fail-cve-2026-31431

Copy-Fail-CVE-2026-31431

Share

Proof-of-concept exploit for Linux kernel CVE-2026-31431 (Copy Fail) that abuses AF_ALG to corrupt setuid-root binaries in page cache, achieving privilege escalation. Includes backup/restore and integrity verification.

View Repository
506 months agoNot yet reviewed

Copy-Fail-CVE-2026-31431

A proof-of-concept exploit reproduction of the Linux kernel vulnerability CVE-2026-31431, also known as Copy Fail.

Credits to: Copy Fail

Affected Systems

  • Linux kernel versions 4.14 and newer
  • Most major distributions released from 2017 until patch deployment (Ubuntu, Debian, Fedora, RHEL...)

How This Differs from Original Exploit

Unminimized and Readable Code

  • Original exploit code is compact
  • This version is fully expanded

Backup and Restore Binaries

  • Creates a backup of the target binary (e.g., /usr/bin/su)
  • Verifies integrity via hashing
  • Restores original state after execution (in case of success)

Proof of Concept

image

git clone https://github.com/MohamedKarrab/Copy-Fail-CVE-2026-31431.git
cd Copy-Fail-CVE-2026-31431

# targets /usr/bin/su by default
python fail.py

# or any setuid-root (passwd, mount, chsh, sudo, pkexec...)
python fail.py /usr/bin/passwd

Warning

In case of exploitation failure, the target binary may not be restored to its original state. Fix it by:

  • Simply reboot the device. A reboot clears the page cache (the exploit does not modify the binary on disk).

  • Alternatively, restore a clean /usr/bin/su (or the selected binary) from a trusted package. Debian / Ubuntu:

sudo apt-get install --reinstall util-linux

Fedora / RHEL:

sudo dnf reinstall util-linux

Arch:

sudo pacman -S util-linux

Technical Overview

This exploit abuses an AF_ALG AEAD implementation to write arbitrary 4-byte chunks into the kernel page cache of /usr/bin/su (a setuid-root binary).

  • Uses unprivileged AF_ALG socket + crafted sendmsg/splice pairs to inject data into AES-CBC-HMAC processing
  • Exploits a scatter/gather boundary bug to make decrypted AAD bytes land inside the cached binary
  • Corrupts the in-memory .text section of /usr/bin/su without touching disk

Finally, executing /usr/bin/su loads the poisoned page cache, running injected code as root due to setuid.

Mitigation

  • Update to patched kernel versions
  • Block AF_ALG socket creation:
echo "install algif_aead /bin/false" > /etc/modprobe.d/disable-algif-aead.conf
rmmod algif_aead 2>/dev/null

Disclaimer

  • This code is for educational and testing purposes only.
  • Use only on systems you own or have explicit permission to test.
  • I am not responsible for misuse or damages.

References

  • NVD - CVE-2026-31431
  • Copy Fail: 732 Bytes to Root
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.

    795
  • 2

    ghostlock-app

    yukonga/ghostlock-app

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

    520
  • 3

    ARTEX

    baarai/artex

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

    439
  • 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

    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.

    267
  • 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.

    264

Explore all tools

Browse our collection of tools

View all tools →