Skip to content

AKIB473/webshield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ WebShield

License: MIT CI Python Version Stars

WebShield is a developer-first web security scanner. Point it at any website and get:

  • A security score (0โ€“100) and letter grade (A+ to F)
  • 78 parallel scan modules covering every OWASP Top 10:2025 category
  • Code-level fix examples for every finding โ€” not just "you have XSS", but here's the exact vulnerable line and the safe version
  • Auto-crawling โ€” discovers injectable URLs automatically, no manual param setup
  • HTML + JSON + SARIF reports
  • Default credential testing on 60+ real apps
  • WAF evasion techniques to find bypasses
  • CVE fingerprinting for 10+ critical vulnerabilities

v1.8.0 โ€” 78 modules. New: default credential testing, exposed panel detection, WAF evasion, OpenAPI/Swagger endpoint testing, blind XXE, source code disclosure, 403 bypass, PII detection, Spring Actuator, HTTP parameter pollution, CVE checks, WebSocket security.


โšก Quick Start

git clone https://github.com/AKIB473/webshield.git
cd webshield && pip install -e .
webshield scan https://yoursite.com

๐Ÿงช Try It on the Demo App

WebShield ships with a deliberately vulnerable Flask app that exercises every module:

# Terminal 1 โ€” run the vulnerable demo app
python3 demo/app.py
# โ†’ http://localhost:5000

# Terminal 2 โ€” scan it
webshield scan http://localhost:5000 --output report.html --json results.json

Demo scan results (verified):

Score: 0/100  Grade: F  |  100+ findings  |  25+ CRITICAL  |  ~12s
๐Ÿ”ด CRITICAL  โ€” SQL injection, SSTI RCE, OS command injection, JWT alg:none,
               heap dump exposed, PII data (SSN/CC/IBAN), .git exposed,
               default credentials (admin/admin), NoSQL auth bypass...
๐ŸŸ  HIGH      โ€” Reflected XSS, DOM XSS, IDOR, CORS, source maps, actuator/env,
               OpenAPI spec with unauth endpoints, websocket downgrade...
๐ŸŸก MEDIUM    โ€” CSRF, GraphQL introspection, cache deception, HPP, evasion...
๐Ÿ”ต LOW       โ€” Cookie flags, info disclosure, SameSite missing...

๐Ÿ” Usage

Basic scan

webshield scan https://example.com

Full scan โ€” all reports

webshield scan https://example.com \
  --output report.html \
  --json results.json \
  --sarif results.sarif \
  --timeout 15

Authenticated scanning

webshield scan https://example.com \
  --auth-cookie "session=abc123" \
  --auth-header "Authorization=Bearer eyJ..."

Scan specific modules only

webshield scan https://example.com \
  --modules sql_injection,xss_detection,default_credentials,cve_checks

CI/CD mode โ€” fail build on findings

webshield scan https://example.com --ci --fail-on high
echo $?   # 0 = pass, 1 = HIGH+ findings found

Compare two scans (track improvements)

webshield scan https://example.com --json before.json
# ... deploy your fixes ...
webshield scan https://example.com --json after.json
webshield compare before.json after.json

List all 60 modules

webshield list-modules

๐Ÿ“ฆ Installation

# From source (recommended)
git clone https://github.com/AKIB473/webshield.git
cd webshield && pip install -e .

# Directly from GitHub
pip install git+https://github.com/AKIB473/webshield.git

# Development (tests included)
pip install -e ".[dev]"

Requirements: Python 3.9+ ยท No external tools needed


๐Ÿ“ฑ Termux / Android Installation

WebShield runs on Android via Termux โ€” all modules work, with graceful fallback for raw-socket features:

# Install Termux from F-Droid (not Play Store)
pkg update && pkg upgrade
pkg install python openssl-tool

# Install WebShield (pure Python โ€” no compilation needed)
pip install webshield

# Scan any site
webshield scan https://example.com

# Full scan with reports
webshield scan https://example.com \
  --output report.html \
  --json results.json

What works on Termux (all 78 modules):

  • โœ… All 78 scan modules run
  • โœ… HTML + JSON + SARIF reports
  • โœ… All injection, header, auth, CVE, disclosure modules
  • โœ… Raw socket modules use smart fallback (timing-based detection)
  • โš ๏ธ request_smuggling โ†’ timing probe instead of raw socket (root not needed)
  • โš ๏ธ websocket_security โ†’ HTTP-based checks (CSWSH test skipped, run on PC for full)
  • โš ๏ธ HTTP/2: run pip install h2 for optional HTTP/2 support

PC/Linux with HTTP/2:

pip install "webshield[http2]"

๐Ÿ†š Why WebShield vs the alternatives?

Feature WebShield Nikto OWASP ZAP Others
Security Score (0โ€“100) โœ… โŒ โŒ โŒ
Letter Grade (A+ to F) โœ… โŒ โŒ โŒ
Code-level fix examples โœ… โŒ โŒ โŒ
Auto URL crawler โœ… โŒ โœ… โŒ
Default credential testing โœ… โŒ โŒ โŒ
WAF evasion techniques โœ… โœ… โŒ โŒ
OpenAPI spec import + testing โœ… โŒ โœ… โŒ
Source code disclosure (.git) โœ… โœ… โœ… โŒ
403 bypass detection โœ… โŒ โœ… โŒ
PII detection (SSN, CC, IBAN) โœ… โŒ โœ… โŒ
Spring Actuator exposure โœ… โŒ โœ… โŒ
HTTP parameter pollution โœ… โŒ โœ… โŒ
CVE fingerprinting (10+ CVEs) โœ… โœ… โœ… โŒ
WebSocket security โœ… โŒ โœ… โŒ
SSTI โ†’ RCE detection โœ… โŒ โŒ โŒ
DOM XSS (JS static analysis) โœ… โŒ โŒ โŒ
Web cache deception โœ… โŒ โŒ โŒ
Business logic flaws โœ… โŒ โŒ โŒ
NoSQL injection โœ… โŒ โŒ โŒ
Insecure deserialization โœ… โŒ โŒ โŒ
JWT deep analysis โœ… โŒ โŒ โŒ
Supply chain CVE check โœ… โŒ โŒ โŒ
IDOR / Broken Access Control โœ… โŒ Partial โŒ
2025 secret patterns โœ… โŒ โŒ โŒ
Authenticated scanning โœ… โŒ โœ… โŒ
SARIF (GitHub Security tab) โœ… โŒ โŒ โŒ
Async parallel scanning โœ… โŒ โŒ โŒ
Dark mode HTML report โœ… โŒ โŒ โŒ
Single pip install โœ… โŒ โŒ โŒ

๐Ÿงฉ All 60 Modules

๐Ÿ’‰ Injection (OWASP A05)

Module What it detects Max CVSS
sql_injection Error-based, boolean-blind, time-based, UNION โ€” MySQL/PG/MSSQL/Oracle/SQLite 9.8
xss_detection Reflected XSS โ€” 30+ payloads, WAF bypass, context-aware 8.2
ssti SSTI โ†’ RCE โ€” Jinja2, Twig, Freemarker, Velocity, Mako, ERB 9.8
cmd_injection OS command injection โ€” error-based + time-based blind 9.8
lfi LFI/Path Traversal โ€” 31 payloads: PHP wrappers, null bytes, /proc/self 9.8
ssrf SSRF โ€” AWS/GCP/Azure metadata, localhost bypass, IPv6 9.8
xxe XXE โ€” XML external entity injection 9.8
xxe_oob Blind/OOB XXE โ€” error-based, parameter entities, JSON-to-XML 9.8
nosql_injection NoSQL injection โ€” MongoDB $ne/$regex/$where auth bypass 9.1
log4shell Log4Shell (CVE-2021-44228), Shellshock, critical CVE detection 10.0
proto_pollution JavaScript prototype pollution via URL parameters 6.5
crlf_injection CRLF / HTTP response splitting 6.1
evasion_scan WAF bypass โ€” double-encoding, comment injection, case variation, HPP, null bytes 9.8

๐Ÿ”“ Broken Access Control (OWASP A01)

Module What it detects Max CVSS
idor_check IDOR โ€” sequential IDs, query param enumeration, unauth user lists 9.1
business_logic Username enumeration, mass assignment, workflow bypass 8.8
auth_hardening No rate limiting, MFA absence, default credentials, weak password reset 9.8
http_header_injection Host header poisoning, X-Original-URL bypass 8.1
bypass_403 HTTP verb tampering, URL path tricks, X-Original-URL/X-Rewrite-URL bypass 7.5

๐Ÿ”‘ Authentication & Tokens (OWASP A07)

Module What it detects Max CVSS
jwt alg:none, weak secret brute-force, kid SQLi/path-traversal, missing exp 9.8
cookies Missing Secure/HttpOnly/SameSite, low-entropy session IDs 7.5
csrf_check Missing CSRF tokens, SameSite enforcement, state-changing GET 6.5
rate_limit Brute-force protection, login throttling 7.5
default_credentials 60+ apps โ€” Jenkins, Grafana, WordPress, Portainer, Gitea, Kibana, phpMyAdmin, Tomcat, Drupal, Rancher, Traefik 9.8

๐Ÿงฑ Security Headers & Config (OWASP A02/A05)

Module What it detects Max CVSS
headers HSTS, CSP, X-Frame-Options, X-Content-Type-Options + info-leaking headers 7.5
csp Full CSP analysis โ€” unsafe-inline, unsafe-eval, wildcards 6.1
clickjacking X-Frame-Options, CSP frame-ancestors 6.1
cors Wildcard, reflected origin + credentials, null origin, pre-domain bypass 9.3
ssl_tls Certificate validity, TLS version, weak ciphers, self-signed 9.8
http_methods Dangerous methods: PUT, DELETE, TRACE, CONNECT 5.3
sri_check Missing integrity= on CDN scripts/styles 6.1
mixed_content HTTP resources on HTTPS pages 4.3
http_parameter_pollution Duplicate params, array notation, WAF bypass, business logic abuse 7.5

๐Ÿ” Information Disclosure

Module What it detects Max CVSS
secret_leak API keys in source โ€” AWS, GitHub, OpenAI, Anthropic, Stripe, Slack + more 9.8
info_leak .env, .git, SQL dumps, backups โ€” 24 sensitive paths 9.8
source_code_disclosure .git/.svn/.hg repos, backup files (.bak, .php~), source maps, composer.json 9.8
pii_detection SSN, credit cards (Luhn-verified), bulk email dumps, IBAN, UK National Insurance 9.8
sensitive_paths Admin panels, phpMyAdmin, Spring Actuator, debug UIs โ€” 36 paths 5.3
dir_listing Directory listing โ€” 40 paths including backups, logs, config 6.5
tech_fingerprint 25 tech patterns + 13 CVE version checks varies
cloud_exposure AWS/GCP/Azure metadata endpoint exposure, S3 buckets 7.5
malware_indicators Suspicious scripts, iframes, known malware patterns 9.8
api_exposure Swagger/OpenAPI specs, GraphiQL IDE, admin APIs, Prometheus metrics 7.5
spring_actuator /actuator/heapdump, /actuator/env, /actuator/shutdown + Quarkus, Laravel Telescope, Django debug 9.8
exposed_panels 30 panels โ€” Elasticsearch, Prometheus, Grafana, Mongo Express, HAProxy, Nginx/Apache status, .env 9.8
openapi_scan OpenAPI/Swagger spec discovery โ†’ tests every endpoint for unauth access, sensitive data, SQLi 9.8

๐ŸŒ Network & Infrastructure

Module What it detects Max CVSS
dns_email SPF, DMARC, CAA records โ€” email spoofing protection 5.3
subdomain_takeover CNAME โ†’ unclaimed services (GitHub Pages, Heroku, S3, Netlifyโ€ฆ) 8.1
waf_detect 15+ WAF signatures (Cloudflare, AWS, Akamai, ModSecurity, Sucuriโ€ฆ) โ€”
open_redirect 22 redirect parameter names tested 6.1
request_smuggling CL.TE and TE.CL via raw socket timing 8.1
broken_links Dead links and unreachable resources โ€”
security_txt RFC 9116 security.txt compliance โ€”
websocket_security CSWSH, ws:// downgrade on HTTPS, Next.js HMR in prod 8.1
cve_checks Text4Shell, Confluence OGNL, Exchange ProxyShell, Grafana path traversal, Drupalgeddon2, Apache Struts, Fortinet auth bypass, GitLab, VMware vCenter, Citrix Bleed 9.8

๐Ÿงฐ Supply Chain (OWASP A03/A06)

Module What it detects Max CVSS
supply_chain CVE check for package.json/requirements.txt โ€” 30+ vulnerable packages 9.8
graphql Introspection, batch DoS, depth DoS, alias flooding, GET-based CSRF 7.5

๐Ÿ†• Advanced Attack Surface

Module What it detects Max CVSS
web_cache_deception Omer Gil attack + James Kettle cache poisoning (unkeyed headers) 9.0
file_upload Webshell detection, SVG-stored-XSS, dangerous MIME types 9.8
dom_xss DOM XSS via JS static analysis โ€” location.hashโ†’innerHTML, jQuery sourceโ†’sink 8.8
insecure_deserialization Java serialization magic bytes, PHP serialize cookies, .NET ViewState 9.8

๐ŸŽฏ Real-World Testing

Scanned against ginandjuice.shop (PortSwigger's intentionally vulnerable shop):

Score: 0/100  F  |  21 findings  |  23s

๐ŸŸ  HIGH
  โœ… X-Original-URL bypasses /admin (403 โ†’ 200)
  โœ… Public AWS S3 bucket enumerable
  โœ… IDOR via ?id= query parameters
  โœ… No rate limiting on /login
  โœ… Missing HSTS, CSP

๐ŸŸก MEDIUM
  โœ… Web cache deception on /my-account
  โœ… CORS misconfiguration
  โœ… OpenAPI spec exposed

๐Ÿ“Š Terminal Output

๐Ÿ›ก๏ธ  WebShield v1.7.0 scanning https://example.com

๐Ÿ” Crawling for injectable parameters...
๐Ÿ” Found 8 URL(s) with parameters โ€” running injection modules

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Scan Summary โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚  Target:  https://example.com                                             โ”‚
โ”‚  Score:   12/100  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘            โ”‚
โ”‚  Grade:     F                                                             โ”‚
โ”‚  Time:    11.2s  |  Modules: 78  |  Findings: 44                         โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

๐Ÿ”ด CRITICAL (6)
  โ–  Default Credentials Accepted โ€” Jenkins (admin/admin)
    CVSS: 9.8

  โ–  Git Repository Exposed (/.git/HEAD)
    Entire source code downloadable via git clone
    CVSS: 9.8

  โ–  PII Leaked: Social Security Numbers (5 found)
    CVSS: 9.8

  โ–  Spring Boot Environment Exposed (/actuator/env)
    DB_PASSWORD, JWT_SECRET, AWS_ACCESS_KEY all in plaintext
    CVSS: 9.8

  โ–  SQL Injection (WAF Bypass via comment injection) โ€” param: id
    CVSS: 9.8

  โ–  XXE โ€” Local File Read (/etc/passwd)
    CVSS: 9.8

๐Ÿ”— CI/CD Integration

GitHub Actions

name: WebShield Security Audit

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  security:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"

      - name: Run WebShield
        run: |
          pip install git+https://github.com/AKIB473/webshield.git
          webshield scan ${{ vars.SITE_URL }} \
            --ci --fail-on high \
            --json results.json \
            --output report.html \
            --sarif results.sarif

      - name: Upload to GitHub Security tab
        uses: github/codeql-action/upload-sarif@v3
        if: always()
        with:
          sarif_file: results.sarif

      - name: Upload Report
        uses: actions/upload-artifact@v4
        if: always()
        with:
          name: webshield-report
          path: "results.json\nreport.html"

๐Ÿ Python API

from webshield.core.scanner import run_scan
from webshield.reporter.html_report import save_html
from webshield.reporter.sarif import save_sarif
import json

# Run full scan โ€” auto-crawls for injectable URLs
result = run_scan("https://example.com", timeout=15)

print(f"Score: {result.score}/100  Grade: {result.grade}")
print(f"Critical: {len(result.by_severity('CRITICAL'))}")
print(f"Scan time: {result.scan_duration}s")

for f in result.findings:
    print(f"[{f.severity.value}] {f.title}")
    if f.code_fix:
        print(f"  Fix: {f.code_fix[:100]}")

# Export all report formats
save_html(result, "report.html")
save_sarif(result, "results.sarif")

with open("results.json", "w") as fp:
    json.dump(result.to_dict(), fp, indent=2)

๐Ÿ“ˆ Changelog

v1.8.0 (current)

  • ๐Ÿ†• Default Credentials โ€” tests 60+ apps (Jenkins, Grafana, WordPress, Portainer, Gitea, Kibana, phpMyAdmin, Tomcat, Drupal, Rancher, Traefik)
  • ๐Ÿ†• Exposed Panels โ€” 30 admin/monitoring panels (Elasticsearch, Prometheus, Grafana, Mongo Express, HAProxy, Nginx status, .env, pgAdmin...)
  • ๐Ÿ†• WAF Evasion โ€” double-encoding, comment injection, case variation, null bytes, HPP bypass
  • ๐Ÿ†• OpenAPI Scan โ€” discovers and tests all endpoints from Swagger/OpenAPI specs
  • ๐Ÿ†• XXE OOB โ€” blind/OOB XXE with error-based fallback and parameter entity detection
  • ๐Ÿ“Š Module count: 55 โ†’ 60 | Tests: 64 โ†’ 96

v1.6.0

  • ๐Ÿ†• Source Code Disclosure โ€” .git/.svn/.hg repos, backup files, source maps, config files
  • ๐Ÿ†• 403 Bypass โ€” verb tampering, URL manipulation, X-Original-URL/X-Rewrite-URL header bypass
  • ๐Ÿ†• PII Detection โ€” SSN, credit cards (Luhn-verified), bulk email dumps, IBAN, UK NI numbers
  • ๐Ÿ†• Spring Actuator โ€” /actuator/heapdump, /env, /shutdown + Laravel Telescope, Quarkus dev, Django debug
  • ๐Ÿ†• HTTP Parameter Pollution โ€” duplicate params, array notation, WAF bypass
  • ๐Ÿ†• CVE Checks โ€” Text4Shell, Confluence, Exchange ProxyShell, Grafana, Drupalgeddon2, Struts, Fortinet, GitLab, VMware, Citrix Bleed
  • ๐Ÿ†• WebSocket Security โ€” CSWSH origin bypass, ws:// downgrade, Next.js HMR exposure
  • ๐Ÿ“Š Module count: 48 โ†’ 55

v1.5.1

  • ๐Ÿ†• URL Crawler โ€” auto-discovers injectable endpoints before running injection modules
  • ๐Ÿ†• Demo App (demo/app.py) โ€” deliberately vulnerable Flask app, one vuln per module
  • โœ… Verified: 23/23 key module coverage on demo app (88 findings, 23 CRITICAL)

v1.5.0

  • ๐Ÿ†• SSTI, Web Cache Deception, File Upload Security, DOM XSS, Business Logic
  • ๐Ÿ“Š Module count: 43 โ†’ 48

v1.4.0

  • ๐Ÿ†• OS Command Injection, NoSQL Injection, Host Header Injection, Insecure Deserialization
  • ๐Ÿ†• --auth-cookie / --auth-header, webshield compare
  • ๐Ÿ“Š Module count: 39 โ†’ 43

v1.3.0

  • ๐Ÿ†• IDOR, API Exposure, Directory Listing, Auth Hardening
  • ๐Ÿ“Š Module count: 35 โ†’ 39 | Full OWASP Top 10:2025 coverage

v1.2.0

  • ๐Ÿ†• SQLi, XSS, LFI, SSRF, XXE, Log4Shell, Secret Leak, CSRF, Cloud Exposure, Malware, Rate Limit, Broken Links, security.txt, CRLF, Proto Pollution
  • โšก Async parallel scanning | ๐Ÿ†• SARIF output
  • ๐Ÿ“Š Module count: 20 โ†’ 35

v1.0.0

  • ๐ŸŽ‰ Initial release โ€” 17 modules, SSL/TLS, headers, CORS, CSP, JWT, cookies, WAF, GraphQL, supply chain CVEs

๐Ÿ›ก๏ธ Ethical Use

WebShield is for owners and authorized testers of websites only.

  • โœ… Your own sites
  • โœ… Sites you have written permission to test
  • โŒ Unauthorized scanning is illegal and unethical

๐Ÿ“„ License

MIT โ€” see LICENSE

AKIBUZZAMAN AKIB โ€” @AKIB473

โญ If WebShield helped you, star it โ€” it helps others find it!

About

๐Ÿ›ก๏ธ Website Security Auditor โ€” Security score, letter grade, and code-level fix guidance for every finding. 17 scan modules: SSL, headers, CORS, CSP, JWT, GraphQL, supply chain CVEs & more.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages