A comprehensive web vulnerability scanner that checks for common security issues in websites, including CSRF, XSS, information disclosure, header misconfigurations, and more. Supports both passive analysis and active testing of vulnerabilities.
- Modular scanner architecture - easy to add new vulnerability checks
- Two-tier scanning approach:
- Passive scanning (analyze responses without sending potentially harmful requests)
- Active scanning with Python integration (test if vulnerabilities are actually exploitable)
- Comprehensive vulnerability detection:
- Cross-Site Scripting (XSS)
- Cross-Site Request Forgery (CSRF)
- SQL Injection
- Content Security Policy (CSP) issues
- Security headers analysis
- SSL/TLS configuration
- Port scanning
- Version disclosure
- And more...
- RESTful API with Express.js
- Detailed JSON reports
- Configurable scan intensity
The following video demonstrates the Web Vulnerability Scanner in action:
# Clone the repository
git clone https://github.com/ZaryabXProgrammer/WEBSITE-VULNERABILITY-SCANNER
cd web-vulnerability-scanner
cd server
# Install Node.js dependencies
npm install
# Set up Python environment (required for active scanning)
# You need Python 3.6+ installed on your system
cd python
pip install -r requirements.txt# Start the server
npm start
# For development with auto-restart
npm run devThe server will start on port 3001 by default. You can customize the port by setting the PORT environment variable.
Endpoint: POST /api/scan
Request Body:
{
"url": "https://example.com",
"enableActiveTesting": true,
"scanIntensity": "medium",
"selectedScanners": ["xss", "csrf", "header", "active-xss", "active-sqli"]
}Parameters:
url(required): The URL to scanenableActiveTesting(optional): Enable Python-based active testing (default: false)scanIntensity(optional): "low", "medium", or "high" (default: "medium")selectedScanners(optional): Array of specific scanner names to run
Response:
{
"status": "success",
"data": {
"url": "https://example.com",
"timestamp": "2023-11-19T12:34:56.789Z",
"scan_time_seconds": 5.67,
"summary": {
"total": 8,
"by_severity": {
"high": 2,
"medium": 3,
"low": 2,
"info": 1
},
"by_type": {
"missing_security_header": 3,
"potential_xss": 1,
"...": "..."
}
},
"vulnerabilities": [
{
"type": "potential_xss",
"description": "Parameter 'q' value is reflected in the page response.",
"recommendation": "Implement proper output encoding.",
"severity": "high",
"evidence": "Parameter: q, Value: test",
"scanner": "xss"
}
// More vulnerabilities...
]
}
}Endpoint: GET /api/scan/config
Returns information about available scanners and configuration options.
Endpoint: GET /api/scan/status
Returns the status of the Python environment and active scanning capability.
The scanner engine automatically loads all JavaScript files from the scanners directory. Each scanner should export a scan function that returns an array of vulnerability objects.
Scanners are categorized into two types:
- Passive Scanners: Analyze responses without sending potentially harmful requests
- Active Scanners: Test if vulnerabilities are actually exploitable by sending test payloads
/**
* @param {Object} page - Page data including content, headers, DOM
* @param {string} url - The URL being scanned
* @param {Object} options - Scan options including intensity and activeTesting flag
* @returns {Array} - Array of vulnerability objects
*/
async function scan(page, url, options) {
const { intensity, activeTesting } = options;
// Vulnerability detection logic
return [
{
type: "vulnerability_type",
description: "Description of the vulnerability",
recommendation: "How to fix the vulnerability",
severity: "high|medium|low|info",
evidence: "Proof that the vulnerability exists",
},
];
}
module.exports = { scan };To add a new passive vulnerability scanner:
- Create a new JavaScript file in the
scannersdirectory - Implement the scanner interface (see above)
- Export the
scanfunction
To add a new active vulnerability scanner:
- Create a new Python file in the
python/scannersdirectory - Implement the required functions for active testing
- Register the scanner in
python/main.py - Add the scanner name to the
activeScannersarray inscannerEngine.js
The project includes a vulnerable test page for scanner development and testing: http://localhost:3001/api/test/vulnerable
You can test specific vulnerabilities by adding parameters:
- XSS:
?xss=<script>alert(1)</script> - SQL Injection:
?sql=1' OR '1'='1
MIT