
intentionally vuln web Application Security in django
intentionally vuln web Application Security in django.
our roadmap build intentionally vuln web Application in django. The Vulnerability can based on OWASP top ten
Every lab runs in its own Docker container, so PyGoat needs Docker in all setups.
This starts PyGoat, Traefik and everything the labs need.
8000, 80 (Traefik, serves the labs) and 8080 (Traefik dashboard) must be free.git clone https://github.com/adeyosemanputra/pygoat.git
cd pygoat
docker compose up -d
(Older Docker installs use docker-compose up -d.)docker compose logs -f migration. Later runs reuse the images and start quickly.localhost). Labs are served at lab-<username>-<lab>.lvh.me and are only accessible to the user who started them, which requires the login cookie to be shared across *.lvh.me.docker compose down.The
pygoat/pygoatimage on Docker Hub is the old v2 release and does not include the v3 labs. Use Docker Compose instead.
To setup the project on your local machine:
First, Clone the repository using GitHub website or git in Terminal
git clone https://github.com/adeyosemanputra/pygoat.git
### To Download a specific branch
git clone -b <branch_name> https://github.com/adeyosemanputra/pygoat.git
Then, download Traefik to your local machine in the Pygoat directory (if you are not using Docker Compose) from the Traefik releases page. Open a separate terminal and run the following commands:
For Linux/WSL -
tar -zxvf traefik_<traefik_version>_linux_<arch>.tar.gz
sudo ./traefik
For Windows (Powershell) -
Expand-Archive traefik_<traefik_version>_windows_<arch>.zip
cd traefik_<traefik_version>_windows_<arch>
./traefik.exe
If you face any issue while installation, kindly refer to the documentation
bash installer.shpython3 manage.py migrate
python3 manage.py seed_scoring
python3 manage.py populate_labs
python3 manage.py runserver.pip install -r requirements.txt.python3 manage.py migrate
python3 manage.py seed_scoring
python3 manage.py populate_labs
python3 manage.py runserver.setup.py file - pip3 install .python3 manage.py migrate
python3 manage.py seed_scoring
python3 manage.py populate_labs
python3 manage.py runserver.python3 command is not available. Use python instead, and make sure it points to Python 3.installer.shinstaller.shThis section guides you through creating and integrating new vulnerability labs into PyGoat.
dockerized_labs folder:cd dockerized_labs
mkdir your_lab_name
cd your_lab_name
Create the standard application structure with a Dockerfile, docker-compose.yml, requirements.txt (if using Python), a main application entry point (e.g., app.py, main.py, or equivalent), vulnerable endpoints or components relevant to the lab, and a README.md documenting the lab. The application does not necessarily have to be a Flask application—it can be any Python project (preferred, since this is part of Pygoat), or even another language if appropriate. Refer to existing labs in the dockerized_labs folder for examples and structure conventions.
Important: Add a /health endpoint in your app.py for container health check.
Access the Django Admin panel at http://localhost:8000/admin/ and navigate to the Labs section.
Add a new entry with:
your_lab_namedockerized_labs/your_lab_name<PORT_NUMBER>(Alternatively, you can register it via Django shell or a custom data migration).
Important:
Dockerfile, docker-compose.yml, app.py, and the database entry.cd /path/to/pygoat
cd dockerized_labs/your_lab_name
docker compose up
Access your lab at http://localhost:<PORT_NUMBER>
Verify the vulnerability works as expected
Stop the individual lab container
Add your lab details in base.html
From the PyGoat root directory, rebuild the entire application:
docker compose down
docker compose up --build
uninstaller.sh script to uninstall pygoat along with all it's dependencies.pygoat, simply run:$ bash ./uninstaller.sh