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-2026-31431-Metasploit-exploit — Automated Metasploit post-exploitation module for CVE-2026-31431 ("Copy Fail"). Weaponizes a deterministic logic flaw in the Linux kernel AF_ALG subsystem to achieve local privilege escalation (LPE) to root by safely corrupting a setuid binary directly in the shared Page Cache (RAM) without modifying files on disk | Kitploit
Tools/GitHubGitHub/adityasingh108/cve-2026-31431-metasploit-exploit
Penetration Testing FrameworksPrivilege EscalationExploit FrameworksVulnerability AnalysisExploitationPost-ExploitationLearning & EducationRed TeamingPayload Development
Binary Exploitation
GitHubadityasingh108/cve-2026-31431-metasploit-exploit

CVE-2026-31431-Metasploit-exploit

View Repository
2416 months agoNot yet reviewed

About

Automated Metasploit post-exploitation module for CVE-2026-31431 ("Copy Fail"). Weaponizes a deterministic logic flaw in the Linux kernel AF_ALG subsystem to achieve local privilege escalation (LPE) to root by safely corrupting a setuid binary directly in the shared Page Cache (RAM) without modifying files on disk

Share

CVE-2026-31431 - Linux Kernel AF_ALG "Copy Fail" Local Privilege Escalation

An automated Metasploit Post-Exploitation module that leverages CVE-2026-31431 (popularly known as "Copy Fail") to perform Local Privilege Escalation (LPE) on vulnerable Linux kernels (versions 4.14 through 6.19.12).


Description

The module exploits a logic flaw within the Linux kernel’s cryptographic subsystem (algif_aead module of the AF_ALG interface). Due to an improper in-place memory optimization, an unprivileged local user can use the splice() system call to map a read-only system binary (such as /usr/bin/su or /usr/bin/sudo) into an AF_ALG socket and perform a controlled 4-byte overwrite directly in the system Page Cache (RAM).

By corrupting specific privilege-checking instructions of a setuid binary in memory, the module bypasses access controls and spawns a root shell without modifying the physical file on disk.


Features

  • Deterministic exploitation (no race condition required)
  • Compatible with both shell and meterpreter sessions
  • Automatic payload cleanup using register_file_for_cleanup
  • Fully integrated Metasploit Post module
  • Supports vulnerable Linux kernels from 4.14 to 6.19.12

Installation

Step 1 — Clone the Repository

git clone https://github.com/adityasingh108/CVE-2026-31431-Metasploit-exploit
cd CVE-2026-31431-Metasploit-exploit

Step 2 — Open the Metasploit Modules Directory

Metasploit custom modules should be placed inside the local user module path:

~/.msf4/modules/

Create the required directory structure if it does not already exist:

~/.msf4/modules/
└── post/
    └── linux/
        └── escalation/

Step 3 — Copy the Module

Copy the copy_fail.rb file into the following directory:

~/.msf4/modules/post/linux/escalation/

Final structure:

~/.msf4/modules/
└── post/
    └── linux/
        └── escalation/
            └── copy_fail.rb

Loading the Module

Start the Metasploit console:

msfconsole

Reload all modules:

reload_all

Load the exploit module:

use post/linux/escalation/copy_fail

Usage

Show Module Options

show options

Set the Active Session

set SESSION 1

Run the Exploit

run

or

exploit

Example Workflow

msfconsole

use post/linux/escalation/copy_fail

show options

set SESSION 1

run

Vulnerable Kernel Versions

The module targets vulnerable Linux kernels:

4.14 <= Kernel Version <= 6.19.12

Supported Session Types

  • Linux shell session
  • Meterpreter session

Notes

  • Requires a valid local session on the target system
  • Exploitation occurs entirely in memory
  • No permanent modification is made to the target binary on disk
  • Intended strictly for authorized security testing and research purposes

Disclaimer

This project is provided for educational purposes and authorized security research only. Unauthorized use against systems you do not own or have explicit permission to test may violate applicable laws and regulations.

Use responsibly.

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.

    708
  • 2

    ghostlock-app

    yukonga/ghostlock-app

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

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

    398
  • 4

    redforge

    cybersecurity91/redforge

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

    341
  • 5

    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.

    259
  • 6

    antifox

    antifox-ai/antifox

    AI multi-agent autonomous penetration testing platform that runs recon, attack-surface discovery, exploitation validation and evidence-backed report delivery.

    257

Explore all tools

Browse our collection of tools

View all tools →