kramscan 0.1.1 β 0.2.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/README.md +392 -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 +150 -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/doctor.js +20 -15
- package/dist/commands/onboard.js +188 -141
- package/dist/commands/report.js +68 -76
- package/dist/commands/scan.js +261 -81
- package/dist/commands/scans.d.ts +2 -0
- package/dist/commands/scans.js +51 -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 +68 -11
- package/dist/core/errors.d.ts +71 -0
- package/dist/core/errors.js +162 -0
- package/dist/core/scan-index.d.ts +19 -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 +336 -248
- package/dist/core/vulnerability-detector.d.ts +3 -0
- package/dist/core/vulnerability-detector.js +25 -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 +7 -0
- package/dist/plugins/index.js +19 -0
- package/dist/plugins/types.d.ts +55 -0
- package/dist/plugins/types.js +25 -0
- package/dist/plugins/vulnerabilities/CSRFPlugin.d.ts +8 -0
- package/dist/plugins/vulnerabilities/CSRFPlugin.js +34 -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 +379 -0
- package/dist/utils/logger.d.ts +33 -1
- package/dist/utils/logger.js +127 -8
- package/dist/utils/theme.d.ts +55 -0
- package/dist/utils/theme.js +195 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,236 +1,392 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<img src="https://github.com/user-attachments/assets/6439c670-8d73-4bdd-b8fa-c74de949a31e" width="500" alt="KramScan Logo" />
|
|
3
|
-
|
|
4
|
-
<h3 align="center">AI-Powered Web Application Security Testing CLI</h3>
|
|
5
|
-
|
|
6
|
-
<br />
|
|
7
|
-
|
|
8
|
-
[](https://www.npmjs.com/package/kramscan)
|
|
9
|
-
[](https://www.npmjs.com/package/kramscan)
|
|
10
|
-
[](https://github.com/shaikhakramshakil/kramscan/blob/main/LICENSE)
|
|
11
|
-
[](https://github.com/shaikhakramshakil/kramscan)
|
|
12
|
-
[](https://www.typescriptlang.org)
|
|
13
|
-
[](https://nodejs.org)
|
|
14
|
-
|
|
15
|
-
<br />
|
|
16
|
-
|
|
17
|
-
π¬ **A next-generation security auditing tool that combines automated vulnerability scanning with multi-provider AI analysis.**
|
|
18
|
-
|
|
19
|
-
*Empowering developers and security researchers with institutional-grade insights and an interactive AI agent.*
|
|
20
|
-
|
|
21
|
-
<br />
|
|
22
|
-
|
|
23
|
-
[π NPM Package](https://www.npmjs.com/package/kramscan) Β· [π Documentation](#-usage) Β· [π Report Bug](https://github.com/shaikhakramshakil/kramscan/issues)
|
|
24
|
-
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
<br />
|
|
30
|
-
|
|
31
|
-
## π The Problem We Solve
|
|
32
|
-
Web security is complex and often fragmented. Developers rely on multiple disjointed tools for scanning, manual testing, and reporting. Traditional automated scanners generate noise without context, and manual pentesting is time-consuming and expensive.
|
|
33
|
-
|
|
34
|
-
**KramScan bridges this gap.** We provide a unified command-line interface that orchestrates headless browser scanning, scrapes critical security headers,
|
|
35
|
-
|
|
36
|
-
<br />
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
<br />
|
|
41
|
-
|
|
42
|
-
## β¨ Key Features
|
|
43
|
-
| Feature | Description |
|
|
44
|
-
| :--- | :--- |
|
|
45
|
-
| π **Automated Vulnerability Engine** | Detects XSS, SQL Injection, CSRF,
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<br />
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
<br
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
<br />
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
|
158
|
-
|
|
|
159
|
-
|
|
|
160
|
-
|
|
|
161
|
-
|
|
|
162
|
-
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://github.com/user-attachments/assets/6439c670-8d73-4bdd-b8fa-c74de949a31e" width="500" alt="KramScan Logo" />
|
|
3
|
+
|
|
4
|
+
<h3 align="center">AI-Powered Web Application Security Testing CLI</h3>
|
|
5
|
+
|
|
6
|
+
<br />
|
|
7
|
+
|
|
8
|
+
[](https://www.npmjs.com/package/kramscan)
|
|
9
|
+
[](https://www.npmjs.com/package/kramscan)
|
|
10
|
+
[](https://github.com/shaikhakramshakil/kramscan/blob/main/LICENSE)
|
|
11
|
+
[](https://github.com/shaikhakramshakil/kramscan)
|
|
12
|
+
[](https://www.typescriptlang.org)
|
|
13
|
+
[](https://nodejs.org)
|
|
14
|
+
|
|
15
|
+
<br />
|
|
16
|
+
|
|
17
|
+
π¬ **A next-generation security auditing tool that combines automated vulnerability scanning with multi-provider AI analysis.**
|
|
18
|
+
|
|
19
|
+
*Empowering developers and security researchers with institutional-grade insights, modular plugin architecture, and an interactive AI agent.*
|
|
20
|
+
|
|
21
|
+
<br />
|
|
22
|
+
|
|
23
|
+
[π NPM Package](https://www.npmjs.com/package/kramscan) Β· [π Documentation](#-usage) Β· [π Report Bug](https://github.com/shaikhakramshakil/kramscan/issues)
|
|
24
|
+
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
<br />
|
|
30
|
+
|
|
31
|
+
## π The Problem We Solve
|
|
32
|
+
Web security is complex and often fragmented. Developers rely on multiple disjointed tools for scanning, manual testing, and reporting. Traditional automated scanners generate noise without context, and manual pentesting is time-consuming and expensive.
|
|
33
|
+
|
|
34
|
+
**KramScan bridges this gap.** We provide a unified command-line interface that orchestrates headless browser scanning, scrapes critical security headers, leverages **Generative AI** (OpenAI, Gemini, Anthropic) for analysis, and features a **modular plugin system** for extensibility. It delivers actionable, human-readable insights alongside raw vulnerability dataβall in seconds.
|
|
35
|
+
|
|
36
|
+
<br />
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
<br />
|
|
41
|
+
|
|
42
|
+
## β¨ Key Features
|
|
43
|
+
| Feature | Description |
|
|
44
|
+
| :--- | :--- |
|
|
45
|
+
| π **Automated Vulnerability Engine** | Detects XSS, SQL Injection, CSRF, insecure headers, and more using Puppeteer-powered crawling. |
|
|
46
|
+
| π **Modular Plugin System** | Extensible architecture for custom vulnerability detection plugins. Built-in plugins for common vulnerabilities. |
|
|
47
|
+
| π€ **Interactive AI Agent** | A conversational security assistant with **Autonomous Verification** skills to confirm findings live. |
|
|
48
|
+
| π§ **Multi-Provider AI Analysis** | Supports OpenAI, Anthropic, Google Gemini, Mistral, OpenRouter, and more for results auditing. |
|
|
49
|
+
| π **AI Executive Summaries** | Automatically generates business-oriented summaries for Word, JSON, and TXT reports. |
|
|
50
|
+
| π **Event-Driven Feedback** | Real-time progress updates with dynamic spinners and live vulnerability alerts during scanning. |
|
|
51
|
+
| π **Professional Reporting** | Generates detailed PDF, DOCX, TXT, and JSON reports with remediation steps and error tracking. |
|
|
52
|
+
| π **Headless Browser Testing** | Renders modern SPAs (Single Page Applications) to find vulnerabilities in dynamic content. |
|
|
53
|
+
| β‘ **Smarter User Flow** | Revamped interactive menu and post-scan "Golden Path" prompts for a guided experience. |
|
|
54
|
+
| π‘οΈ **Error Resilience** | Robust configuration defaults and graceful recovery if individual URLs or plugins fail. |
|
|
55
|
+
|
|
56
|
+
<br />
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
<br />
|
|
61
|
+
|
|
62
|
+
## ποΈ Architecture & Workflow
|
|
63
|
+
|
|
64
|
+
```mermaid
|
|
65
|
+
graph LR
|
|
66
|
+
A[User Command] --> B{CLI Controller};
|
|
67
|
+
B --> C[Scanner Module<br/>Puppeteer / Plugin System];
|
|
68
|
+
B --> D[AI Agent<br/>NLP Processing];
|
|
69
|
+
|
|
70
|
+
C --> E[Plugin Manager<br/>XSS / SQLi / Headers / CSRF];
|
|
71
|
+
E --> F[Vulnerability Detection];
|
|
72
|
+
C --> G[Event System<br/>Progress / Results];
|
|
73
|
+
|
|
74
|
+
F & G --> H[AI Analysis Engine<br/>LLM Provider];
|
|
75
|
+
|
|
76
|
+
H --> I[Risk Assessment<br/>Confidence Scoring];
|
|
77
|
+
I --> J[Report Generator<br/>PDF / DOCX / JSON / TXT];
|
|
78
|
+
J --> K((Final Output<br/>+ Error Report));
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
<br />
|
|
82
|
+
|
|
83
|
+
### Plugin Architecture
|
|
84
|
+
|
|
85
|
+
KramScan now features a modular plugin system that makes extending vulnerability detection effortless:
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
src/plugins/
|
|
89
|
+
βββ types.ts # Base interfaces and types
|
|
90
|
+
βββ PluginManager.ts # Plugin orchestration
|
|
91
|
+
βββ index.ts # Plugin exports
|
|
92
|
+
βββ vulnerabilities/ # Built-in plugins
|
|
93
|
+
βββ XSSPlugin.ts
|
|
94
|
+
βββ SQLInjectionPlugin.ts
|
|
95
|
+
βββ SecurityHeadersPlugin.ts
|
|
96
|
+
βββ SensitiveDataPlugin.ts
|
|
97
|
+
βββ CSRFPlugin.ts
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Creating a custom plugin:**
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
import { BaseVulnerabilityPlugin, PluginContext } from 'kramscan/plugins';
|
|
104
|
+
|
|
105
|
+
export class MyCustomPlugin extends BaseVulnerabilityPlugin {
|
|
106
|
+
readonly name = "Custom Detector";
|
|
107
|
+
readonly type = "custom";
|
|
108
|
+
readonly description = "Detects custom vulnerability";
|
|
109
|
+
|
|
110
|
+
async testParameter(context: PluginContext, param: string, value: string) {
|
|
111
|
+
// Your detection logic here
|
|
112
|
+
if (/* vulnerability found */) {
|
|
113
|
+
return this.success(this.createVulnerability(
|
|
114
|
+
"Custom Vulnerability",
|
|
115
|
+
"Description...",
|
|
116
|
+
context.url,
|
|
117
|
+
"high",
|
|
118
|
+
"Evidence...",
|
|
119
|
+
"Remediation..."
|
|
120
|
+
));
|
|
121
|
+
}
|
|
122
|
+
return this.failure();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
<br />
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
<br />
|
|
132
|
+
|
|
133
|
+
## π§ͺ Tech Stack
|
|
134
|
+
<div align="center">
|
|
135
|
+
|
|
136
|
+
| Component | Technology |
|
|
137
|
+
| :--- | :--- |
|
|
138
|
+
| **Runtime** | Node.js β₯ 18 |
|
|
139
|
+
| **Language** | TypeScript 5.4 |
|
|
140
|
+
| **CLI Framework** | Commander.js, Inquirer.js |
|
|
141
|
+
| **Browser Automation** | Puppeteer (Headless Chrome) |
|
|
142
|
+
| **AI Integration** | OpenAI SDK, Google Generative AI, Anthropic SDK |
|
|
143
|
+
| **Schema Validation** | Zod |
|
|
144
|
+
| **Reporting** | Docx, Puppeteer (PDF), Chalk |
|
|
145
|
+
| **Package Manager** | NPM / Yarn / PNPM |
|
|
146
|
+
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
<br />
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
<br />
|
|
154
|
+
|
|
155
|
+
## π§ Supported AI Providers
|
|
156
|
+
|
|
157
|
+
| Provider | SDK / Integration | Default Model |
|
|
158
|
+
| :--- | :--- | :--- |
|
|
159
|
+
| **OpenAI** | `openai` | `gpt-4` |
|
|
160
|
+
| **Anthropic** | `@anthropic-ai/sdk` | `claude-3-5-sonnet-20241022` |
|
|
161
|
+
| **Google Gemini** | `@google/generative-ai` | `gemini-2.0-flash` |
|
|
162
|
+
| **Mistral** | `@mistralai/mistralai` | `mistral-large-latest` |
|
|
163
|
+
| **OpenRouter** | OpenAI-compatible | `anthropic/claude-3.5-sonnet` |
|
|
164
|
+
| **Kimi** | OpenAI-compatible | `moonshot-v1-8k` |
|
|
165
|
+
| **Groq** | OpenAI-compatible | `llama-3.1-8b-instant` |
|
|
166
|
+
|
|
167
|
+
> Switch providers instantly with `kramscan onboard` or by editing `~/.kramscan/config.json`.
|
|
168
|
+
|
|
169
|
+
### API Key Environment Variables
|
|
170
|
+
You can provide API keys via environment variables (useful for CI/CD) instead of saving them locally:
|
|
171
|
+
|
|
172
|
+
| Provider | Env Var |
|
|
173
|
+
| :--- | :--- |
|
|
174
|
+
| OpenAI | `OPENAI_API_KEY` |
|
|
175
|
+
| Anthropic | `ANTHROPIC_API_KEY` |
|
|
176
|
+
| Gemini | `GEMINI_API_KEY` |
|
|
177
|
+
| Mistral | `MISTRAL_API_KEY` |
|
|
178
|
+
| OpenRouter | `OPENROUTER_API_KEY` |
|
|
179
|
+
| Kimi | `KIMI_API_KEY` |
|
|
180
|
+
| Groq | `GROQ_API_KEY` |
|
|
181
|
+
|
|
182
|
+
### Smart Environment Detection
|
|
183
|
+
KramScan automatically detects API keys in your environment variables. During `kramscan onboard`, the tool will identify and pre-configure providers like OpenAI, Anthropic, and Gemini if their keys are found in your session.
|
|
184
|
+
|
|
185
|
+
### AI-Powered Context-Aware Payloads
|
|
186
|
+
The scanning engine now utilizes AI to generate payloads tailored to the specific context of your application, significantly increasing detection rates against filtered inputs and complex WAFs.
|
|
187
|
+
|
|
188
|
+
### Autonomous Finding Verification
|
|
189
|
+
The `kramscan agent` can now independently verify reported vulnerabilities using non-destructive, context-aware payloads to differentiate between theoretical findings and exploitable risks.
|
|
190
|
+
|
|
191
|
+
<br />
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
<br />
|
|
196
|
+
|
|
197
|
+
## π Quick Start
|
|
198
|
+
|
|
199
|
+
### 1. Installation
|
|
200
|
+
Install KramScan globally using npm:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
npm install -g kramscan
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### 2. First-Time Setup
|
|
207
|
+
Initialize the configuration wizard to set up your AI provider and API keys:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
kramscan onboard
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### 3. Run a Scan
|
|
214
|
+
Execute a full security scan on a target URL:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
kramscan scan https://example.com
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
<br />
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
<br />
|
|
225
|
+
|
|
226
|
+
## π Usage & Commands
|
|
227
|
+
|
|
228
|
+
| Command | Description | Status |
|
|
229
|
+
| :--- | :--- | :---: |
|
|
230
|
+
| `kramscan` | Launch the interactive dashboard menu with smart argument prompting. | β
Stable |
|
|
231
|
+
| `kramscan scan <url>` | Run a comprehensive vulnerability scan with post-scan prompts. | β
Stable |
|
|
232
|
+
| `kramscan agent` | Start the AI security assistant with autonomous verification skills. | β
Stable |
|
|
233
|
+
| `kramscan analyze` | AI-powered analysis with proactive onboarding redirection. | β
Stable |
|
|
234
|
+
| `kramscan report` | Generate professional reports with optional AI executive summaries. | β
Stable |
|
|
235
|
+
| `kramscan onboard` | Smart setup wizard with environment key detection. | β
Stable |
|
|
236
|
+
| `kramscan doctor` | Verify environment health and check for Docker dependencies. | β
Stable |
|
|
237
|
+
| `kramscan config` | View and edit current configuration with robust schema defaults. | β
Stable |
|
|
238
|
+
| `kramscan scans` | List and inspect recent scans from the persistent index. | β
Stable |
|
|
239
|
+
| `kramscan ai` | AI helpers (model listing and connectivity test). | β
Stable |
|
|
240
|
+
|
|
241
|
+
<br />
|
|
242
|
+
|
|
243
|
+
### Scan Profiles and Limits
|
|
244
|
+
KramScan supports profiles for quick tuning:
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
kramscan scan https://example.com --profile quick
|
|
248
|
+
kramscan scan https://example.com --profile balanced
|
|
249
|
+
kramscan scan https://example.com --profile deep
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
You can also control crawl limits and URL scope:
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
kramscan scan https://example.com --max-pages 30 --max-links-per-page 50
|
|
256
|
+
kramscan scan https://example.com --exclude "logout|signout"
|
|
257
|
+
kramscan scan https://example.com --include "^https://example\.com/docs"
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Automatic PDF Report After Scan
|
|
261
|
+
After each scan, KramScan automatically generates a PDF report (no separate command required).
|
|
262
|
+
|
|
263
|
+
The file is saved to:
|
|
264
|
+
|
|
265
|
+
- JSON: `~/.kramscan/scans/scan-<timestamp>.json`
|
|
266
|
+
- PDF: `~/.kramscan/reports/scanreport_<hostname>_<timestamp>.pdf`
|
|
267
|
+
|
|
268
|
+
You can disable it with:
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
kramscan scan https://example.com --no-pdf
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Error Tracking and Recovery
|
|
275
|
+
KramScan now features comprehensive error handling:
|
|
276
|
+
|
|
277
|
+
- **Continue on Failure**: Scan continues even if individual URLs fail to load
|
|
278
|
+
- **Plugin Error Isolation**: If one vulnerability plugin fails, others continue working
|
|
279
|
+
- **Error Reports**: PDF reports include a "β οΈ Scan Errors & Skipped Items" section
|
|
280
|
+
- **CLI Feedback**: Real-time error messages during scanning
|
|
281
|
+
|
|
282
|
+
### Event-Driven Progress Feedback
|
|
283
|
+
Watch your scan progress in real-time:
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
π Starting Security Scan
|
|
287
|
+
ββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
288
|
+
|
|
289
|
+
β Initializing scanner...
|
|
290
|
+
β ΄ Crawling: https://example.com (5/30)
|
|
291
|
+
β οΈ Found high vulnerability: Reflected Cross-Site Scripting (XSS)
|
|
292
|
+
β ΄ Continuing scan (1 vulns found)...
|
|
293
|
+
β ΄ Testing forms on https://example.com/login (3 forms)...
|
|
294
|
+
β Scan complete!
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Scan History
|
|
298
|
+
Every scan is indexed in `~/.kramscan/scans/index.json`.
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
kramscan scans list -n 10
|
|
302
|
+
kramscan scans latest
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### AI Diagnostics
|
|
306
|
+
List models and test your configured provider/model:
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
kramscan ai models -n 10
|
|
310
|
+
kramscan ai test
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Example Agent Session
|
|
314
|
+
```bash
|
|
315
|
+
$ kramscan agent
|
|
316
|
+
> scan https://example.com
|
|
317
|
+
|
|
318
|
+
Agent: I'll perform a comprehensive security scan of https://example.com.
|
|
319
|
+
Checking for XSS, SQLi, and missing headers...
|
|
320
|
+
[Scanning...]
|
|
321
|
+
|
|
322
|
+
Agent: Scan complete! Found 2 High severity issues.
|
|
323
|
+
Would you like me to generate a report?
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
<br />
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
<br />
|
|
331
|
+
|
|
332
|
+
## πΊοΈ Roadmap
|
|
333
|
+
|
|
334
|
+
- [x] Core vulnerability scanner (XSS, SQLi, CSRF, headers)
|
|
335
|
+
- [x] Multi-provider AI analysis engine
|
|
336
|
+
- [x] Interactive AI agent mode
|
|
337
|
+
- [x] Professional report generation (DOCX, TXT, JSON)
|
|
338
|
+
- [x] Configuration wizard & management
|
|
339
|
+
- [x] **Plugin system for custom scan modules** β
|
|
340
|
+
- [x] **PDF report generation** β
|
|
341
|
+
- [x] **Event-driven progress feedback** β
|
|
342
|
+
- [x] **Error resilience and recovery** β
|
|
343
|
+
- [x] **Zod schema validation** β
|
|
344
|
+
- [x] **AI Executive Summaries** β
|
|
345
|
+
- [x] **Autonomous Verification Agent** β
|
|
346
|
+
- [x] **Smarter Interactive Flows** β
|
|
347
|
+
- [ ] CI/CD integration (GitHub Actions, GitLab CI)
|
|
348
|
+
- [ ] Web-based dashboard UI
|
|
349
|
+
- [ ] SARIF export format
|
|
350
|
+
- [ ] OWASP ZAP integration
|
|
351
|
+
|
|
352
|
+
<br />
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
<br />
|
|
357
|
+
|
|
358
|
+
## π Security & Privacy
|
|
359
|
+
- **Local Execution:** All scanning logic runs locally on your machine.
|
|
360
|
+
- **API Key Safety:** AI provider API keys are stored securely in your local home directory and are never sent to our servers.
|
|
361
|
+
- **Data Privacy:** Scan data is sent only to your chosen AI provider for analysis and is not stored by KramScan.
|
|
362
|
+
- **Error Tracking:** Failed scan attempts are logged locally for debugging but never transmitted.
|
|
363
|
+
|
|
364
|
+
<br />
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
<br />
|
|
369
|
+
|
|
370
|
+
## π€ Author
|
|
371
|
+
<div align="center">
|
|
372
|
+
|
|
373
|
+
**Akram Shaikh**
|
|
374
|
+
|
|
375
|
+
[](https://akramshaikh.me)
|
|
376
|
+
[](https://github.com/shaikhakramshakil)
|
|
377
|
+
[](https://www.linkedin.com/in/shaikhakramshakil/)
|
|
378
|
+
|
|
379
|
+
</div>
|
|
380
|
+
|
|
381
|
+
<br />
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
<br />
|
|
386
|
+
|
|
387
|
+
## π License
|
|
388
|
+
This project is licensed under the **MIT License** β see the [LICENSE](LICENSE) file for details.
|
|
389
|
+
|
|
390
|
+
<div align="center">
|
|
391
|
+
<sub>Made with β€οΈ by Akram Shaikh</sub>
|
|
392
|
+
</div>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Confirmation Prompt System
|
|
3
3
|
* Handles user confirmation for skill execution with detailed risk assessment
|
|
4
4
|
*/
|
|
5
|
+
import * as readline from "readline";
|
|
5
6
|
import { ConfirmationPrompt } from "./types";
|
|
6
7
|
export interface ConfirmationResult {
|
|
7
8
|
confirmed: boolean;
|
|
@@ -10,7 +11,10 @@ export interface ConfirmationResult {
|
|
|
10
11
|
}
|
|
11
12
|
export declare class ConfirmationHandler {
|
|
12
13
|
private rl;
|
|
13
|
-
|
|
14
|
+
private ownsRl;
|
|
15
|
+
constructor(rl?: readline.Interface);
|
|
16
|
+
setInterface(rl: readline.Interface): void;
|
|
17
|
+
private getInterface;
|
|
14
18
|
/**
|
|
15
19
|
* Display confirmation prompt and get user response
|
|
16
20
|
*/
|