Exploit database

GH-5739ce8136ad3220d15bb3e9fc25946e

iamliuxiaozhen/copy_fail

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-31431

166 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files2
iamliuxiaozhen/copy_failRevision dbb188b09d05

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

code/safe_assessment.py

Python · 2,016 bytes
#!/usr/bin/env python3
"""Non-destructive local assessment helper for copy_fail research."""

from __future__ import annotations

import os
import platform
import socket
from pathlib import Path


RELEVANT_CRYPTO_TERMS = (
    "authencesn",
    "hmac(sha256)",
    "cbc(aes)",
    "aead",
)


def yes_no(value: bool) -> str:
    return "yes" if value else "no"


def read_proc_crypto() -> str:
    path = Path("/proc/crypto")
    try:
        return path.read_text(encoding="utf-8", errors="replace")
    except OSError:
        return ""


def af_alg_supported() -> bool:
    family = getattr(socket, "AF_ALG", 38)
    sock_type = getattr(socket, "SOCK_SEQPACKET", 5)
    try:
        probe = socket.socket(family, sock_type, 0)
    except OSError:
        return False
    finally:
        try:
            probe.close()
        except UnboundLocalError:
            pass
    return True


def main() -> int:
    proc_crypto = read_proc_crypto()
    proc_crypto_lower = proc_crypto.lower()
    crypto_hits = [
        term for term in RELEVANT_CRYPTO_TERMS if term.lower() in proc_crypto_lower
    ]

    print("copy_fail safe local assessment")
    print("=" * 31)
    print(f"system: {platform.system()}")
    print(f"platform: {platform.platform()}")
    print(f"kernel_release: {platform.release()}")
    print(f"machine: {platform.machine()}")
    print(f"effective_uid: {os.geteuid()}")
    print(f"running_as_root: {yes_no(os.geteuid() == 0)}")
    print(f"python_af_alg_socket_supported: {yes_no(af_alg_supported())}")
    print(f"proc_crypto_readable: {yes_no(bool(proc_crypto))}")
    print(f"relevant_crypto_terms_seen: {', '.join(crypto_hits) or 'none'}")
    print()
    print("assessment:")
    print("- These checks do not prove whether the kernel is vulnerable.")
    print("- Confirm exposure with vendor advisories and the running kernel package.")
    print("- Patch and reboot systems where untrusted local code can run.")
    return 0


if __name__ == "__main__":
    raise SystemExit(main())