MarahAlkilani/SOC-project-Threat-Intelligence-
GitHub: MarahAlkilani/SOC-project-Threat-Intelligence-
一个基于 Splunk Enterprise 的 SOC 威胁情报检测平台,通过威胁情报关联、行为分析和 AI 启发式模型实现网络威胁的自动化检测与风险优先级排序。
Stars: 0 | Forks: 0
# SOC 威胁情报平台
一个使用 **Splunk Enterprise** 构建的安全运营中心(SOC)威胁情报项目,用于使用真实数据集、威胁情报查询、行为分析和 AI 启发式检测模型来检测、分析和监控网络威胁。
本项目集成了:
- 威胁情报(TI)源
- Splunk 查询表
- 关联搜索
- 行为检测规则
- 风险评分
- AI 驱动的异常检测
- 仪表板和告警
# 📌 项目概述
本项目的目标是模拟一个真实的 SOC 环境,能够:
- 检测恶意 IP、域名、URL 和 User-Agent
- 识别暴力破解和端口扫描攻击
- 使用外部情报进行威胁富化
- 创建基于风险的优先级排序
- 为分析师生成告警和仪表板
- 应用 AI 启发式检测模型进行异常检测
该项目完全在 **Splunk Enterprise** 中使用自定义 SPL 查询、查询表和已保存告警实现。
# 🛠 使用的技术
- Splunk Enterprise
- SPL(搜索处理语言)
- CSV 数据集
- 威胁情报源
- 查询表
- 行为分析
- 风险评分
- AI 启发式检测模型
# 📂 项目结构
```
SOC-project-Threat-Intelligence/
│
├── datasets/
│ ├── train_test_network.csv
│ ├── linux_auth_logs_full(balanced).csv
│
├── lookups/
│ ├── threat_intel_ips.csv
│ ├── threat_intel_domains.csv
│ ├── threat_intel_urls.csv
│ ├── threat_intel_useragents.csv
│
├── spl_queries/
│ ├── rule_1.spl
│ ├── rule_2.spl
│ ├── ...
│
├── README.md
```
# 📊 数据源
项目使用两个主要数据集:
## 1. 网络流量数据集
包含:
- 源 IP
- 目标 IP
- DNS 查询
- URL
- HTTP User-Agent
- 攻击标签
数据集:
```
train_test_network.csv
```
## 2. Linux 认证日志
包含:
- 登录尝试
- 源 IP
- 用户名
- 登录状态
- 端口
- 服务器
- 攻击异常
数据集:
```
linux_auth_logs_full(balanced).csv
```
# 🧠 威胁情报查询表
创建并在 Splunk 中集成了多个威胁情报查询表。
## 查询表
| 查询表 | 描述 |
|---|---|
| `threat_intel_ips.csv` | 恶意 IP 地址 |
| `threat_intel_domains.csv` | 恶意域名 |
| `threat_intel_urls.csv` | 恶意 URL |
| `threat_intel_useragents.csv` | 可疑 User-Agent |
# 🔍 检测规则
SOC 威胁情报平台包含 9 个高级检测和关联规则,旨在识别恶意活动、富化入侵指标(IOC)、检测行为异常,并根据风险严重性对威胁进行优先级排序。
这些规则结合了:
- 威胁情报富化
- 行为分析
- 关联搜索
- 风险评分
- AI 启发式异常检测
# 规则 1 — 认证日志中的恶意 IP
通过将认证日志与外部威胁情报源关联,检测尝试对 Linux 系统进行身份验证的恶意源 IP 地址。
### 功能
- 威胁情报富化
- 登录活动监控
- 严重性分类
- 用户目标可见性
```
index=soc_project source="linux_auth_logs_full(balanced).csv"
| lookup threat_intel_ips ioc_value AS source_ip
OUTPUT severity, source AS ti_source, description
| where isnotnull(severity)
| stats count AS hit_count,
values(username) AS targeted_users,
values(status) AS login_status
by source_ip, severity, description
| sort -hit_count
```
# 规则 2 — 网络流量中的恶意 IP
使用威胁情报查询表检测网络流量日志中的恶意源或目标 IP 地址。
### 功能
- 源和目标 IP 检查
- IOC 关联
- 攻击类型可见性
- 威胁严重性识别
```
index=soc_project source="train_test_network.csv"
| eval check_ip=mvappend(src_ip, dst_ip)
| mvexpand check_ip
| lookup threat_intel_ips ioc_value AS check_ip
OUTPUT severity, source AS ti_source, description
| where isnotnull(severity)
| stats count AS hits,
values(label) AS attack_label,
values(type) AS attack_type
by check_ip, severity, description
| sort -hits
```
# 规则 3 — 恶意域名检测
检测通过 DNS 查询的可疑和恶意域名。
### 功能
- DNS 查询检查
- 域名 IOC 富化
- 威胁严重性映射
- 主机可见性
```
index=soc_project source="train_test_network.csv"
dns_query!="-"
dns_query!=""
| lookup threat_intel_domains ioc_value AS dns_query
OUTPUT severity, source AS ti_source, description
| where isnotnull(severity)
| stats count AS hits,
values(src_ip) AS requesting_hosts
by dns_query, severity, description
| sort -hits
```
# 规则 4 — 恶意 URL 检测
检测网络通信中访问的恶意 URL。
### 功能
- URL 检查
- IOC 富化
- 源和目标跟踪
- 威胁分类
```
index=soc_project source="train_test_network.csv"
http_uri!="-"
http_uri!=""
| lookup threat_intel_urls ioc_value AS http_uri
OUTPUT severity, source AS ti_source, description
| where isnotnull(severity)
| stats count AS hits,
values(src_ip) AS source_hosts,
values(dst_ip) AS dest_hosts
by http_uri, severity, description
| sort -hits
```
# 规则 5 — 可疑 User-Agent 检测
检测通常与恶意软件、扫描器、机器人或自动化攻击工具相关的可疑或恶意 HTTP User-Agent 字符串。
### 功能
- User-Agent 检查
- 行为检测
- 威胁情报关联
- 目标 URL 可见性
```
index=soc_project source="train_test_network.csv"
http_user_agent!="-"
http_user_agent!=""
| lookup threat_intel_useragents ioc_value AS http_user_agent
OUTPUT severity, source AS ti_source, description
| where isnotnull(severity)
| stats count AS hits,
values(src_ip) AS source_hosts,
values(http_uri) AS target_urls
by http_user_agent, severity, description
| sort -hits
```
# 规则 6 — 暴力破解检测
通过识别来自同一源 IP 地址的过多失败认证尝试来检测暴力破解登录尝试。
### 功能
- 失败登录监控
- 用户目标分析
- 风险分类
- 认证异常检测
```
index=soc_project source="linux_auth_logs_full(balanced).csv"
status="Failed"
| stats count AS failed_attempts,
dc(username) AS unique_users_targeted,
values(username) AS usernames,
latest(_time) AS last_attempt
by source_ip
| where failed_attempts > 10
| sort -failed_attempts
| eval risk_level=case(
failed_attempts>100, "Critical",
failed_attempts>50, "High",
failed_attempts>20, "Medium",
1==1, "Low")
```
# 规则 7 — 端口扫描检测
通过分析跨多个端口和服务器的异常连接行为来检测端口扫描活动。
### 功能
- 端口扫描检测
- 多服务器目标分析
- 扫描强度监控
- 行为威胁分析
```
index=soc_project source="linux_auth_logs_full(balanced).csv"
anomaly_label="port_scan"
| stats count AS scan_events,
dc(port) AS ports_scanned,
dc(server) AS servers_targeted,
values(server) AS server_list
by source_ip
| sort -scan_events
| eval risk_level=case(
scan_events>100, "Critical",
scan_events>50, "High",
1==1, "Medium")
```
# 规则 8 — 多 IOC 风险评分
将多个入侵指标合并为统一的风险评分,以改进威胁优先级排序和事件响应。
### 功能
- 多源 IOC 富化
- IP 严重性评分
- 域名严重性评分
- URL 严重性评分
- User-Agent 严重性评分
- 风险等级分类
```
index=soc_project source="train_test_network.csv"
| lookup threat_intel_ips ioc_value AS src_ip OUTPUT severity AS ip_severity
| lookup threat_intel_ips ioc_value AS dst_ip OUTPUT severity AS dst_ip_severity
| lookup threat_intel_domains ioc_value AS dns_query OUTPUT severity AS domain_severity
| lookup threat_intel_urls ioc_value AS http_uri OUTPUT severity AS url_severity
| lookup threat_intel_useragents ioc_value AS http_user_agent OUTPUT severity AS ua_severity
| eval ip_score=case(ip_severity=="critical",5, ip_severity=="high",3, ip_severity=="medium",1, isnotnull(dst_ip_severity),2, 1==1,0)
| eval domain_score=case(domain_severity=="critical",5, domain_severity=="high",3, domain_severity=="medium",1, 1==1,0)
| eval url_score=case(url_severity=="critical",5, url_severity=="high",3, url_severity=="medium",1, 1==1,0)
| eval ua_score=case(ua_severity=="critical",5, ua_severity=="high",3, ua_severity=="medium",1, 1==1,0)
| eval total_threat_score=ip_score+domain_score+url_score+ua_score
| where total_threat_score > 0
```
# 规则 9 — 基于 AI 的威胁优先级排序
使用加权攻击评分和威胁情报富化自动对高风险恶意活动进行优先级排序。
### 功能
- 加权攻击评分
- 威胁情报富化
- 自动优先级排序
- 基于风险的分类
- AI 启发式分析
```
index=soc_project source="train_test_network.csv" label=1
| eval attack_risk=case(
type=="backdoor",10,
type=="ransomware",10,
type=="mitm",9,
type=="injection",8,
type=="xss",7,
type=="password",7,
type=="ddos",6,
type=="dos",5,
type=="scanning",4,
1==1,1)
| lookup threat_intel_ips ioc_value AS src_ip OUTPUT severity AS ti_severity
| eval ti_bonus=case(
ti_severity=="critical",5,
ti_severity=="high",3,
ti_severity=="medium",1,
1==1,0)
| eval final_risk=attack_risk + ti_bonus
| stats avg(final_risk) AS avg_risk,
max(final_risk) AS max_risk,
count AS events
by src_ip, type
| sort -max_risk
```
# 🤖 AI 检测模型
项目包含三个 AI 启发式安全分析模型。
# AI 模型 1 — 加权风险评分
根据攻击类型和 TI 富化计算加权风险。
风险等级:
- IMMEDIATE(紧急)
- HIGH(高)
- MEDIUM(中)
- LOW(低)
```
index=soc_project source="train_test_network.csv" label=1
| eval attack_risk=case(
type=="backdoor",10,
type=="ransomware",10,
type=="mitm",9,
type=="injection",8,
type=="xss",7,
type=="password",7,
type=="ddos",6,
type=="dos",5,
type=="scanning",4,
1==1,1)
| lookup threat_intel_ips ioc_value AS src_ip OUTPUT severity AS ti_severity
| eval ti_bonus=case(
ti_severity=="critical",5,
ti_severity=="high",3,
ti_severity=="medium",1,
1==1,0)
| eval final_risk=attack_risk + ti_bonus
| stats avg(final_risk) AS avg_risk,
max(final_risk) AS max_risk,
count AS events
by src_ip, type
| sort -max_risk
```
# AI 模型 2 — 认证异常检测
使用统计异常检测方法,包括:
- 小时聚合
- 平均值计算
- 标准差
- Z-score 分析
```
index=soc_project source="linux_auth_logs_full(balanced).csv"
| bin _time span=1h
| stats count AS total_attempts,
sum(eval(if(status=="Failed",1,0))) AS failures,
dc(username) AS unique_users
by source_ip, _time
| eventstats avg(total_attempts) AS avg_attempts,
stdev(total_attempts) AS stdev_attempts
| eval z_score=round((total_attempts-avg_attempts)/stdev_attempts, 2)
| where z_score > 2
| sort -z_score
```
# AI 模型 3 — IP 富化
通过以下方式富化可疑认证活动:
- 失败登录阈值
- 唯一目标用户
- 风险分类
```
index=soc_project source="linux_auth_logs_full(balanced).csv"
status="Failed"
| stats count AS failed_attempts,
dc(username) AS unique_users_targeted,
values(username) AS usernames
by source_ip
| where failed_attempts > 10
| sort -failed_attempts
| eval risk_level=case(
failed_attempts>40, "CRITICAL",
failed_attempts>30, "HIGH",
failed_attempts>20, "MEDIUM",
1==1, "LOW")
```
# 📈 仪表板
项目包含用于监控的自定义 SOC 仪表板:
- 威胁严重性分布
- 排名靠前的恶意 IP
- IOC 统计
- 告警趋势
- 风险评分
- 已触发告警
# 🚨 告警
配置的已保存告警包括:
- 恶意 IP 检测
- 暴力破解检测
- 端口扫描检测
- 多 IOC 风险告警
- 可疑 User-Agent 告警
# 📌 主要功能
✅ 威胁情报集成
✅ 行为分析
✅ IOC 关联
✅ 基于风险的优先级排序
✅ AI 启发式检测
✅ 实时告警
✅ SOC 仪表板
✅ Splunk 查询表
✅ 威胁富化
✅ 认证监控
# 🚀 未来改进
潜在的增强方向:
- 与 VirusTotal API 集成
- MITRE ATT&CK 映射
- SOAR 自动化
- 机器学习模型
- GeoIP 可视化
- 邮件告警
- 实时流数据
- UEBA(用户和实体行为分析)
# 👩💻 作者
- Tasnim Abuayyash https://github.com/ta099l
- Marah Alkilani https://github.com/MarahAlkilani
- Rana Alshalout https://github.com/r05m
- Dana Alsaket https://github.com/saket5d
GitHub 仓库:
https://github.com/MarahAlkilani/SOC-project-Threat-Intelligence-
# 📜 许可证
本项目仅用于教育和学术目的。
标签:AI异常检测, ATT&CK框架, CSV数据集, DNS查询分析, IP 地址批量处理, Linux认证日志, PE 加载器, Python代码, SOC威胁情报平台, SPL, Splunk Enterprise, Splunk仪表板, Splunk告警, 关联搜索, 威胁富集, 威胁情报, 威胁情报馈送(TI feeds), 威胁指标(IOCs), 威胁检测规则, 安全事件响应, 安全数据集, 安全运营中心, 密码管理, 开发者工具, 恶意IP检测, 恶意User-Agent检测, 恶意域名检测, 插件系统, 数据统计, 无线安全, 时间线生成, 暴力破解攻击, 机器学习检测模型, 查找表, 深度包检测, 端口扫描, 红队行动, 网络威胁侦测, 网络安全, 网络安全分析, 网络映射, 网络流量分析, 隐私保护, 风险评分