Skip to content

coderzzone/Web-Vulnerability-Scanner

Web Vulnerability Scanner (WVS)

Python FastAPI Next.js License: MIT Status

WVS is a full-stack web security scanning framework that pairs a Python FastAPI backend with a Next.js + Tailwind frontend to deliver real-time, extensible vulnerability detection.

It helps developers and security teams identify common injection flaws, misconfigurations, and logic issues in modern web applications using safe-by-default, low-impact modules.

Table of Contents

Key Features

  • Injection checks: SQLi, SSTI (benign heuristics)
  • XSS: Reflected, DOM-based (static sink heuristics)
  • Misconfigurations: CORS, Clickjacking, Security headers, Cookie flags, TLS checks
  • Recon and info: Ping/connectivity, Domain scan, IP identification, Tech fingerprinting
  • GraphQL: Introspection detection
  • Protocols/headers: Host header reflection checks
  • Orchestrator: Concurrent module execution with consistent result schema
  • AI Explain: One-click “AI Explain” to turn findings into a detailed remediation report (Gemini)

Note: Several advanced modules are present in the codebase and will be expanded over time. Safety comes first; most implemented modules are passive or low-impact.

Architecture

  • backend/ — FastAPI service, scanning engine, and vulnerability modules
  • frontend/ — Next.js App Router UI for starting scans and viewing results

Screenshots

  • Dashboard: start scans and view findings (severity, confidence, evidence)
  • Login: obtain an access token to interact with the API
  • About, Developers, Careers pages for project info and contribution paths

Add screenshots under docs/screenshots and link them here.

Quickstart

Backend (FastAPI)

  1. Create a virtual environment and install dependencies
python -m venv .venv
source .venv/bin/activate
pip install -r backend/requirements.txt
  1. Set environment and run the API
export JWT_SECRET=change_me_for_dev
uvicorn backend.app.main:app --reload
  1. Health check
curl -s http://127.0.0.1:8000/health | jq .

Frontend (Next.js)

  1. Start the dev server
cd frontend
npm run dev
  1. Visit the app

The frontend proxies to the backend via /api/backend (configured in the app). Ensure the backend is running on http://127.0.0.1:8000.

Environment Variables (Backend)

  • JWT_SECRET: secret for signing tokens (required for stable auth)
  • JWT_ALG: token algorithm (default HS256)
  • JWT_EXPIRE_MINUTES: token lifetime (default 60)
  • GEMINI_API_KEY: API key for Gemini to enable AI explanations (optional)
  • GEMINI_MODEL: Gemini model name (default: gemini-1.5-flash)

Docker (Backend)

Build and run the backend API with Docker:

docker build -t wvs-backend -f backend/Dockerfile .
docker run --rm -p 8000:8000 -e JWT_SECRET=change_me wvs-backend

Check health:

curl -s http://127.0.0.1:8000/health | jq .

API Usage

Authenticate and run a scan (authorized testing only):

TOKEN=$(curl -s -X POST http://127.0.0.1:8000/api/auth/login \
  -H 'Content-Type: application/json' \
  -d '{"email":"user@example.com","password":"pw"}' | jq -r .access_token)

curl -s -X POST "http://127.0.0.1:8000/api/scan?verbose=true" \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"target":"https://example.com","modules":["headers","cookies","tls_checks","clickjacking","cors_misconfig","sqli","xss_reflected","xss_dom","ssti","ping","domain_scan","ip_identification","graphql_introspection","host_header_injection"]}' | jq .

AI Explanation

Enable Gemini on the backend and generate a detailed markdown report from findings.

  1. Configure environment (do not paste secrets in commands; set them in your shell):
export GEMINI_API_KEY={{GEMINI_API_KEY}}
export GEMINI_MODEL=gemini-1.5-flash   # optional
  1. Call the AI endpoint:
TOKEN=$(curl -s -X POST http://127.0.0.1:8000/api/auth/login \
  -H 'Content-Type: application/json' \
  -d '{"email":"user@example.com","password":"pw"}' | jq -r .access_token)

curl -s -X POST http://127.0.0.1:8000/api/ai/explain \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "target": "https://example.com",
    "findings": [{"module":"headers","severity":"low","title":"Missing Security Header: X-Frame-Options","confidence":"high","evidence":{"header":"x-frame-options"}}],
    "tone": "detailed",
    "language": "en"
  }' | jq .

UI integration: In the Dashboard, after a scan returns findings, click “AI Explain” to fetch and render the explanation.

Testing

Run the backend tests:

. .venv/bin/activate
pytest -q backend/tests

Contributing

Please read CONTRIBUTING.md for guidelines on proposing changes, branching, commit messages, and pull requests. To add a module, create a file under backend/scanner/modules/ that defines:

  • MODULE: string module name
  • async def scan(target: str, context: dict | None) -> list[dict]

The engine auto-discovers modules and runs them concurrently.

Code of Conduct

We follow the Contributor Covenant. See CODE_OF_CONDUCT.md for expected behavior and reporting.

Security Policy

Please report vulnerabilities responsibly as described in SECURITY.md. Only test systems you own or have explicit permission to test.

Support

Open a GitHub issue for bugs and feature requests. For general questions, use GitHub Discussions (if enabled). We aim to respond within a few business days.

Roadmap

  • Expand module coverage (SSRF advanced checks, NoSQLi, JSONi, XXE, HTTP Smuggling)
  • Add linting/formatting (ruff, black) and CI workflows
  • Enhance result presentation and filtering in the UI
  • Add rate limiting and concurrency controls for production safety

License

This project is licensed under the MIT License — see LICENSE for details.

Security and Legal

Only scan systems you own or have explicit written permission to test. Unauthorized scanning may be illegal. Use responsibly.

Acknowledgements

Developed by INSA Teams

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •