@voidagency/web-scanner 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +198 -0
- package/dist/aggregator.d.ts +65 -0
- package/dist/aggregator.d.ts.map +1 -0
- package/dist/aggregator.js +546 -0
- package/dist/aggregator.js.map +1 -0
- package/dist/categories.d.ts +59 -0
- package/dist/categories.d.ts.map +1 -0
- package/dist/categories.js +278 -0
- package/dist/categories.js.map +1 -0
- package/dist/cli.d.ts +12 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +457 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +19 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +121 -0
- package/dist/config.js.map +1 -0
- package/dist/coverage.d.ts +49 -0
- package/dist/coverage.d.ts.map +1 -0
- package/dist/coverage.js +165 -0
- package/dist/coverage.js.map +1 -0
- package/dist/enrichers/nvd.d.ts +55 -0
- package/dist/enrichers/nvd.d.ts.map +1 -0
- package/dist/enrichers/nvd.js +326 -0
- package/dist/enrichers/nvd.js.map +1 -0
- package/dist/report.d.ts +12 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +460 -0
- package/dist/report.js.map +1 -0
- package/dist/runners/nuclei.d.ts +59 -0
- package/dist/runners/nuclei.d.ts.map +1 -0
- package/dist/runners/nuclei.js +531 -0
- package/dist/runners/nuclei.js.map +1 -0
- package/dist/runners/testssl.d.ts +16 -0
- package/dist/runners/testssl.d.ts.map +1 -0
- package/dist/runners/testssl.js +179 -0
- package/dist/runners/testssl.js.map +1 -0
- package/dist/runners/zap.d.ts +30 -0
- package/dist/runners/zap.d.ts.map +1 -0
- package/dist/runners/zap.js +389 -0
- package/dist/runners/zap.js.map +1 -0
- package/dist/types.d.ts +172 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/package.json +54 -0
- package/templates/drupal-api-index-exposed.yaml +81 -0
- package/templates/drupal-api-user-detail.yaml +76 -0
- package/templates/drupal-api-user-listing.yaml +59 -0
- package/templates/drupal-dev-files-exposed.yaml +73 -0
- package/templates/drupal-file-path-disclosure.yaml +59 -0
- package/templates/drupal-files-listing.yaml +63 -0
- package/templates/drupal-install-error-disclosure.yaml +62 -0
- package/templates/drupal-theme-lockfiles.yaml +79 -0
- package/templates/drupal-version-detect.yaml +89 -0
- package/templates/http-options-enabled.yaml +56 -0
- package/templates/nextjs-version-detect.yaml +35 -0
- package/templates/php-version-detect.yaml +37 -0
- package/zap.yaml +33 -0
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finding Aggregator
|
|
3
|
+
* Combine and normalize findings from all scanning tools
|
|
4
|
+
*/
|
|
5
|
+
import { enrichWithNvd, getCvesForTechnology } from './enrichers/nvd.js';
|
|
6
|
+
import { calculateCoverage, markTestedCategories, getCoverageForReport, getPassedChecksForReport } from './coverage.js';
|
|
7
|
+
/**
|
|
8
|
+
* Count findings by severity
|
|
9
|
+
*/
|
|
10
|
+
export function countSeverities(findings) {
|
|
11
|
+
const counts = {
|
|
12
|
+
critical: 0,
|
|
13
|
+
high: 0,
|
|
14
|
+
medium: 0,
|
|
15
|
+
low: 0,
|
|
16
|
+
info: 0,
|
|
17
|
+
};
|
|
18
|
+
for (const finding of findings) {
|
|
19
|
+
counts[finding.severity]++;
|
|
20
|
+
}
|
|
21
|
+
return counts;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Sort findings by severity (critical first)
|
|
25
|
+
*/
|
|
26
|
+
export function sortBySeverity(findings) {
|
|
27
|
+
const order = { critical: 0, high: 1, medium: 2, low: 3, info: 4 };
|
|
28
|
+
return [...findings].sort((a, b) => order[a.severity] - order[b.severity]);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Re-number findings sequentially
|
|
32
|
+
*/
|
|
33
|
+
export function renumberFindings(findings) {
|
|
34
|
+
return findings.map((f, i) => ({
|
|
35
|
+
...f,
|
|
36
|
+
id: String(i + 1).padStart(3, '0'),
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Deduplicate findings by title and target
|
|
41
|
+
*/
|
|
42
|
+
export function deduplicateFindings(findings) {
|
|
43
|
+
const seen = new Set();
|
|
44
|
+
const unique = [];
|
|
45
|
+
for (const finding of findings) {
|
|
46
|
+
const key = `${finding.title}|${finding.target}`;
|
|
47
|
+
if (!seen.has(key)) {
|
|
48
|
+
seen.add(key);
|
|
49
|
+
unique.push(finding);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return unique;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Patterns that identify version disclosure findings - should be consolidated
|
|
56
|
+
*/
|
|
57
|
+
const VERSION_DISCLOSURE_PATTERNS = [
|
|
58
|
+
/Server Leaks.*Version/i,
|
|
59
|
+
/Server Leaks.*X-Powered-By/i,
|
|
60
|
+
/In Page Banner Information Leak/i,
|
|
61
|
+
/Version Information.*Leak/i,
|
|
62
|
+
/Information Leak.*Version/i,
|
|
63
|
+
];
|
|
64
|
+
/**
|
|
65
|
+
* Check if a finding is about version disclosure
|
|
66
|
+
*/
|
|
67
|
+
function isVersionDisclosure(finding) {
|
|
68
|
+
return VERSION_DISCLOSURE_PATTERNS.some(pattern => pattern.test(finding.title));
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Check if a finding is a CSP-related finding
|
|
72
|
+
*/
|
|
73
|
+
function isCspFinding(finding) {
|
|
74
|
+
return finding.title.startsWith('CSP:') ||
|
|
75
|
+
finding.title.includes('Content Security Policy');
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Consolidate CSP findings into one
|
|
79
|
+
*/
|
|
80
|
+
function consolidateCspFindings(findings) {
|
|
81
|
+
const cspFindings = findings.filter(isCspFinding);
|
|
82
|
+
const otherFindings = findings.filter(f => !isCspFinding(f));
|
|
83
|
+
if (cspFindings.length <= 1) {
|
|
84
|
+
return findings; // Nothing to consolidate
|
|
85
|
+
}
|
|
86
|
+
// Extract the specific CSP issues (e.g., "script-src unsafe-inline", "style-src unsafe-inline")
|
|
87
|
+
const issues = cspFindings.map(f => {
|
|
88
|
+
const match = /CSP:\s*(.+)/i.exec(f.title);
|
|
89
|
+
return match ? match[1] : f.title;
|
|
90
|
+
});
|
|
91
|
+
// Get highest severity among CSP findings
|
|
92
|
+
const severityOrder = { critical: 4, high: 3, medium: 2, low: 1, info: 0 };
|
|
93
|
+
const highestSeverity = cspFindings.reduce((max, f) => severityOrder[f.severity] > severityOrder[max.severity] ? f : max).severity;
|
|
94
|
+
const consolidated = {
|
|
95
|
+
id: '',
|
|
96
|
+
title: 'Content Security Policy Issues',
|
|
97
|
+
description: 'The Content Security Policy (CSP) header has multiple configuration issues that could allow XSS attacks:\n• ' +
|
|
98
|
+
issues.join('\n• ') +
|
|
99
|
+
'\n\nCSP is a security header that helps prevent XSS by specifying which sources of content are allowed to load.',
|
|
100
|
+
severity: highestSeverity,
|
|
101
|
+
source: cspFindings[0].source,
|
|
102
|
+
target: cspFindings[0].target,
|
|
103
|
+
cwe: 'CWE-693',
|
|
104
|
+
tags: ['csp', 'header', 'security-misconfiguration', 'xss'],
|
|
105
|
+
matcher: issues.join(', '),
|
|
106
|
+
references: [
|
|
107
|
+
'https://content-security-policy.com/',
|
|
108
|
+
'https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP',
|
|
109
|
+
],
|
|
110
|
+
};
|
|
111
|
+
return [...otherFindings, consolidated];
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Consolidate version disclosure findings into one
|
|
115
|
+
*/
|
|
116
|
+
function consolidateVersionDisclosures(findings) {
|
|
117
|
+
const versionFindings = findings.filter(isVersionDisclosure);
|
|
118
|
+
const otherFindings = findings.filter(f => !isVersionDisclosure(f));
|
|
119
|
+
if (versionFindings.length <= 1) {
|
|
120
|
+
return findings; // Nothing to consolidate
|
|
121
|
+
}
|
|
122
|
+
// Merge all version disclosures into one
|
|
123
|
+
const versions = versionFindings
|
|
124
|
+
.map(f => f.matcher || f.extracted?.[0])
|
|
125
|
+
.filter(Boolean);
|
|
126
|
+
const consolidated = {
|
|
127
|
+
id: '',
|
|
128
|
+
title: 'Server Version Disclosure',
|
|
129
|
+
description: 'The server leaks version information through HTTP headers and responses. ' +
|
|
130
|
+
'This information can help attackers identify specific vulnerabilities for the software versions in use.',
|
|
131
|
+
severity: 'low',
|
|
132
|
+
source: versionFindings[0].source,
|
|
133
|
+
target: versionFindings[0].target,
|
|
134
|
+
cwe: 'CWE-200',
|
|
135
|
+
tags: ['version-disclosure', 'info-disclosure', 'headers'],
|
|
136
|
+
matcher: versions.join(', '),
|
|
137
|
+
affectedUrls: versionFindings.map(f => f.target),
|
|
138
|
+
references: ['https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/01-Information_Gathering/02-Fingerprint_Web_Server'],
|
|
139
|
+
};
|
|
140
|
+
return [...otherFindings, consolidated];
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Consolidate findings - group same vulnerability type across multiple URLs
|
|
144
|
+
* Results in one finding with list of affected URLs
|
|
145
|
+
*/
|
|
146
|
+
export function consolidateFindings(findings) {
|
|
147
|
+
// Consolidate special categories first
|
|
148
|
+
findings = consolidateVersionDisclosures(findings);
|
|
149
|
+
findings = consolidateCspFindings(findings);
|
|
150
|
+
// Group by: title + severity + templateId (same vulnerability type)
|
|
151
|
+
const groups = new Map();
|
|
152
|
+
for (const finding of findings) {
|
|
153
|
+
// Use templateId if available, otherwise title
|
|
154
|
+
const key = `${finding.templateId || finding.title}|${finding.severity}`;
|
|
155
|
+
if (!groups.has(key)) {
|
|
156
|
+
groups.set(key, []);
|
|
157
|
+
}
|
|
158
|
+
groups.get(key).push(finding);
|
|
159
|
+
}
|
|
160
|
+
// Convert groups to consolidated findings
|
|
161
|
+
const consolidated = [];
|
|
162
|
+
for (const [, group] of groups) {
|
|
163
|
+
if (group.length === 1) {
|
|
164
|
+
// Single finding, no consolidation needed
|
|
165
|
+
consolidated.push(group[0]);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
// Multiple findings - consolidate
|
|
169
|
+
const first = group[0];
|
|
170
|
+
const allUrls = group.map(f => f.target);
|
|
171
|
+
const allExtracted = group.flatMap(f => f.extracted || []);
|
|
172
|
+
// Limit extracted values (avoid noise from files like composer.lock)
|
|
173
|
+
const uniqueExtracted = [...new Set(allExtracted)];
|
|
174
|
+
const limitedExtracted = uniqueExtracted.length > 5
|
|
175
|
+
? [...uniqueExtracted.slice(0, 5), `... and ${uniqueExtracted.length - 5} more`]
|
|
176
|
+
: uniqueExtracted;
|
|
177
|
+
consolidated.push({
|
|
178
|
+
...first,
|
|
179
|
+
// Keep first URL as main target
|
|
180
|
+
target: first.target,
|
|
181
|
+
// List all affected URLs
|
|
182
|
+
affectedUrls: allUrls,
|
|
183
|
+
// Merge extracted values (limited to avoid noise)
|
|
184
|
+
extracted: limitedExtracted.length > 0 ? limitedExtracted : undefined,
|
|
185
|
+
// Keep one curl command as example
|
|
186
|
+
curl: first.curl,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return consolidated;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Merge technology detections from multiple sources
|
|
194
|
+
*/
|
|
195
|
+
export function mergeTechnologies(techLists) {
|
|
196
|
+
const byHost = new Map();
|
|
197
|
+
for (const techs of techLists) {
|
|
198
|
+
for (const tech of techs) {
|
|
199
|
+
if (!byHost.has(tech.host)) {
|
|
200
|
+
byHost.set(tech.host, new Set());
|
|
201
|
+
}
|
|
202
|
+
for (const t of tech.technologies) {
|
|
203
|
+
byHost.get(tech.host).add(t);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return Array.from(byHost.entries()).map(([host, techs]) => ({
|
|
208
|
+
host,
|
|
209
|
+
technologies: Array.from(techs).sort(),
|
|
210
|
+
}));
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Format duration in human-readable format
|
|
214
|
+
*/
|
|
215
|
+
export function formatDuration(ms) {
|
|
216
|
+
const seconds = Math.floor(ms / 1000);
|
|
217
|
+
const minutes = Math.floor(seconds / 60);
|
|
218
|
+
const remainingSeconds = seconds % 60;
|
|
219
|
+
if (minutes > 0) {
|
|
220
|
+
return `${minutes}m ${remainingSeconds}s`;
|
|
221
|
+
}
|
|
222
|
+
return `${seconds}s`;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Extract technology name from finding title
|
|
226
|
+
*/
|
|
227
|
+
function extractTechFromTitle(title) {
|
|
228
|
+
// Common patterns: "Nginx End-of-Life - Detect", "Drupal - Detect", "PHP - Version"
|
|
229
|
+
const patterns = [
|
|
230
|
+
/^(nginx|apache|drupal|wordpress|php|mysql|nodejs|openssl|jquery|bootstrap|tomcat)/i,
|
|
231
|
+
/^([a-z0-9.]+)\s+(?:End-of-Life|Version|Detect)/i,
|
|
232
|
+
/^([a-z0-9.]+)\s+-\s+(?:Detect|Version)/i,
|
|
233
|
+
];
|
|
234
|
+
for (const pattern of patterns) {
|
|
235
|
+
const match = title.match(pattern);
|
|
236
|
+
if (match) {
|
|
237
|
+
return match[1].toLowerCase();
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return null;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Extract technology from finding (checks title and matcher field)
|
|
244
|
+
*/
|
|
245
|
+
function extractTechFromFinding(finding) {
|
|
246
|
+
// First try title
|
|
247
|
+
const techFromTitle = extractTechFromTitle(finding.title);
|
|
248
|
+
if (techFromTitle) {
|
|
249
|
+
return techFromTitle;
|
|
250
|
+
}
|
|
251
|
+
// Check matcher field (e.g., "nginx/1.25.5" or "nextjs:12.1.6")
|
|
252
|
+
if (finding.matcher) {
|
|
253
|
+
const matcherPatterns = [
|
|
254
|
+
/^([a-z0-9.]+)\/(\d+\.\d+)/i, // nginx/1.25.5
|
|
255
|
+
/^([a-z0-9.]+):(\d+\.\d+)/i, // nextjs:12.1.6
|
|
256
|
+
];
|
|
257
|
+
for (const pattern of matcherPatterns) {
|
|
258
|
+
const match = finding.matcher.match(pattern);
|
|
259
|
+
if (match) {
|
|
260
|
+
const tech = match[1].toLowerCase();
|
|
261
|
+
// Only return if it's in our default CVE check list
|
|
262
|
+
if (DEFAULT_CVE_CHECK_TECHNOLOGIES.has(tech) || DEFAULT_CVE_CHECK_TECHNOLOGIES.has(tech.replace('.', ''))) {
|
|
263
|
+
return tech.replace('.', ''); // Normalize "next.js" to "nextjs"
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Extract version from various sources (extracted results, title, description, matcher)
|
|
272
|
+
*/
|
|
273
|
+
function extractVersion(finding) {
|
|
274
|
+
// First check matcher field (e.g., "nginx/1.25.5" or "nextjs:12.1.6")
|
|
275
|
+
if (finding.matcher) {
|
|
276
|
+
const matcherPatterns = [
|
|
277
|
+
/^[a-z0-9.]+\/(\d+\.\d+\.?\d*)/i, // nginx/1.25.5
|
|
278
|
+
/^[a-z0-9.]+:(\d+\.\d+\.?\d*)/i, // nextjs:12.1.6
|
|
279
|
+
];
|
|
280
|
+
for (const pattern of matcherPatterns) {
|
|
281
|
+
const match = finding.matcher.match(pattern);
|
|
282
|
+
if (match) {
|
|
283
|
+
return match[1];
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
// Check extracted results
|
|
288
|
+
if (finding.extracted && finding.extracted.length > 0) {
|
|
289
|
+
// Look for version-like patterns in extracted results
|
|
290
|
+
for (const result of finding.extracted) {
|
|
291
|
+
const versionMatch = result.match(/^(\d+\.\d+\.?\d*)/);
|
|
292
|
+
if (versionMatch) {
|
|
293
|
+
return versionMatch[1];
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
// Check title for version
|
|
298
|
+
const titleMatch = finding.title.match(/(\d+\.\d+\.?\d*)/);
|
|
299
|
+
if (titleMatch) {
|
|
300
|
+
return titleMatch[1];
|
|
301
|
+
}
|
|
302
|
+
// Check description for version patterns
|
|
303
|
+
const descMatch = finding.description?.match(/version[:\s]+(\d+\.\d+\.?\d*)/i);
|
|
304
|
+
if (descMatch) {
|
|
305
|
+
return descMatch[1];
|
|
306
|
+
}
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Convert CVSS score to severity
|
|
311
|
+
*/
|
|
312
|
+
function cvssToSeverity(score) {
|
|
313
|
+
if (!score)
|
|
314
|
+
return 'info';
|
|
315
|
+
if (score >= 9.0)
|
|
316
|
+
return 'critical';
|
|
317
|
+
if (score >= 7.0)
|
|
318
|
+
return 'high';
|
|
319
|
+
if (score >= 4.0)
|
|
320
|
+
return 'medium';
|
|
321
|
+
if (score >= 0.1)
|
|
322
|
+
return 'low';
|
|
323
|
+
return 'info';
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Technologies to check for CVEs by default
|
|
327
|
+
* These are common server-side technologies where version-based CVEs are most relevant
|
|
328
|
+
*/
|
|
329
|
+
const DEFAULT_CVE_CHECK_TECHNOLOGIES = new Set([
|
|
330
|
+
'nginx',
|
|
331
|
+
'drupal',
|
|
332
|
+
'php',
|
|
333
|
+
'nextjs',
|
|
334
|
+
'next.js',
|
|
335
|
+
'apache',
|
|
336
|
+
'wordpress',
|
|
337
|
+
]);
|
|
338
|
+
/**
|
|
339
|
+
* Generate consolidated CVE findings from detected technology versions
|
|
340
|
+
* Creates ONE finding per tech+version with a CVE table
|
|
341
|
+
* @param limitToDefaults - If true, only check CVEs for DEFAULT_CVE_CHECK_TECHNOLOGIES
|
|
342
|
+
*/
|
|
343
|
+
async function generateCveFindingsFromVersions(findings, target, onProgress, limitToDefaults = false) {
|
|
344
|
+
const generatedFindings = [];
|
|
345
|
+
const processedTech = new Set();
|
|
346
|
+
// Find version detection findings
|
|
347
|
+
for (const finding of findings) {
|
|
348
|
+
const tech = extractTechFromFinding(finding);
|
|
349
|
+
if (!tech)
|
|
350
|
+
continue;
|
|
351
|
+
// If limiting to defaults, skip technologies not in the list
|
|
352
|
+
if (limitToDefaults && !DEFAULT_CVE_CHECK_TECHNOLOGIES.has(tech.toLowerCase())) {
|
|
353
|
+
continue;
|
|
354
|
+
}
|
|
355
|
+
const version = extractVersion(finding);
|
|
356
|
+
if (!version)
|
|
357
|
+
continue;
|
|
358
|
+
const techVersionKey = `${tech}:${version}`;
|
|
359
|
+
// Skip if already processed this tech+version
|
|
360
|
+
if (processedTech.has(techVersionKey))
|
|
361
|
+
continue;
|
|
362
|
+
processedTech.add(techVersionKey);
|
|
363
|
+
if (onProgress) {
|
|
364
|
+
onProgress(`Looking up CVEs for ${tech} ${version}...`);
|
|
365
|
+
}
|
|
366
|
+
// Query NVD for CVEs
|
|
367
|
+
const cves = await getCvesForTechnology(tech, version, 10);
|
|
368
|
+
if (cves.length === 0)
|
|
369
|
+
continue;
|
|
370
|
+
// Build CVE table entries
|
|
371
|
+
const cveTable = cves.map(cve => ({
|
|
372
|
+
cve: cve.id,
|
|
373
|
+
cvss: cve.cvssScore?.toFixed(1),
|
|
374
|
+
severity: cvssToSeverity(cve.cvssScore),
|
|
375
|
+
summary: truncateText(cve.description, 200),
|
|
376
|
+
references: cve.references,
|
|
377
|
+
}));
|
|
378
|
+
// Determine highest severity
|
|
379
|
+
const highestSeverity = getHighestSeverity(cveTable.map(c => c.severity));
|
|
380
|
+
// Capitalize tech name
|
|
381
|
+
const techName = tech.charAt(0).toUpperCase() + tech.slice(1);
|
|
382
|
+
// Create ONE consolidated finding for this tech+version
|
|
383
|
+
generatedFindings.push({
|
|
384
|
+
id: '', // Will be renumbered
|
|
385
|
+
title: `Vulnerabilities found for ${techName} ${version}`,
|
|
386
|
+
description: `${cves.length} known vulnerabilities affecting ${techName} version ${version}.`,
|
|
387
|
+
severity: highestSeverity,
|
|
388
|
+
target: finding.target || target,
|
|
389
|
+
source: 'nvd',
|
|
390
|
+
tags: ['cve', tech.toLowerCase(), 'nvd-enriched'],
|
|
391
|
+
cveTable,
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
return generatedFindings;
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Truncate text to max length
|
|
398
|
+
*/
|
|
399
|
+
function truncateText(text, maxLength) {
|
|
400
|
+
if (text.length <= maxLength)
|
|
401
|
+
return text;
|
|
402
|
+
return text.substring(0, maxLength).trim() + '...';
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Get highest severity from array
|
|
406
|
+
*/
|
|
407
|
+
function getHighestSeverity(severities) {
|
|
408
|
+
const order = ['critical', 'high', 'medium', 'low', 'info'];
|
|
409
|
+
for (const sev of order) {
|
|
410
|
+
if (severities.includes(sev))
|
|
411
|
+
return sev;
|
|
412
|
+
}
|
|
413
|
+
return 'info';
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Lookup CVEs for detected technologies (default behavior)
|
|
417
|
+
* Only checks nginx, drupal, php, nextjs etc.
|
|
418
|
+
*/
|
|
419
|
+
export async function lookupDefaultCves(findings, target, onProgress) {
|
|
420
|
+
if (onProgress) {
|
|
421
|
+
onProgress('Looking up CVEs for detected technologies...');
|
|
422
|
+
}
|
|
423
|
+
const cveFindings = await generateCveFindingsFromVersions(findings, target, onProgress, true // limitToDefaults
|
|
424
|
+
);
|
|
425
|
+
if (cveFindings.length > 0 && onProgress) {
|
|
426
|
+
onProgress(`Found ${cveFindings.length} CVEs for detected technologies`);
|
|
427
|
+
}
|
|
428
|
+
return [...findings, ...cveFindings];
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Full NVD enrichment (--enrich flag)
|
|
432
|
+
* - Enriches existing CVE findings with full descriptions
|
|
433
|
+
* - Looks up CVEs for ALL detected technology versions
|
|
434
|
+
*/
|
|
435
|
+
export async function enrichFindings(findings, target, options = {}) {
|
|
436
|
+
if (!options.enableNvd) {
|
|
437
|
+
return findings;
|
|
438
|
+
}
|
|
439
|
+
let enriched = [];
|
|
440
|
+
// Step 1: Enrich existing CVE findings with NVD descriptions
|
|
441
|
+
const cveFindings = findings.filter(f => f.cve);
|
|
442
|
+
if (cveFindings.length > 0 && options.onProgress) {
|
|
443
|
+
options.onProgress(`Enriching ${cveFindings.length} existing CVE findings...`);
|
|
444
|
+
}
|
|
445
|
+
for (const finding of findings) {
|
|
446
|
+
if (finding.cve) {
|
|
447
|
+
try {
|
|
448
|
+
const nvdData = await enrichWithNvd(finding.cve);
|
|
449
|
+
if (nvdData) {
|
|
450
|
+
enriched.push({
|
|
451
|
+
...finding,
|
|
452
|
+
// Use NVD description if we don't have one or it's generic
|
|
453
|
+
description: finding.description && finding.description.length > 50
|
|
454
|
+
? finding.description
|
|
455
|
+
: nvdData.description,
|
|
456
|
+
// Add CVSS if not present
|
|
457
|
+
cvss: finding.cvss || nvdData.cvssVector,
|
|
458
|
+
// Add CWE if not present
|
|
459
|
+
cwe: finding.cwe || nvdData.cweId,
|
|
460
|
+
// Merge references
|
|
461
|
+
references: [...new Set([...(finding.references || []), ...nvdData.references])],
|
|
462
|
+
});
|
|
463
|
+
continue;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
catch (error) {
|
|
467
|
+
// Continue without enrichment on error
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
enriched.push(finding);
|
|
471
|
+
}
|
|
472
|
+
// Step 2: Generate new findings from version detections
|
|
473
|
+
if (options.onProgress) {
|
|
474
|
+
options.onProgress(`Looking for version detections to query NVD...`);
|
|
475
|
+
}
|
|
476
|
+
const versionCveFindings = await generateCveFindingsFromVersions(findings, target, options.onProgress);
|
|
477
|
+
if (versionCveFindings.length > 0 && options.onProgress) {
|
|
478
|
+
options.onProgress(`Generated ${versionCveFindings.length} CVE findings from version detections`);
|
|
479
|
+
}
|
|
480
|
+
enriched = enriched.concat(versionCveFindings);
|
|
481
|
+
// Step 3: Generate findings from manually specified technologies
|
|
482
|
+
if (options.manualTech && options.manualTech.length > 0) {
|
|
483
|
+
if (options.onProgress) {
|
|
484
|
+
options.onProgress(`Looking up CVEs for ${options.manualTech.length} manually specified technologies...`);
|
|
485
|
+
}
|
|
486
|
+
for (const { tech, version } of options.manualTech) {
|
|
487
|
+
const cves = await getCvesForTechnology(tech, version, 10);
|
|
488
|
+
for (const cve of cves) {
|
|
489
|
+
enriched.push({
|
|
490
|
+
id: '',
|
|
491
|
+
title: `${cve.id}: ${tech.charAt(0).toUpperCase() + tech.slice(1)} ${version}`,
|
|
492
|
+
description: cve.description,
|
|
493
|
+
severity: cvssToSeverity(cve.cvssScore),
|
|
494
|
+
target,
|
|
495
|
+
source: 'nvd',
|
|
496
|
+
cve: cve.id,
|
|
497
|
+
cwe: cve.cweId,
|
|
498
|
+
cvss: cve.cvssVector,
|
|
499
|
+
references: cve.references,
|
|
500
|
+
tags: ['cve', tech, 'nvd-enriched', 'manual-tech'],
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
return enriched;
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Aggregate all findings into a report
|
|
509
|
+
*/
|
|
510
|
+
export async function aggregateFindings(target, profile, startTime, endTime, allFindings, technologies, options = {}) {
|
|
511
|
+
// Deduplicate
|
|
512
|
+
const unique = deduplicateFindings(allFindings);
|
|
513
|
+
let findings = unique;
|
|
514
|
+
// Default: lookup CVEs for detected nginx, drupal, php, nextjs
|
|
515
|
+
// Skip if --no-cve or if --enrich (full enrichment handles it)
|
|
516
|
+
if (!options.disableCve && !options.enableNvd) {
|
|
517
|
+
findings = await lookupDefaultCves(findings, target, options.onProgress);
|
|
518
|
+
}
|
|
519
|
+
// Full NVD enrichment if --enrich flag (includes ALL technologies)
|
|
520
|
+
if (options.enableNvd && !options.disableCve) {
|
|
521
|
+
findings = await enrichFindings(findings, target, options);
|
|
522
|
+
}
|
|
523
|
+
// Consolidate same vulnerabilities across multiple URLs
|
|
524
|
+
findings = consolidateFindings(findings);
|
|
525
|
+
// Sort and renumber (after enrichment so new CVEs are sorted correctly)
|
|
526
|
+
findings = sortBySeverity(findings);
|
|
527
|
+
findings = renumberFindings(findings);
|
|
528
|
+
// Calculate test coverage
|
|
529
|
+
let coverage = calculateCoverage(findings);
|
|
530
|
+
coverage = markTestedCategories(coverage, profile, []);
|
|
531
|
+
const coverageItems = getCoverageForReport(coverage);
|
|
532
|
+
const passedChecks = getPassedChecksForReport(coverage);
|
|
533
|
+
return {
|
|
534
|
+
target,
|
|
535
|
+
scanDate: startTime.toISOString(),
|
|
536
|
+
duration: formatDuration(endTime.getTime() - startTime.getTime()),
|
|
537
|
+
profile,
|
|
538
|
+
summary: countSeverities(findings),
|
|
539
|
+
totalFindings: findings.length,
|
|
540
|
+
technologies,
|
|
541
|
+
findings,
|
|
542
|
+
coverage: coverageItems,
|
|
543
|
+
passedChecks,
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
//# sourceMappingURL=aggregator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregator.js","sourceRoot":"","sources":["../src/aggregator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAc,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAExH;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,QAAmB;IACjD,MAAM,MAAM,GAAmB;QAC7B,QAAQ,EAAE,CAAC;QACX,IAAI,EAAE,CAAC;QACP,MAAM,EAAE,CAAC;QACT,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC;KACR,CAAC;IAEF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;Q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* Supports both ZAP (primary) and Nuclei (supplementary)
|
|
7
|
+
*/
|
|
8
|
+
import { ToolSource } from './types.js';
|
|
9
|
+
export interface TestCategory {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
tags: string[];
|
|
14
|
+
templatePatterns?: string[];
|
|
15
|
+
sources?: ToolSource[];
|
|
16
|
+
zapPluginIds?: string[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Define all test categories
|
|
20
|
+
* Order matters - this is how they'll appear in the report
|
|
21
|
+
*
|
|
22
|
+
* ZAP Plugin IDs reference:
|
|
23
|
+
* - 10003: Vulnerable JS Library (Retire.js)
|
|
24
|
+
* - 10038: CSP Header Not Set
|
|
25
|
+
* - 10020: Missing X-Frame-Options
|
|
26
|
+
* - 10035: Strict-Transport-Security Not Set
|
|
27
|
+
* - 10021: X-Content-Type-Options Missing
|
|
28
|
+
* - 10098: Cross-Domain Misconfiguration (CORS)
|
|
29
|
+
* - 10202: Absence of Anti-CSRF Tokens
|
|
30
|
+
* - 90003: Sub Resource Integrity Missing
|
|
31
|
+
* - 10037: X-Powered-By Information Leak
|
|
32
|
+
* - 10036: Server Version Leak
|
|
33
|
+
* - 10027: Information Disclosure - Suspicious Comments
|
|
34
|
+
* - 10031: User Controllable HTML Attribute (XSS hint)
|
|
35
|
+
* - 10017: Cross-Domain JavaScript Source
|
|
36
|
+
*/
|
|
37
|
+
export declare const TEST_CATEGORIES: TestCategory[];
|
|
38
|
+
/**
|
|
39
|
+
* Category result for reporting
|
|
40
|
+
*/
|
|
41
|
+
export interface CategoryResult {
|
|
42
|
+
category: TestCategory;
|
|
43
|
+
tested: boolean;
|
|
44
|
+
findingCount: number;
|
|
45
|
+
findings: string[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Match a finding to categories based on tags and template ID
|
|
49
|
+
*/
|
|
50
|
+
export declare function matchCategories(templateId: string, tags?: string[]): string[];
|
|
51
|
+
/**
|
|
52
|
+
* Get category by ID
|
|
53
|
+
*/
|
|
54
|
+
export declare function getCategoryById(id: string): TestCategory | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Get all category IDs
|
|
57
|
+
*/
|
|
58
|
+
export declare function getAllCategoryIds(): string[];
|
|
59
|
+
//# sourceMappingURL=categories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"categories.d.ts","sourceRoot":"","sources":["../src/categories.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,eAAe,EAAE,YAAY,EA4OzC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,YAAY,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,MAAM,EAAO,GAClB,MAAM,EAAE,CA6BV;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAEpE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAE5C"}
|