Dockerfile: Hack the Box VPN Iodine pwntools - SuperMarioOfficial/Docker-Wiki GitHub Wiki

  • Download your OVPN file from HTB.eu and place it in this folder
  • Build using: docker build -t hilalh/kali-linux:latest .
  • Run using: docker run -ti --privileged hilalh/kali-linux:latest /bin/bash
  • Enable tunnel using sudo ./enalbe-tunnel inside the container (pass: newpassword)
  • Connect to vpn using openvpn --config --daemon
  • Start hacking ⚔️
FROM kalilinux/kali-linux-docker
ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm-256color
# do APT update
RUN apt-get -y update && apt-get -y dist-upgrade && apt-get -y autoremove && apt-get clean
# install system essentials
apt-get install -y build-essential jq strace ltrace curl wget gcc dnsutils netcat gcc-multilib net-tools vim gdb gdb-multiarch python python3 python3-pip python3-dev libssl-dev libffi-dev wget git make procps 
apt-get install iodine -y


RUN apt-get install file git openvpn bridge-utils net-tools seclists zsh -y
RUN apt-get install kali-tools-web  kali-tools-database  kali-tools-passwords  kali-tools-exploitation -y
RUN apt-get install sudo -y
pip3 install pwntools
pip install pwntools
RUN $ sh -c "$(curl -fsSL https://raw.githubusercontent.com/SuperMarioOfficial/DevOps-Playground/master/scripts/install_osquery.sh)"

# create a new user
RUN adduser --quiet --disabled-password --shell /bin/bash --home /home/newuser --gecos "User" newuser
RUN echo "newuser:newpassword" | chpasswd
RUN usermod -aG sudo newuser

# switch to new user
USER newuser
WORKDIR /home/newuser

#Copy necessary files for VPN and tunneling
COPY *.ovpn ./
RUN $ sh -c "$(curl -fsSL https://raw.githubusercontent.com/SuperMarioOfficial/Docker-Wiki/master/docker_networking.sh)"
sysctl -w net.ipv6.conf.all.disable_ipv6=0
sysctl -w net.ipv6.conf.default.disable_ipv6=0
sysctl -w net.ipv4.ip_forward=0
cd /dev && mkdir net && mknod net/tun c 10 200 && chmod 0666 net/tun
iptables -A FORWARD -i eth0 -o tun0 -j ACCEPT
iptables -A FORWARD -i tun0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE

References

⚠️ **GitHub.com Fallback** ⚠️