Skip to content

Instantly share code, notes, and snippets.

@zesty
Last active May 14, 2022 10:02
Show Gist options
  • Save zesty/1fdbc7aadc4e6cb3ae0c0f75a1ceeaf0 to your computer and use it in GitHub Desktop.
Save zesty/1fdbc7aadc4e6cb3ae0c0f75a1ceeaf0 to your computer and use it in GitHub Desktop.
kali linux via docker on ubuntu with vnc
mkdir $HOME/kali
# assumes you're in the docker group ...
# if you want net_admin inside the container
# docker run -td --name mykali --network host -v $HOME/kali:/tmp/home --device=/dev/net/tun --cap-add=net_admin kalilinux/kali-rolling
docker run -td --name mykali --network host -v $HOME/kali:/tmp/home kalilinux/kali-rolling
docker exec -it mykali bash
apt update
apt upgrade
# takes a while, and requires some input
apt install kali-linux-default
# yes to kismet suid, [Enter] for userids
# macchanger yes
# keyboard: English (US)
# dumpcap no
# utf-8
# latin1 latin5
# sslh: inetd
# no installation candidates for pkgs recommened in previous, but check anyway
for p in libnfqueue-perl python3-mpltoolkits.basemap xar bomutils python3-numba python3-rekall-core volatility3; do apt install $p; done
# switch this up for xfce, gnome, etc
# xfonts-100dpi, xfonts-scalable were suggested packages from tigervnc
apt install tigervnc-standalone-server tigervnc-xorg-extension tigervnc-tools xfonts-100dpi xfonts-scalable dbus-x11 kali-desktop-kde
# most do not have installation candidates
for p in kde-style-qtcurve secureboot-db xdg-desktop-portal-kde xserver-xorg-video-qxl; do apt install $p; done
# /etc/alternatives should have updated with the new tigervncserver
# check with:
ls -l /etc/alternatives/*vnc
# should show something like:
# lrwxrwxrwx 1 root root 18 May 14 12:08 /etc/alternatives/Xvnc -> /usr/bin/Xtigervnc
# ch0053 y0u2 0wn h42d 70 7yp3 u532n4m3
useradd -G kismet,sudo -m -s /usr/bin/zsh bob
# three groups (wireshark,kaboxer,docker) disappeared from the install since I first wrote this
passwd bob
su - bob
vncpasswd # gets put at ~/.vnc/passwd
echo -e '#!/bin/sh\nvncconfig -iconic &\ndbus-launch --exit-with-session startplasma-x11' > ~/.vnc/xstartup
# last line of that file would be different for gnome, xfce, or whatever you run
chmod 755 ~/.vnc/xstartup
vncserver :1 -depth 24 -geometry 1280x1024
# in another terminal on your host, not on the container (port may vary?)
xvncviewer localhost:5901
# that's different from the advice of vncserver above for client connections, because you're on a *different host*
# comes up with 1600x1200 on the client and resolution scales with window size for me
# in the container
ln -s /tmp/home $HOME/t
# libdbus for firefox
sudo apt install iputils-ping libdbus-glib-1-2
mkdir ~/bin
# vi mode in .zshrc
echo 'bindkey -v' >> ~/.zshrc
echo 'bindkey "^?" backward-delete-char' >> ~/.zshrc
# .zshenv
echo 'export LC_ALL="en_US.UTF-8"' >> ~/.zshenv
echo 'export PATH=$PATH:$HOME/bin' >> ~/.zshenv
# maybe also 'export LANG="en_US.UTF-8"' for some people?
# the rest of the fix for the duplicate text artifact you can't backspace over when using autosuggestions
# uncomment the appropriate line:
sudo vim /etc/locale.gen
# en_US.UTF-8 UTF-8 <------------ for me, this line
# have to be root login shell or this won't work
sudo su - root
locale-gen
exit
# firefox
wget 'https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64&lang=en-US' -O firefox.tar.bz2
tar xvfa firefox.tar.bz2
ln -s $HOME/firefox/firefox $HOME/bin/firefox
# zaproxy (not covered here)
# fix the font display
echo '#!env zsh
_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on' $HOME/Downloads/zap/zap.sh' >> ~/bin/zap
chmod 755 ~/bin/zap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment