mars13-tech/splunk-lab
GitHub: mars13-tech/splunk-lab
Splunk企业版实验室,用于SOC分析师技能培养和实战演练。
Stars: 0 | Forks: 0
# Splunk Lab — Splunk 企业版实验室
**作者:** Karthikeyan
**目标角色:** SOC 分析师(蓝队)
**平台:** Splunk 企业版(免费许可证)
**主机:** Windows
**状态:** 活动
🔗 [LinkedIn](https://www.linkedin.com/in/karthi-keyan-9042862bb) · 🐙 [GitHub](https://github.com/mars13-tech)
## 这是什么
一个基于 Splunk 企业版构建的家用实验室,用于培养真实的 SOC 分析师技能 —
SPL 查询编写、威胁狩猎、关联规则构建和使用 Windows 和 Linux 日志源进行检测工程。
这个实验室是应用检测项目的基石:
🔗 [splunk-soc-detection](https://github.com/mars13-tech/splunk-soc-detection)
## 实验室架构
```
Windows Event Logs (Security, System, Application)
↓
Splunk Universal Forwarder
↓
Splunk Enterprise (Windows Host)
↓
Search and Reporting (SPL Queries)
↓
Correlation Rules → Alerts → Detection
```
## 仓库结构
```
splunk-lab/
│
├── README.md
│
├── setup/
│ ├── splunk-install-notes.md — Splunk Enterprise installation walkthrough
│ └── troubleshooting-notes.md — Real issues hit during setup and how they were fixed
│
├── notes/
│ ├── splunk-setup-and-data-ingestion.md — Data sources, indexes, sourcetypes
│ ├── spl-fundamentals.md — Core SPL commands and syntax
│ ├── threat-hunting-with-spl.md — Threat hunting queries and methodology
│ ├── correlation-rules-and-alerts.md — Building correlation searches and alerts
│ └── detection-engineering-and-tuning.md — Detection logic and false positive reduction
│
├── queries/
│ ├── basic-spl-cheatsheet.md — Foundational SPL commands reference
│ ├── intermediate-spl-cheatsheet.md — Intermediate SPL commands reference
│ └── threat-hunting-spl.md — SPL queries for threat hunting
│
├── correlation-rules/
│ ├── brute-force-detection.md — T1110 — Brute force login detection
│ ├── brute-force-success.md — T1078 — Successful login after brute force
│ └── lateral-movement-detection.md — T1021 — Lateral movement via remote services
│
├── dashboards/
│ ├── dashboard-notes.md — Dashboard descriptions and query explanations
│ ├── correlation-rule-results.png — Correlation rule firing on failed logons
│ ├── spl-timechart.png — Event volume timechart by sourcetype
│ └── splunk-home.png — Splunk Enterprise home interface
│
└── screenshots/
├── screenshots-index.md — Index and description of all screenshots
├── splunk-search-interface.png — Splunk search workspace
├── spl-query-results.png — SPL query results showing sourcetype distribution
└── threat-hunting-search.png — Threat hunting search for failed logons
```
## 关联规则
| 规则 | MITRE 技术 | ID | 严重性 |
|---|---|---|---|
| 暴力破解检测 | 暴力破解:密码猜测 | T1110.001 | 高 |
| 暴力破解成功检测 | 有效账户 | T1078 | 严重 |
| 横向移动检测 | 远程服务:SSH | T1021.004 | 严重 |
## 关键 SPL 查询
### 失败登录检测
```
index=main EventCode=4625
| stats count by Account_Name
| sort -count
```
### 暴力破解源 IP 检测
```
index=main EventCode=4625
| rex "from (?\d+\.\d+\.\d+\.\d+)"
| stats count by src
| where count > 10
```
### 事件量时间图
```
index=main
| timechart span=1h count by sourcetype
```
### 提权检测
```
index=main EventCode=4672
| stats count by Account_Name
| sort -count
```
### 可疑进程执行
```
index=main EventCode=4688
| search Image="*cmd*" OR Image="*powershell*"
| table _time Account_Name Image CommandLine
```
## MITRE ATT&CK 覆盖范围
| 技术 | ID | 检测 |
|---|---|---|
| 暴力破解:密码猜测 | T1110.001 | 失败登录计数阈值 |
| 有效账户 | T1078 | 失败后的成功登录 |
| 远程服务:SSH | T1021.004 | 来自意外来源的网络登录 |
| 提权 | T1068 | 监控事件 ID 4672 |
| 命令和脚本解释器 | T1059.004 | 监控事件 ID 4688 进程 |
## 展示的技能
| 技能 | 证据 |
|---|---|
| Splunk 管理 | setup/ — 完整安装和配置有文档记录 |
| SPL 查询编写 | queries/ — 3 个覆盖基本到威胁狩猎的速查表文件 |
| 关联规则构建 | correlation-rules/ — 3 个规则带有 MITRE 映射 |
| 威胁狩猎 | queries/threat-hunting-spl.md · screenshots/threat-hunting-search.png |
| 仪表板开发 | dashboards/ — 3 个仪表板截图,包含完整说明 |
| 故障排除 | setup/troubleshooting-notes.md — 7 个真实问题有文档记录 |
| 检测工程 | 应用在 splunk-soc-detection 项目中 |
## 我在教程中没有学到的东西
最难的部分不是编写 SPL 查询。
而是知道查询哪个字段。
Ubuntu 上的 Auth.log 使用与 Windows 上的 WinEventLog:Security 完全不同的字段名。相同的攻击 — 失败登录 — 在每个日志源中看起来都完全不同。理解这种差异是区分能够编写 SPL 的人和能够实际在真实环境中狩猎威胁的人的关键。
## 应用项目
在这个实验室中构建的技能被应用于一个完整的检测工程项目:
🔗 [splunk-soc-detection](https://github.com/mars13-tech/splunk-soc-detection)
该项目模拟了跨 Linux 和 Windows 的真实暴力破解和横向移动攻击 — 完全使用 Splunk 进行检测。
## 作者
**Karthikeyan**
网络安全工程学生 | 蓝队 | 正在成为的 SOC 分析师
🔗 [LinkedIn](https://www.linkedin.com/in/karthi-keyan-9042862bb)
🐙 [GitHub](https://github.com/mars13-tech)
标签:DNS解析, LinkedIn, Linux 日志, SOC 分析, SPL 查询, URL发现, Windows 日志, 中间级命令, 关联规则, 威胁情报, 安全实验室, 安全检测, 安全运营中心, 安装指南, 开发者工具, 开源项目, 技术文档, 故障排除, 数据源, 核心命令, 源类型, 生成式AI, 管理员页面发现, 索引, 网络映射, 误报减少