relsqui / bad-python-app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setup

Requisites

Running

Run in Docker

# building
docker build -t vuln-flask-web-app .

# running
docker run -it -p 5000:5000 --rm --name vuln-flask-web-app vuln-flask-web-app

Run Local

python3 -m venv venv
source venv/bin/activate
sh setup.sh
sh run.sh

Options

Restricting Access (optional)

By default, the api key is set to None and any request will be allowed.

If you want to restrict the access to the app, just set the environment variable named VULN_FLASK_APP_API_KEY with your secret:

export VULN_FLASK_APP_API_KEY=myapisecret

Now, every request should include a cookie named api_key with the value of the VULN_FLASK_APP_API_KEY environment variable.

GET / HTTP/1.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Host: localhost:5000
...

Cookie: api_key=myapisecret

...

About

License:MIT License


Languages

Language:Python 38.4%Language:HTML 30.5%Language:Java 28.3%Language:JavaScript 1.7%Language:Dockerfile 0.7%Language:Shell 0.4%