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-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
253 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 →

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

root@kitploit:~
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:

root@kitploit:~
~/.msf4/modules/

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

root@kitploit:~
~/.msf4/modules/
└── post/
    └── linux/
        └── escalation/

Step 3 — Copy the Module

Copy the copy_fail.rb file into the following directory:

root@kitploit:~
~/.msf4/modules/post/linux/escalation/

Final structure:

root@kitploit:~
~/.msf4/modules/
└── post/
    └── linux/
        └── escalation/
            └── copy_fail.rb

Loading the Module

Start the Metasploit console:

root@kitploit:~
msfconsole

Reload all modules:

root@kitploit:~
reload_all

Load the exploit module:

root@kitploit:~
use post/linux/escalation/copy_fail

Usage

Show Module Options

root@kitploit:~
show options

Set the Active Session

root@kitploit:~
set SESSION 1

Run the Exploit

root@kitploit:~
run

or

root@kitploit:~
exploit

Example Workflow

root@kitploit:~
msfconsole

use post/linux/escalation/copy_fail

show options

set SESSION 1

run

Vulnerable Kernel Versions

The module targets vulnerable Linux kernels:

root@kitploit:~
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