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蜜罐,能夠快速地部署、修改和拓展;旨在收集有關針對工業(yè)控制系統(tǒng)的對手的動機和方法的情報。開發(fā)者通過提供一系列的通用工控協(xié)議,使得我們能夠非??焖俚卦谖覀兊南到y(tǒng)上構建一套復雜的工控基礎設施用于欺騙未知的攻擊者。 Conpot一共支持bacnet、enip、guardian_ast、http、ipmi、kamstrup、misc、modbus、s7comm和snmp等10個協(xié)議
安裝
官方提供三種安裝方法:
1、使用docker安裝
2、使用docker-compose安裝
3、本地虛擬環(huán)境運行
我們進行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

創(chuàng)建文件:
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

采坑過程
直接執(zhí)行啟動conpot是會提示ftp及tftp服務的目錄不存在(新建后依然無法解決,移除templates/default中的ftp)(希望大佬提供幫助)


移除默認模板中的ftp及tftp即可啟動

在/home/conpot/.local/bin/下執(zhí)行下面命令
./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
http://www.itdecent.cn/p/4cb58dcf7ce7