pentesting 0.56.8 → 0.70.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/README.md +2 -2
- package/dist/{chunk-CQP3HGEW.js → chunk-FRZJJB6X.js} +16 -0
- package/dist/main.js +5109 -4374
- package/dist/{process-registry-LAAAYEWU.js → process-registry-P22TUNRK.js} +1 -1
- package/dist/prompts/offensive-playbook.md +81 -0
- package/dist/prompts/strategist-system.md +34 -0
- package/dist/prompts/techniques/ad-attack.md +114 -9
- package/dist/prompts/techniques/auth-access.md +165 -21
- package/dist/prompts/techniques/enterprise-pentest.md +175 -0
- package/dist/prompts/techniques/injection.md +4 -0
- package/dist/prompts/techniques/network-svc.md +4 -0
- package/dist/prompts/techniques/pivoting.md +205 -0
- package/dist/prompts/techniques/privesc.md +4 -0
- package/dist/prompts/techniques/pwn.md +187 -3
- package/dist/prompts/techniques/shells.md +4 -0
- package/dist/prompts/zero-day.md +125 -0
- package/package.json +4 -5
package/dist/prompts/zero-day.md
CHANGED
|
@@ -170,3 +170,128 @@ DISCOVERY → SEARCH → ATTACK → ADAPT → CHAIN → PIVOT → REPEAT
|
|
|
170
170
|
NEVER give up. ALWAYS search. The answer exists on the internet.
|
|
171
171
|
web_search("how to exploit {specific_thing_you_discovered}")
|
|
172
172
|
```
|
|
173
|
+
|
|
174
|
+
## 🎯 Phase C: DEF CON / Enterprise Level
|
|
175
|
+
|
|
176
|
+
### C1: Fuzzing Loop — Write, Compile, Fuzz, Analyze
|
|
177
|
+
```
|
|
178
|
+
When dealing with compiled targets or custom protocols:
|
|
179
|
+
|
|
180
|
+
AFL++ / LibFuzzer Loop:
|
|
181
|
+
1. write_file("fuzz_target.c", harness_code)
|
|
182
|
+
- Harness: reads from stdin → passes to target function
|
|
183
|
+
- Prototype: int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
|
184
|
+
2. run_cmd("AFL_USE_ASAN=1 afl-cc -o fuzz_target fuzz_target.c -fsanitize=address")
|
|
185
|
+
3. run_cmd("afl-fuzz -i seed_corpus/ -o findings/ -- ./fuzz_target @@")
|
|
186
|
+
4. Monitor: run_cmd("afl-whatsup findings/") → crash rate, path coverage
|
|
187
|
+
5. Triage: run_cmd("afl-cmin -i findings/ -o min/ -- ./fuzz_target @@")
|
|
188
|
+
6. Analyze: for crash in findings/crashes/*; do
|
|
189
|
+
ASAN_OPTIONS=symbolize=1 ./fuzz_target $crash
|
|
190
|
+
done
|
|
191
|
+
7. Root cause → write exploit
|
|
192
|
+
|
|
193
|
+
Network Fuzzer (custom protocol):
|
|
194
|
+
write_file("fuzzer.py", """
|
|
195
|
+
import socket, itertools, random
|
|
196
|
+
def mutate(data): # bit flip, byte replace, insert/delete
|
|
197
|
+
...
|
|
198
|
+
for payload in corpus:
|
|
199
|
+
s = socket.connect(HOST, PORT)
|
|
200
|
+
s.send(mutate(payload))
|
|
201
|
+
response = s.recv(1024)
|
|
202
|
+
if unusual(response): log(payload, response)
|
|
203
|
+
""")
|
|
204
|
+
run_cmd("python3 fuzzer.py")
|
|
205
|
+
|
|
206
|
+
web_search("AFL++ tutorial custom protocol fuzzing {year}")
|
|
207
|
+
web_search("libfuzzer harness writing guide {binary_type}")
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### C2: Patch Diffing → N-Day/1-Day Exploitation
|
|
211
|
+
```
|
|
212
|
+
When target is slightly behind on patches:
|
|
213
|
+
|
|
214
|
+
1. Identify version: banner, file metadata, build strings
|
|
215
|
+
2. Find next patched version:
|
|
216
|
+
web_search("{software} {version} → {next_version} security changelog")
|
|
217
|
+
web_search("{software} CVE {year} patch commit")
|
|
218
|
+
3. If open source → diff:
|
|
219
|
+
git clone {repo}
|
|
220
|
+
git diff v{old_version} v{new_version} -- {likely_vuln_files}
|
|
221
|
+
→ Look for: bounds checks added, condition added before dangerous call
|
|
222
|
+
4. Understand the vulnerability class from the diff
|
|
223
|
+
5. Craft exploit targeting the exact unfixed version
|
|
224
|
+
6. Test locally with same version → adapt to remote
|
|
225
|
+
|
|
226
|
+
Patch diffing tools:
|
|
227
|
+
├── bindiff (IDA plugin): binary-level diff between versions
|
|
228
|
+
├── diaphora (free alternative): similar to bindiff
|
|
229
|
+
├── patchdiff2: older but works
|
|
230
|
+
└── web_search("bindiff tutorial patch diffing binary exploitation")
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### C3: Variant Hunting — Known Bug Class, Unknown Instances
|
|
234
|
+
```
|
|
235
|
+
Once you find ONE vulnerability, hunt for variants:
|
|
236
|
+
|
|
237
|
+
Source code search:
|
|
238
|
+
grep -rn "same_dangerous_pattern" src/
|
|
239
|
+
grep -rn "similar_function_name" --include="*.c" .
|
|
240
|
+
|
|
241
|
+
Binary variant hunting:
|
|
242
|
+
├── If SQLi here → test ALL similar parameters in ALL endpoints
|
|
243
|
+
├── If UAF in module A → check module B's dealloc order
|
|
244
|
+
├── If path traversal in /upload → test /backup, /export, /download
|
|
245
|
+
|
|
246
|
+
IDOR/Logic flaw variants:
|
|
247
|
+
├── Found IDOR on id= → test: user_id= order_id= doc_id= ref= token=
|
|
248
|
+
├── Found admin bypass via X-Role header → test ALL other privilege endpoints
|
|
249
|
+
└── Found TOCTOU in open() → check other syscall pairs: stat()+open(), lstat()+open()
|
|
250
|
+
|
|
251
|
+
Automated variant search:
|
|
252
|
+
write_file("variant_hunter.py", """
|
|
253
|
+
import requests
|
|
254
|
+
ENDPOINTS = ['/api/v1/user', '/api/v1/order', '/api/v2/...']
|
|
255
|
+
PAYLOADS = [...] # from original finding
|
|
256
|
+
for ep in ENDPOINTS:
|
|
257
|
+
for p in PAYLOADS:
|
|
258
|
+
r = requests.get(f'BASE_URL{ep}', params=p)
|
|
259
|
+
if r.status_code != 403:
|
|
260
|
+
print(f'POTENTIAL: {ep} {p} → {r.status_code}')
|
|
261
|
+
""")
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### C4: Enterprise Internal Network
|
|
265
|
+
```
|
|
266
|
+
Initial foothold → internal network playbook:
|
|
267
|
+
|
|
268
|
+
SEGMENT DISCOVERY:
|
|
269
|
+
├── ip route + arp -a + netstat → map known segments
|
|
270
|
+
├── Scan adjacent /24 blocks: nmap -sn 10.{1..20}.0.0/24
|
|
271
|
+
├── DNS enumeration: for i in $(seq 1 254); do host 10.x.x.$i; done
|
|
272
|
+
└── SNMP sweep: onesixtyone -c community.txt -i targets.txt
|
|
273
|
+
|
|
274
|
+
CRITICAL INTERNAL SERVICES TO FIND:
|
|
275
|
+
├── Active Directory DC: 88/TCP (Kerberos), 389/389 (LDAP), 636 (LDAPS)
|
|
276
|
+
├── SCCM/WSUS: 8530/HTTP → privilege escalation paths
|
|
277
|
+
├── Exchange/Mail: 25/443 → phishing from internal, relay attacks
|
|
278
|
+
├── Corporate CA: 80 (web enrollment) → ADCS attacks
|
|
279
|
+
├── Jump hosts/bastion: SSH/RDP → lateral movement hub
|
|
280
|
+
├── Prod databases: 1433/3306/5432 → credential reuse + data dump
|
|
281
|
+
├── DevOps infra: 8080(Jenkins)/9090(Prometheus)/9000(SonarQube)
|
|
282
|
+
│ → often weak auth → code execution
|
|
283
|
+
└── Cloud endpoints: 169.254.169.254 (AWS/Azure metadata) → IAM creds
|
|
284
|
+
|
|
285
|
+
AD FOREST ATTACKS:
|
|
286
|
+
├── Forest trust → SID history → Enterprise Admin across forests
|
|
287
|
+
├── External trusts → kerberoast across trust → crack → access other domain
|
|
288
|
+
└── web_search("active directory forest trust attack SID filtering bypass {year}")
|
|
289
|
+
|
|
290
|
+
CLOUD PIVOT (when enterprise uses hybrid):
|
|
291
|
+
├── From on-prem → find AWS/Azure creds in env vars, files, secrets managers
|
|
292
|
+
│ env | grep -i aws/azure/gcp/secret
|
|
293
|
+
│ find / -name "*.env" -o -name "credentials" -o -name "*.pem" 2>/dev/null
|
|
294
|
+
├── AWS: aws sts get-caller-identity → role → escalate via misconfigured policies
|
|
295
|
+
├── Azure: az account list → subscriptions → VMs → managed identity → creds
|
|
296
|
+
└── web_search("cloud privilege escalation {provider} misconfiguration {year}")
|
|
297
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pentesting",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.70.2",
|
|
4
4
|
"description": "Autonomous Penetration Testing AI Agent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|
|
13
13
|
"skills",
|
|
14
|
-
"src/agents/specs",
|
|
15
14
|
"README.md"
|
|
16
15
|
],
|
|
17
16
|
"scripts": {
|
|
@@ -19,7 +18,7 @@
|
|
|
19
18
|
"dev:tsx": "tsx src/platform/tui/main.tsx",
|
|
20
19
|
"build": "tsup",
|
|
21
20
|
"start": "node dist/main.js",
|
|
22
|
-
"test": "mkdir -p .vitest && TMPDIR=.vitest vitest run && rm -rf .vitest .pentesting",
|
|
21
|
+
"test": "mkdir -p .vitest && TMPDIR=.vitest npx vitest run && rm -rf .vitest .pentesting",
|
|
23
22
|
"test:watch": "vitest",
|
|
24
23
|
"lint": "tsc --noEmit",
|
|
25
24
|
"prepublishOnly": "npm run build",
|
|
@@ -36,9 +35,9 @@
|
|
|
36
35
|
"type": "git",
|
|
37
36
|
"url": "git+https://github.com/agnusdei1207"
|
|
38
37
|
},
|
|
39
|
-
"homepage": "https://
|
|
38
|
+
"homepage": "https://agnusdei1207.github.io/brainscience/",
|
|
40
39
|
"bugs": {
|
|
41
|
-
"url": "https://github.
|
|
40
|
+
"url": "https://agnusdei1207.github.io/brainscience/"
|
|
42
41
|
},
|
|
43
42
|
"keywords": [
|
|
44
43
|
"penetration-testing",
|