Skip to main content

OWASP-focused web vulnerability scanner with vulnerable and fixed Flask apps for lab exercises. Independent of Microsoft Presidio (a data-anonymization toolkit).

Project description

presidio-hardened-vuln-scanner

Web application vulnerability scanner with a deliberately vulnerable Flask app and its hardened counterpart. Used in Experiment 3 of PRES-EDU-SEC-101.

Warning: vulnerable_app/ contains intentional security flaws. Never deploy it outside a local development environment.

Setup

git clone https://github.com/presidio-v/presidio-hardened-vuln-scanner.git
cd presidio-hardened-vuln-scanner
pip install -r requirements.txt

Phase A — Static Analysis

bandit -r vulnerable_app/ -f json -o reports/bandit_report.json -ll
bandit -r vulnerable_app/ -f txt
pip-audit --requirement vulnerable_app/requirements.txt \
          --output reports/pip_audit.json --format json
python report.py --phase static

Expected findings: hardcoded secret key, eval, insecure subprocess, MD5 hashing.

Phase B — Dynamic Scanning

cd vulnerable_app && python app.py &
cd ..
python scanner.py --target http://localhost:5000 \
                  --checks sqli xss csrf auth headers \
                  --output reports/dynamic_report.json
python report.py --phase dynamic

Expected findings: SQL injection, reflected XSS, missing CSRF token, missing headers.

Phase C — Manual Exploitation

python exploit.py --vuln sqli \
                  --payload "' OR '1'='1" \
                  --target http://localhost:5000

python exploit.py --vuln xss \
                  --payload "<script>alert('XSS')</script>" \
                  --target http://localhost:5000

Phase D — Fix and Verify

kill %1
cd fixed_app && python app.py --port 5001 2>/dev/null || python app.py &
cd ..
bandit -r fixed_app/ -f txt
python scanner.py --target http://localhost:5001 \
                  --checks sqli xss csrf auth headers \
                  --output reports/dynamic_report_fixed.json
python report.py --compare vulnerable fixed

What to Measure

  • Findings before fix: count by severity (HIGH / MEDIUM / LOW)
  • Findings after fix: should be zero HIGH
  • Takeaway: static + dynamic analysis find different vulnerability classes

License

MIT


SDLC

This repository is developed under the Presidio hardened-family SDLC: https://github.com/presidio-v/presidio-hardened-docs/blob/main/sdlc/sdlc-report.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

presidio_hardened_vuln_scanner-0.1.0.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

presidio_hardened_vuln_scanner-0.1.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file presidio_hardened_vuln_scanner-0.1.0.tar.gz.

File metadata

File hashes

Hashes for presidio_hardened_vuln_scanner-0.1.0.tar.gz
Algorithm Hash digest
SHA256 04c4d926ba6cd275b21379b8fa8b5249f37643698963e7c68d7f13164fd5afce
MD5 31fa4929f4102382867e8dd1cd0e516b
BLAKE2b-256 730ec0faf13b3e685cfebb07a6c6a905225c97ce37cdf8d2fcdb529537dd63fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for presidio_hardened_vuln_scanner-0.1.0.tar.gz:

Publisher: publish.yml on presidio-v/presidio-hardened-vuln-scanner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file presidio_hardened_vuln_scanner-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for presidio_hardened_vuln_scanner-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1bb3ed496570c26c17c7cdc0c0d06c8ba7821f66fae0a8c46495269a8956c6dd
MD5 d2d70b745e57d461aa38e92149b65093
BLAKE2b-256 e270339d64bead6ebd8d182f28a44fca0c56020afa48a559f7b1246a37336662

See more details on using hashes here.

Provenance

The following attestation bundles were made for presidio_hardened_vuln_scanner-0.1.0-py3-none-any.whl:

Publisher: publish.yml on presidio-v/presidio-hardened-vuln-scanner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page