Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
Detections-CVE-2026-31431 — 针对 CVE-2026-31431 Linux 内核 LPE 漏洞(Copy Fail)的检测规则、YARA 签名、auditd/Wazuh 规则和 MISP 事件模板。包括 IoC、缓解步骤和漏洞利用分析。 | Kitploit
工具/GitHubGitHub/insomnisec/detections-cve-2026-31431
危害指标 (IOC) 管理权限提升漏洞分析漏洞利用取证分析威胁情报入侵检测学习与教育事件响应

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享
GitHubinsomnisec/detections-cve-2026-31431

Detections-CVE-2026-31431

针对 CVE-2026-31431 Linux 内核 LPE 漏洞(Copy Fail)的检测规则、YARA 签名、auditd/Wazuh 规则和 MISP 事件模板。包括 IoC、缓解步骤和漏洞利用分析。

查看仓库
253个月前尚未审核

迁移至:https://github.com/insomnisec/public_cve_detections

为更好地长期管理检测发布内容

本仓库将于2026年6月移除

后续请使用另一仓库

CVE-2026-31431 "复制失败" — 检测与响应包

发布日期: 2026-04-30
CVSSv3: 7.8(高危)
类型: 本地权限提升(LPE)
子系统: Linux 内核 algif_aead / authencesn 加密模板
影响范围: Linux 内核 4.14 – 6.18.21(几乎自 2017 年以来的所有发行版)
参考资料:

  • Xint/Theori 分析文章
  • 官方 PoC
  • oss-security 披露
  • copy.fail

目录

  1. 漏洞概述
  2. 漏洞利用原理
  3. 检测局限性
  4. 紧急缓解措施
  5. YARA 规则
  6. Auditd 规则
  7. Wazuh 规则
  8. MISP 事件模板
  9. 打补丁与修复
  10. 关键 IoC 参考

漏洞概述

CVE-2026-31431 是内核 4.14(2017 年)中引入的一个逻辑缺陷,源于三个独立变更的交集:

  1. authencesn 模板(2011 年添加,用于 IPsec ESN 支持)会在其输出缓冲区边界之外写入 4 字节的临时数据。
  2. AF_ALG 在 2015 年获得了 AEAD 支持,允许用户空间通过 splice() 从页缓存文件提交数据。
  3. 2017 年,algif_aead.c 被优化为原地操作(req->src == req->dst),将活动页缓存页面放入可写的散列/收集列表(scatterlist)中。

结果:无特权用户可以向内核页缓存中任意可读文件(包括 setuid 二进制文件和 /etc/passwd)的副本写入恰好 4 字节由攻击者控制的数据,而无需触碰磁盘上的文件。可用的 PoC 是一个 732 字节的 Python 脚本。无需竞态条件,无需针对特定发行版的偏移量。在 Ubuntu、RHEL、Amazon Linux 和 SUSE 上均稳定可靠。


漏洞利用原理```

Attacker opens AF_ALG socket (family 38, type 5) └─ Binds to "authencesn(hmac(sha256),cbc(aes))" └─ Sets SOL_ALG (279) options including key and authsize └─ Accepts a connection socket

Attacker opens target file (e.g., /etc/passwd) read-only └─ Uses splice() to feed page-cache pages into the AEAD socket's RX buffer └─ Sends crafted AAD via sendmsg() — bytes 4–7 of AAD = attacker-controlled write value

authencesn performs in-place decryption: └─ scatterwalk_map_and_copy writes seqno_lo into the chained page-cache page └─ recvmsg() returns an error (HMAC fails — expected), but the write already happened

Page-cache now contains attacker-modified copy of the file └─ Kernel executes from page-cache, not disk └─ On-disk file is UNCHANGED — file integrity tools see nothing

root@kitploit:~
该PoC针对`/etc/passwd`:它找到当前用户UID字段的偏移量,并将其覆盖为`0000`,然后调用`su`获取root shell。

---

## 检测限制

> **在部署以下规则之前,请先阅读本节内容。**

该漏洞利用有两个特性,极大地限制了检测覆盖范围:

**1. 写入操作针对的是页缓存,而非文件系统。**
任何监控文件系统事件的检测工具——`inotify`、`fanotify`、AIDE、Tripwire、auditd路径监控——都**不会**观察到该修改。磁盘上的文件从未被写入。这意味着auditd路径监控中针对`/usr/bin/su`或`/etc/passwd`的`-p w`(写入)标志将不会捕获实际的漏洞利用写入。

**2. 该机制使用了合法的内核接口。**
`AF_ALG`套接字、`splice()`和`authencesn`都有合法用途(IPsec、内核自测试、sendfile风格的I/O)。检测必须关注这些原始操作的**组合**,而非孤立地看待任何一个,并且在运行IPsec或进行内核加密测试的系统上,预期会出现误报。

**检测能够捕捉到的内容:**
- `socket(AF_ALG, SOCK_SEQPACKET, 0)`系统调用
- 与上述相关的`splice()`系统调用,尤其是在访问setuid二进制文件附近
- PoC脚本本身(通过YARA)
- 进程内存或脚本文件中特定的`authencesn(hmac(sha256),cbc(aes))`算法字符串

**检测无法捕捉到的内容:**
- 实际的页缓存写入(内存中,无文件系统事件)
- 利用后对修改后的页缓存条目的使用(看起来像正常的`su`或`passwd`调用)
- 避开Python或特定算法字符串的变种

---

## 即时缓解措施

在部署检测规则之前,请在未打补丁的主机上应用此缓解措施:```bash
# Disable algif_aead kernel module — blocks the exploit primitive entirely
echo "install algif_aead /bin/false" | sudo tee /etc/modprobe.d/disable-algif-aead.conf
sudo rmmod algif_aead 2>/dev/null || true

验证缓解措施是否生效 使用官方检测器:```bash

Exit 0 = not vulnerable / mitigated

Exit 2 = VULNERABLE

python3 test_cve_2026_31431.py

root@kitploit:~
> **注意:** `rmmod` 命令在模块未加载时会失败;这是可接受的。`modprobe.d` 配置可防止未来加载。此缓解措施对标准 TLS、SSH 或文件系统加密工作负载没有影响——它仅影响使用 `authencesn` 模板的具有扩展序列号的 IPsec,这在不属于专用 VPN 网关的情况外并不常见。

---

## YARA 规则

保存为 `cve_2026_31431.yar`

> **扫描范围:** 此规则旨在扫描磁盘上的或从内存转储中提取的 Python 脚本文件。它将匹配已知的 PoC 和相近变体。它不会检测系统调用级别的利用活动——请使用 auditd/Wazuh 规则进行检测。```yara
rule CVE_2026_31431_CopyFail_PoC_HighConfidence {
    meta:
        description     = "High-confidence match: CVE-2026-31431 Copy Fail PoC or close variant"
        author          = "Detection Engineering"
        reference       = "https://xint.io/blog/copy-fail-linux-distributions"
        cve             = "CVE-2026-31431"
        date            = "2026-04-30"
        severity        = "High"
        cvss            = "7.8"

    strings:
        // Algorithm string unique to this exploit path — very high fidelity
        $alg_full      = "authencesn(hmac(sha256),cbc(aes))" ascii

        // Specific socket call signature from PoC: AF_ALG=38, SOCK_SEQPACKET=5
        $socket_call   = "socket(38,5,0)" ascii

        // SOL_ALG socket option (decimal 279)
        $solalg        = "setsockopt(279" ascii

        // Hex key/iv payload written via setsockopt in PoC
        $key_payload   = "0800010000000010" ascii

        // splice() usage in context of AEAD operations
        $splice        = "splice(" ascii

        // Target indicators from PoC (page-cache corruption targets)
        $target_passwd = "/etc/passwd" ascii
        $target_su     = "/usr/bin/su" ascii

        // AF_ALG aead bind strings
        $aead_bind     = "\"aead\"" ascii

    condition:
        // High-confidence: unique algorithm string alone is sufficient
        $alg_full
        or
        // Medium-confidence: socket primitive + option number
        ($socket_call and $solalg)
        or
        // Medium-confidence: splice into AEAD socket targeting a setuid path
        ($aead_bind and $splice and ($target_passwd or $target_su))
        or
        // PoC hex payload present alongside splice
        ($key_payload and $splice)
}

rule CVE_2026_31431_CopyFail_Mechanism {
    meta:
        description     = "Behavioral: AF_ALG AEAD + splice combination suggestive of CVE-2026-31431 technique"
        author          = "Detection Engineering"
        reference       = "https://xint.io/blog/copy-fail-linux-distributions"
        cve             = "CVE-2026-31431"
        date            = "2026-04-30"
        severity        = "Medium"
        note            = "Higher false positive rate than HighConfidence rule — review matches in context"

    strings:
        $authencesn    = "authencesn" ascii nocase
        $af_alg_num    = "socket(38" ascii
        $sol_alg_num   = "279" ascii
        $splice        = "splice(" ascii

    condition:
        ($authencesn and $splice)
        or
        ($af_alg_num and $sol_alg_num and $splice)
}

Auditd 规则

保存为 /etc/audit/rules.d/cve-2026-31431.rules

重新加载:```bash sudo augenrules --load

or on older systems:

sudo auditctl -R /etc/audit/rules.d/cve-2026-31431.rules

root@kitploit:~
(空)```bash
## ============================================================
## CVE-2026-31431 "Copy Fail" — Auditd Detection Rules
## ============================================================
## These rules capture the MECHANISM of the exploit (socket +
## splice syscalls) and correlated /etc/passwd access patterns.
##
## IMPORTANT: These rules will NOT detect the page-cache write
## itself — it is an in-memory operation with no filesystem
## event. File path watches (-w) on setuid binaries or
## /etc/passwd will not fire on the exploit write.
##
## Correlate rule hits across audit.key values to build signal:
## A hit on afalg_socket followed closely by a hit on
## splice_syscall from the same process is a strong indicator.
## ============================================================

## --- Core exploit primitive: AF_ALG socket creation ---
## Monitors socket(2) syscall where a0 = 0x26 (38 decimal = AF_ALG)
## This is the first step of the exploit chain.
-a always,exit -F arch=b64 -S socket -F a0=0x26 -k cve_2026_31431_afalg_socket
-a always,exit -F arch=b32 -S socket -F a0=0x26 -k cve_2026_31431_afalg_socket

## --- splice() syscall monitoring ---
## splice() is used to feed page-cache pages into the AEAD socket.
## NOTE: splice() is commonly used for sendfile-like operations.
## Correlate with cve_2026_31431_afalg_socket hits from the same PID.
-a always,exit -F arch=b64 -S splice -k cve_2026_31431_splice
-a always,exit -F arch=b32 -S splice -k cve_2026_31431_splice

## --- /etc/passwd access monitoring ---
## The PoC reads /etc/passwd to locate the UID field offset.
## Read access (-p r) is retained here because the intent is
## to correlate this read with the AF_ALG socket key above,
## not to use the watch as a standalone alert.
-w /etc/passwd -p rwa -k cve_2026_31431_passwd_access

## --- setuid binary execution monitoring ---
## Detects execution of su after page-cache modification.
## The page-cache write makes su execute as root; this catches
## the exploitation outcome, not the write itself.
-w /usr/bin/su   -p xa -k cve_2026_31431_su_exec
-w /usr/bin/sudo -p xa -k cve_2026_31431_sudo_exec

## --- algif_aead module state monitoring ---
## The exploit requires algif_aead to be loaded.
## Monitoring modprobe helps detect attempts to load the module
## on systems where it was previously disabled as a mitigation,
## and confirms whether the mitigation is being bypassed.
-a always,exit -F arch=b64 -S finit_module -S init_module -k cve_2026_31431_module_load
-w /etc/modprobe.d -p wa -k cve_2026_31431_modprobe_conf

查询关联性

部署规则后,使用 ausearch 在时间窗口内跨键关联命中记录:```bash

Find all CVE-2026-31431 related events in the last hour

sudo ausearch -k cve_2026_31431_afalg_socket -k cve_2026_31431_splice
--start recent -i | aureport --interpret

Check if a specific PID hit both AF_ALG and splice

sudo ausearch -k cve_2026_31431_afalg_socket --start today -i
| grep 'pid=' | awk -F'pid=' '{print $2}' | awk '{print $1}' | sort -u
| while read pid; do sudo ausearch -k cve_2026_31431_splice --start today -i | grep "pid=$pid"
&& echo "[!] PID $pid hit both AF_ALG and splice — investigate" done

root@kitploit:~
---

## Wazuh 规则

保存为本地规则文件(通常为 `/var/ossec/etc/rules/local_rules.xml`)。

> **先决条件:** 这些规则依赖于已按上述规则配置的 auditd 以及生效的 Wazuh auditd 解码器。它们匹配由 auditd 填充的 `audit.key` 字段,这是连接两个系统的正确且可靠的方式。规则使用 `<if_group>auditd</if_group>` 而非特定的 `<if_sid>`,以保持与不同 Wazuh 版本的兼容性。```xml
<!-- ============================================================
     CVE-2026-31431 "Copy Fail" — Wazuh Correlation Rules
     Requires: auditd rules from cve-2026-31431.rules deployed
     ============================================================ -->

<!-- Level 10: AF_ALG socket creation detected -->
<rule id="112001" level="10">
    <if_group>auditd</if_group>
    <field name="audit.key">cve_2026_31431_afalg_socket</field>
    <description>CVE-2026-31431 Copy Fail: AF_ALG socket (family 38) created by unprivileged process</description>
    <group>cve,privilege_escalation,linux,kernel,crypto,</group>
</rule>

<!-- Level 10: splice() syscall detected -->
<rule id="112002" level="10">
    <if_group>auditd</if_group>
    <field name="audit.key">cve_2026_31431_splice</field>
    <description>CVE-2026-31431 Copy Fail: splice() syscall detected — monitor for correlation with AF_ALG socket rule</description>
    <group>cve,privilege_escalation,linux,kernel,</group>
</rule>

<!-- Level 14 CRITICAL: AF_ALG socket followed by splice() from the same source -->
<!-- This chaining is the core exploit mechanism                                 -->
<rule id="112003" level="14">
    <if_matched_sid>112001</if_matched_sid>
    <if_group>auditd</if_group>
    <field name="audit.key">cve_2026_31431_splice</field>
    <same_field>audit.pid</same_field>
    <description>CVE-2026-31431 Copy Fail CRITICAL: AF_ALG socket creation followed by splice() from same process — active exploitation likely</description>
    <group>cve,privilege_escalation,linux,kernel,crypto,high_confidence,</group>
</rule>

<!-- Level 12: /etc/passwd access correlated with AF_ALG activity -->
<rule id="112004" level="12">
    <if_matched_sid>112001</if_matched_sid>
    <if_group>auditd</if_group>
    <field name="audit.key">cve_2026_31431_passwd_access</field>
    <description>CVE-2026-31431 Copy Fail: /etc/passwd access following AF_ALG socket creation — consistent with PoC target selection</description>
    <group>cve,privilege_escalation,linux,kernel,</group>
</rule>

<!-- Level 13: su or sudo executed after AF_ALG socket was created -->
<!-- This may represent execution of the modified page-cache entry  -->
<rule id="112005" level="13">
    <if_matched_sid>112001</if_matched_sid>
    <if_group>auditd</if_group>
    <field name="audit.key">cve_2026_31431_su_exec|cve_2026_31431_sudo_exec</field>
    <description>CVE-2026-31431 Copy Fail: su/sudo execution following AF_ALG socket creation — possible post-exploitation</description>
    <group>cve,privilege_escalation,linux,kernel,</group>
</rule>

<!-- Level 12: Attempt to load algif_aead after it was disabled as a mitigation -->
<rule id="112006" level="12">
    <if_group>auditd</if_group>
    <field name="audit.key">cve_2026_31431_module_load</field>
    <field name="audit.exe" type="pcre2">^.*(python|python3|insmod|modprobe).*$</field>
    <description>CVE-2026-31431 Copy Fail: Kernel module load attempt — verify algif_aead mitigation has not been bypassed</description>
    <group>cve,privilege_escalation,linux,kernel,</group>
</rule>

<!-- Level 13: modprobe.d config modified — possible mitigation removal -->
<rule id="112007" level="13">
    <if_group>auditd</if_group>
    <field name="audit.key">cve_2026_31431_modprobe_conf</field>
    <description>CVE-2026-31431 Copy Fail: /etc/modprobe.d modified — verify algif_aead disable config has not been removed</description>
    <group>cve,privilege_escalation,linux,kernel,</group>
</rule>

MISP 事件模板

保存为 misp_cve_2026_31431.json,然后通过 MISP → 事件 → 导入 进行导入。

注意: 在导入之前,请将下面的占位符 UUID 替换为您环境新生成的 UUID4。占位符值以一致的格式显示,便于阅读。```json { "Event": { "uuid": "7f3a2d1e-8b4c-4f9a-a3e2-6d5c1b8e9f0a", "info": "CVE-2026-31431 Copy Fail — Linux LPE via authencesn page-cache write", "threat_level_id": "2", "analysis": "2", "date": "2026-04-30", "Attribute": [ { "type": "vulnerability", "category": "External analysis", "to_ids": false, "uuid": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d", "comment": "CVE identifier", "value": "CVE-2026-31431" }, { "type": "text", "category": "Other", "to_ids": false, "uuid": "2b3c4d5e-6f7a-8b9c-0d1e-2f3a4b5c6d7e", "comment": "Vulnerability description", "value": "Logic flaw in Linux kernel authencesn cryptographic template. An unprivileged local user can write 4 attacker-controlled bytes into the page cache of any readable file via AF_ALG + splice(), enabling local privilege escalation. No race condition required. Affects kernels 4.14 through 6.18.21." }, { "type": "text", "category": "Other", "to_ids": false, "uuid": "3c4d5e6f-7a8b-9c0d-1e2f-3a4b5c6d7e8f", "comment": "Attack vector summary", "value": "socket(38, 5, 0) [AF_ALG/SOCK_SEQPACKET] → bind authencesn(hmac(sha256),cbc(aes)) → setsockopt(SOL_ALG/279) → splice() page-cache pages into AEAD socket → 4-byte controlled write into page cache of target file" }, { "type": "text", "category": "Other", "to_ids": false, "uuid": "4d5e6f7a-8b9c-0d1e-2f3a-4b5c6d7e8f9a", "comment": "Affected kernel range", "value": "Linux kernel 4.14 (commit 72548b093ee3) through 6.18.21" }, { "type": "text", "category": "Other", "to_ids": false, "uuid": "5e6f7a8b-9c0d-1e2f-3a4b-5c6d7e8f9a0b", "comment": "Introducing commit (root cause)", "value": "72548b093ee38a6d4f2a19e6ef1948ae05c181f7 — algif_aead in-place AEAD optimization (2017)" }, { "type": "text", "category": "Other", "to_ids": false, "uuid": "6f7a8b9c-0d1e-2f3a-4b5c-6d7e8f9a0b1c", "comment": "Fix commit — kernel 6.18.22 stable", "value": "fafe0fa2995a0f7073c1c358d7d3145bcc9aedd8" }, { "type": "text", "category": "Other", "to_ids": false, "uuid": "7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d", "comment": "Fix commit — kernel 6.19.12 stable", "value": "ce42ee423e58dffa5ec03524054c9d8bfd4f6237" }, { "type": "text", "category": "Other", "to_ids": false, "uuid": "8b9c0d1e-2f3a-4b5c-6d7e-8f9a0b1c2d3e", "comment": "Fix commit — kernel 7.0 mainline", "value": "a664bf3d603dc3bdcf9ae47cc21e0daec706d7a5" }, { "type": "text", "category": "Other", "to_ids": true, "uuid": "9c0d1e2f-3a4b-5c6d-7e8f-9a0b1c2d3e4f", "comment": "IoC: Socket family (AF_ALG)", "value": "socket family 38 (AF_ALG)" }, { "type": "text", "category": "Other", "to_ids": true, "uuid": "0d1e2f3a-4b5c-6d7e-8f9a-0b1c2d3e4f5a", "comment": "IoC: Socket type (SOCK_SEQPACKET)", "value": "socket type 5 (SOCK_SEQPACKET)" }, { "type": "text", "category": "Other", "to_ids": true, "uuid": "1e2f3a4b-5c6d-7e8f-9a0b-1c2d3e4f5a6b", "comment": "IoC: Socket option (SOL_ALG = 279)", "value": "setsockopt level 279 (SOL_ALG)" }, { "type": "text", "category": "Other", "to_ids": true, "uuid": "2f3a4b5c-6d7e-8f9a-0b1c-2d3e4f5a6b7c", "comment": "IoC: Algorithm string (highest fidelity)", "value": "authencesn(hmac(sha256),cbc(aes))" }, { "type": "text", "category": "Other", "to_ids": true, "uuid": "3a4b5c6d-7e8f-9a0b-1c2d-3e4f5a6b7c8d", "comment": "IoC: Primary PoC target file", "value": "/etc/passwd (UID field offset targeted by PoC)" }, { "type": "text", "category": "Other", "to_ids": true, "uuid": "4b5c6d7e-8f9a-0b1c-2d3e-4f5a6b7c8d9e", "comment": "IoC: Secondary targets (setuid binaries)", "value": "/usr/bin/su, /usr/bin/sudo" }, { "type": "text", "category": "Other", "to_ids": false, "uuid": "5c6d7e8f-9a0b-1c2d-3e4f-5a6b7c8d9e0f", "comment": "Immediate mitigation", "value": "echo 'install algif_aead /bin/false' > /etc/modprobe.d/disable-algif-aead.conf && rmmod algif_aead" }, { "type": "url", "category": "External analysis", "to_ids": false, "uuid": "6d7e8f9a-0b1c-2d3e-4f5a-6b7c8d9e0f1a", "comment": "Official write-up", "value": "" }, { "type": "url", "category": "External analysis", "to_ids": false, "uuid": "7e8f9a0b-1c2d-3e4f-5a6b-7c8d9e0f1a2b", "comment": "Official PoC repository", "value": "" } ], "Object": [ { "name": "vulnerability", "meta-category": "vulnerability", "Attribute": [ { "type": "vulnerability", "object_relation": "id", "value": "CVE-2026-31431" }, { "type": "cvss-score", "object_relation": "cvss-score", "value": "7.8" }, { "type": "text", "object_relation": "summary", "value": "Linux kernel authencesn LPE via AF_ALG + splice() page-cache write" } ] } ] } }

root@kitploit:~
---

## 补丁与修复

### 内核补丁

| 分支 | 修复版本 | 修复提交 |
|--------|--------------|------------|
| 稳定版 6.18.x | 6.18.22 | `fafe0fa2995a0f7073c1c358d7d3145bcc9aedd8` |
| 稳定版 6.19.x | 6.19.12 | `ce42ee423e58dffa5ec03524054c9d8bfd4f6237` |
| 主线版 | 7.0 | `a664bf3d603dc3bdcf9ae47cc21e0daec706d7a5` |

该修复将 2017 年在 `algif_aead.c` 中引入的原地 AEAD 优化还原为异地操作,确保页面缓存页面永远不会被放入可写的散列表中。

### 特定发行版指南

| 发行版 | 操作 |
|---|---|
| Ubuntu | `apt-get update && apt-get upgrade linux-image-generic`;查看 USN 公告 |
| RHEL / Rocky / Alma | `dnf update kernel`;查看 RHSB 公告 |
| Amazon Linux 2023 | `dnf update kernel`;查看 ALAS 公告 |
| SUSE / openSUSE | `zypper update kernel-default`;查看 SUSE SA 公告 |
| Debian | 检查安全追踪器;回溯补丁可能早于内核更新到达 |
| Arch | `pacman -Syu`(滚动更新;上游修复发布后即可获取) |

### 暴露后的完整性验证

如果您怀疑主机在打补丁之前已被利用:```bash
# 1. Check if /etc/passwd UID fields have been tampered
# (compare against a known-good backup or secondary host)
awk -F: '$3 ~ /^0+$/ && $1 != "root" {print "SUSPICIOUS UID 0 ENTRY:", $0}' /etc/passwd

# 2. Drop the page cache to flush any in-memory modifications
# WARNING: This impacts performance temporarily
sync && echo 3 | sudo tee /proc/sys/vm/drop_caches

# 3. Verify setuid binaries against package manager
rpm -Va --nomtime 2>/dev/null | grep -E '^.{0,8}5.*su$|^.{0,8}5.*sudo$'   # RHEL/rpm
debsums -s 2>/dev/null | grep -E 'su|sudo'                                  # Debian/Ubuntu

# 4. Re-examine recently logged su/sudo invocations for unexpected UID transitions
journalctl -u sudo --since "48 hours ago" | grep "session opened for user root"

重要提示: 标准文件完整性工具(AIDE、Tripwire、debsums、rpm -Va)会检查磁盘上的哈希值,即使在页面缓存被利用后也会显示二进制文件未被修改。页面缓存在重启或执行 drop_caches 后会自然清除。在重启后的系统上,页面缓存损坏消失,但攻击者可能已经通过其他方式建立了持久性。


关键入侵指标参考


检测包针对官方 PoC 维护,地址为 theori-io/copy-fail-CVE-2026-31431。如果您观察到这些规则未涵盖的利用变体,请在 PoC 主仓库中提交 issue。

下载工具
https://xint.io/blog/copy-fail-linux-distributions
https://github.com/theori-io/copy-fail-CVE-2026-31431
指标值置信度
AF_ALG 套接字族38 (socket() 的第一个参数)中等 — 存在合法用途
套接字类型5 (SOCK_SEQPACKET)中等
SOL_ALG 选项级别279 (setsockopt() 的第一个参数)中等
算法字符串authencesn(hmac(sha256),cbc(aes))高 — 在 IPsec ESN 之外不常见
系统调用链socket(38) → setsockopt(279) → splice()高
PoC 密钥负载0800010000000010 (十六进制,位于 setsockopt 中)高(针对已知 PoC)
主要 PoC 目标/etc/passwd UID 字段中等
次要目标/usr/bin/su, /usr/bin/sudo中等
内核模块algif_aead视情况而定