pranmoydev/splunk-2026-supply-chain-detection-lab

GitHub: pranmoydev/splunk-2026-supply-chain-detection-lab

一个基于 Splunk 的供应链攻击检测实验室,模拟并检测 2026 年 Claude 源码泄露与 Axios RAT 攻击链。

Stars: 0 | Forks: 0

# Splunk SIEM 实验室:Anthropic 源码泄露与 Axios RAT 检测 [![Splunk](https://img.shields.io/badge/Splunk-Enterprise_10.2.2-000000?logo=splunk)](https://www.splunk.com/) [![Sigma](https://img.shields.io/badge/Sigma-Rules-000000?logo=sigma)](https://github.com/SigmaHQ/sigma) [![YARA](https://img.shields.io/badge/YARA-4.x-000000)](https://github.com/VirusTotal/yara) [![MITRE ATT&CK](https://img.shields.io/badge/MITRE_ATT&CK-Mapped-000000)](https://attack.mitre.org/) **一个完整的安全检测工程实验室,模拟 2026 年 3 月的 Anthropic Claude Code 源码泄露与受损的 axios 供应链攻击。** ## 📋 概述 本项目使用 Splunk Enterprise 作为 SIEM 实现了端到端的安全检测管道。实验室模拟了 2026 年 3 月 31 日发生的两个真实供应链事件: | 威胁 | 描述 | MITRE 技术 | |--------|-------------|-----------------| | **Anthropic 源码泄露** | 配置错误的源映射暴露了 51.2 万行 Claude Code 内部源码 | T1530, T1078 | | **Axios RAT** | 被破坏的 npm 包 `axios` 附带 `plain-crypto-js` RAT 泄露环境变量 | T1195.001, T1059.001 | ### 主要成就 - ✅ **部署 8 条检测规则**(4 条 Sigma→SPL,3 条 YARA),触发率达 100% - ✅ **针对风险评分的 PowerShell 检测**,克服 Windows 事件分段限制 - ✅ **自动化的 YARA 扫描器**,按 30 分钟间隔运行(Python) - ✅ **9 面板 Splunk 仪表板**,用于事件可视化 - ✅ **完整的文档**,涵盖挑战、差距与未来改进 ## 📊 仪表板 ![Flow](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/40f570658d013908.png) ## 🔄 数据流 ![Flow](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/c912b7aa21013908.png) ## 🏗️ 实验室架构 ┌─────────────────────────────────────────────────────────────────┐ │ Windows 主机(终端) │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │ │ │ Sysmon │ │PowerShell│ │ Security │ │ YARA Scanner │ │ │ │Event IDs │ │Event 4104│ │ Event │ │ (Python/sched) │ │ │ │1,3,11,13 │ │ │ │ Logs │ │ │ │ │ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────────┬─────────┘ │ │ └─────────────┴─────────────┴─────────────────┘ │ │ │ │ │ Splunk Universal Forwarder │ │ │ (port 9997) │ └──────────────────────────────┼───────────────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────────────┐ │ Ubuntu VM(运行 Splunk Enterprise) │ │ │ │ │ ┌─────────────────────────────────────────────────────────┐ │ │ │ 索引:main │ │ │ └─────────────────────────────────────────────────────────┘ │ │ │ │ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────┐ │ │ │ Sigma 规则 │ │ YARA 事件 │ │ 9 面板仪表板 │ │ │ │ (SPL 告警) │ │ (解析后) │ │ (Splunk Classic XML) │ │ │ └──────────────┘ └──────────────┘ └──────────────────────┘ │ └─────────────────────────────────────────────────────────────────┘ ## 📁 仓库结构 splunk-anthropic-lab/ │ ├── README.md # 本文件 ├── report/ │ └── README.md # 本文件 │ ├── rules/ │ ├── splunk/ # 原始 Sigma 规则(.spl) │ │ ├── sc-008.spl │ │ ├── sc-007.spl │ │ ├── sc-013a.spl │ │ └── sc-004a.spl │ │ │ ├── sigma/ # 转换后的 SPL 查询(.yml) │ │ ├── sc-008.yml │ │ ├── sc-007.yml │ │ ├── sc-013a.yml │ │ └── sc-004a.yml │ │ │ └── yara/ # YARA 检测规则(.yar) │ ├── claude_leak.yar │ ├── axios_rat.yar │ └── kairos_daemon.yar │ ├── scripts/ │ └── yara_scanner.py # 自动化 YARA 扫描器(30 分钟间隔) │ ├── screenshots/ # 仪表板与告警截图 │ ├── dashboard_main.png │ ├── sc-008_alert.png │ ├── sc-013a_risk_scoring.png │ └── yara_matches.png │ └── lab_setup/ └── inputs.conf # Splunk Universal Forwarder 配置 ## 🛠️ 检测规则总结 ### Sigma 规则(已转换为 SPL) | 规则 ID | 检测逻辑 | MITRE | 严重性 | |---------|-----------------|-------|----------| | **SC-008** | `powershell.exe` → `cmd.exe /c whoami` | T1059.001 | 高 | | **SC-007** | `node.exe` 写入使用 `../` 路径遍历的文件 | T1078 | 高 | | **SC-013a** | 对 `eval`、`require`、`process.env`、`dump` 进行风险评分 | T1059.001 | 中高 | | **SC-004a** | 命令行中包含 `KAIROS` 或 `daemon` 且含 `claude` | T1569 | 严重 | ### YARA 规则 | 规则名称 | 检测目标 | 严重性 | |-----------|------------------|----------| | `Claude_Code_Leak_Artifact` | `.claude/settings.local.json`、`dangerouslySkipPermissions`、`@anthropic-ai/claude-code` | 高 | | `Axios_RAT_PlainCryptoJS` | `plain-crypto-js`、`eval(process.env`、`dump(process.env` | 严重 | | `Claude_KAIROS_Daemon_Mode` | `KAIROS_ENABLED`、`daemon_mode` | 中 | ## 🧠 展示技能 - SIEM 工程 - 检测工程 - 威胁狩猎 - MITRE ATT&CK 映射 - YARA 规则编写 ## 📈 MITRE ATT&CK 覆盖范围 | 战术 | 技术 | 规则 | |-----------------|-----------------------------------------------------|-------------------| | 执行 | T1059.001 - 命令与脚本解释器 | SC-008, SC-013a | | 防御规避 | T1078 - 有效账户滥用 | SC-007 | | 初始访问 | T1195.001 - 破坏软件依赖 | YARA(axios-rat) | | 收集 | T1530 - 信息存储库中的数据 | YARA(claude-leak) | | 执行 | T1569 - 系统服务 | SC-004a | ## 📝 经验教训 - PowerShell 脚本块跨事件分割 → AND 逻辑失效。使用风险评分与分级严重性更稳健。 - Splunk Universal Forwarder 源类型可能在重启后丢失 → 始终确保基于文件的输入在重启前至少有一条记录。 - 在 Linux Lite 上安装 Sigma CLI → 需要通过 pipx 注入 `sigma-cli` `pySigma-backend-splunk`,因为 Python 环境受管。 - YARA 语法严格 → 不要在 meta 区域使用行内 `//` 注释;所有字符串变量必须在条件中引用。 - Sysmon 事件代码 1 需要显式配置 → 默认配置不会捕获所有进程创建事件。 ## 作者 Pranmoy 网络安全实验室项目 ## 📧 联系 [Pranmoy] — [https://www.linkedin.com/in/pranmoy-patar-b99a142b3/]
标签:Axios, Cloudflare, FTP漏洞扫描, IPv6, MITRE ATT&CK, npm污染, OpenCanary, PowerShell, RAT, Sigma规则, Sysmon, Windows端点, YARA, 事件关联, 云资产可视化, 仪表盘可视化, 供应链攻击, 安全工具, 安全编排, 日志采集, 明文加密, 源代码泄露, 目标导入, 端点检测与响应, 脱壳工具, 软件开发工具包, 逆向工具, 风险评分