Skip to content

Instantly share code, notes, and snippets.

@l4rm4nd
Last active October 31, 2024 18:13
Show Gist options
  • Select an option

  • Save l4rm4nd/571e95ed45df23634b08d4062c8a1949 to your computer and use it in GitHub Desktop.

Select an option

Save l4rm4nd/571e95ed45df23634b08d4062c8a1949 to your computer and use it in GitHub Desktop.
Kali Linux Docker Container with WireGuard VPN + OpenSSH

Docker Run

# run the container
docker run -v ./kali:/root --privileged --cap-add=NET_ADMIN --cap-add=NET_RAW --sysctl net.ipv4.ip_forward=1 --tty --interactive kalilinux/kali-rolling

Post-Installation within container

# install packages
apt update -y && apt upgrade -y && apt install dnsutils nmap wireguard resolvconf net-tools openssh-server nano iproute2 curl procps -y

# set new root pw; use a very strong pw as the user can login via SSH
passwd

# allow ssh root login
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config

# start openssh
service ssh start

# paste your wg config
nano /etc/wireguard/wg0.conf

# enable wireguard
wg-quick up wg0

## validate that you have the correct ips
curl ifconfig.me
ip a

# adjust dns if it is not working yet
nano /etc/resolv.conf
@l4rm4nd
Copy link
Author

l4rm4nd commented Oct 31, 2024

Alternatively, build your own Docker image:

https://github.com/l4rm4nd/Kali-Linux-Dockerfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment