diff --git a/Dockerfile/noNginx/Dockerfile b/Dockerfile/noNginx/Dockerfile new file mode 100644 index 0000000..ecb4959 --- /dev/null +++ b/Dockerfile/noNginx/Dockerfile @@ -0,0 +1,31 @@ +FROM ubuntu:16.04 + +RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list && \ + apt-get -y update && apt-get install -y supervisor git && \ + mkdir -p /var/log/supervisor && \ + mkdir -p /etc/supervisord.d/ && \ + mkdir -p /var/run/supervisor/ +COPY config/supervisord.conf /etc/supervisord.conf + + +#create user xssor +RUN useradd -d /home/xssor -s /usr/sbin/nologin xssor &&\ + git clone https://github.com/evilcos/xssor2.git /home/xssor &&\ + chown -R xssor:xssor /home/xssor/ + + +#django +RUN apt-get install -y python-pip && \ + mkdir ~/.pip + +COPY config/pip.conf ~/.pip/pip.conf +#run +RUN cd /home/xssor/ && pip install -r requirement.txt +#config +COPY config/xssor.conf /etc/supervisord.d/xssor.conf + + +EXPOSE 8000 +VOLUME ["/home/xssor/"] + +CMD ["/usr/bin/supervisord","-c","/etc/supervisord.conf"] diff --git a/Dockerfile/noNginx/README.md b/Dockerfile/noNginx/README.md new file mode 100644 index 0000000..2478097 --- /dev/null +++ b/Dockerfile/noNginx/README.md @@ -0,0 +1,81 @@ +# Docker for XSSOR2 + +## 安装Docker + +Docker 要求内核3.10以上并且要求64位操作系统。CentOS7.X的内核为3.10 CentOS6.X的2.6.32。 + +CentOS 安装Docker + +```shell +sudo yum install docker +#开机自启动 +sudo systemctl enable docker +#启动docker +sudo systemctl start docker +``` + +ubuntu 安装Docker(未经测试全靠记忆) + +```shell +apt-get install docker.io docker +#开机自启动 +update-rc.d docker default +#启动docker +services start +#注如果使用的ubuntu16.04以上的也可以使用systemd +sudo systemctl enable docker +sudo systemctl start docker +``` + +## 目录结构 + +``` +Dockerfile/ +└── noNginx + ├── config + │   ├── pip.conf + │   ├── supervisord.conf + │   └── xssor.conf + └── Dockerfile +``` + +## 使用 + +根据需求切换到相应的Dockerfile文件下建立docker镜像 + +``` +docker build -t xssor . +``` + +运行 + +``` +docker run -d -p --name xssor 主机端口:8000 xssor +#eg +docker run -d --name xssor --restart=always -p 8004:8000 testxss +``` + +## 注意事项 + +modify xssor/payload/probe.js + +有两种方式。 + +- 容器内修改 + + ```shell + docker exec -i -t xssor /bin/bash + #正常修改然后执行 + supervisorctl restart all + ``` + +- 提前修改好挂载主机内的目录 + +``` +#主机的shell下 +mkdir /opt/xssor/ +git clone https://github.com/evilcos/xssor2.git /opt/xssor/ +#修改文件 +docker run -d --name xssor --restart=always -v /opt/xssor/:/home/xssor/ -p 8004:8000 testxss +``` + diff --git a/Dockerfile/noNginx/config/pip.conf b/Dockerfile/noNginx/config/pip.conf new file mode 100644 index 0000000..7069c28 --- /dev/null +++ b/Dockerfile/noNginx/config/pip.conf @@ -0,0 +1,2 @@ +[global] +index-url = https://pypi.mirrors.ustc.edu.cn/simple diff --git a/Dockerfile/noNginx/config/supervisord.conf b/Dockerfile/noNginx/config/supervisord.conf new file mode 100644 index 0000000..43cf876 --- /dev/null +++ b/Dockerfile/noNginx/config/supervisord.conf @@ -0,0 +1,21 @@ +[unix_http_server] +file=/var/run/supervisor/supervisor.sock + +[supervisord] +nodaemon=true +logfile=/var/log/supervisor/supervisord.log +logfile_maxbytes=50MB +logfile_backups=10 +loglevel=info +pidfile=/var/run/supervisord.pid + +[supervisorctl] +serverurl=unix:///var/run/supervisor/supervisor.sock + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[include] +files = supervisord.d/*.conf + + diff --git a/Dockerfile/noNginx/config/xssor.conf b/Dockerfile/noNginx/config/xssor.conf new file mode 100644 index 0000000..4cca236 --- /dev/null +++ b/Dockerfile/noNginx/config/xssor.conf @@ -0,0 +1,10 @@ +[program:uwsgi] +user=xssor +directory=/home/xssor/ +command=python manage.py runserver 0.0.0.0:8000 +autostart = true +autorestart=true +redirect_stderr=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +