├── .github ├── FUNDING.yml └── images │ └── screenshoot.png ├── startup.sh ├── docker-compose.yml ├── Dockerfile ├── .circleci └── config.yml └── README.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | patreon: csalab 2 | custom: ["https://paypal.me/csalabid"] 3 | -------------------------------------------------------------------------------- /.github/images/screenshoot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csalab-id/kalilinux-docker/HEAD/.github/images/screenshoot.png -------------------------------------------------------------------------------- /startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ! -d ~/.vnc/ ]; then 4 | mkdir -p ~/.vnc/ 5 | fi 6 | if [ ! -f ~/.Xauthority ]; then 7 | touch ~/.Xauthority 8 | fi 9 | rm -rf ~/.vnc/*.pid ~/.vnc/*.log /tmp/.X1* 10 | (echo "${PASSWORD}"; echo "${PASSWORD}") | sudo passwd kali > /dev/null 2>&1 11 | vncpasswd -f <<< ${PASSWORD} > ~/.vnc/passwd 12 | vncserver -PasswordFile ~/.vnc/passwd 13 | sudo dbus-daemon --config-file=/usr/share/dbus-1/system.conf 14 | /usr/share/novnc/utils/novnc_proxy --listen 8080 --vnc 127.0.0.1:5901 15 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | kalilinux: 3 | hostname: kalilinux.lab 4 | build: 5 | context: ./ 6 | dockerfile: Dockerfile 7 | image: 'csalab/kalilinux-docker:latest' 8 | restart: always 9 | cap_add: 10 | - NET_ADMIN 11 | ports: 12 | - ${BIND:-0.0.0.0:8080}:8080 13 | environment: 14 | - SHELL=/bin/bash 15 | - PASSWORD=${PASSWORD:-kalilinux} 16 | volumes: 17 | - data:/home/kali/Desktop 18 | entrypoint: ["/bin/bash", "/startup.sh"] 19 | 20 | volumes: 21 | data: {} 22 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kalilinux/kali-rolling:latest 2 | LABEL maintainer="admin@csalab.id" 3 | RUN sed -i "s/http.kali.org/mirrors.ocf.berkeley.edu/g" /etc/apt/sources.list && \ 4 | apt-get update && \ 5 | apt-get -y upgrade 6 | RUN DEBIAN_FRONTEND=noninteractive apt-get -yq install \ 7 | sudo \ 8 | openssh-server \ 9 | python2 \ 10 | dialog \ 11 | firefox-esr \ 12 | inetutils-ping \ 13 | htop \ 14 | nano \ 15 | net-tools \ 16 | tigervnc-standalone-server \ 17 | tigervnc-xorg-extension \ 18 | tigervnc-viewer \ 19 | novnc \ 20 | dbus-x11 21 | RUN DEBIAN_FRONTEND=noninteractive apt-get -yq install \ 22 | xfce4-goodies \ 23 | kali-desktop-xfce && \ 24 | apt-get -y full-upgrade 25 | RUN apt-get -y autoremove && \ 26 | apt-get clean all && \ 27 | rm -rf /var/lib/apt/lists/* && \ 28 | useradd -m -c "Kali Linux" -s /bin/bash -d /home/kali kali && \ 29 | sed -i "s/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/g" /etc/ssh/sshd_config && \ 30 | sed -i "s/off/remote/g" /usr/share/novnc/app/ui.js && \ 31 | echo "kali ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \ 32 | mkdir /run/dbus && \ 33 | touch /usr/share/novnc/index.htm 34 | COPY startup.sh /startup.sh 35 | USER kali 36 | WORKDIR /home/kali 37 | ENV PASSWORD=kalilinux 38 | ENV SHELL=/bin/bash 39 | EXPOSE 8080 40 | ENTRYPOINT ["/bin/bash", "/startup.sh"] 41 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | parameters: 4 | workflow: 5 | type: enum 6 | default: auto 7 | description: "The workflow to trigger." 8 | enum: [auto, latest] 9 | 10 | executors: 11 | docker: 12 | docker: 13 | - image: cimg/base:stable 14 | resource_class: large 15 | 16 | jobs: 17 | hadolint: 18 | executor: docker 19 | steps: 20 | - checkout 21 | - setup_remote_docker 22 | - run: 23 | name: "Checking Dockerfile code quality" 24 | command: docker run --rm -i ghcr.io/hadolint/hadolint:latest < Dockerfile || true 25 | 26 | build-kalilinux: 27 | executor: docker 28 | steps: 29 | - checkout 30 | - setup_remote_docker 31 | - run: 32 | name: "Build and push multi-architecture image" 33 | command: | 34 | echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin $DOCKER_REGISTRY 35 | export DOCKER_CLI_EXPERIMENTAL=enabled 36 | docker context create buildx-build 37 | docker buildx create --use buildx-build 38 | docker buildx build --push \ 39 | --tag $DOCKER_REGISTRY/$REGISTRY_USER/kalilinux-docker:latest \ 40 | --platform linux/amd64,linux/arm64 \ 41 | -f Dockerfile . 42 | 43 | workflows: 44 | build-auto: 45 | when: 46 | equal: [auto, << pipeline.parameters.workflow >>] 47 | jobs: 48 | - hadolint 49 | 50 | build-latest: 51 | when: 52 | equal: [latest, << pipeline.parameters.workflow >>] 53 | jobs: 54 | - hadolint 55 | - build-kalilinux: 56 | requires: 57 | - hadolint 58 | 59 | build-weekly: 60 | triggers: 61 | - schedule: 62 | cron: "0 0 * * 0" 63 | filters: 64 | branches: 65 | only: 66 | - main 67 | jobs: 68 | - hadolint 69 | - build-kalilinux: 70 | requires: 71 | - hadolint 72 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Kali Linux Desktop on the Browser 2 | 3 | This repository contains a Docker Compose application that runs a Kali Linux desktop accessible through your web browser via NoVNC. 4 | 5 | ![Screenshot](.github/images/screenshoot.png) 6 | 7 | ## Description 8 | 9 | This Docker Compose application provides: 10 | 11 | - **Kali Linux**: A web server running NoVNC with Kali Linux Desktop environment. 12 | - Default password: `kalilinux` 13 | - Default exposed port: `8080` 14 | 15 | ## Requirements 16 | 17 | To run this application, you need: 18 | 19 | - Docker Engine 20 | - Docker Compose 21 | 22 | ## Usage 23 | 24 | ### Quick Start 25 | 26 | 1. Clone the repository: 27 | ```bash 28 | git clone https://github.com/csalab-id/kalilinux-docker.git 29 | ``` 30 | 31 | 2. Navigate to the repository directory: 32 | ```bash 33 | cd kalilinux-docker 34 | ``` 35 | 36 | 3. Pull the required Docker images: 37 | ```bash 38 | docker compose pull 39 | ``` 40 | 41 | 4. Set a custom password for the environment (optional): 42 | ```bash 43 | export PASSWORD="YourVNCPassword" 44 | ``` 45 | 46 | 5. Start the containers in detached mode: 47 | ```bash 48 | docker compose up -d 49 | ``` 50 | 51 | 6. Access the web application at: http://localhost:8080/vnc.html 52 | 53 | ## Environment Variables 54 | 55 | You can customize the application using these environment variables: 56 | 57 | | Variable | Description | Default | 58 | |----------|-------------|---------| 59 | | `PASSWORD` | VNC password | `kalilinux` | 60 | | `BIND` | Address and port to bind the server (format: IP:PORT) | `0.0.0.0:8080` | 61 | 62 | Example usage: 63 | ```bash 64 | export PASSWORD="mysecretpassword" 65 | export BIND="0.0.0.0:9090" 66 | docker compose up -d 67 | ``` 68 | 69 | ## License 70 | 71 | This Docker Compose application is released under the MIT License. See the [LICENSE](https://www.mit.edu/~amini/LICENSE.md) file for details. 72 | 73 | ## Disclaimer 74 | 75 | The software developed and distributed for hacking purposes is intended for **educational and testing purposes only**. The use of this software for any illegal activity is strictly prohibited. The developers and distributors of the software are not liable for any damages or legal consequences resulting from the misuse of the software. 76 | --------------------------------------------------------------------------------