From 2e98b08cec327954c4614b046d62af97e94b8829 Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Thu, 28 Jan 2021 23:46:21 +1300 Subject: [PATCH] Deb: add Kali kali-rolling support --- builder/build-tarball | 3 +- builder/dockerfile.kali_kali-rolling.build | 31 +++++++++++ .../dockerfile.kali_kali-rolling.deb.build | 12 +++++ builder/dockerfile.kali_kali-rolling.deb.test | 53 +++++++++++++++++++ 4 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 builder/dockerfile.kali_kali-rolling.build create mode 100644 builder/dockerfile.kali_kali-rolling.deb.build create mode 100644 builder/dockerfile.kali_kali-rolling.deb.test diff --git a/builder/build-tarball b/builder/build-tarball index 20f8621..c5f3f2f 100755 --- a/builder/build-tarball +++ b/builder/build-tarball @@ -12,9 +12,8 @@ cd "$(dirname "$0")/.." build_www_dir -docker pull "$os_image" docker build -t kasmvncbuilder:$os_codename \ --f builder/dockerfile.${os}_${os_codename}.build . + -f builder/dockerfile.${os}_${os_codename}.build . mkdir -p builder/build docker run -v /tmp:/build --rm kasmvncbuilder:$os_codename diff --git a/builder/dockerfile.kali_kali-rolling.build b/builder/dockerfile.kali_kali-rolling.build new file mode 100644 index 0000000..6087895 --- /dev/null +++ b/builder/dockerfile.kali_kali-rolling.build @@ -0,0 +1,31 @@ +FROM kalilinux/kali-rolling:latest + +ENV KASMVNC_BUILD_OS kali +ENV KASMVNC_BUILD_OS_CODENAME kali-rolling +ENV XORG_VER 1.20.10 +ENV DEBIAN_FRONTEND noninteractive + +RUN grep '^deb' /etc/apt/sources.list | sed 's#^deb#deb-src#' >> /etc/apt/sources.list + +RUN apt-get update && \ + apt-get -y install sudo + +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata +RUN apt-get update && apt-get -y build-dep xorg-server libxfont-dev +RUN apt-get update && apt-get -y install cmake git libjpeg-dev libgnutls28-dev vim wget tightvncserver +RUN apt-get update && apt-get -y install libjpeg-dev libpng-dev libtiff-dev libgif-dev libavcodec-dev libssl-dev + +# Additions for webp +RUN cd /tmp && wget https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.0.2.tar.gz +RUN cd /tmp && tar -xzvf /tmp/libwebp-* +RUN cd /tmp/libwebp-1.0.2 && \ + ./configure --enable-static --disable-shared && \ + make && make install + +RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo + +COPY . /src +RUN chown -R docker:docker /src + +USER docker +ENTRYPOINT ["/src/builder/build.sh"] diff --git a/builder/dockerfile.kali_kali-rolling.deb.build b/builder/dockerfile.kali_kali-rolling.deb.build new file mode 100644 index 0000000..8f0a2c5 --- /dev/null +++ b/builder/dockerfile.kali_kali-rolling.deb.build @@ -0,0 +1,12 @@ +FROM kalilinux/kali-rolling:latest + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update && \ + apt-get -y install vim build-essential devscripts equivs + +# Install build-deps for the package. +COPY ./debian/control /tmp +RUN echo YYY | mk-build-deps --install --remove /tmp/control + +USER 1000 diff --git a/builder/dockerfile.kali_kali-rolling.deb.test b/builder/dockerfile.kali_kali-rolling.deb.test new file mode 100644 index 0000000..9ee469c --- /dev/null +++ b/builder/dockerfile.kali_kali-rolling.deb.test @@ -0,0 +1,53 @@ +FROM kalilinux/kali-rolling:latest + +ENV DISPLAY=:1 \ + VNC_PORT=8443 \ + VNC_RESOLUTION=1280x720 \ + MAX_FRAME_RATE=24 \ + VNCOPTIONS="-PreferBandwidth -DynamicQualityMin=4 -DynamicQualityMax=7" \ + HOME=/home/user \ + TERM=xterm \ + STARTUPDIR=/dockerstartup \ + INST_SCRIPTS=/dockerstartup/install \ + KASM_RX_HOME=/dockerstartup/kasmrx \ + DEBIAN_FRONTEND=noninteractive \ + VNC_COL_DEPTH=24 \ + VNC_RESOLUTION=1280x1024 \ + VNC_PW=vncpassword \ + VNC_USER=user \ + VNC_VIEW_ONLY_PW=vncviewonlypassword \ + LD_LIBRARY_PATH=/usr/local/lib/ \ + OMP_WAIT_POLICY=PASSIVE \ + SHELL=/bin/bash \ + SINGLE_APPLICATION=0 \ + KASMVNC_BUILD_OS=ubuntu \ + KASMVNC_BUILD_OS_VER=18.04 + +EXPOSE $VNC_PORT + +WORKDIR $HOME + +### REQUIRED STUFF ### + +RUN apt-get update && apt-get install -y supervisor xfce4 xfce4-terminal xterm libnss-wrapper gettext wget +RUN apt-get purge -y pm-utils xscreensaver* +RUN apt-get update && apt-get install -y vim less + +RUN echo 'source $STARTUPDIR/generate_container_user' >> $HOME/.bashrc + +RUN mkdir -p $STARTUPDIR +COPY startup/ $STARTUPDIR + +### START CUSTOM STUFF #### + +ARG KASMVNC_PACKAGE_DIR +COPY $KASMVNC_PACKAGE_DIR/kasmvncserver_*.deb /tmp +RUN dpkg -i /tmp/*.deb; apt-get -yf install + +### END CUSTOM STUFF ### + +RUN chown -R 1000:0 $HOME +USER 1000:ssl-cert +WORKDIR $HOME + +ENTRYPOINT [ "/dockerstartup/vnc_startup.sh" ]