IMG-20260516155637159.source 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. FROM kalilinux/kali-rolling@sha256:99a8a101fb7c3747f5f55886d0b698e67424c1815d0b70d057643fce620da324
  2. RUN apt update && \
  3. DEBIAN_FRONTEND=noninteractive apt install -y kali-desktop-xfce kali-linux-default locales sudo
  4. RUN apt update && \
  5. DEBIAN_FRONTEND=noninteractive apt install -y xrdp tigervnc-standalone-server && \
  6. adduser xrdp ssl-cert && \
  7. echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
  8. dpkg-reconfigure --frontend=noninteractive locales && \
  9. update-locale LANG=en_US.UTF-8
  10. ARG USER=testuser
  11. ARG PASS=1234
  12. RUN useradd -m $USER -p $(openssl passwd $PASS) && \
  13. usermod -aG sudo $USER && \
  14. chsh -s /bin/bash $USER
  15. RUN echo "#!/bin/sh\n\
  16. export XDG_SESSION_DESKTOP=xfce\n\
  17. export XDG_SESSION_TYPE=x11\n\
  18. export XDG_CURRENT_DESKTOP=XFCE\n\
  19. export XDG_CONFIG_DIRS=/etc/xdg/xdg-xfce:/etc/xdg\n\
  20. exec dbus-run-session -- xfce4-session" > /xstartup && chmod +x /xstartup
  21. RUN mkdir /home/$USER/.vnc && \
  22. echo $PASS | vncpasswd -f > /home/$USER/.vnc/passwd && \
  23. chmod 0600 /home/$USER/.vnc/passwd && \
  24. chown -R $USER:$USER /home/$USER/.vnc
  25. RUN cp -f /xstartup /etc/xrdp/startwm.sh && \
  26. cp -f /xstartup /home/$USER/.vnc/xstartup
  27. RUN echo "#!/bin/sh\n\
  28. sudo -u $USER -g $USER -- vncserver -rfbport 5902 -geometry 1920x1080 -depth 24 -verbose -localhost no -autokill no" > /startvnc && chmod +x /startvnc
  29. EXPOSE 3389
  30. EXPOSE 5902
  31. ENV PULSE_SERVER=/tmp/PulseServer
  32. ENV WAYLAND_DISPLAY=wayland-0
  33. ENV XDG_RUNTIME_DIR=/tmp/runtime-dir/
  34. ENV DISPLAY=:0
  35. CMD service dbus start; /usr/lib/systemd/systemd-logind & service xrdp start; /startvnc; bash