t-pot蜜罐的系统的搭建分为下载iso安装和在虚拟机中挂载iso安装。
一开始是使用第一种,直接下载iso镜像,直接安装在虚拟机中,但是由于github上19.03.1由于网络延迟问题总是下载失败,于是从其他网盘中下载pot 19.3版本,在安装过程中报错导致无法进行,并且iso镜像中默认是从国外拉取镜像,速度很慢。于是转换思路选择在虚拟机中安装。(使用在虚拟机安装t-pot失败,最后还是选择在直接下载iso镜像)
t-pot 蜜罐系统在19.03版本所用的虚拟机系统从ubuntu转换成了debian(sid)于是安装debian虚拟机,debian版本:9.7或更新。
debian各版本官网下载地址:/cdimage/archive/
安装debian
我安装的是9.7版本64位(amd64)xfce cd版。
更换一下apt源。
echo "deb /debian/ sid main non-free contrib
deb-src /debian/ sid main non-free contrib
deb https://mirrors.tuna./debian/ sid main non-free contrib
deb-src https://mirrors.tuna./debian/ sid main non-free contrib
deb http://mirrors./debian/ sid main non-free contrib
deb-src http://mirrors./debian/ sid main non-free contrib
deb http://ftp./debian/ sid main non-free contrib
deb-src http://ftp./debian/ sid main non-free contrib " > /etc/apt/sources.list
apt-get update
更新过后版本会从9.7升级到9.11
apt-get install curl git
安装apt-fast,apt-fast可以加速下载包的速度,通过aria2的多线程在多个镜像源中进行下载同一个文件。
apt-get install aria2 -y
git clone /ilikenwf/apt-fast.git
cd apt-fast/
cp apt-fast /usr/bin/
cp apt-fast /usr/local/sbin/
chmod +x /usr/bin/apt-fast
chmod +x /usr/local/sbin/
cp apt-fast.conf /etc
apt-fast update
sed -i "/^ *MIRRORS/d" /etc/apt-fast.conf
echo "MIRRORS=( '/debian/,https://mirrors.tuna./debian/,http://mirrors./debian/' ) " >> /etc/apt-fast.conf
配置npm源
apt-fast install npm
npm config set registry http://registry.
#将npm源换成国内源
这里存在警告 (1.npm does not support node.js v10.15.2
2.you should probably upgrade to a newer version of node as we
.在搭建过程中将国内源设置做了跳过。
更改脚本
进入到安装目录cd /opt/tpot/iso/installer
#发现脚本会将镜像源替换成官方源,需要将脚本中的替换命令删除,以下是19.03版本的删除命令:
sed -i '/^ *tee \/etc/d' install.sh
sed -i '/^ *deb/d' install.sh
sed -i "$(cat -n install.sh | grep "EOF$" | awk '{print $1}' | sed -n "1p")d" install.sh
#以上三条命令不建议在非19.03版本运行,可能install脚本内容更改。
sed -i "/^ *git clone https:\/\/github/d" install.sh #此条删除install.sh中克隆库到/opt/tpot前面已经克隆到这个目录所以删除
#默认拉docker镜像的是国外的网站,总有几个镜像拉不动,配置加速会快很多
cd /opt/tpot/iso/installer
AA=$(cat -n install.sh | grep "myTPOTCOMPOSE" | grep "for name in" | awk '{ print $1 }')
sed -i "${AA}i curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io" install.sh
sed -i "${AA}a systemctl restart docker" install.sh
安装
./install.sh --type=user
#如果中途退出执行install.sh,可能会报版本不支持错误,需要删除检测版本验证
sed -i "s/if \[ \"\$myLSB\" \!=.*/if \[ 1 \!= 1\]\;/" install.sh
安装过程十分漫长,但最后总是莫名结束始终安装不成功。
于是还是选择第一种方法,在这iso安装。此次是选择官方github下载文件,将和github.global.对应的ip添加到hosts文件中。ip可以从这个网站获取。/
下载后安装。
部署
选择 t-pot 19.03.1
选择地区other->asia->china
选择源 china->
之后开始安装基础系统(大约40分钟)
选择STANDARD Honeypots,ELK,NSM&Tools
之后会设置tsec的密码,和自己的用户名和密码。
随后就开始了安装,安装完毕后将显示控制台界面。
web:https://ip:64297
admin:https://ip:64294