mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-06-21 10:21:21 +00:00
feat: 添加VNC测试靶场
This commit is contained in:
parent
ef2c20bf4e
commit
c0b7f4ca4f
45
TestDocker/VNC/Dockerfile
Normal file
45
TestDocker/VNC/Dockerfile
Normal file
@ -0,0 +1,45 @@
|
||||
FROM ubuntu:20.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=Asia/Shanghai
|
||||
|
||||
# 安装必要的包
|
||||
RUN apt-get update && apt-get install -y \
|
||||
tightvncserver \
|
||||
xfce4 \
|
||||
xfce4-terminal \
|
||||
supervisor
|
||||
|
||||
# 创建新用户
|
||||
RUN useradd -m vncuser
|
||||
ENV USER=vncuser
|
||||
ENV HOME=/home/vncuser
|
||||
|
||||
# 设置supervisor配置
|
||||
RUN mkdir -p /var/log/supervisor
|
||||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
# 切换到vncuser用户
|
||||
USER vncuser
|
||||
WORKDIR /home/vncuser
|
||||
|
||||
# 创建必要的文件和目录
|
||||
RUN touch ~/.Xauthority
|
||||
RUN mkdir -p ~/.vnc
|
||||
|
||||
# 创建启动脚本
|
||||
RUN echo '#!/bin/bash\nxrdb $HOME/.Xresources\nstartxfce4 &' > ~/.vnc/xstartup
|
||||
RUN chmod +x ~/.vnc/xstartup
|
||||
|
||||
# 设置VNC密码
|
||||
RUN echo "123456" | vncpasswd -f > ~/.vnc/passwd
|
||||
RUN chmod 600 ~/.vnc/passwd
|
||||
|
||||
# 切回root用户来运行supervisor
|
||||
USER root
|
||||
|
||||
# 暴露VNC端口
|
||||
EXPOSE 5901
|
||||
|
||||
# 使用supervisor启动服务
|
||||
CMD ["/usr/bin/supervisord"]
|
8
TestDocker/VNC/supervisord.conf
Normal file
8
TestDocker/VNC/supervisord.conf
Normal file
@ -0,0 +1,8 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
|
||||
[program:vnc]
|
||||
command=/usr/bin/vncserver :1 -geometry 1280x800 -depth 24
|
||||
user=vncuser
|
||||
autostart=true
|
||||
autorestart=true
|
Loading…
x
Reference in New Issue
Block a user