ICSpector:一款功能强大的微软开源工业PLC安全取证框架

关于ICSpector

ICSpector是一款功能强大的开源工业PLC安全取证框架,该工具由微软的研究人员负责开发和维护,可以帮助广大研究人员轻松分析工业PLC元数据和项目文件。

ICSpector提供了方便的方式来扫描PLC并识别ICS环境中的可疑痕迹,可以用于手动检查、自动监控任务或响应事件以检测受损设备。在该工具的帮助下,安全研究人员和取证分许人员可以轻松审查输出结果并根据自己的特定需求进行定制化开发。

工具要求

Python 3.9+

Microsoft Visual C++ 14.0

工具架构

工具安装

由于该工具基于Python 3开发,因此我们首先需要在本地设备上安装并配置好Python 3.9+环境。接下来,广大研究人员可以直接使用下列命令将该项目源码克隆至本地:

复制代码
git clone https://github.com/microsoft/ics-forensics-tools.git

然后切换到项目目录中,使用pip工具和项目提供的requirements.txt文件安装该工具所需的其他依赖组件:

复制代码
cd ics-forensics-tools

pip install -r requirements.txt

工具参数选项

常用应用程序参数选项

|--------------------|-----------------------|---------------------------------|
| 参数 | 描述 | 必选 / 可选 |
| -h, --help | 显示帮助信息和退出 | 可选 |
| -s, --save-config | 存储配置文件 | 可选 |
| -c, --config | 配置文件路径,默认为config.json | 可选 |
| -o, --output-dir | 输出目录路径,默认为output | 可选 |
| -v, --verbose | Verbose模式 | 可选 |
| -p, --multiprocess | 以多进程模式运行 | 可选 |

特定插件参数选项

|-------------|-------------------------|---------------------------------|
| 参数 | 描述 | 必选 / 可选 |
| -h, --help | 显示帮助信息和退出 | 可选 |
| --ip | 地址文件路径、CIDR或IP地址CSV文件路径 | 必选 |
| --port | 端口号 | 可选 |
| --transport | tcp/udp | 可选 |
| --analyzer | 要运行的分析器 | 可选 |

工具使用

工具命令行使用

复制代码
python driver.py -s -v PluginName --ip ips.csv
复制代码
python driver.py -s -v PluginName --ip ips.csv --analyzer AnalyzerName
复制代码
python driver.py -s -v -c config.json --multiprocess

以代码库形式导入使用

复制代码
from forensic.client.forensic_client import ForensicClient

from forensic.interfaces.plugin import PluginConfig

forensic = ForensicClient()

plugin = PluginConfig.from_json({

    "name": "PluginName",

    "port": 123,

    "transport": "tcp",

    "addresses": [{"ip": "192.168.1.0/24"}, {"ip": "10.10.10.10"}],

    "parameters": {

    },

    "analyzers": []

})

forensic.scan([plugin])

添加插件

研究人员在根据实际需求进行本地自定义开发时,请确保将src目录标记为"Sources Root"。接下来,按照下列步骤开发即可:

1、在插件目录下使用插件名称创建一个新的目录;

2、使用插件名称创建一个新的Python文件;

3、使用下列模板代码开发自己的插件,并将其中的"General"替换为你的插件名称;

复制代码
from pathlib import Path

from forensic.interfaces.plugin import PluginInterface, PluginConfig, PluginCLI

from forensic.common.constants.constants import Transport

 

 

class GeneralCLI(PluginCLI):

    def __init__(self, folder_name):

        super().__init__(folder_name)

        self.name = "General"

        self.description = "General Plugin Description"

        self.port = 123

        self.transport = Transport.TCP

 

    def flags(self, parser):

        self.base_flags(parser, self.port, self.transport)

        parser.add_argument('--general', help='General additional argument', metavar="")

 

 

class General(PluginInterface):

    def __init__(self, config: PluginConfig, output_dir: Path, verbose: bool):

        super().__init__(config, output_dir, verbose)

 

    def connect(self, address):

        self.logger.info(f"{self.config.name} connect")

 

    def export(self, extracted):

        self.logger.info(f"{self.config.name} export")

添加分析器

1、在分析器目录下使用跟分析器相关的插件名创建一个新的目录;

2、使用分析器名称创建一个新的Python文件;

3、使用下列模板开发自己的分析器,并将其中的"General"替换为你的分析器名称;

复制代码
from pathlib import Path

from forensic.interfaces.analyzer import AnalyzerInterface, AnalyzerConfig

 

 

class General(AnalyzerInterface):

    def __init__(self, config: AnalyzerConfig, output_dir: Path, verbose: bool):

        super().__init__(config, output_dir, verbose)

        self.plugin_name = 'General'

        self.create_output_dir(self.plugin_name)

 

    def analyze(self):

      pass

工具运行截图

许可证协议

本项目的开发与发布遵循MIT开源许可证协议。

项目地址

ICSpector :【GitHub传送门

参考资料

Download Python | Python.org

Download Visual Studio Tools - Install Free for Windows, Mac, Linux

Microsoft Defender for IoT | Microsoft Security

Microsoft Security Response Center

ICS 2022: Deep Dive Into PLC Ladder Logic Forensic...

https://www.youtube.com/watch?v=g3KLq_IHId4&ab_channel=MicrosoftSecurityCommunity

相关推荐
用户962377954481 天前
DVWA 靶场实验报告 (High Level)
安全
数据智能老司机2 天前
用于进攻性网络安全的智能体 AI——在 n8n 中构建你的第一个 AI 工作流
人工智能·安全·agent
数据智能老司机2 天前
用于进攻性网络安全的智能体 AI——智能体 AI 入门
人工智能·安全·agent
用户962377954482 天前
DVWA 靶场实验报告 (Medium Level)
安全
red1giant_star2 天前
S2-067 漏洞复现:Struts2 S2-067 文件上传路径穿越漏洞
安全
用户962377954482 天前
DVWA Weak Session IDs High 的 Cookie dvwaSession 为什么刷新不出来?
安全
cipher3 天前
ERC-4626 通胀攻击:DeFi 金库的"捐款陷阱"
前端·后端·安全
一次旅行6 天前
网络安全总结
安全·web安全
red1giant_star7 天前
手把手教你用Vulhub复现ecshop collection_list-sqli漏洞(附完整POC)
安全
ZeroNews内网穿透7 天前
谷歌封杀OpenClaw背后:本地部署或是出路
运维·服务器·数据库·安全