关于安全:sysmon映射ATTCK环境搭建

7次阅读

共计 2805 个字符,预计需要花费 8 分钟才能阅读完成。

1. 前置环境

开源我的项目地址:该我的项目是将 sysmon 事件通过 splunk app 映射到 ATT&CK 上,能够疾速的进行剖析。搭建过程中开始始终不出数据,这里记录搭建的过程。

https://github.com/olafhartong/ThreatHunting

https://github.com/olafhartong/sysmon-modular

环境:

Windows 主机一台,曾经装置 splunk 转发器

Linux 服务器一台,曾经装置 splunk

2.Windows 客户端配置

2.1 装置 sysmon

Sysmon 下载:https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon

规定文件下载(这个规定是这个我的项目配套的):

https://github.com/olafhartong/sysmon-modular/blob/master/sysmonconfig.xml

装置 sysmon:sysmon.exe -accepteula -i sysmonconfig.xml

后续更新规定:sysmon.exe -c sysmonconfig.xml

验证:在事件查看器 应用程序和服务日志 >Microsoft>Windows>Sysmon>Operational 中能够看到事件日志。

2.2 配置 splunk 采集

在以下门路配置文件中,配置采集内容(老外的视频是把 sysmon,splunk 服务端装置在一起,所以间接在 splunk 中抉择即可,个别状况下都是要配置转发器)

C:\Program Files\SplunkUniversalForwarder\etc\apps\SplunkUniversalForwarder\default 门路下的 inputs.conf 配置文件,配置如下内容:

[WinEventLog://Microsoft-Windows-Sysmon/Operational]

disabled = false

renderXml = false

index = windows

source = WinEventLog:Microsoft-Windows-Sysmon/Operational

如下图所示:(目标是为了采集 Sysmon 日志,并采集到 splunk 的 windows 索引中,指定 source 类型,不解析 Xml。这几行配置都很重要,跟前面的内容是一一对应的)

配置实现后,重启 splunk,到 bin 门路下执行 splunk.exe restart

验证:在实现了 3.3 索引建设当前,能够通过 index=”windows”搜寻数据,source 肯定要配对,不然关联不上数据

3.Linux 服务端配置

3.1 装置 threathunting APP

在查找更多利用中搜寻

装置实现后会看到 app 呈现在列表中

3.2 装置依赖 APP,lookup 文件

进入 threathunting APP,点击对于 >About this app, 会看到一堆依赖的 app 和 csv 文件

须要装置的 app:

Force Directed Visualisation App for Splunk

Link Analysis App for Splunk

Punchcard

Sankey Diagram

Timeline

到 splunk 的 app 治理中顺次装置,其中 Microsoft Sysmon Add-on 能够不装置,老外的视频说依据教训装了会出问题。

上传白名单的 csv 文件:

文件下载门路:

https://github.com/olafhartong/ThreatHunting/raw/master/files/ThreatHunting.tar.gz

上传到装置 splunk 的服务器,解压到 splunk/etc/apps/ThreatHunting/lookups 门路下(依据你装置 splunk 的门路做调整)。

验证: 刷新页面,显示只有 Microsoft Sysmon Add-on 没装置

3.3 建设索引

建设 windows 和 threathunting 索引,windows 索引用来接管 agent 上来的原始数据,threathunting 接管的是 windows 索引加工统计后的数据,这里比拟不好了解。

留神:索引名称肯定要对,数据完整性查看要抉择 Enable, 应要抉择 ThreatHunting(如果是从 ThreatHunting 跳过去默认会选这个,然而如果从其余利用过去会建到其余利用去)


验证:

4. 成果


5. 遇到的一些坑

5.1 仪表盘上没有数据

  1. 利用首页的数据须要从 windows 索引进行统计分析输出到 threathunting 索引,这个比较慢,会等比拟久
  2. Windows 和 threathunting 索引建到别的利用上面去了,参考 3.3
  3. Source 类型不对

5.2 原文中批改配置

原文中有这么一部分,旧的版本 sysmon 配置只有 source=”XmlWinEventLog:Microsoft-Windows-Sysmon/Operational”,前面变成了 source=”XmlWinEventLog:Microsoft-Windows-Sysmon/Operational”,所以新版本是不须要批改的。

5.3 一些查问没有后果

有些语句 app 写的有问题,参考最初的视频,找到原始语句进行查问,对报错语句进行批改并保留。通过这个办法遇到其余没后果的也能够应用相似的调试形式。

5.4 谬误 could not load lookup=lookup-eventcode

参考解决方案:

https://community.splunk.com/t5/All-Apps-and-Add-ons/ThreatHunting-app-by-Olaf-Hartong-Red-Triangle-Error-quot-Could/td-p/482176

5.5source 的作用


App 的宏配置中有定义 sysmon,而很多查问语句应用 `sysmon` 进行查问,所以配置 source 时须要 source 是精确的,尽量保障

source=”WinEventLog:Microsoft-Windows-Sysmon/Operational”。

`sysmon` 是个宏,会被替换成

index=windows (source=”XmlWinEventLog:Microsoft-Windows-Sysmon/Operational” OR source=”WinEventLog:Microsoft-Windows-Sysmon/Operational”)

6. 参考原文

https://www.linkedin.com/pulse/attckized-splunk-kirtar-oza-cissp-cisa-ms-/

https://www.youtube.com/watch?v=GVM8RRyQx7s&feature=youtu.be

正文完
 0