How To Run WebGoat within a Docker Container on Kali Linux

A very quick setup guide. No BS.

theUnknown
2 min readFeb 16, 2020
  • create a script.sh file
  • paste in the contents below (source)
#!/bin/bash

#
# Kali Docker Setup Script
# @decidedlygray 20180902
# LICENSE: MIT
#
# Steps taken from: https://docs.docker.com/install/linux/docker-ce/debian/
# And: https://medium.com/@airman604/installing-docker-in-kali-linux-2017-1-fbaa4d1447fe
# Install uses the repository, so we can get updates in the future

# Remove any existing docker packages and update package list
sudo apt remove docker docker-engine docker.io -y
sudo apt update

# Install apt HTTPS packages
sudo apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common -y

# Add Docker GPG key
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
# Verify key exists
# sudo apt-key fingerprint 0EBFCD88

# Add stable repo
# sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian jessie stable"
echo 'deb https://download.docker.com/linux/debian stretch stable' > /etc/apt/sources.list.d/docker.list

# Update repo list
sudo apt update

# Finally, install Docker Community Edition
sudo apt install docker-ce -y
# Verify install by running the docker hello world
systemctl start docker
sudo docker run hello-world
  • make script.sh into executable by typing below command in Terminal:
chmod +x script.sh
  • execute the script by typing the following command in Terminal:
./script.sh
  • after docker is successfully installed and running, it is time to pull the WebGoat image from docker hub and containerise it:

Official WebGoat Docker image release 8.0

Please note: WebGoat 8.0 is work in progress and currently does not support a lot of lesson since we are working on a new lesson model. For a stable version use https://hub.docker.com/r/webgoat/webgoat-7.1/

docker pull webgoat/webgoat-7.1docker run -p 8000:8080 -t webgoat/webgoat-7.1
  • After its all set up and ready, open the browser and type the following url to access WebGoat:
http://localhost:8000/WebGoat/

That’s All Folks! ☕️

--

--

theUnknown

Everything is unknown until it’s known. Self-learner.