工控蜜罐conpot安装
conpot描述:
Conpot is an ICS honeypot with the goal to collect intelligence about the motives and methods of adversaries targeting industrial control systems.
Conpot是一个部署在服务端的低交互ICS蜜罐,能够快速地部署、修改和拓展;旨在收集有关针对工业控制系统的对手的动机和方法的情报。开发者通过提供一系列的通用工控协议,使得我们能够非常快速地在我们的系统上构建一套复杂的工控基础设施用于欺骗未知的攻击者。 Conpot一共支持bacnet、enip、guardian_ast、http、ipmi、kamstrup、misc、modbus、s7comm和snmp等10个协议
安装
官方提供三种安装方法:
1、使用docker安装
2、使用docker-compose安装
3、本地虚拟环境运行
我们进行docker安装;本次docker安装采用官方文档中时,会存在诸多问题,docker安装过程与官方文档有所不同;
一、下载镜像
先查查看当前conpot的镜像
docker search conpot

下载 :docker pull honeynet/conpot
启动镜像
docker启动镜像(以root启动时加--user root)
docker run -it -p 6230:6230 -p 8800:8800 -p 47808:47808 -p 10201:10201 -p 5020:5020 -p 16100:16100/udp --network=bridge honeynet/conpot:latest /bin/sh
这里的端口都是对蜜罐中的工控设备模拟使用的端口
进入容器中:
conpot启动指令在.local/bin目录下


config位置如下<将testing.cfg复制成conpot.cfg>
/home/conpot/.local/lib/python3.6/site-packages/conpot-0.6.0-py3.6.egg/conpot

创建文件:
mkdir /home/conpot/virtual/
mkdir /home/conpot/fs_url/
修改conpot.cfg中(只有目录存在即可)
[virtual_file_system]
data_fs_url = /home/conpot/virtual/
fs_url = /home/conpot/fs_url/

默认templates位置
/home/conpot/.local/lib/python3.6/site-packages/conpot-0.6.0-py3.6.egg/conpot/templates/default

采坑过程
直接执行启动conpot是会提示ftp及tftp服务的目录不存在(新建后依然无法解决,移除templates/default中的ftp)(希望大佬提供帮助)


移除默认模板中的ftp及tftp即可启动

在/home/conpot/.local/bin/下执行下面命令
./conpot --template /home/conpot/.local/lib/python3.6/site-packages/conpot-0.6.0-py3.6.egg/conpot/templates/default/ --config /home/conpot/.local/lib/python3.6/site-packages/conpot-0.6.0-py3.6.egg/conpot/conpot.cfg

针对坑点有以下猜想(验证完成后再回复):
推断是在读取path时,读取的路径将末尾的斜杠去掉,导致self.isdir(path)检查失败
if self.exists(path) and self.isdir(path):
if not fs_url:
new_dir = self.create_jail(path)
else:
......
else:
raise fs.errors.DirectoryExpected("{} path does not exist".format(path))
参考链接:
https://conpot.readthedocs.io/en/latest/installation/quick_install.html
https://www.freebuf.com/column/147545.html
https://www.jianshu.com/p/4cb58dcf7ce7