| Linux 内核 CVE 漏洞检测与 PoC 验证工具。88 个内核漏洞检测器,CTF 挑战模式验证。需要 root 权限(sudo)运行。 务必在检测内核漏洞时使用此技能。每当需要验证 CVE 或执行 PoC 验证时,优先调用此技能。 当用户提到内核安全、CVE 检测、漏洞利用验证时,主动触发。
npx skills add https://github.com/aliyun/alibabacloud-ecs-troubleshoot-skills --skill alibabacloud-ecs-sec-kernel
Linux 内核 CVE 漏洞检测与 PoC 验证工具。88 个内核漏洞检测器,CTF 挑战模式验证。
Version: 1.4.0 (JSON-driven architecture)
当以下场景出现时,务必主动调用此技能:
> PoC 验证可能导致 kernel crash (panic/hang/deadlock),建议在隔离的虚拟机/可快照环境中运行。
> PoC 不会永久改写系统文件,不会进行持久化提权。所有临时修改均在 Post 阶段完整恢复。
> 使用本工具即表示您同意遵守 完整安全声明 中的所有条款。
> 违规使用需承担全部法律责任。
# 从 skill 根目录执行:
# 需要 root 权限(sudo)
# 全量检测与 PoC 验证(默认对所有 enabled 的 CVE 执行 PoC)
sudo python3 -m scripts --verbose
# 单 CVE 验证
sudo python3 -m scripts --cve-id CVE-2026-31431 -v
# 列出所有检测器(无需 root)
python3 -m scripts --list-detectors
# 自动编译缺失的 PoC 二进制
sudo python3 -m scripts --compile-poc -v
# 输出 JSON 格式报告
sudo python3 -m scripts --format json -v
| 参数 | 类型 | 默认值 | 说明 |
|------|------|--------|------|
| --mode | choice | host | 运行模式(仅 host,Linux 服务器环境) |
| --poc-output | path | ./workspace | PoC 证据输出目录 |
| --poc-timeout | int | 30 | PoC 执行超时时间(秒) |
| --no-prepare | flag | off | 跳过 Prepare 阶段 |
| --no-post | flag | off | 跳过 Post 阶段 |
| --poc-user | string | nobody | Run 阶段执行用户(降权执行) |
| --no-force-demote | flag | off | 不强制降权到非特权用户 |
| --compile-poc | flag | off | 自动编译缺失的 PoC 二进制文件(plain 模式) |
| --output-dir | path | ./workspace | 报告输出目录 |
| --format | choice | markdown | 报告格式(markdown / json) |
| --cve-id | string | - | 仅检测指定 CVE |
| --config | path | - | 配置文件路径 |
| --verbose / -v | flag | off | 详细输出 |
| --list-detectors | flag | off | 列出所有检测器(无需 root) |
默认行为: 所有在 kernel_cves.yaml 中 enabled: true 的 CVE 都会自动执行 PoC 验证,无需额外参数。唯一跳过 PoC 的条件是将 CVE 设置为 enabled: false。
--compile-poc: 当 poc-bin/ 目录下缺少对应 ELF binary 时,自动调用 poc-src/build.sh 编译。仅在 plain 模式(源码部署)下生效。
> Why: 本地编译确保 PoC 源码不出环境,源码仅存在于有 git 的开发机器上,编译产物才会同步到远程。
--no-prepare / --no-post: 跳过三阶段验证中的 Prepare 或 Post 阶段。用于调试目的,生产环境建议保留完整三阶段。
--poc-user: Run 阶段以指定用户身份执行 PoC binary,默认 nobody(uid=65534)。用于验证 LPE(本地提权)路径。
--no-force-demote: 默认情况下 PoC 执行会强制降权到 --poc-user 指定的非特权用户。此参数禁用强制降权。
PoC 三阶段验证需要 root 权限的原因:
modprobe algif_aead、modprobe esp4 等)、创建 root 拥有的目标文件、配置 xfrm SA/SP 等安全策略CTF 挑战模式的设计理由:
setuid(0),只是通过文件操作证明漏洞可被利用| 指标 | 数量 |
|------|------|
| 总检测器数 | 88 |
| write_root_file 模式 | 84 |
| read_root_file 模式 | 24 |
| uaf 模式 | 5 |
每次执行完成后自动输出详细统计报表,包含:
| 模式 | 目标文件权限 | 验证方式 | 数量 |
|------|-------------|---------|------|
| write_root_file | root:root 0644 | nobody 通过内核漏洞写入 root 文件 | 86 |
| read_root_file | root:root 0400 | nobody 通过内核漏洞读取 root 文件 | 24 |
| uaf | N/A | Use-After-Free 利用验证 | 5 |
[PoC-IMPL] 标签区分环境问题和代码问题)==============================================================
sec-kernel v1.4.1 - Linux Kernel CVE Detection
==============================================================
Kernel: 5.15.0-91-generic (x86_64)
Mode: host (Linux Server)
==============================================================
==============================================================
Detection Summary
==============================================================
Total CVEs checked: 88
Vulnerable: 3
Not Vulnerable: 80
Uncertain: 2
PoC Exploitable: 2
Execution time: 45.32s
==============================================================
================================================================
sec-kernel PoC Execution Statistics
================================================================
Total Detectors: 88 (with PoC capability)
PoC Executed: 83
------------------------------------------------------------
SUCCESS (ran correctly): 78
+- EXPLOITABLE: 2 (vulnerability confirmed)
+- NOT_EXPLOITABLE: 76 (kernel patched/mitigated)
------------------------------------------------------------
FAILED (execution error): 5
+- TIMEOUT: 2
+- CRASH: 1
+- MISSING_BIN: 0
+- PARSE_ERROR: 2
+- PERMISSION: 0
------------------------------------------------------------
SKIPPED: 2
+- NO_MODULE: 2
------------------------------------------------------------
Execution Time: 45.32s
================================================================
⚠️ SECURITY DISCLAIMER / 安全声明
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
本工具仅限在已授权的隔离测试环境中使用。
严禁用于生产环境或未授权系统。违规使用需承担全部法律责任。
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[Phase 1: Prepare] (root)
✓ Loaded kernel module: algif_aead
✓ Created target file: /tmp/sec-kernel-poc-XXXX/poc_target (root:root 0644)
✓ Initial content: writeme_a3f8b2c1
[Phase 2: Run] (nobody, uid=65534)
CTF_READ_BEFORE:writeme_a3f8b2c1
CTF_WRITE:ctf{164d74cd804f9361} (attempting...)
CTF_READ_AFTER:ctf{164d74cd804f9361}
CTF_FLAG:ctf{164d74cd804f9361}
POC_RESULT:EXPLOITABLE
[Phase 3: Post] (root)
✓ File content verified: ctf{164d74cd804f9361} ✓ MATCH
✓ Cleanup completed
✓ System state restored
[RESULT] CVE-2026-31431: EXPLOITABLE (confidence=0.95)
| 字段 | 含义 |
|------|------|
| CTF_READ_BEFORE: | PoC 执行前读取的原始文件内容 |
| CTF_WRITE: | PoC 尝试写入的 CTF 值 |
| CTF_READ_AFTER: | PoC 执行后读取的文件内容 |
| CTF_FLAG:ctf{xxx} | 漏洞利用成功的标志值 |
| POC_RESULT:EXPLOITABLE | 漏洞可利用 |
| POC_RESULT:NOT_EXPLOITABLE | 漏洞不可利用(内核已修复) |
| 结果 | 含义 | 建议操作 |
|------|------|----------|
| EXPLOITABLE | 当前内核存在可利用漏洞 | 立即升级内核 |
| NOT_EXPLOITABLE | 漏洞条件不满足或已修复 | 无需操作 |
| DETECTION_ONLY | 版本匹配但未执行 PoC | 建议进一步验证 |
以下 CVE 已在真实内核环境中通过 CTF 挑战模式验证提权成功(EXPLOITABLE),CTF flag 每次随机生成。
[Phase 1: Prepare] (root)
Created CTF target: /tmp/sec-kernel-poc-XXXX/poc_target_canary
mode=write_root_file, uid=0, perm=644
Initial content: writeme_f9de12afe0d6da5a
[Phase 2: Run] (nobody, uid=65534)
CTF_WRITE:ctf{dddb28301f24e3db} (attempting...)
CTF_FLAG:ctf{dddb28301f24e3db}
POC_RESULT:EXPLOITABLE
[Phase 3: Post] (root)
CTF write_root_file PASSED: inner value matches (dddb28301f24e3db)
Rollback executed: target file removed
System state restored
[RESULT] CVE-2026-31431: EXPLOITABLE (confidence=0.95)
Kernel: 6.6.87.2-microsoft-standard-WSL2
Exploit path: AF_ALG AEAD authencesn + splice() -> page cache corruption
[Phase 1: Prepare] (root)
Created CTF target: /tmp/sec-kernel-poc-XXXX/poc_target_dirtyfrag
mode=write_root_file, uid=0, perm=644, size=4096
Module state snapshot: esp4=loaded
[Phase 2: Run] (nobody, uid=65534)
CTF_WRITE:ctf{ab2084cd52cdad11} (attempting via rxrpc/rxkad...)
RxRPC variant failed (EAFNOSUPPORT), trying ESP/xfrm fallback...
CTF_WRITE:ctf{ab2084cd52cdad11} (attempting via esp/xfrm fallback...)
CTF_FLAG:ctf{ab2084cd52cdad11}
POC_RESULT:EXPLOITABLE
[Phase 3: Post] (root)
CTF write_root_file PASSED: inner value matches (ab2084cd52cdad11)
Rollback executed: target file removed
System state restored
[RESULT] CVE-2026-PENDING-DIRTYFRAG: EXPLOITABLE (confidence=0.95)
Kernel: 6.6.87.2-microsoft-standard-WSL2
Exploit path: ESP/xfrm variant (RxRPC fallback) -> splice() page cache write
Dual-variant: RxRPC (Ubuntu 24.04) / ESP (WSL2) automatic fallback
Phase 1 (root): 准备环境 — 加载模块、创建目标文件、记录初始状态
Phase 2 (nobody): 执行 PoC — 读原值 → 漏洞利用写入 → 读回验证
Phase 3 (root): 验证清理 — 独立确认写入结果、恢复系统状态
完整 CVE 检测列表见 references/cve-list.md(88 个内核漏洞检测器,全部启用 CTF 挑战模式验证)。
覆盖子系统:Netfilter/nf_tables (18) | eBPF/BPF (8) | Network/Socket (12) | TLS (7) | io_uring (3) | Memory/Page Cache (5) | Filesystem (3) | IPsec/xfrm (3) | ptrace/cred (3) | Others (23)
PoC 执行日志:workspace/poc-{CVE-ID}.log
回退路径:/tmp/poc-{CVE-ID}.log(workspace 不可写时)
Expert in secure backend coding practices specializing in input validation, authentication, and API security. Use PROACTIVELY for backend security implementations or security code reviews.
This skill should be used when the user asks to "perform cloud penetration testing", "assess Azure or AWS or GCP security", "enumerate cloud resources", "exploit cloud misconfigurations", "test O365 security", "extract secrets from cloud environments", or "audit cloud infrastructure". It provides comprehensive techniques for security assessment across major cloud platforms.
You are a dependency security expert specializing in vulnerability scanning, license compliance, and supply chain security. Analyze project dependencies for known vulnerabilities, licensing issues, outdated packages, and provide actionable remediation strategies.
Comprehensive Flow Nexus platform management - authentication, sandboxes, app deployment, payments, and challenges
This skill should be used when the user asks to "escalate privileges on Linux", "find privesc vectors on Linux systems", "exploit sudo misconfigurations", "abuse SUID binaries", "exploit cron jobs for root access", "enumerate Linux systems for privilege escalation", or "gain root access from low-privilege shell". It provides comprehensive techniques for identifying and exploiting privilege escalation paths on Linux systems.
Expert malware analyst specializing in defensive malware research, threat intelligence, and incident response. Masters sandbox analysis, behavioral analysis, and malware family identification. Handles static/dynamic analysis, unpacking, and IOC extraction. Use PROACTIVELY for malware triage, threat hunting, incident response, or security research.
This skill should be used when the user asks to "use Metasploit for penetration testing", "exploit vulnerabilities with msfconsole", "create payloads with msfvenom", "perform post-exploitation", "use auxiliary modules for scanning", or "develop custom exploits". It provides comprehensive guidance for leveraging the Metasploit Framework in security assessments.
Expert in secure mobile coding practices specializing in input validation, WebView security, and mobile-specific security patterns. Use PROACTIVELY for mobile security implementations or mobile security code reviews.
Take aliyun/alibabacloud-ecs-sec-kernel from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.