wormclaude 1.0.156 → 1.0.157
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/dist/commands.js +10 -8
- package/dist/theme.js +1 -1
- package/dist/tools.js +46 -1
- package/package.json +1 -1
package/dist/commands.js
CHANGED
|
@@ -185,22 +185,24 @@ function formatFinding(x) {
|
|
|
185
185
|
// /recon /scan /xss /sqli — ince runner'ı sürer. Zorunlu yetki onayı + trust 3+ teaser.
|
|
186
186
|
// Slash'sız komut tespiti: kullanıcı "recon target.com" (slash'sız) yazınca "/recon target.com" öner.
|
|
187
187
|
// FALSE-POZİTİF guard: ilk kelime tam komut adı + argüman var + soru DEĞİL ("recon nedir?" tetiklemez).
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
// Yalnız hedef-alan komutları; ve hedef URL/domain GİBİ görünmeli ("xss ile tara" → komut DEĞİL,
|
|
189
|
+
// model SecurityScan ile halleder). "?'li URL kabul edilir (parametreli xss/sqli hedefi).
|
|
190
|
+
const _BARE_CMDS = new Set(['recon', 'scan', 'xss', 'sqli']);
|
|
191
|
+
const _TARGET_RE = /(^https?:\/\/)|(\.[a-z]{2,})|(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/i;
|
|
190
192
|
export function detectBareCommand(input) {
|
|
191
193
|
const s = (input || '').trim();
|
|
192
|
-
if (!s || s.startsWith('/') || s.includes('
|
|
194
|
+
if (!s || s.startsWith('/') || s.includes('\n'))
|
|
193
195
|
return null;
|
|
194
196
|
const parts = s.split(/\s+/);
|
|
195
197
|
if (parts.length < 2)
|
|
196
|
-
return null;
|
|
198
|
+
return null;
|
|
197
199
|
const first = parts[0].toLowerCase();
|
|
198
200
|
if (!_BARE_CMDS.has(first))
|
|
199
201
|
return null;
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
return '/' +
|
|
202
|
+
const arg = parts.slice(1).join(' ');
|
|
203
|
+
if (!_TARGET_RE.test(arg))
|
|
204
|
+
return null; // hedef URL/domain/IP değil → komut değil
|
|
205
|
+
return '/' + first + ' ' + arg;
|
|
204
206
|
}
|
|
205
207
|
async function pentestCmd(tool, arg, ctx) {
|
|
206
208
|
if (tool === 'scan')
|
package/dist/theme.js
CHANGED
package/dist/tools.js
CHANGED
|
@@ -208,6 +208,21 @@ export const toolSchemas = [
|
|
|
208
208
|
},
|
|
209
209
|
},
|
|
210
210
|
},
|
|
211
|
+
{
|
|
212
|
+
type: 'function',
|
|
213
|
+
function: {
|
|
214
|
+
name: 'SecurityScan',
|
|
215
|
+
description: "Run an AUTHORIZED security scan with WormClaude's own server-side engine (no external tools, no manual payloads). Use THIS — never shell/curl/Invoke-WebRequest — whenever the user asks to scan/test a target for vulnerabilities (\"tara\", \"scan\", \"xss tara\", \"sqli\", \"recon\", \"açık bul\", \"zafiyet tara\"). The engine runs payloads + detection server-side and returns findings. For xss/sqli give a PARAMETERIZED url (e.g. https://site/page?id=1); for recon/scan give a domain. Requires authorized-researcher level (3+); traffic exits the user's IP — only authorized targets.",
|
|
216
|
+
parameters: {
|
|
217
|
+
type: 'object',
|
|
218
|
+
properties: {
|
|
219
|
+
tool: { type: 'string', enum: ['recon', 'scan', 'xss', 'sqli'], description: 'recon/scan → domain; xss/sqli → parameterized URL' },
|
|
220
|
+
target: { type: 'string', description: 'Domain for recon/scan (example.com) OR parameterized URL for xss/sqli (https://example.com/p?id=1)' },
|
|
221
|
+
},
|
|
222
|
+
required: ['tool', 'target'],
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
},
|
|
211
226
|
{
|
|
212
227
|
type: 'function',
|
|
213
228
|
function: {
|
|
@@ -592,7 +607,7 @@ const computerToolSchemas = [
|
|
|
592
607
|
// çağırıp işi yapar, planı ekrana basmaz. (Gerekirse buraya yeni araç eklenir.)
|
|
593
608
|
const CORE_TOOLS = new Set([
|
|
594
609
|
'Bash', 'PowerShell', 'Read', 'Write', 'Edit', 'Glob', 'Grep',
|
|
595
|
-
'WebFetch', 'WebSearch', 'Sleep',
|
|
610
|
+
'WebFetch', 'WebSearch', 'Sleep', 'SecurityScan',
|
|
596
611
|
'TaskOutput', // uzun komutları arka planda çalıştırıp bitişini yoklamak için (run_in_background)
|
|
597
612
|
'AskUserQuestion', // GERİ EKLENDİ: FLAT şema (options: string[]) ile 32B temiz çağrı üretiyor
|
|
598
613
|
// (test edildi). Eski degenere NESTED şemadandı ([{label,description}]). Handler string→{label}
|
|
@@ -698,6 +713,36 @@ async function execOne(call, hooks) {
|
|
|
698
713
|
return { ok: false, output: 'Plan modunda — yazma/komut engellendi (yalnız okuma/araştırma). Planı yaz; uygulamak için kullanıcı /plan off demeli.', args };
|
|
699
714
|
}
|
|
700
715
|
}
|
|
716
|
+
// 3.4) Güvenlik taraması — kullanıcı "tara/scan/xss/sqli/recon" deyince model bu aracı çağırır;
|
|
717
|
+
// elle PowerShell payload yazmak YERİNE sunucu motorunu (runPentest) çalıştırır.
|
|
718
|
+
if (call.name === 'SecurityScan') {
|
|
719
|
+
const tool = String(args?.tool || '').toLowerCase().trim();
|
|
720
|
+
const target = String(args?.target || '').trim();
|
|
721
|
+
if (!['recon', 'scan', 'xss', 'sqli'].includes(tool) || !target) {
|
|
722
|
+
return { ok: false, output: 'SecurityScan: tool (recon|scan|xss|sqli) ve target gerekli.', args };
|
|
723
|
+
}
|
|
724
|
+
try {
|
|
725
|
+
const { runPentest } = await import('./pentest.js');
|
|
726
|
+
const out = await runPentest(cfg(), tool, target, true, () => { });
|
|
727
|
+
if (!out?.ok) {
|
|
728
|
+
const reason = out?.reason || out?.plan?.reason || 'error';
|
|
729
|
+
const tip = reason === 'trust_required' ? ' (Doğrulanmış Araştırmacı / seviye 3+ gerekir: /dogrula)'
|
|
730
|
+
: reason === 'invalid_target' ? ' (xss/sqli için parametreli URL ver: https://site/p?id=1)' : '';
|
|
731
|
+
return { ok: false, output: `Tarama yapılamadı: ${reason}${tip}`, args };
|
|
732
|
+
}
|
|
733
|
+
const rep = out.report || {};
|
|
734
|
+
const f = rep.findings || [];
|
|
735
|
+
let txt = `Tarama tamam (${tool}) — ${rep.target || target}\n`;
|
|
736
|
+
if (!f.length)
|
|
737
|
+
txt += 'Zafiyet bulunamadı (hedef temiz ya da yanıt vermedi).';
|
|
738
|
+
else
|
|
739
|
+
txt += `${rep.found_count} bulgu:\n` + f.slice(0, 50).map((x) => ' ' + JSON.stringify(x)).join('\n');
|
|
740
|
+
return { ok: true, output: txt, args };
|
|
741
|
+
}
|
|
742
|
+
catch (e) {
|
|
743
|
+
return { ok: false, output: 'Tarama hatası: ' + (e?.message || e), args };
|
|
744
|
+
}
|
|
745
|
+
}
|
|
701
746
|
// 3.5) Komut güvenliği (Bash/PowerShell) — cmdsec: deny→blokla, allow→izinsiz, confirm→izin akışı
|
|
702
747
|
if ((call.name === 'Bash' || call.name === 'PowerShell') && args && args.command) {
|
|
703
748
|
const chk = checkCommand(String(args.command), { shell: call.name === 'PowerShell' ? 'powershell' : 'bash' });
|