kramscan 0.1.1 → 0.3.0
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/LICENSE +1 -1
- package/README.md +419 -236
- package/dist/agent/confirmation.d.ts +5 -1
- package/dist/agent/confirmation.js +29 -9
- package/dist/agent/context.js +2 -3
- package/dist/agent/orchestrator.d.ts +2 -0
- package/dist/agent/orchestrator.js +50 -8
- package/dist/agent/prompts/system.d.ts +1 -1
- package/dist/agent/prompts/system.js +5 -7
- package/dist/agent/skills/health-check.js +22 -2
- package/dist/agent/skills/index.d.ts +1 -0
- package/dist/agent/skills/index.js +3 -1
- package/dist/agent/skills/verify-finding.d.ts +17 -0
- package/dist/agent/skills/verify-finding.js +91 -0
- package/dist/agent/skills/web-scan.js +46 -0
- package/dist/cli.js +156 -149
- package/dist/commands/agent.js +38 -38
- package/dist/commands/ai.d.ts +2 -0
- package/dist/commands/ai.js +112 -0
- package/dist/commands/analyze.js +103 -54
- package/dist/commands/config.js +55 -29
- package/dist/commands/dev.d.ts +2 -0
- package/dist/commands/dev.js +236 -0
- package/dist/commands/doctor.js +20 -15
- package/dist/commands/gate.d.ts +2 -0
- package/dist/commands/gate.js +109 -0
- package/dist/commands/onboard.js +188 -141
- package/dist/commands/report.js +68 -76
- package/dist/commands/scan.js +262 -81
- package/dist/commands/scans.d.ts +2 -0
- package/dist/commands/scans.js +55 -0
- package/dist/core/ai-client.d.ts +6 -1
- package/dist/core/ai-client.js +80 -12
- package/dist/core/ai-payloads.d.ts +17 -0
- package/dist/core/ai-payloads.js +54 -0
- package/dist/core/config-schema.d.ts +197 -0
- package/dist/core/config-schema.js +68 -0
- package/dist/core/config-schema.test.d.ts +1 -0
- package/dist/core/config-schema.test.js +151 -0
- package/dist/core/config.d.ts +8 -31
- package/dist/core/config.js +71 -14
- package/dist/core/diff-engine.d.ts +12 -0
- package/dist/core/diff-engine.js +47 -0
- package/dist/core/errors.d.ts +71 -0
- package/dist/core/errors.js +162 -0
- package/dist/core/scan-index.d.ts +20 -0
- package/dist/core/scan-index.js +52 -0
- package/dist/core/scan-storage.d.ts +11 -0
- package/dist/core/scan-storage.js +69 -0
- package/dist/core/scanner.d.ts +95 -13
- package/dist/core/scanner.js +342 -248
- package/dist/core/server-probe.d.ts +20 -0
- package/dist/core/server-probe.js +109 -0
- package/dist/core/vulnerability-detector.d.ts +9 -0
- package/dist/core/vulnerability-detector.js +46 -15
- package/dist/core/vulnerability-detector.test.d.ts +1 -0
- package/dist/core/vulnerability-detector.test.js +210 -0
- package/dist/index.js +3 -0
- package/dist/plugins/PluginManager.d.ts +27 -0
- package/dist/plugins/PluginManager.js +166 -0
- package/dist/plugins/index.d.ts +12 -0
- package/dist/plugins/index.js +29 -0
- package/dist/plugins/types.d.ts +55 -0
- package/dist/plugins/types.js +25 -0
- package/dist/plugins/vulnerabilities/CORSAnalyzerPlugin.d.ts +10 -0
- package/dist/plugins/vulnerabilities/CORSAnalyzerPlugin.js +67 -0
- package/dist/plugins/vulnerabilities/CSRFPlugin.d.ts +8 -0
- package/dist/plugins/vulnerabilities/CSRFPlugin.js +34 -0
- package/dist/plugins/vulnerabilities/CookieSecurityPlugin.d.ts +10 -0
- package/dist/plugins/vulnerabilities/CookieSecurityPlugin.js +91 -0
- package/dist/plugins/vulnerabilities/DebugEndpointPlugin.d.ts +15 -0
- package/dist/plugins/vulnerabilities/DebugEndpointPlugin.js +222 -0
- package/dist/plugins/vulnerabilities/DirectoryTraversalPlugin.d.ts +13 -0
- package/dist/plugins/vulnerabilities/DirectoryTraversalPlugin.js +110 -0
- package/dist/plugins/vulnerabilities/OpenRedirectPlugin.d.ts +10 -0
- package/dist/plugins/vulnerabilities/OpenRedirectPlugin.js +69 -0
- package/dist/plugins/vulnerabilities/SQLInjectionPlugin.d.ts +11 -0
- package/dist/plugins/vulnerabilities/SQLInjectionPlugin.js +109 -0
- package/dist/plugins/vulnerabilities/SecurityHeadersPlugin.d.ts +11 -0
- package/dist/plugins/vulnerabilities/SecurityHeadersPlugin.js +63 -0
- package/dist/plugins/vulnerabilities/SensitiveDataPlugin.d.ts +9 -0
- package/dist/plugins/vulnerabilities/SensitiveDataPlugin.js +32 -0
- package/dist/plugins/vulnerabilities/XSSPlugin.d.ts +15 -0
- package/dist/plugins/vulnerabilities/XSSPlugin.js +81 -0
- package/dist/reports/PdfGenerator.d.ts +36 -0
- package/dist/reports/PdfGenerator.js +404 -0
- package/dist/utils/logger.d.ts +33 -1
- package/dist/utils/logger.js +127 -8
- package/dist/utils/theme.d.ts +56 -0
- package/dist/utils/theme.js +201 -0
- package/package.json +6 -3
package/dist/core/scanner.d.ts
CHANGED
|
@@ -1,10 +1,69 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EventEmitter } from "events";
|
|
2
|
+
import { ScanResult, Vulnerability } from "./vulnerability-detector";
|
|
3
|
+
export interface ScanEventMap {
|
|
4
|
+
"scan:start": {
|
|
5
|
+
target: string;
|
|
6
|
+
options: ScanOptions;
|
|
7
|
+
};
|
|
8
|
+
"scan:complete": {
|
|
9
|
+
result: ScanResult;
|
|
10
|
+
};
|
|
11
|
+
"scan:error": {
|
|
12
|
+
error: Error;
|
|
13
|
+
};
|
|
14
|
+
"crawl:start": {
|
|
15
|
+
url: string;
|
|
16
|
+
depth: number;
|
|
17
|
+
};
|
|
18
|
+
"crawl:page": {
|
|
19
|
+
url: string;
|
|
20
|
+
crawledCount: number;
|
|
21
|
+
maxPages: number;
|
|
22
|
+
};
|
|
23
|
+
"crawl:complete": {
|
|
24
|
+
url: string;
|
|
25
|
+
};
|
|
26
|
+
"crawl:error": {
|
|
27
|
+
url: string;
|
|
28
|
+
error: Error;
|
|
29
|
+
};
|
|
30
|
+
"form:test": {
|
|
31
|
+
url: string;
|
|
32
|
+
formCount: number;
|
|
33
|
+
};
|
|
34
|
+
"vuln:found": {
|
|
35
|
+
vulnerability: Vulnerability;
|
|
36
|
+
};
|
|
37
|
+
"plugin:execute": {
|
|
38
|
+
plugin: string;
|
|
39
|
+
url: string;
|
|
40
|
+
duration: number;
|
|
41
|
+
};
|
|
42
|
+
"progress": {
|
|
43
|
+
stage: string;
|
|
44
|
+
current: number;
|
|
45
|
+
total: number;
|
|
46
|
+
message?: string;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
2
49
|
export interface ScanOptions {
|
|
3
50
|
depth?: number;
|
|
4
51
|
timeout?: number;
|
|
5
52
|
headless?: boolean;
|
|
53
|
+
maxPages?: number;
|
|
54
|
+
maxLinksPerPage?: number;
|
|
55
|
+
include?: string[];
|
|
56
|
+
exclude?: string[];
|
|
57
|
+
strictScope?: boolean;
|
|
58
|
+
profile?: string;
|
|
59
|
+
useAiPayloads?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface ScanError {
|
|
62
|
+
url: string;
|
|
63
|
+
error: string;
|
|
64
|
+
plugin?: string;
|
|
6
65
|
}
|
|
7
|
-
export declare class Scanner {
|
|
66
|
+
export declare class Scanner extends EventEmitter {
|
|
8
67
|
private browser;
|
|
9
68
|
private detector;
|
|
10
69
|
private visitedUrls;
|
|
@@ -14,25 +73,48 @@ export declare class Scanner {
|
|
|
14
73
|
private headersChecked;
|
|
15
74
|
private rateLimiter;
|
|
16
75
|
private retryConfig;
|
|
17
|
-
|
|
18
|
-
private
|
|
76
|
+
private maxConcurrency;
|
|
77
|
+
private strictScope;
|
|
78
|
+
private baseOrigin;
|
|
79
|
+
private maxPages;
|
|
80
|
+
private maxLinksPerPage;
|
|
81
|
+
private includePatterns;
|
|
82
|
+
private excludePatterns;
|
|
83
|
+
private userAgent;
|
|
84
|
+
private scanErrors;
|
|
85
|
+
private pluginErrors;
|
|
86
|
+
private usePlugins;
|
|
87
|
+
private useAiPayloads;
|
|
88
|
+
private payloadGenerator;
|
|
89
|
+
constructor(usePlugins?: boolean);
|
|
90
|
+
private registerDefaultPlugins;
|
|
91
|
+
emit<K extends keyof ScanEventMap>(event: K, data: ScanEventMap[K]): boolean;
|
|
92
|
+
on<K extends keyof ScanEventMap>(event: K, listener: (data: ScanEventMap[K]) => void): this;
|
|
93
|
+
once<K extends keyof ScanEventMap>(event: K, listener: (data: ScanEventMap[K]) => void): this;
|
|
94
|
+
getScanErrors(): ScanError[];
|
|
95
|
+
getPluginErrors(): Map<string, Array<{
|
|
96
|
+
url: string;
|
|
97
|
+
error: string;
|
|
98
|
+
}>>;
|
|
99
|
+
private initializeScanSettings;
|
|
100
|
+
private resetScanState;
|
|
19
101
|
initialize(options?: ScanOptions): Promise<void>;
|
|
20
102
|
scan(targetUrl: string, options?: ScanOptions): Promise<ScanResult>;
|
|
21
103
|
private applyRateLimit;
|
|
22
104
|
private withRetry;
|
|
23
|
-
private
|
|
105
|
+
private createInstrumentedPage;
|
|
106
|
+
private runInIsolatedPage;
|
|
24
107
|
private crawl;
|
|
25
|
-
private
|
|
108
|
+
private runPlugins;
|
|
109
|
+
private processPluginResults;
|
|
110
|
+
private testUrlParametersWithPlugins;
|
|
111
|
+
private testFormsWithPlugins;
|
|
112
|
+
private runLegacyDetection;
|
|
113
|
+
private testFormsLegacy;
|
|
114
|
+
private testUrlParametersLegacy;
|
|
26
115
|
private runWithConcurrency;
|
|
27
|
-
private testUrlParameters;
|
|
28
116
|
private testXSS;
|
|
29
117
|
private testSQLi;
|
|
30
|
-
private testLFI;
|
|
31
|
-
private testPathTraversal;
|
|
32
|
-
private testCMDI;
|
|
33
|
-
private testSSRF;
|
|
34
|
-
private testOpenRedirect;
|
|
35
|
-
private testIDOR;
|
|
36
118
|
private buildTestUrl;
|
|
37
119
|
private extractLinks;
|
|
38
120
|
close(): Promise<void>;
|