一、下载git包以及安装:
git clone https://github.com/leveryd/vulndocker.git
cd vulndocker
apt-get install uwsgi-plugin-python docker.io nginx-core
pip install -r requirements.txt
cp nginx.conf /etc/nginx/sites-enabled/default
vim Dockerfile
#推荐使用[阿里云docker加速器](https://yq.aliyun.com/articles/29941) (下载镜像快)
#懒得创建用户可以使用我的镜像地址:https://l0fso5am.mirror.aliyuncs.com
setsid python compile.py &
sh ./run.sh
二、运行:
#平台需要redis服务
docker run -d -p : redis:latest #启动
cd vulndocker/ #修改app.py中的ip和port
ip = "127.0.0.1" #本机ip
webport = #web端口
ttyport = #在线docker端口 #启动
uwsgi_python --socket 127.0.0.1: --wsgi-file app.py --callable app --processes --threads --stats 127.0.0.1: & #启动web页面的ssh
#原项目:https://github.com/JetMuffin/dockertty
cd dockertty/dockertty
nohup python server.py -p & #添加计划任务
*/ * * * * python /root/vulndocker/crontab.py
三、停止:
ps -ef|grep uwsgi|grep -v grep|awk '{print $2}'|xargs kill -