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
常用应用程序参数选项
特定插件参数选项
工具命令行使用
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”。接下来,按照下列步骤开发即可:
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:
https://github.com/microsoft/ics-forensics-tools
原文始发于微信公众号(FreeBuf):ICSpector:一款功能强大的微软开源工业PLC安全取证框架
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论