Skip to content

Instantly share code, notes, and snippets.

@caitlynrw
Last active January 13, 2023 08:43
Show Gist options
  • Save caitlynrw/28c34acb64799955a68906875a534e76 to your computer and use it in GitHub Desktop.
Save caitlynrw/28c34acb64799955a68906875a534e76 to your computer and use it in GitHub Desktop.
Working Kali Linux Docker container
FROM kalilinux/kali-rolling:latest
RUN echo "*** install packages *** " && apt update && apt upgrade -y \
&& DEBIAN_FRONTEND=noninteractive apt install kali-linux-default kali-desktop-xfce xorgxrdp xrdp -y \
&& useradd -d /home/kali -m -s /bin/bash kali && /bin/echo -e "kali\nkali\n" | passwd kali \
&& echo 'kali ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN echo "*** cleanup & patch ***" && \
rm -f /usr/share/xfce4/panel/plugins/power-manager-plugin.desktop && apt clean \
&& wget https://gist.githubusercontent.com/DarkMagicSource/28c34acb64799955a68906875a534e76/raw/1822c954966e5999bbf5d02b31699dd6fb6a6c56/entry -O /entry \
&& chmod +x /entry
USER kali
EXPOSE 3389
CMD ["sudo", "/entry"]
#!/bin/bash
# Start xrdp sesman service
/usr/sbin/xrdp-sesman
# Run xrdp in foreground if no commands specified
if [ -z "$1" ]; then
/usr/sbin/xrdp --nodaemon
else
/usr/sbin/xrdp
exec "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment