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
copy-fail-mitigation-with-bpftrace — CVE-2026-31431, AKA Copy Fail, can be mitigated in one-line with bpftrace | Kitploit
Tools/GitHubGitHub/tang-yikai/copy-fail-mitigation-with-bpftrace
Defensive ToolsDynamic Analysis (Sandboxing)Vulnerability AnalysisIncident Response
GitHubtang-yikai/copy-fail-mitigation-with-bpftrace

copy-fail-mitigation-with-bpftrace

CVE-2026-31431, AKA Copy Fail, can be mitigated in one-line with bpftrace

View Repository
3 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 →
Share

copy-fail-mitigation-with-bpftrace

CVE-2026-31431, AKA Copy Fail, can be mitigated in one-line with bpftrace, no kpatch building, no cargo building

English Version | 中文版本

Idea

To exploit Copy Fail, you need to bind socket AF_ALG and use algorithm authencesn, which most applications don't use a lot. And that's where the mitigation can involve.

files

├── kfunc.sh

├── kprobe.sh

├── tests

│   └── bind_af_alg.py

└── tracepoint.sh

Why these files

the Author of tracepoint.sh is @天擎智能云, who published his writing at Wechat Public Accounts

I tested his script, and it worked out fine.

However, inspired by https://github.com/Jannik2099/copyfail-ebpf-mitigation I find that who bind socket AF_ALG but did not use algorithm authencesn, it may kill unconditionally.

The code explained for me.

Therefore, with the help of Deepseek, and after a day of manual experimentation, I verified kprobe.sh and kfunc.sh, who can log and deny all attempts to use bind() with salg_name=authencesn.

Test results

tracepointkprobe

Requirements

!!unverified!!

Download Tool
kfunc
Ubuntu 20.04✅✅❌
Rocky 8.4✅✅❌
Gentoo rolling✅✅✅
tracepointkprobekfunc
kernel version (minimum)4.7 (4.9+ recommended)4.15.5
bpftrace version (minimum)0.9.40.9.00.12
kernel parameters

CONFIG_BPF=y
CONFIG_BPF_SYSCALL=y
CONFIG_BPF_EVENTS=y
CONFIG_FTRACE_SYSCALLS=y
CONFIG_FUNCTION_TRACER=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_DEBUG_FS=y

optional:
CONFIG_BPF_JIT=y & CONFIG_HAVE_EBPF_JIT=y
CONFIG_KPROBES=y
CONFIG_KPROBE_EVENTS=y VENTS=y
CONFIG_BPF=y
CONFIG_BPF_SYSCALL=y
CONFIG_KPROBES=y
CONFIG_KPROBE_EVENTS=y
CONFIG_BPF_EVENTS=y
CONFIG_BPF=y
CONFIG_BPF_SYSCALL=y
CONFIG_BPF_EVENTS=y
CONFIG_BPF_JIT=y
CONFIG_HAVE_EBPF_JIT=y
CONFIG_KPROBES=y
CONFIG_KPROBE_EVENTS=y
CONFIG_FUNCTION_TRACER=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_DYNAMIC_FTRACE=y
CONFIG_DEBUG_INFO_BTF=y
CONFIG_DEBUG_INFO_BTF_MODULES=y
CONFIG_DEBUG_FS=y