2

so I'm pretty new to docker and all that stuff. I would like to install Kali Linux as a Docker container and access it's GUI from the browser. How do I do that? I use Portainer as a GUI for managing the docker containers.

If possible, I'd like to have access to the kali GUI over a domain. I'm already using nginx proxy manager in a docker container on my machine. I also installed a desktop environment on the container but I have no idea how to access it.

Thanks for your help in advance

PS: I'm sorry if this question is stupid or so, as I said I'm a newbie working with docker and all that, so forgive me

1 Answer 1

0

Dear Kindly use below dockerfile to deploy kali docker container and for accessing it from web, Kindly click here

#Purpose: Installing Kali GUI in docker
From kalilinux/kali-rolling
#RUN apt-get install apt-utils -y
ENV DEBIAN_FRONTEND noninteractive
ENV TZ=Asia/Kolkata DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt install tzdata -y && apt install net-tools vim man file -y
RUN apt-get install kali-linux-headless -y
RUN  apt-get install -y vim perl wget tar man sudo adduser netstat-nat net-tools curl w3m
RUN useradd -m  -s /bin/bash kali
RUN usermod -aG sudo kali && echo "kali ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/kali
RUN chmod 044 /etc/sudoers.d/kali
USER kali:kali
WORKDIR /home/kali
#browser implementation
RUN apt-get install openssl shellinabox -y
#RUN echo -e "# TCP port that shellinboxd's webserver listens on\nSHELLINABOX_PORT=443\n#specify the IP address of a destination SSH server\nSHELLINABOX_ARGS=\"--o-beep -s /:SSH:192.168.1.7\"\n# if you want to restrict access to shellinaboxd from localhost only\nSHELLINABOX_ARGS=\"--o-beep -s /:SSH:192.168.1.7 --localhost-only"\" >> /etc/default/shellinabox
CMD ["/bin/bash"]
#docker run -itd --privileged #type_here_target_image_id /usr/sbin/init #command to run systemctl inside docker container
1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Jun 29, 2022 at 7:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .