sicario-red-team 0.1.0 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sicario-red-team",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Autonomous Agentic Red-Teaming Swarm Protocol",
5
5
  "type": "module",
6
6
  "files": [
@@ -82,23 +82,47 @@ export async function hitCommand(target, options) {
82
82
  if (client && missionId) await client.mutation('handler:logMessage', { missionId, type: 'Breacher', message: 'Analysis complete.' });
83
83
 
84
84
  if (breachReport.vulnerabilityFound) {
85
- console.log('\n' + theme.exploit(`${breachReport.title} locked on ${breachReport.targetElement}`));
86
- console.log(pc.red(`Vector: ${breachReport.vector}`));
87
- console.log(pc.red(`Severity: ${breachReport.severity}\n`));
85
+ // 6. Sanitization Layer (The Anti-Crash Upgrade)
86
+ const sanitize = (raw) => ({
87
+ title: raw.title || "Unknown Logic Flaw",
88
+ vector: raw.vector || "Vector analysis inconclusive.",
89
+ severity: raw.severity || "MEDIUM",
90
+ targetElement: raw.targetElement || "General DOM Context",
91
+ mitigation: raw.mitigation || "Implement standard server-side validation guards.",
92
+ thoughtProcess: raw.thoughtProcess || "Reasoning engine offline."
93
+ });
94
+
95
+ const clean = sanitize(breachReport);
96
+
97
+ console.log('\n' + theme.exploit(`${clean.title} locked on ${clean.targetElement}`));
98
+ console.log(pc.red(`Vector: ${clean.vector}`));
99
+ console.log(pc.red(`Severity: ${clean.severity}\n`));
88
100
 
89
101
  if (client && missionId) {
90
102
  await client.mutation('handler:logExploit', {
91
103
  missionId,
92
- title: breachReport.title,
93
- vector: breachReport.vector,
94
- severity: breachReport.severity,
95
- target: breachReport.targetElement,
96
- mitigation: breachReport.mitigation // Ensure backend supports this
104
+ ...clean
97
105
  });
98
106
  }
99
107
 
100
- if (breachReport.mitigation) {
101
- note(pc.cyan(breachReport.mitigation), 'FIX RECOMMENDATION');
108
+ const mitigation = clean.mitigation;
109
+ const thoughtProcess = clean.thoughtProcess;
110
+
111
+ if (clean.mitigation) {
112
+ const boxWidth = 60;
113
+ const wrap = (str, width) => str.match(new RegExp(`.{1,${width}}(\\s|$)`, 'g')) || [str];
114
+
115
+ const drawBoxRow = (content, width) => `│ ${content.trim().padEnd(width - 4)} │`;
116
+
117
+ const thoughtLines = wrap(thoughtProcess, boxWidth - 4);
118
+ const mitLines = wrap(mitigation, boxWidth - 4);
119
+
120
+ console.log('\n' + pc.cyan(`◇ SICARIO REASONING ${'─'.repeat(boxWidth - 21)}╮`));
121
+ thoughtLines.forEach(line => console.log(pc.cyan(drawBoxRow(line, boxWidth))));
122
+ console.log(pc.cyan(`├${'─'.repeat(boxWidth - 2)}┤`));
123
+ console.log(pc.cyan(`│ ${pc.bold('FIX RECOMMENDATION').padEnd(boxWidth - 4)} │`));
124
+ mitLines.forEach(line => console.log(pc.cyan(drawBoxRow(line, boxWidth))));
125
+ console.log(pc.cyan(`├${'─'.repeat(boxWidth - 2)}╯`) + '\n');
102
126
  }
103
127
  } else {
104
128
  log.info(theme.dim('No high-value business logic targets identified.'));
@@ -13,25 +13,22 @@ export async function runBreacher(domElements) {
13
13
  });
14
14
 
15
15
  const systemPrompt = `
16
- You are 'The Breacher', an elite, autonomous SecOps AI. Your sole objective is to analyze a JSON array of web elements (DOM) and identify critical OWASP Business Logic vulnerabilities.
16
+ You are the "Breacher" node of the Sicario Autonomous Swarm.
17
+ Your goal is to identify Business Logic Flaws that automated scanners miss.
17
18
 
18
- ### YOUR RULES OF ENGAGEMENT:
19
- 1. FOCUS ONLY ON BUSINESS LOGIC: Look for vectors allowing Action Limit Overruns (using coupons multiple times), Concurrent Workflow Bypassing (skipping checkout steps), or Price/State Manipulation.
20
- 2. NO BASIC FLAWS: DO NOT report standard XSS, SQLi, or CSRF vulnerabilities.
21
- 3. GROUNDED REALITY: You may only formulate an attack if the specific elements required (e.g., a checkout button, a promo code input) exist in the provided JSON array.
22
- 4. ZERO HALLUCINATIONS: If the DOM array does not contain high-value business logic targets (e.g., it is just a simple blog or static page), you MUST report no vulnerabilities.
19
+ ### PHASE 1: REASONING (THINK OUT LOUD)
20
+ Before providing JSON, analyze the DOM elements for state-changing flows, manipulation vectors, and missing validation guards.
23
21
 
24
- ### MANDATORY OUTPUT FORMAT:
25
- You must respond ONLY with a valid, raw JSON object. Do not include markdown formatting, conversational text, or explanations outside the JSON structure.
26
-
27
- Use this exact schema:
22
+ ### PHASE 2: DATA STRUCTURE
23
+ Return a VALID JSON object. DO NOT use "null".
28
24
  {
29
25
  "vulnerabilityFound": boolean,
30
- "title": string | null,
31
- "targetElement": string | null, // The ID or Name of the exploited element
32
- "vector": string | null, // A strict, 1-sentence technical explanation of the logic flaw
33
- "severity": "LOW" | "MEDIUM" | "HIGH" | "CRITICAL" | null,
34
- "mitigation": string | null // A brief, 2-sentence technical recommendation for fixing the logic flaw
26
+ "thoughtProcess": "Step-by-step logic on how you'd exploit this...",
27
+ "title": "Clear name of flaw",
28
+ "vector": "Technical exploit path",
29
+ "severity": "LOW|MEDIUM|HIGH|CRITICAL",
30
+ "targetElement": "The CSS selector or element name",
31
+ "mitigation": "Detailed code fix recommendation"
35
32
  }
36
33
  `;
37
34