forked from evilcos/xssor2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request evilcos#1 from h00k4n1/master
add Dockerfile - noNginx
- Loading branch information
Showing
5 changed files
with
145 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[global] | ||
index-url = https://pypi.mirrors.ustc.edu.cn/simple |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|