krmahadik456/Cybersecurity-Investigation-Lab-Threat-Hunting-with-Splunk
GitHub: krmahadik456/Cybersecurity-Investigation-Lab-Threat-Hunting-with-Splunk
一个基于 Splunk 平台的 SOC 威胁狩猎实战项目,通过分析真实攻击数据集完整还原并记录了 APT 攻击链的调查过程。
Stars: 0 | Forks: 0
# 网络安全调查实验室 — 使用 Splunk 进行威胁狩猎
## 📌 项目概述
本项目模拟了真实的安全运营中心 (SOC) 调查。我担任一级 SOC 分析师,通过分析企业攻击日志来检测、调查并记录完整的网络攻击链。
### 场景背景
一家名为 Frothly Inc. 的虚构公司遭遇了安全漏洞。我使用 Splunk 分析了他们的网络和系统日志,以揭示攻击者是如何获取访问权限、他们执行了哪些操作,以及他们是如何维持持久化的。
### 发现的攻击类型
**Apache Struts2 远程代码执行 (CVE-2018-11776)** — 与 Equifax 数据泄露事件中利用的漏洞相同。
## 🛠️ 工具与环境
| 工具 | 用途 |
|------|---------|
| Splunk Enterprise | 用于日志分析的 SIEM 平台 |
| BOTS v3 Dataset | 真实的企业攻击数据 |
| SPL | 用于查询的 Splunk 搜索语言 |
| MITRE ATT&CK | 用于映射攻击者技术的框架 |
## 📊 调查步骤
### 1. 初始日志评估
首先,我探索了数据集以了解可用的日志类型:
```
index=botsv3 earliest=0 | stats count by sourcetype | sort -count
```
**📸 截图:**

### 2. 识别可疑活动
我查找了可能表明攻击的异常 POST 请求:
```
index=botsv3 earliest=0 sourcetype="stream:http" http_method=POST
| stats count by uri_path, src_ip
| sort -count
| head 20
```
**关键发现:** 一个 IP 地址 (`192.168.8.103`) 在反复访问一个可疑的 URL (`/frothlyinventory/integration/saveGangster.action`)。
**📸 截图:**

### 3. 确认攻击
我检查了 POST 数据以确认恶意活动:
```
index=botsv3 earliest=0 sourcetype="stream:http" uri_path="/frothlyinventory/integration/saveGangster.action" http_method=POST
| table _time, src_ip, form_data
| sort _time
```
**📸 截图:**

### 4. 提取攻击者命令
我提取了攻击者执行的隐藏命令:
```
index=botsv3 earliest=0 sourcetype="stream:http" src_ip="192.168.8.103" http_method=POST
| rex field=form_data "cmd='(?P[^']+)'"
| where isnotnull(command)
| table _time, command
| sort _time
```
**📸 截图:**

### 5. 持久化检测
我发现了攻击者创建后门的证据:
```
index=botsv3 earliest=0 sourcetype="stream:http" src_ip="192.168.8.103" http_method=POST
| rex field=form_data "cmd='(?P[^']+)'"
| search command="*useradd*"
| table _time, command
```
**📸 截图:**

### 6. 权限提升尝试
攻击者上传了一个名为 `colonel.c` 的内核漏洞利用程序:
```
index=botsv3 earliest=0 sourcetype="stream:http" src_ip="192.168.8.103" http_method=POST
| rex field=form_data "cmd='(?P[^']+)'"
| search command="*colonel*"
| table _time, command
```
**📸 截图:**

### 7. 命令与控制 (C2) 发现
我检测到攻击者正在建立一个指向外部服务器的反弹 shell:
```
index=botsv3 earliest=0 sourcetype="stream:http" src_ip="192.168.8.103" http_method=POST
| rex field=form_data "cmd='(?P[^']+)'"
| search command="*nc*" OR command="*backpipe*"
| where NOT like(command,"echo%")
| table _time, command
| sort _time
```
**📸 截图:**

### 8. SOC 仪表板
我在 Splunk 中构建了一个包含 5 个面板的实时 SOC 仪表板:
| 面板 | 类型 | 用途 |
|-------|------|---------|
| 攻击活动时间线 | 折线图 | 可视化攻击模式 |
| 主要攻击者 | 柱状图 | 识别可疑 IP |
| 命令使用情况 | 柱状图 | 查看使用了哪些命令 |
| C2 连接 | 表格 | 监控反弹 shell 尝试 |
| 流量分布 | 饼图 | 分析 HTTP 方法使用情况 |
**📸 截图:**

## 📅 攻击时间线
| 时间 | 活动 |
|------|----------|
| 15:15 | 自动化扫描开始 |
| 16:35 | Struts2 RCE 漏洞利用执行 |
| 16:36 | 侦察 (whoami, id) |
| 16:36 | 窃取密码文件 (/etc/passwd) |
| 16:37 | 创建后门账户 (tomcat7) |
| 16:38 | 上传内核漏洞利用 (colonel.c) |
| 16:42 | 创建反弹 shell 管道 |
| 16:43 | C2 连接到 45.77.53.176:8088 |
| 17:04 | 第二次 C2 连接尝试 |
## 🏛️ MITRE ATT&CK 框架映射
| 战术 | 技术 | ID |
|--------|-----------|-----|
| 初始访问 | 利用面向公众的应用程序 | T1190 |
| 执行 | 命令和脚本解释器 | T1059 |
| 发现 | 系统信息发现 | T1082 |
| 凭据访问 | 操作系统凭据转储 | T1003 |
| 持久化 | 创建账户 | T1136 |
| 权限提升 | 利用漏洞进行权限提升 | T1068 |
| 命令与控制 | 应用层协议 | T1071 |
## 🔑 关键发现
| 发现 | 详情 |
|---------|--------|
| 漏洞 | CVE-2018-11776 (Struts2 RCE) |
| 攻击者 IP | 192.168.8.103 |
| C2 服务器 | 45.77.53.176:8088 |
| 后门账户 | tomcat7 |
| 漏洞利用文件 | colonel.c |
## 🛡️ 建议
### 立即采取的行动
1. 在防火墙处**阻断** C2 服务器 IP 地址 (45.77.53.176)
2. **移除**后门用户账户 (tomcat7)
3. **修补** Apache Struts2 漏洞 (CVE-2018-11776)
### 短期行动
4. **实施** Web 应用防火墙 (WAF)
5. **监控**所有出站网络连接
6. **启用**所有关键系统的全面日志记录
### 长期行动
7. **执行**定期的漏洞评估
8. **实施**网络分段
9. **提供**员工安全意识培训
## 📁 仓库结构
```
SOC-Splunk-Project/
├── README.md ← You are here
├── screenshots/ ← All investigation screenshots
│ ├── 01_sourcetypes.png
│ ├── 02_suspicious_post_urls.png
│ ├── 03_attacker_confirmed.png
│ ├── 04_attack_commands.png
│ ├── 05_backdoor_account.png
│ ├── 06_kernel_exploit.png
│ ├── 07_c2_reverse_shell.png
│ └── 08_full_dashboard.png
├── detections/ ← SPL detection rules
│ ├── 01_suspicious_post_urls.spl
│ ├── 02_attacker_confirmed.spl
│ ├── 03_attack_commands.spl
│ ├── 04_c2_reverse_shell.spl
│ └── 05_backdoor_account.spl
└── reports/
└── Incident_Report_Frothly_APT.md ← Full incident report
```
## 👤 关于我
**Kaustubh Rohidas Mahadik**
有志成为 SOC 分析师 | 网络安全爱好者
## 📎 参考
- [Splunk BOTS v3 数据集](https://github.com/splunk/botsv3)
- [MITRE ATT&CK 框架](https://attack.mitre.org/)
- [CVE-2018-11776](https://nvd.nist.gov/vuln/detail/CVE-2018-11776)
标签:BurpSuite集成, 安全实验报告, 安全运营中心, 网络映射