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 +1 -1
- package/src-cli/commands/hit.js +34 -10
- package/src-cli/nodes/breacher.js +12 -15
package/package.json
CHANGED
package/src-cli/commands/hit.js
CHANGED
|
@@ -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
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
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
|
-
|
|
101
|
-
|
|
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
|
|
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
|
-
###
|
|
19
|
-
|
|
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
|
-
###
|
|
25
|
-
|
|
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
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"vector":
|
|
33
|
-
"severity": "LOW
|
|
34
|
-
"
|
|
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
|
|