faizaanmir/splunk-spl-pack
GitHub: faizaanmir/splunk-spl-pack
一套与 MITRE ATT&CK 对齐的 Splunk SPL 检测查询集合,帮助 SOC 团队快速开展威胁检测和狩猎工作。
Stars: 0 | Forks: 0
# Splunk SPL Query Pack
一个精心整理的 Splunk SPL (Search Processing Language) 查询库,用于检测、威胁狩猎和事件调查。基于实际的 SOC 经验构建,并与 MITRE ATT&CK 对齐。
适用于 SPLK-1002 考试准备和实际的 SOC 运营。
## 结构
```
splunk-spl-pack/
├── authentication/ # Login failures, brute force, privilege escalation
├── endpoint/ # Process execution, file activity, registry changes
├── network/ # DNS, proxy, firewall, traffic anomalies
├── email/ # Phishing, malicious attachments, email flow
└── threat-hunting/ # Proactive hunt queries across multiple data sources
```
## 查询索引
### 身份验证
| 文件 | 技术 | 描述 |
|---|---|---|
| `authentication/brute-force-detection.spl` | T1110 | 检测来自单一来源的重复登录失败 |
| `authentication/password-spray.spl` | T1110.003 | 针对大量账户的慢速登录失败 |
| `authentication/after-hours-login.spl` | T1078 | 在工作时间之外的成功登录 |
| `authentication/privilege-escalation-sudo.spl` | T1548.003 | 非标准账户使用 Linux sudo |
### 终端
| 文件 | 技术 | 描述 |
|---|---|---|
| `endpoint/powershell-suspicious.spl` | T1059.001 | 编码或混淆的 PowerShell 命令 |
| `endpoint/new-service-installed.spl` | T1543.003 | 创建新的 Windows 服务(横向移动 / 持久化) |
| `endpoint/lolbas-execution.spl` | T1218 | Living off the Land 二进制文件滥用 |
| `endpoint/ransomware-file-extension.spl` | T1486 | 大量文件扩展名更改,表明存在勒索软件 |
### 网络
| 文件 | 技术 | 描述 |
|---|---|---|
| `network/dns-exfiltration.spl` | T1048.003 | 具有长子域名的大量 DNS 查询 |
| `network/beaconing-detection.spl` | T1071 | 固定间隔的定期出站连接(C2 信标) |
| `network/port-scan-detection.spl` | T1046 | 单一来源连接到多个端口/主机 |
| `network/large-outbound-transfer.spl` | T1048 | 异常的大型数据上传到外部目标 |
### 电子邮件
| 文件 | 技术 | 描述 |
|---|---|---|
| `email/phishing-attachment-types.spl` | T1566.001 | 带有高风险附件扩展名的电子邮件 |
| `email/spoofed-sender-detection.spl` | T1566 | 发件人域不匹配 / SPF-DKIM 失败 |
### 威胁狩猎
| 文件 | 描述 |
|---|---|
| `threat-hunting/rare-processes.spl` | 识别在整个环境中很少运行的进程 |
| `threat-hunting/first-time-seen-connections.spl` | 连接到以前从未见过的目标的外部连接 |
## SPL 备忘单
### 核心命令
```
| stats count by field # Count events grouped by field
| table field1 field2 # Select specific fields
| sort -count # Sort descending by count
| dedup field # Remove duplicate values
| eval newfield=if(x>5,"high","low") # Conditional field creation
| rex field=_raw "(?pattern)" # Extract field with regex
| transaction host maxspan=5m # Group related events into transactions
| timechart span=1h count by src # Time-based chart grouped by field
| rename old AS new # Rename field
| where count > 10 # Filter after stats
```
### 时间修饰符
```
earliest=-24h latest=now # Last 24 hours
earliest=-7d@d latest=@d # Last 7 days (snapped to day)
earliest=@w0 latest=@w0+7d # Current week
```
### Lookups
```
| lookup threat_intel_ips ip AS src_ip OUTPUT threat_category
| inputlookup my_watchlist.csv
| outputlookup updated_watchlist.csv
```
## 使用说明
- 所有查询均使用 `index=*` 作为占位符 —— 请替换为您实际的索引名称
- 调整时间范围和阈值以匹配您的环境基线
- 在部署为警报之前,请在 Splunk 的 Search & Reporting 应用程序中测试查询
- 在测试期间使用 `| head 100` 来限制结果集
*作者:Faizaan Sajjad — Security Specialist, Orange Cyber Defense*
*所有示例均使用脱敏数据。不包含任何生产或客户数据。*
标签:CSV导出, IP 地址批量处理, SPL查询, 安全检测规则, 安全运营, 扫描框架, 插件系统, 知识库安全, 红队行动