Conpot 是一个 ICS 蜜罐,目的是收集有关针对工业控制系统的对手动机和方法的情报。
使用 Docker 快速安装
安装Docker
跑步docker pull honeynet/conpot
跑步 docker run -it -p 80:80 -p 102:102 -p 502:502 -p 161:161/udp --network=bridge honeynet/conpot:latest /bin/sh
最后运行conpot -f --template default
导航至http://MY_IP_ADDRESS确认设置。
从源代码构建docker镜像
安装Docker
使用以下命令克隆此仓库git clone https://github.com/mushorg/conpot.git
跑步sudo make run-docker
导航至http://MY_IP_ADDRESS确认设置。
从源代码构建并使用 docker-compose 运行
安装docker-compose
使用以下命令 克隆此 repo git clone https://github.com/mushorg/conpot.gitcd conpot/docker
使用以下方式构建图像docker-compose build
测试一切是否正常运行docker-compose up
作为守护进程永久运行docker-compose up -d
示例输出
首先我们看一个典型的工业控制网络拓扑图:
conpot启动指令在.local/bin目录下
MOSBUS
1 <block name="a">
2 <!-- COILS/DISCRETE_OUTPUTS aka. binary output, power on/power off
3 Here we map modbus addresses 1 to 127 to S7-200 PLC Addresses Q0.0 to Q15.7 -->
4 <type>COILS</type>
5 <starting_address>1</starting_address>
6 <size>128</size>
7 <values>
8 <value>
9 <address>1</address>
10 <!-- Will be parsed with eval() -->
11 <content>[random.randint(0,1) for b in range(0,128)]</content>
12 </value>
13 </values>
14 </block>
SNMP
1 <symbol name="sysDescr">
2 <value>Siemens, SIMATIC, S7-200</value>
3 </symbol>
HTTP
<global>
2 <config>
3 <!-- what protocol shall we use by default? -->
4 <entity name="protocol_version">HTTP/1.1</entity>
5 <!-- if we find any date header to be delivered, should we update it to a real value? -->
6 <entity name="update_header_date">true</entity>
7 <!-- should we disable the HTTP HEAD method? -->
8 <entity name="disable_method_head">false</entity>
9 <!-- should we disable the HTTP TRACE method? -->
10 <entity name="disable_method_trace">false</entity>
11 <!-- should we disable the HTTP OPTIONS method? -->
12 <entity name="disable_method_options">false</entity>
13 <!-- TARPIT: how much latency should we introduce to any response by default? -->
14 <entity name="tarpit">0</entity>
15 </config>
16
17 <!-- these headers will be sent with each response -->
18 <headers>
19 <!-- this date header will be updated, if enabled above -->
20 <entity name="Date">Sat, 28 Apr 1984 07:30:00 GMT</entity>
21 </headers>
22 </global>
进阶:
既然考虑进行大规模的部署,像我们刚才做的镜像那样那样直接输出到屏幕显然是不合理的, Conpot 提供了多种日志收集的途径, Conpot 在 conpot.cfg 文件中配置了默认日志输出形式,用户可以通过修改 conpot.cfg 文件来自定义日志收集的配置。
[json]
enabled = False
filename = /var/log/conpot.json
[sqlite]
enabled = False
[mysql]
enabled = False
device = /tmp/mysql.sock
host = localhost
port = 3306
db = conpot
username = conpot
passphrase = conpot
socket = tcp ; tcp (sends to host:port), dev (sends to mysql device/socket file)
[syslog]
enabled = False
device = /dev/log
host = localhost
port = 514
facility = local0
socket = dev ; udp (sends to host:port), dev (sends to device)
[hpfriends]
enabled = False
host = hpfriends.honeycloud.net
port = 20000
ident = 3Ykf9Znv
secret = 4nFRhpm44QkG9cvD
channels = ["conpot.events", ]
[taxii]
enabled = False
host = taxiitest.mitre.org
port = 80
inbox_path = /services/inbox/default/
use_https = False
可以看到,在 Conpot 中,我们可以使用 json 、 sqlite 、 mysql 、 syslog 、 hpfriends 和 taxii 等几种方式输出访问日志。
这样的话,可以用我前面分享的ELK日志审计平台,如果您有专业的日志审计设备也可以外发,或者存储在mysql里查询。
更多内容请查阅:
-
https://github.com/mushorg/conpot
-
Conpot’s documentation
-
http://plcscan.org/blog/tools/conpot/
各位朋友停更了两天,实在太忙了上周,后面我会持续更新。
原文始发于微信公众号(三沐数安):Conpot开源的工控系统蜜罐
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论