sicario-red-team 0.1.1 → 0.1.3

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/bin/sicario.js CHANGED
@@ -28,7 +28,7 @@ const program = new Command();
28
28
  program
29
29
  .name('sicario')
30
30
  .description('Autonomous Agentic Red-Teaming Swarm Protocol')
31
- .version('0.1.0');
31
+ .version('0.1.3');
32
32
 
33
33
  // Use a more robust way to import the command logic relative to this file
34
34
  const hitCommandPath = pathToFileURL(path.join(__dirname, '../src-cli/commands/hit.js')).href;
@@ -36,12 +36,12 @@ const hitCommandPath = pathToFileURL(path.join(__dirname, '../src-cli/commands/h
36
36
  program
37
37
  .command('hit')
38
38
  .description('Launch an autonomous swarm attack on a target')
39
- .option('-t, --target <url>', 'Target URL')
40
- .option('-a, --agents <number>', 'Number of agents to deploy', (val) => parseInt(val), 3)
41
- .option('-d, --debug', 'Enable verbose debug logging', false)
39
+ .argument('<target>', 'Target URL')
40
+ .option('--swarm', 'Deploy multiple specialized nodes in parallel')
42
41
  .option('--auth <string>', 'Session token or cookie string for authenticated scans')
43
- .action(async (options) => {
42
+ .action(async (target, options) => {
44
43
  try {
44
+ options.target = target;
45
45
  // API Key Check & Viral Hook
46
46
  let apiKey = process.env.CEREBRAS_API_KEY || getApiKey();
47
47
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sicario-red-team",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Autonomous Agentic Red-Teaming Swarm Protocol",
5
5
  "type": "module",
6
6
  "files": [
@@ -76,12 +76,27 @@ export async function hitCommand(target, options) {
76
76
  // 5. [Breacher] Analysis
77
77
  log.step('[Breacher] : Analyzing DOM for logic flaws via Cerebras...');
78
78
  if (client && missionId) await client.mutation('handler:logMessage', { missionId, type: 'Breacher', message: 'Analyzing DOM for logic flaws via Cerebras...' });
79
+
79
80
  try {
80
- breachReport = await runBreacher(elements);
81
- log.success('[Breacher] : Analysis complete.');
82
- if (client && missionId) await client.mutation('handler:logMessage', { missionId, type: 'Breacher', message: 'Analysis complete.' });
81
+ let breachReports = [];
82
+
83
+ if (options.swarm) {
84
+ log.info(pc.magenta('šŸ›ø [System] : Deploying Specialized Task Force Swarm...'));
85
+ const results = await Promise.all([
86
+ runBreacher(elements, 'ACCOUNTANT'),
87
+ runBreacher(elements, 'ADMIN'),
88
+ runBreacher(elements, 'CHAOS_MONKEY')
89
+ ]);
90
+ breachReports = results.filter(r => r.vulnerabilityFound);
91
+ } else {
92
+ const singleReport = await runBreacher(elements);
93
+ if (singleReport.vulnerabilityFound) breachReports.push(singleReport);
94
+ }
83
95
 
84
- if (breachReport.vulnerabilityFound) {
96
+ log.success(`[Breacher] : Analysis complete. ${breachReports.length} vulnerabilities isolated.`);
97
+ if (client && missionId) await client.mutation('handler:logMessage', { missionId, type: 'Breacher', message: `Analysis complete. Found ${breachReports.length} vectors.` });
98
+
99
+ for (const breachReport of breachReports) {
85
100
  // 6. Sanitization Layer (The Anti-Crash Upgrade)
86
101
  const sanitize = (raw) => ({
87
102
  title: raw.title || "Unknown Logic Flaw",
@@ -117,31 +132,36 @@ export async function hitCommand(target, options) {
117
132
  const thoughtLines = wrap(thoughtProcess, boxWidth - 4);
118
133
  const mitLines = wrap(mitigation, boxWidth - 4);
119
134
 
120
- console.log('\n' + pc.cyan(`ā—‡ SICARIO REASONING ${'─'.repeat(boxWidth - 21)}ā•®`));
135
+ console.log(pc.cyan(`ā—‡ SICARIO REASONING [${breachReport.title}] ${'─'.repeat(boxWidth - 21 - breachReport.title.length)}ā•®`));
121
136
  thoughtLines.forEach(line => console.log(pc.cyan(drawBoxRow(line, boxWidth))));
122
137
  console.log(pc.cyan(`ā”œ${'─'.repeat(boxWidth - 2)}┤`));
123
138
  console.log(pc.cyan(`│ ${pc.bold('FIX RECOMMENDATION').padEnd(boxWidth - 4)} │`));
124
139
  mitLines.forEach(line => console.log(pc.cyan(drawBoxRow(line, boxWidth))));
125
140
  console.log(pc.cyan(`ā”œ${'─'.repeat(boxWidth - 2)}╯`) + '\n');
126
141
  }
127
- } else {
142
+ }
143
+
144
+ if (breachReports.length === 0) {
128
145
  log.info(theme.dim('No high-value business logic targets identified.'));
129
146
  }
147
+
148
+ // 6. Mission Dossier
149
+ const summaryLines = [
150
+ `${theme.dim('Target')} ${theme.bold(finalTarget)}`,
151
+ `${theme.dim('Nodes Recalled')} ${theme.bold(options.swarm ? '5 (Scout, Ghost, Accountant, Admin, Chaos)' : '3 (Scout, Ghost, Breacher)')}`,
152
+ `${theme.dim('Breaches Found')} ${breachReports.length > 0 ? pc.red(pc.bold(breachReports.length)) : theme.bold('0')}`,
153
+ `${theme.dim('Status')} ${theme.success('MISSION SUCCESSFUL')}`
154
+ ];
155
+
156
+ console.log(pc.green('\nā”Œ MISSION DOSSIER ───────────────────────────────────────╮'));
157
+ summaryLines.forEach(line => console.log(pc.green(`│ ${line.padEnd(54)} │`)));
158
+ console.log(pc.green(`ā”” Mission complete. Trace extraction successful. ╯`));
159
+
130
160
  } catch (error) {
131
161
  log.error('[Breacher] : Analysis node failure.');
132
162
  log.error(error.message);
133
163
  }
134
164
 
135
- // 6. Mission Dossier
136
- const summaryLines = [
137
- `${theme.dim('Target')} ${theme.bold(finalTarget)}`,
138
- `${theme.dim('Nodes Recalled')} ${theme.bold('3 (Scout, Ghost, Breacher)')}`,
139
- `${theme.dim('Breaches Found')} ${breachReport.vulnerabilityFound ? pc.red(pc.bold('1')) : theme.bold('0')}`,
140
- `${theme.dim('Status')} ${theme.success('MISSION SUCCESSFUL')}`
141
- ];
142
-
143
- note(summaryLines.join('\n'), 'MISSION DOSSIER');
144
-
145
165
  } catch (error) {
146
166
  log.error(`Mission failed: ${error.message}`);
147
167
  } finally {
@@ -1,38 +1,55 @@
1
1
  import Cerebras from '@cerebras/cerebras_cloud_sdk';
2
2
  import 'dotenv/config';
3
3
 
4
+ const PERSONAS = {
5
+ ACCOUNTANT: `
6
+ You are 'The Accountant' node. Your primary focus is on financial logic, pricing, and quantities.
7
+ Look for: Negative value injections, Scientific notation (1e10) bypasses, Currency-decimal manipulation, and Action Limit overruns in financial flows.
8
+ `,
9
+ ADMIN: `
10
+ You are 'The Admin' node. Your focus is on Privilege Escalation and Access Control.
11
+ Look for: Hidden /admin navigation links, accessible settings panels meant for high-privilege users, IDOR vectors in the DOM structure, and authentication bypass hints.
12
+ `,
13
+ CHAOS_MONKEY: `
14
+ You are 'The Chaos Monkey'. Your focus is on Input Resilience and Error Handling bypasses.
15
+ Look for: Fields that lack character limits, unhandled edge-case inputs (emojis, 1GB strings), and state-manipulation vectors that could lead to crashes or unhandled server-side exceptions.
16
+ `
17
+ };
18
+
4
19
  /**
5
- * Breacher Node: Analyzes interactive elements for OWASP Business Logic Abuse vectors.
6
- * Uses Cerebras AI to hypothesize vulnerabilities.
7
- * @param {Array} domElements - Array of extracted DOM elements.
20
+ * Breacher Node: Analyzes the context and attempts to identify business logic flaws.
21
+ * @param {Array} elements - Array of extracted DOM elements.
22
+ * @param {string} [personaType='GENERAL'] - The type of persona to use (e.g., 'ACCOUNTANT', 'ADMIN', 'CHAOS_MONKEY', or 'GENERAL').
8
23
  * @returns {Promise<Object>} - A strict JSON report of findings.
9
24
  */
10
- export async function runBreacher(domElements) {
25
+ export async function runBreacher(elements, personaType = 'GENERAL') {
11
26
  const client = new Cerebras({
12
27
  apiKey: process.env.CEREBRAS_API_KEY,
13
28
  });
14
29
 
30
+ const personaContext = PERSONAS[personaType] || "Evaluate the DOM for general business logic vulnerabilities.";
31
+
15
32
  const systemPrompt = `
16
- You are the "Breacher" node of the Sicario Autonomous Swarm.
17
- Your goal is to identify Business Logic Flaws that automated scanners miss.
33
+ You are a specialized node in the Sicario Autonomous Swarm.
34
+ ${personaContext}
18
35
 
19
36
  ### PHASE 1: REASONING (THINK OUT LOUD)
20
- Before providing JSON, analyze the DOM elements for state-changing flows, manipulation vectors, and missing validation guards.
37
+ Before providing JSON, analyze the DOM elements according to your specific persona.
21
38
 
22
39
  ### PHASE 2: DATA STRUCTURE
23
40
  Return a VALID JSON object. DO NOT use "null".
24
41
  {
25
42
  "vulnerabilityFound": boolean,
26
- "thoughtProcess": "Step-by-step logic on how you'd exploit this...",
27
- "title": "Clear name of flaw",
28
- "vector": "Technical exploit path",
43
+ "thoughtProcess": "Your specialized step-by-step reasoning",
44
+ "title": "Persona-specific flaw name",
45
+ "vector": "Technical path",
29
46
  "severity": "LOW|MEDIUM|HIGH|CRITICAL",
30
- "targetElement": "The CSS selector or element name",
31
- "mitigation": "Detailed code fix recommendation"
47
+ "targetElement": "CSS selector or name",
48
+ "mitigation": "Code-level fix"
32
49
  }
33
50
  `;
34
51
 
35
- const userPrompt = `DOM Elements: ${JSON.stringify(domElements)}`;
52
+ const userPrompt = `DOM Elements: ${JSON.stringify(elements)}`;
36
53
 
37
54
  try {
38
55
  const completion = await client.chat.completions.create({