A powerful and pluggable JavaScript CLI tool to scan websites for common security vulnerabilities:
- โ SQL Injection
- โ XSS (Cross-Site Scripting)
- โ CSRF
- โ CSP Misconfigurations
- โ SSL/TLS Issues
- โ Insecure HTTP Headers
- โ Directory Traversal
- โ Open Ports
- โ Outdated JavaScript Libraries
- โ IDOR
- โ RCE Checks
Generate reports in Console, JSON, HTML, or Markdown formats.
git clone https://github.com/pratikacharya1234/Web-Vulnerability-Scanner.git
cd Web-Vulnerability-Scanner
npm install
๐ Requires Node.js v18+
Package | Role |
---|---|
commander | CLI interface |
chalk | Colored console output |
ora | CLI loading spinners |
node-fetch | Makes HTTP requests |
jsdom | Parses HTML into DOM |
cheerio | Lightweight HTML traversal |
debug | Debug logger |
p-limit | Controls concurrency |
open | Opens HTML reports in browser |
node bin/cli.js https://example.com
node bin/cli.js https://juice-shop.herokuapp.com \
--only xss,sql,headers \
--format html \
--output report.html \
--open \
--verbose
Option | Description |
---|---|
--output | Save results to file (.json, .html, .md) |
--format | Output format: console, html, json, markdown |
--only | Run only selected modules (e.g., xss,sql) |
--headers | Custom headers as JSON |
--cookies | Cookies to attach to request |
--depth | Max crawl depth (default: 1) |
--disable-crawler | Scan only the main URL |
--verbose | Show detailed vulnerability breakdown |
--open | Automatically open HTML report in browser |
--risk-insight | Include detailed risk analysis in reports |
--show-evidence | Display vulnerable code snippets in output |
npm install web-vuln-scanner
const scanner = require('web-vuln-scanner');
(async () => {
const results = await scanner.scan('https://example.com', {
scanModules: ['xss', 'headers', 'ssl'],
timeout: 30000,
verbose: true,
depth: 1,
concurrency: 5,
userAgent: 'MyScanner/1.0'
});
console.log(JSON.stringify(results, null, 2));
})();
const fs = require('fs');
const path = require('path');
const scanner = require('web-vuln-scanner');
const { generateReport } = require('web-vuln-scanner/lib/reporters/html-reporter');
const open = (...args) => import('open').then(m => m.default(...args));
(async () => {
const url = 'https://example.com';
const results = await scanner.scan(url, {
scanModules: ['xss', 'headers', 'ssl'],
timeout: 30000,
depth: 1,
concurrency: 5
});
const report = {
target: url,
summary: results.summary,
vulnerabilities: results.vulnerabilities
};
const filePath = path.resolve(__dirname, 'scan-report.html');
fs.writeFileSync(filePath, generateReport(report));
console.log(`๐ Report saved at: ${filePath}`);
await open(filePath);
})();
{
"summary": {
"total": 5,
"high": 1,
"medium": 2,
"low": 2,
"info": 0
},
"vulnerabilities": [
{
"type": "xss",
"severity": "high",
"description": "Potential reflected XSS found",
"recommendation": "Sanitize user input.",
"evidence": "<script>alert(1)</script>",
"url": "https://example.com"
}
]
}
web-vuln-scanner/
โโโ bin/
โ โโโ cli.js # CLI entrypoint
โโโ lib/
โ โโโ index.js # Exports scanner
โ โโโ scanner.js # Core scanner
โ โโโ crawler.js # HTML-based crawler
โ โโโ crawler-puppeteer.js # JS-based crawler
โ โโโ auth.js # Login scanning
โ โโโ session-recorder.js # Session manager
โ โโโ version-check.js
โ โโโ scanners/
โ โ โโโ xss.js
โ โ โโโ sql-injection.js
โ โ โโโ ssl-tls.js
โ โ โโโ external-scripts.js
โ โ โโโ dependency.js
โ โโโ reporters/
โ โ โโโ html-reporter.js
โ โ โโโ markdown-reporter.js
โ โ โโโ json-reporter.js
โ โ โโโ owasp.js
โ โโโ integrations/
โ โโโ jira.js
โ โโโ slack.js
We're building a powerful, enterprise-ready security toolkit. See our roadmap.md for the detailed plan:
- โ Modular scanners implementation
- โ Report generators (HTML, JSON, Markdown)
- โ Smart CLI flags (risk-insight, show-evidence)
- โ Puppeteer crawler for JS apps
- โ Gemini AI fix recommendations
- ๐ง LLM vulnerability explainer
- ๐ Web-based dashboard UI
- ๐ Authentication scanning
- ๐ OWASP & compliance reporting
- ๐งฒ Jira & Slack integrations
We welcome your help!
Please check out CONTRIBUTING.md for how to submit a PR and see our roadmap.md for upcoming features.
MIT ยฉ 2025
Made with ๐ป by Pratik Acharya