wormclaude 1.0.167 → 1.0.169

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 CHANGED
@@ -329,6 +329,20 @@ export function summarizeScan(target, findings) {
329
329
  : `\n➤ Verdict: no high/medium issues; tested surface largely clean. (Stored/DOM/behind-auth out of scope)`);
330
330
  return out;
331
331
  }
332
+ // Tarama sonucunu MODELİN context'ine ekle → kullanıcı tarama hakkında soru sorabilsin
333
+ // ("türkçe anlat", "neyi önce düzelteyim", "SSRF nedir"). assistant() sadece ekrana basar, geçmişe
334
+ // eklemez; bu yüzden model taramayı bilmiyordu. Özet + yüksek/orta bulgular eklenir (context şişmesin).
335
+ function injectScanContext(ctx, target, findings) {
336
+ if (!findings || !findings.length)
337
+ return;
338
+ const imp = findings.filter((f) => ['critical', 'high', 'medium'].includes(f.severity)).slice(0, 40);
339
+ const note = summarizeScan(target, findings).join('\n') + (imp.length ? '\n' + imp.map(formatFinding).join('\n') : '');
340
+ try {
341
+ ctx.setHistory([...ctx.getHistory(),
342
+ { role: 'assistant', content: `[${tt('Security scan result', 'Güvenlik tarama sonucu')} — ${target}]\n${note}` }]);
343
+ }
344
+ catch { /* geçmiş güncellenemezse sessiz geç */ }
345
+ }
332
346
  // /recon /scan /xss /sqli — ince runner'ı sürer. Zorunlu yetki onayı + trust 3+ teaser.
333
347
  // Slash'sız komut tespiti: kullanıcı "recon target.com" (slash'sız) yazınca "/recon target.com" öner.
334
348
  // FALSE-POZİTİF guard: ilk kelime tam komut adı + argüman var + soru DEĞİL ("recon nedir?" tetiklemez).
@@ -416,6 +430,7 @@ async function pentestCmd(tool, arg, ctx) {
416
430
  lines.push(` … +${f.length - 40} ${tt('more', 'daha')}`);
417
431
  }
418
432
  ctx.assistant(lines.join('\n'));
433
+ injectScanContext(ctx, rep.target || target, f); // model tarama hakkında soruları yanıtlayabilsin
419
434
  }
420
435
  // /fullscan — DETERMİNİSTİK tam tarama. Modelin doğaçlamasına (nmap/sqlmap orkestrasyonu →
421
436
  // narration/uydurma/PATH derdi) GÜVENMEZ: recon → XSS → SQLi motorunu KOD sırayla, her hedefte
@@ -497,6 +512,7 @@ async function fullScanCmd(arg, ctx) {
497
512
  lines.push(` … +${all.length - 60} ${tt('more', 'daha')}`);
498
513
  }
499
514
  ctx.assistant(lines.join('\n'));
515
+ injectScanContext(ctx, target, all); // model tarama hakkında soruları yanıtlayabilsin
500
516
  }
501
517
  // /exploit ve /harden — AKTİF tarama DEĞİL, model-üretim görevleri (PoC / YARA-Sigma yazar).
502
518
  // Güçlü, yetkili-kapsam çerçevesiyle modele gider (skill gibi). Çıktı kullanıcının dilinde.
package/dist/theme.js CHANGED
@@ -16,4 +16,4 @@ export const theme = {
16
16
  synType: '#a78bfa', // tip/sınıf adları, sabitler
17
17
  synProp: '#e0e0e0', // özellik/anahtar adları
18
18
  };
19
- export const VERSION = '1.0.167';
19
+ export const VERSION = '1.0.169';
package/dist/tools.js CHANGED
@@ -47,6 +47,10 @@ function _cmdTimeout(cmd, explicit) {
47
47
  let bashCwd;
48
48
  export function getBashCwd() { return bashCwd || process.cwd(); }
49
49
  export function setBashCwd(dir) { bashCwd = dir; }
50
+ // SecurityScan döngü-kırıcı: model mevcut bulguları "açıklarken" aynı taramayı tekrar tekrar
51
+ // çağırıp döngüye giriyordu. Aynı (tool,target) 2 dk içinde tekrar gelirse YENİDEN tarama yok —
52
+ // önceki sonucu + "yeniden tarama, bulgularla yanıtla" notunu dön.
53
+ const _scanCache = new Map();
50
54
  // Göreli dosya yollarını AKTİF workspace'e (bashCwd) çözer; mutlak yol aynen kalır.
51
55
  // Böylece model "index.html" gibi göreli yol verse bile dosya bilinen klasöre yazılır.
52
56
  export function resolveWs(fp) {
@@ -733,6 +737,13 @@ async function execOne(call, hooks) {
733
737
  }
734
738
  if (tool === 'scan')
735
739
  tool = 'recon'; // "scan" genel tarama → motorun bildiği "recon" (slash ile aynı)
740
+ // DÖNGÜ-KIRICI: aynı tarama 2 dk içinde tekrar → yeniden koşma, önceki sonuç + "yeniden tarama" notu.
741
+ const _ck = tool + '|' + target.toLowerCase();
742
+ const _cached = _scanCache.get(_ck);
743
+ if (_cached && Date.now() - _cached.t < 120000) {
744
+ return { ok: true, args, output: _cached.out
745
+ + '\n\n[ALREADY-SCANNED] This exact scan just ran — results above. Do NOT scan again. Answer the user from these findings (explain / prioritize / translate / show fixes). Re-scanning is a loop.' };
746
+ }
736
747
  try {
737
748
  const { runPentest } = await import('./pentest.js');
738
749
  const out = await runPentest(cfg(), tool, target, true, () => { });
@@ -754,6 +765,7 @@ async function execOne(call, hooks) {
754
765
  + ` the user to run the deterministic command "/fullscan ${target}" — it chains recon + XSS + SQLi`
755
766
  + ` in one reliable, repeatable pass. Do NOT hand-orchestrate nmap/sqlmap yourself; recommend`
756
767
  + ` /fullscan. Pair it with the authorization reminder (only on owned / written-authorized targets).`;
768
+ _scanCache.set(_ck, { out: txt, t: Date.now() }); // döngü-kırıcı için sakla
757
769
  return { ok: true, output: txt, args };
758
770
  }
759
771
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wormclaude",
3
- "version": "1.0.167",
3
+ "version": "1.0.169",
4
4
  "description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
5
5
  "type": "module",
6
6
  "bin": {