pentesting 0.55.0 → 0.55.2
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/main.js +158 -138
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -342,7 +342,7 @@ var ORPHAN_PROCESS_NAMES = [
|
|
|
342
342
|
|
|
343
343
|
// src/shared/constants/agent.ts
|
|
344
344
|
var APP_NAME = "Pentest AI";
|
|
345
|
-
var APP_VERSION = "0.55.
|
|
345
|
+
var APP_VERSION = "0.55.2";
|
|
346
346
|
var APP_DESCRIPTION = "Autonomous Penetration Testing AI Agent";
|
|
347
347
|
var LLM_ROLES = {
|
|
348
348
|
SYSTEM: "system",
|
|
@@ -4940,19 +4940,145 @@ var CHALLENGE_TYPE_SIGNALS = {
|
|
|
4940
4940
|
]
|
|
4941
4941
|
};
|
|
4942
4942
|
|
|
4943
|
+
// src/shared/constants/prompts.ts
|
|
4944
|
+
var PROMPT_PATHS = {
|
|
4945
|
+
BASE: "base.md",
|
|
4946
|
+
OFFENSIVE_PLAYBOOK: "offensive-playbook.md",
|
|
4947
|
+
AGENT_FILES: {
|
|
4948
|
+
ORCHESTRATOR: "orchestrator.md",
|
|
4949
|
+
RECON: "recon.md",
|
|
4950
|
+
VULN: "vuln.md",
|
|
4951
|
+
WEB: "web.md",
|
|
4952
|
+
EXPLOIT: "exploit.md",
|
|
4953
|
+
POST: "post.md",
|
|
4954
|
+
REPORT: "report.md",
|
|
4955
|
+
INFRA: "infra.md",
|
|
4956
|
+
// Strategic methodology (always loaded as reference)
|
|
4957
|
+
STRATEGY: "strategy.md",
|
|
4958
|
+
EVASION: "evasion.md",
|
|
4959
|
+
ZERO_DAY: "zero-day.md",
|
|
4960
|
+
PAYLOAD_CRAFT: "payload-craft.md"
|
|
4961
|
+
},
|
|
4962
|
+
/** Technique reference library directory */
|
|
4963
|
+
TECHNIQUES_DIR: "techniques"
|
|
4964
|
+
};
|
|
4965
|
+
var TECHNIQUE_FILES = {
|
|
4966
|
+
INJECTION: "injection",
|
|
4967
|
+
PRIVESC: "privesc",
|
|
4968
|
+
LATERAL: "lateral",
|
|
4969
|
+
AD_ATTACK: "ad-attack",
|
|
4970
|
+
AUTH_ACCESS: "auth-access",
|
|
4971
|
+
CONTAINER_ESCAPE: "container-escape",
|
|
4972
|
+
SANDBOX_ESCAPE: "sandbox-escape",
|
|
4973
|
+
FILE_ATTACKS: "file-attacks",
|
|
4974
|
+
NETWORK_SVC: "network-svc",
|
|
4975
|
+
CRYPTO: "crypto",
|
|
4976
|
+
REVERSING: "reversing",
|
|
4977
|
+
FORENSICS: "forensics",
|
|
4978
|
+
PWN: "pwn",
|
|
4979
|
+
SHELLS: "shells"
|
|
4980
|
+
};
|
|
4981
|
+
var PROMPT_XML = {
|
|
4982
|
+
PHASE: (phase, content) => `<phase-instructions phase="${phase}">
|
|
4983
|
+
${content}
|
|
4984
|
+
</phase-instructions>`,
|
|
4985
|
+
SCOPE: (allowed, domains, exclude, flags) => `<scope type="ABSOLUTE_CONSTRAINT">
|
|
4986
|
+
Authorized CIDR: ${allowed}
|
|
4987
|
+
Authorized Domains: ${domains}
|
|
4988
|
+
Exclusions: ${exclude}
|
|
4989
|
+
Constraints: ${flags}
|
|
4990
|
+
</scope>`,
|
|
4991
|
+
STATE: (content) => `<current-state>
|
|
4992
|
+
${content}
|
|
4993
|
+
</current-state>`,
|
|
4994
|
+
TODO: (content) => `<todo>
|
|
4995
|
+
${content}
|
|
4996
|
+
</todo>`
|
|
4997
|
+
};
|
|
4998
|
+
var PROMPT_DEFAULTS = {
|
|
4999
|
+
NO_SCOPE: "<scope>NO SCOPE DEFINED. STOP.</scope>",
|
|
5000
|
+
EMPTY_TODO: "Create initial plan",
|
|
5001
|
+
USER_CONTEXT: (context) => `
|
|
5002
|
+
<user-input>
|
|
5003
|
+
"${context}"
|
|
5004
|
+
</user-input>
|
|
5005
|
+
|
|
5006
|
+
<intent-rules>
|
|
5007
|
+
ANALYZE the user's intent before acting. Classify into ONE:
|
|
5008
|
+
ABORT \u2192 stop current work, confirm with \`ask_user\`
|
|
5009
|
+
CORRECTION \u2192 adjust approach, continue
|
|
5010
|
+
INFORMATION \u2192 store and USE immediately (credentials, paths, hints)
|
|
5011
|
+
COMMAND \u2192 execute EXACTLY what was asked, nothing more
|
|
5012
|
+
TARGET_CHANGE \u2192 \`add_target\`, then begin testing
|
|
5013
|
+
GUIDANCE \u2192 acknowledge via \`ask_user\`, adjust strategy, continue
|
|
5014
|
+
STATUS_QUERY \u2192 report via \`ask_user\`, then RESUME previous work
|
|
5015
|
+
CONVERSATION \u2192 respond via \`ask_user\`, do NOT scan or attack
|
|
5016
|
+
|
|
5017
|
+
RULES:
|
|
5018
|
+
- No target set and none provided \u2192 \`ask_user\` to request target.
|
|
5019
|
+
- Conversation or greeting \u2192 respond conversationally, do NOT attack.
|
|
5020
|
+
- Uncertain intent \u2192 ask for clarification with \`ask_user\`.
|
|
5021
|
+
- This is a collaborative tool. The user is your partner.
|
|
5022
|
+
</intent-rules>`
|
|
5023
|
+
};
|
|
5024
|
+
var PROMPT_CONFIG = {
|
|
5025
|
+
ENCODING: "utf-8"
|
|
5026
|
+
};
|
|
5027
|
+
var INITIAL_TASKS = {
|
|
5028
|
+
RECON: "Initial reconnaissance and target discovery"
|
|
5029
|
+
};
|
|
5030
|
+
var CONTEXT_EXTRACTOR_PROMPT = `You are extracting actionable intelligence from a penetration testing session.
|
|
5031
|
+
DO NOT simply summarize or shorten. EXTRACT critical facts:
|
|
5032
|
+
|
|
5033
|
+
1. DISCOVERED: Services, versions, paths, parameters (exact IPs, ports, versions)
|
|
5034
|
+
2. CONFIRMED: Vulnerabilities or access confirmed
|
|
5035
|
+
3. CREDENTIALS: Usernames, passwords, tokens, keys
|
|
5036
|
+
4. DEAD ENDS: What failed \u2014 include EXACT command, tool, arguments, wordlist/file used.
|
|
5037
|
+
Distinguish between:
|
|
5038
|
+
- "This approach itself is impossible" (e.g., SSH key-only \u2192 no password brute force works)
|
|
5039
|
+
- "This specific attempt failed" (e.g., sqlmap with default tamper \u2192 try different tamper)
|
|
5040
|
+
5. OPEN LEADS: Unexplored paths worth pursuing
|
|
5041
|
+
|
|
5042
|
+
Every line must include exact commands/tools/files used.
|
|
5043
|
+
The reader must be able to judge whether a retry with different parameters is worthwhile.`;
|
|
5044
|
+
var REFLECTION_PROMPT = `You are a tactical reviewer for a penetration testing agent.
|
|
5045
|
+
Review ALL actions from this turn \u2014 successes AND failures.
|
|
5046
|
+
|
|
5047
|
+
1. ASSESSMENT: What did this turn accomplish? Rate: HIGH / MED / LOW / NONE.
|
|
5048
|
+
2. SUCCESSES: What worked? Can this pattern be replicated elsewhere?
|
|
5049
|
+
3. FAILURES: What failed? Is this a repeated pattern? If so \u2192 STOP this approach.
|
|
5050
|
+
4. BLIND SPOTS: What was missed or overlooked?
|
|
5051
|
+
5. NEXT PRIORITY: Single most valuable next action.
|
|
5052
|
+
|
|
5053
|
+
3-5 lines. Every word must be actionable.`;
|
|
5054
|
+
var SUMMARY_REGENERATOR_PROMPT = `Update this penetration testing session summary with the new turn data.
|
|
5055
|
+
|
|
5056
|
+
Must include:
|
|
5057
|
+
- All discovered hosts, services, versions (exact IPs, ports, software versions)
|
|
5058
|
+
- All confirmed vulnerabilities
|
|
5059
|
+
- All obtained credentials
|
|
5060
|
+
- Failed attempts with EXACT commands/tools/arguments/files used.
|
|
5061
|
+
For each failure, state:
|
|
5062
|
+
- The root cause (auth method? WAF? patched? wrong params?)
|
|
5063
|
+
- Whether retrying with different parameters could work
|
|
5064
|
+
- Top unexplored leads
|
|
5065
|
+
|
|
5066
|
+
Remove outdated/superseded info. Keep concise but COMPLETE.
|
|
5067
|
+
The reader must be able to decide what to retry and what to never attempt again.`;
|
|
5068
|
+
|
|
4943
5069
|
// src/shared/utils/auto-prompter.ts
|
|
4944
5070
|
var SECONDARY_TYPE_RATIO = 0.5;
|
|
4945
5071
|
var MIN_CHALLENGE_CONFIDENCE = 0.2;
|
|
4946
5072
|
var MIN_RECON_OUTPUT_LENGTH = 100;
|
|
4947
5073
|
var TYPE_TECHNIQUE_MAP = {
|
|
4948
|
-
web: [
|
|
4949
|
-
pwn: [
|
|
4950
|
-
crypto: [
|
|
4951
|
-
forensics: [
|
|
4952
|
-
reversing: [
|
|
4953
|
-
misc: [
|
|
4954
|
-
network: [
|
|
4955
|
-
unknown: [
|
|
5074
|
+
web: [TECHNIQUE_FILES.INJECTION, TECHNIQUE_FILES.AUTH_ACCESS, TECHNIQUE_FILES.FILE_ATTACKS, TECHNIQUE_FILES.CRYPTO],
|
|
5075
|
+
pwn: [TECHNIQUE_FILES.PWN, TECHNIQUE_FILES.SHELLS, TECHNIQUE_FILES.REVERSING],
|
|
5076
|
+
crypto: [TECHNIQUE_FILES.CRYPTO],
|
|
5077
|
+
forensics: [TECHNIQUE_FILES.FORENSICS, TECHNIQUE_FILES.REVERSING, TECHNIQUE_FILES.CRYPTO],
|
|
5078
|
+
reversing: [TECHNIQUE_FILES.REVERSING, TECHNIQUE_FILES.PWN],
|
|
5079
|
+
misc: [TECHNIQUE_FILES.SANDBOX_ESCAPE, TECHNIQUE_FILES.CRYPTO, TECHNIQUE_FILES.FORENSICS],
|
|
5080
|
+
network: [TECHNIQUE_FILES.NETWORK_SVC, TECHNIQUE_FILES.SHELLS, TECHNIQUE_FILES.LATERAL, TECHNIQUE_FILES.AD_ATTACK],
|
|
5081
|
+
unknown: [TECHNIQUE_FILES.NETWORK_SVC, TECHNIQUE_FILES.INJECTION, TECHNIQUE_FILES.SHELLS, TECHNIQUE_FILES.FILE_ATTACKS]
|
|
4956
5082
|
};
|
|
4957
5083
|
var TYPE_PHASE_PROMPT_MAP = {
|
|
4958
5084
|
web: "web.md",
|
|
@@ -9635,7 +9761,9 @@ var LLM_LIMITS = {
|
|
|
9635
9761
|
* can produce full analysis, tool calls, and reasoning without cutoff. */
|
|
9636
9762
|
streamMaxTokens: 128e3,
|
|
9637
9763
|
/** WHY: ~3.5 chars/token is a reasonable average for mixed English/CJK content */
|
|
9638
|
-
charsPerTokenEstimate: 3.5
|
|
9764
|
+
charsPerTokenEstimate: 3.5,
|
|
9765
|
+
/** WHY: 5 minutes max timeout for streaming and non-streaming responses */
|
|
9766
|
+
fetchTimeoutMs: 3e5
|
|
9639
9767
|
};
|
|
9640
9768
|
var LLM_ERROR_TYPES = {
|
|
9641
9769
|
RATE_LIMIT: "rate_limit",
|
|
@@ -9774,6 +9902,8 @@ var LLMClient = class {
|
|
|
9774
9902
|
}
|
|
9775
9903
|
async makeRequest(body, signal) {
|
|
9776
9904
|
const url = `${this.baseUrl}${LLM_API.MESSAGES_PATH}`;
|
|
9905
|
+
const timeoutSignal = AbortSignal.timeout(LLM_LIMITS.fetchTimeoutMs);
|
|
9906
|
+
const combinedSignal = signal ? AbortSignal.any([signal, timeoutSignal]) : timeoutSignal;
|
|
9777
9907
|
const response = await fetch(url, {
|
|
9778
9908
|
method: LLM_HTTP_METHOD.POST,
|
|
9779
9909
|
headers: {
|
|
@@ -9784,7 +9914,7 @@ var LLMClient = class {
|
|
|
9784
9914
|
[LLM_HEADER.ANTHROPIC_VERSION]: LLM_API.VERSION
|
|
9785
9915
|
},
|
|
9786
9916
|
body: JSON.stringify(body),
|
|
9787
|
-
signal
|
|
9917
|
+
signal: combinedSignal
|
|
9788
9918
|
});
|
|
9789
9919
|
if (!response.ok) {
|
|
9790
9920
|
let errorBody = `HTTP ${response.status}`;
|
|
@@ -10475,19 +10605,19 @@ var ANALYST_SYSTEM_PROMPT = `You are an independent pentesting output analyst. Y
|
|
|
10475
10605
|
|
|
10476
10606
|
FORMAT YOUR RESPONSE EXACTLY LIKE THIS:
|
|
10477
10607
|
|
|
10478
|
-
##
|
|
10608
|
+
## ${MEMO_SECTIONS.KEY_FINDINGS}
|
|
10479
10609
|
- [finding 1 with exact values: ports, versions, paths]
|
|
10480
10610
|
- [finding 2]
|
|
10481
10611
|
|
|
10482
|
-
##
|
|
10612
|
+
## ${MEMO_SECTIONS.CREDENTIALS}
|
|
10483
10613
|
- [any discovered credentials, hashes, tokens, keys, certificates]
|
|
10484
10614
|
- (write "None found" if none)
|
|
10485
10615
|
|
|
10486
|
-
##
|
|
10616
|
+
## ${MEMO_SECTIONS.ATTACK_VECTORS}
|
|
10487
10617
|
- [exploitable services, vulnerabilities, misconfigurations, CVEs]
|
|
10488
10618
|
- (write "None identified" if none)
|
|
10489
10619
|
|
|
10490
|
-
##
|
|
10620
|
+
## ${MEMO_SECTIONS.FAILURES}
|
|
10491
10621
|
Classify EVERY failure using one of these types. Format: [TYPE] exact_command \u2192 why_failed \u2192 recommended_pivot
|
|
10492
10622
|
|
|
10493
10623
|
Failure types:
|
|
@@ -10504,7 +10634,7 @@ Examples:
|
|
|
10504
10634
|
- "[TIMEOUT] nmap -sV -p- target --min-rate=5000 \u2192 timed out 5min \u2192 rustscan first, then targeted nmap on found ports"
|
|
10505
10635
|
- (write "No failures" if everything succeeded)
|
|
10506
10636
|
|
|
10507
|
-
##
|
|
10637
|
+
## ${MEMO_SECTIONS.SUSPICIONS}
|
|
10508
10638
|
- [anomalies that are NOT confirmed vulnerabilities but suggest exploitable surface]
|
|
10509
10639
|
- [e.g.: "Response time 3x slower on /admin path \u2014 possible auth check or backend processing"]
|
|
10510
10640
|
- [e.g.: "X-Debug-Token header present \u2014 debug mode may be enabled"]
|
|
@@ -10512,11 +10642,11 @@ Examples:
|
|
|
10512
10642
|
- [e.g.: "Unexpected 302 redirect with session param leaked in URL"]
|
|
10513
10643
|
- (write "No suspicious signals" if nothing anomalous)
|
|
10514
10644
|
|
|
10515
|
-
##
|
|
10645
|
+
## ${MEMO_SECTIONS.ATTACK_VALUE}
|
|
10516
10646
|
- [ONE word: HIGH / MED / LOW / NONE]
|
|
10517
10647
|
- Reasoning: [1 sentence why \u2014 what makes this worth pursuing or abandoning]
|
|
10518
10648
|
|
|
10519
|
-
##
|
|
10649
|
+
## ${MEMO_SECTIONS.NEXT_STEPS}
|
|
10520
10650
|
- [recommended immediate actions based on findings]
|
|
10521
10651
|
|
|
10522
10652
|
RULES:
|
|
@@ -10530,7 +10660,7 @@ RULES:
|
|
|
10530
10660
|
- Do NOT miss subtle signals: unusual HTTP headers, non-standard responses, timing differences
|
|
10531
10661
|
- Write as much detail as needed \u2014 do NOT artificially shorten. Every detail matters for strategy.
|
|
10532
10662
|
|
|
10533
|
-
##
|
|
10663
|
+
## ${MEMO_SECTIONS.REFLECTION}
|
|
10534
10664
|
- What this output tells us: [1-line assessment]
|
|
10535
10665
|
- Recommended next action: [1-2 specific follow-up actions]`;
|
|
10536
10666
|
function parseAnalystMemo(response) {
|
|
@@ -11328,116 +11458,6 @@ import { readFileSync as readFileSync6, existsSync as existsSync10 } from "fs";
|
|
|
11328
11458
|
import { join as join11, dirname as dirname4 } from "path";
|
|
11329
11459
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
11330
11460
|
|
|
11331
|
-
// src/shared/constants/prompts.ts
|
|
11332
|
-
var PROMPT_PATHS = {
|
|
11333
|
-
BASE: "base.md",
|
|
11334
|
-
OFFENSIVE_PLAYBOOK: "offensive-playbook.md",
|
|
11335
|
-
AGENT_FILES: {
|
|
11336
|
-
ORCHESTRATOR: "orchestrator.md",
|
|
11337
|
-
RECON: "recon.md",
|
|
11338
|
-
VULN: "vuln.md",
|
|
11339
|
-
WEB: "web.md",
|
|
11340
|
-
EXPLOIT: "exploit.md",
|
|
11341
|
-
POST: "post.md",
|
|
11342
|
-
REPORT: "report.md",
|
|
11343
|
-
INFRA: "infra.md",
|
|
11344
|
-
// Strategic methodology (always loaded as reference)
|
|
11345
|
-
STRATEGY: "strategy.md",
|
|
11346
|
-
EVASION: "evasion.md",
|
|
11347
|
-
ZERO_DAY: "zero-day.md",
|
|
11348
|
-
PAYLOAD_CRAFT: "payload-craft.md"
|
|
11349
|
-
},
|
|
11350
|
-
/** Technique reference library directory (auto-discovered) */
|
|
11351
|
-
TECHNIQUES_DIR: "techniques"
|
|
11352
|
-
};
|
|
11353
|
-
var PROMPT_XML = {
|
|
11354
|
-
PHASE: (phase, content) => `<phase-instructions phase="${phase}">
|
|
11355
|
-
${content}
|
|
11356
|
-
</phase-instructions>`,
|
|
11357
|
-
SCOPE: (allowed, domains, exclude, flags) => `<scope type="ABSOLUTE_CONSTRAINT">
|
|
11358
|
-
Authorized CIDR: ${allowed}
|
|
11359
|
-
Authorized Domains: ${domains}
|
|
11360
|
-
Exclusions: ${exclude}
|
|
11361
|
-
Constraints: ${flags}
|
|
11362
|
-
</scope>`,
|
|
11363
|
-
STATE: (content) => `<current-state>
|
|
11364
|
-
${content}
|
|
11365
|
-
</current-state>`,
|
|
11366
|
-
TODO: (content) => `<todo>
|
|
11367
|
-
${content}
|
|
11368
|
-
</todo>`
|
|
11369
|
-
};
|
|
11370
|
-
var PROMPT_DEFAULTS = {
|
|
11371
|
-
NO_SCOPE: "<scope>NO SCOPE DEFINED. STOP.</scope>",
|
|
11372
|
-
EMPTY_TODO: "Create initial plan",
|
|
11373
|
-
USER_CONTEXT: (context) => `
|
|
11374
|
-
<user-input>
|
|
11375
|
-
"${context}"
|
|
11376
|
-
</user-input>
|
|
11377
|
-
|
|
11378
|
-
<intent-rules>
|
|
11379
|
-
ANALYZE the user's intent before acting. Classify into ONE:
|
|
11380
|
-
ABORT \u2192 stop current work, confirm with \`ask_user\`
|
|
11381
|
-
CORRECTION \u2192 adjust approach, continue
|
|
11382
|
-
INFORMATION \u2192 store and USE immediately (credentials, paths, hints)
|
|
11383
|
-
COMMAND \u2192 execute EXACTLY what was asked, nothing more
|
|
11384
|
-
TARGET_CHANGE \u2192 \`add_target\`, then begin testing
|
|
11385
|
-
GUIDANCE \u2192 acknowledge via \`ask_user\`, adjust strategy, continue
|
|
11386
|
-
STATUS_QUERY \u2192 report via \`ask_user\`, then RESUME previous work
|
|
11387
|
-
CONVERSATION \u2192 respond via \`ask_user\`, do NOT scan or attack
|
|
11388
|
-
|
|
11389
|
-
RULES:
|
|
11390
|
-
- No target set and none provided \u2192 \`ask_user\` to request target.
|
|
11391
|
-
- Conversation or greeting \u2192 respond conversationally, do NOT attack.
|
|
11392
|
-
- Uncertain intent \u2192 ask for clarification with \`ask_user\`.
|
|
11393
|
-
- This is a collaborative tool. The user is your partner.
|
|
11394
|
-
</intent-rules>`
|
|
11395
|
-
};
|
|
11396
|
-
var PROMPT_CONFIG = {
|
|
11397
|
-
ENCODING: "utf-8"
|
|
11398
|
-
};
|
|
11399
|
-
var INITIAL_TASKS = {
|
|
11400
|
-
RECON: "Initial reconnaissance and target discovery"
|
|
11401
|
-
};
|
|
11402
|
-
var CONTEXT_EXTRACTOR_PROMPT = `You are extracting actionable intelligence from a penetration testing session.
|
|
11403
|
-
DO NOT simply summarize or shorten. EXTRACT critical facts:
|
|
11404
|
-
|
|
11405
|
-
1. DISCOVERED: Services, versions, paths, parameters (exact IPs, ports, versions)
|
|
11406
|
-
2. CONFIRMED: Vulnerabilities or access confirmed
|
|
11407
|
-
3. CREDENTIALS: Usernames, passwords, tokens, keys
|
|
11408
|
-
4. DEAD ENDS: What failed \u2014 include EXACT command, tool, arguments, wordlist/file used.
|
|
11409
|
-
Distinguish between:
|
|
11410
|
-
- "This approach itself is impossible" (e.g., SSH key-only \u2192 no password brute force works)
|
|
11411
|
-
- "This specific attempt failed" (e.g., sqlmap with default tamper \u2192 try different tamper)
|
|
11412
|
-
5. OPEN LEADS: Unexplored paths worth pursuing
|
|
11413
|
-
|
|
11414
|
-
Every line must include exact commands/tools/files used.
|
|
11415
|
-
The reader must be able to judge whether a retry with different parameters is worthwhile.`;
|
|
11416
|
-
var REFLECTION_PROMPT = `You are a tactical reviewer for a penetration testing agent.
|
|
11417
|
-
Review ALL actions from this turn \u2014 successes AND failures.
|
|
11418
|
-
|
|
11419
|
-
1. ASSESSMENT: What did this turn accomplish? Rate: HIGH / MED / LOW / NONE.
|
|
11420
|
-
2. SUCCESSES: What worked? Can this pattern be replicated elsewhere?
|
|
11421
|
-
3. FAILURES: What failed? Is this a repeated pattern? If so \u2192 STOP this approach.
|
|
11422
|
-
4. BLIND SPOTS: What was missed or overlooked?
|
|
11423
|
-
5. NEXT PRIORITY: Single most valuable next action.
|
|
11424
|
-
|
|
11425
|
-
3-5 lines. Every word must be actionable.`;
|
|
11426
|
-
var SUMMARY_REGENERATOR_PROMPT = `Update this penetration testing session summary with the new turn data.
|
|
11427
|
-
|
|
11428
|
-
Must include:
|
|
11429
|
-
- All discovered hosts, services, versions (exact IPs, ports, software versions)
|
|
11430
|
-
- All confirmed vulnerabilities
|
|
11431
|
-
- All obtained credentials
|
|
11432
|
-
- Failed attempts with EXACT commands/tools/arguments/files used.
|
|
11433
|
-
For each failure, state:
|
|
11434
|
-
- The root cause (auth method? WAF? patched? wrong params?)
|
|
11435
|
-
- Whether retrying with different parameters could work
|
|
11436
|
-
- Top unexplored leads
|
|
11437
|
-
|
|
11438
|
-
Remove outdated/superseded info. Keep concise but COMPLETE.
|
|
11439
|
-
The reader must be able to decide what to retry and what to never attempt again.`;
|
|
11440
|
-
|
|
11441
11461
|
// src/shared/constants/scoring.ts
|
|
11442
11462
|
var ATTACK_SCORING = {
|
|
11443
11463
|
/** Base score for all attack prioritization */
|
|
@@ -11822,15 +11842,15 @@ var CORE_KNOWLEDGE_FILES = [
|
|
|
11822
11842
|
// Active Directory / infrastructure attack methodology
|
|
11823
11843
|
];
|
|
11824
11844
|
var PHASE_TECHNIQUE_MAP = {
|
|
11825
|
-
[PHASES.RECON]: [
|
|
11826
|
-
[PHASES.VULN_ANALYSIS]: [
|
|
11827
|
-
[PHASES.EXPLOIT]: [
|
|
11828
|
-
[PHASES.POST_EXPLOIT]: [
|
|
11829
|
-
[PHASES.PRIV_ESC]: [
|
|
11830
|
-
[PHASES.LATERAL]: [
|
|
11831
|
-
[PHASES.PERSISTENCE]: [
|
|
11832
|
-
[PHASES.EXFIL]: [
|
|
11833
|
-
[PHASES.WEB]: [
|
|
11845
|
+
[PHASES.RECON]: [TECHNIQUE_FILES.NETWORK_SVC, TECHNIQUE_FILES.SHELLS, TECHNIQUE_FILES.CRYPTO],
|
|
11846
|
+
[PHASES.VULN_ANALYSIS]: [TECHNIQUE_FILES.INJECTION, TECHNIQUE_FILES.NETWORK_SVC, TECHNIQUE_FILES.FILE_ATTACKS, TECHNIQUE_FILES.CRYPTO, TECHNIQUE_FILES.REVERSING],
|
|
11847
|
+
[PHASES.EXPLOIT]: [TECHNIQUE_FILES.INJECTION, TECHNIQUE_FILES.SHELLS, TECHNIQUE_FILES.FILE_ATTACKS, TECHNIQUE_FILES.NETWORK_SVC, TECHNIQUE_FILES.PWN, TECHNIQUE_FILES.CONTAINER_ESCAPE, TECHNIQUE_FILES.SANDBOX_ESCAPE, TECHNIQUE_FILES.REVERSING],
|
|
11848
|
+
[PHASES.POST_EXPLOIT]: [TECHNIQUE_FILES.PRIVESC, TECHNIQUE_FILES.LATERAL, TECHNIQUE_FILES.AUTH_ACCESS, TECHNIQUE_FILES.SHELLS, TECHNIQUE_FILES.CONTAINER_ESCAPE, TECHNIQUE_FILES.SANDBOX_ESCAPE, TECHNIQUE_FILES.FORENSICS],
|
|
11849
|
+
[PHASES.PRIV_ESC]: [TECHNIQUE_FILES.PRIVESC, TECHNIQUE_FILES.AUTH_ACCESS, TECHNIQUE_FILES.SHELLS, TECHNIQUE_FILES.PWN, TECHNIQUE_FILES.CONTAINER_ESCAPE, TECHNIQUE_FILES.SANDBOX_ESCAPE],
|
|
11850
|
+
[PHASES.LATERAL]: [TECHNIQUE_FILES.LATERAL, TECHNIQUE_FILES.AD_ATTACK, TECHNIQUE_FILES.AUTH_ACCESS, TECHNIQUE_FILES.CONTAINER_ESCAPE, TECHNIQUE_FILES.NETWORK_SVC],
|
|
11851
|
+
[PHASES.PERSISTENCE]: [TECHNIQUE_FILES.SHELLS, TECHNIQUE_FILES.PRIVESC, TECHNIQUE_FILES.LATERAL],
|
|
11852
|
+
[PHASES.EXFIL]: [TECHNIQUE_FILES.LATERAL, TECHNIQUE_FILES.NETWORK_SVC, TECHNIQUE_FILES.FORENSICS],
|
|
11853
|
+
[PHASES.WEB]: [TECHNIQUE_FILES.INJECTION, TECHNIQUE_FILES.FILE_ATTACKS, TECHNIQUE_FILES.AUTH_ACCESS, TECHNIQUE_FILES.CRYPTO, TECHNIQUE_FILES.SHELLS],
|
|
11834
11854
|
[PHASES.REPORT]: []
|
|
11835
11855
|
// Report phase: no attack techniques needed
|
|
11836
11856
|
};
|