pwn 0.5.615 → 0.5.618
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.
- checksums.yaml +4 -4
- data/README.md +109 -85
- data/README.md.bak +200 -0
- data/bin/pwn +47 -2
- data/bin/pwn_gqrx_scanner +75 -18
- data/documentation/AI-Integration.md +42 -26
- data/documentation/AWS.md +57 -0
- data/documentation/Agent-Tool-Registry.md +56 -0
- data/documentation/Banner.md +17 -0
- data/documentation/Blockchain.md +18 -0
- data/documentation/Bounty.md +21 -0
- data/documentation/BurpSuite.md +41 -16
- data/documentation/CLI-Drivers.md +58 -0
- data/documentation/Configuration.md +66 -0
- data/documentation/Contributing.md +33 -19
- data/documentation/Cron.md +47 -0
- data/documentation/Diagrams.md +123 -40
- data/documentation/Drivers.md +43 -16
- data/documentation/Extrospection.md +54 -0
- data/documentation/FFI.md +14 -0
- data/documentation/Fuzzing.md +36 -0
- data/documentation/General-PWN-Usage.md +50 -30
- data/documentation/Hardware.md +40 -0
- data/documentation/Home.md +78 -51
- data/documentation/How-PWN-Works.md +59 -57
- data/documentation/Installation.md +53 -28
- data/documentation/Metasploit.md +34 -0
- data/documentation/NmapIt.md +18 -12
- data/documentation/PWN.png +0 -0
- data/documentation/PWN_Contributors_and_Users.png +0 -0
- data/documentation/Persistence.md +38 -0
- data/documentation/Plugins.md +97 -47
- data/documentation/Reporting.md +25 -18
- data/documentation/SAST.md +39 -22
- data/documentation/SDR.md +40 -0
- data/documentation/Sessions.md +39 -0
- data/documentation/Skills-Memory-Learning.md +49 -29
- data/documentation/Swarm.md +71 -0
- data/documentation/Transparent-Browser.md +26 -22
- data/documentation/Troubleshooting.md +44 -25
- data/documentation/WWW.md +32 -0
- data/documentation/What-is-PWN.md +51 -32
- data/documentation/Why-PWN.md +41 -11
- data/documentation/diagrams/agent-tool-registry.svg +284 -0
- data/documentation/diagrams/ai-integration-tool-calling.svg +141 -103
- data/documentation/diagrams/aws-cloud-security.svg +166 -0
- data/documentation/diagrams/build.sh +20 -0
- data/documentation/diagrams/burp-vs-zap-preference.svg +47 -62
- data/documentation/diagrams/code-scanning-sast.svg +139 -79
- data/documentation/diagrams/cron-scheduling.svg +148 -0
- data/documentation/diagrams/dot/_THEME.md +27 -0
- data/documentation/diagrams/dot/agent-tool-registry.dot +59 -0
- data/documentation/diagrams/dot/ai-integration-tool-calling.dot +47 -20
- data/documentation/diagrams/dot/aws-cloud-security.dot +48 -0
- data/documentation/diagrams/dot/burp-vs-zap-preference.dot +23 -12
- data/documentation/diagrams/dot/code-scanning-sast.dot +46 -18
- data/documentation/diagrams/dot/cron-scheduling.dot +40 -0
- data/documentation/diagrams/dot/driver-framework.dot +36 -14
- data/documentation/diagrams/dot/extrospection-world-awareness.dot +55 -0
- data/documentation/diagrams/dot/fuzzing-workflow.dot +44 -24
- data/documentation/diagrams/dot/hardware-hacking.dot +48 -0
- data/documentation/diagrams/dot/history-to-drivers.dot +31 -17
- data/documentation/diagrams/dot/memory-skills-detailed.dot +57 -25
- data/documentation/diagrams/dot/network-infra-testing.dot +51 -19
- data/documentation/diagrams/dot/overall-pwn-architecture.dot +110 -44
- data/documentation/diagrams/dot/penetration-testing-workflow.dot +56 -25
- data/documentation/diagrams/dot/persistence-filesystem.dot +29 -0
- data/documentation/diagrams/dot/plugin-ecosystem.dot +41 -27
- data/documentation/diagrams/dot/pwn-ai-feedback-learning-loop.dot +87 -46
- data/documentation/diagrams/dot/pwn-repl-prototyping.dot +49 -30
- data/documentation/diagrams/dot/reporting-pipeline.dot +43 -14
- data/documentation/diagrams/dot/reverse-engineering-flow.dot +40 -18
- data/documentation/diagrams/dot/sdr-radio-flow.dot +45 -0
- data/documentation/diagrams/dot/sessions-cron-automation.dot +41 -14
- data/documentation/diagrams/dot/swarm-multi-agent.dot +70 -0
- data/documentation/diagrams/dot/web-application-testing.dot +45 -23
- data/documentation/diagrams/dot/zero-day-research-flow.dot +46 -24
- data/documentation/diagrams/driver-framework.svg +87 -66
- data/documentation/diagrams/extrospection-world-awareness.svg +185 -0
- data/documentation/diagrams/fuzzing-workflow.svg +128 -115
- data/documentation/diagrams/hardware-hacking.svg +163 -0
- data/documentation/diagrams/history-to-drivers.svg +84 -82
- data/documentation/diagrams/memory-skills-detailed.svg +167 -119
- data/documentation/diagrams/network-infra-testing.svg +146 -84
- data/documentation/diagrams/overall-pwn-architecture.svg +356 -185
- data/documentation/diagrams/penetration-testing-workflow.svg +161 -108
- data/documentation/diagrams/persistence-filesystem.svg +174 -0
- data/documentation/diagrams/plugin-ecosystem.svg +225 -121
- data/documentation/diagrams/pwn-ai-feedback-learning-loop.svg +257 -185
- data/documentation/diagrams/pwn-repl-prototyping.svg +126 -137
- data/documentation/diagrams/reporting-pipeline.svg +128 -68
- data/documentation/diagrams/reverse-engineering-flow.svg +100 -80
- data/documentation/diagrams/sdr-radio-flow.svg +146 -0
- data/documentation/diagrams/sessions-cron-automation.svg +112 -68
- data/documentation/diagrams/swarm-multi-agent.svg +225 -0
- data/documentation/diagrams/web-application-testing.svg +136 -100
- data/documentation/diagrams/zero-day-research-flow.svg +116 -112
- data/documentation/fax-spectrogram.png +0 -0
- data/documentation/fax-waveform.png +0 -0
- data/documentation/pwn-REPL.md +40 -24
- data/documentation/pwn-ai-Agent.md +59 -30
- data/documentation/pwn_android_war_dialer_session.png +0 -0
- data/documentation/pwn_install.png +0 -0
- data/documentation/pwn_wallpaper.jpg +0 -0
- data/documentation/ringing-spectrogram.png +0 -0
- data/documentation/ringing-waveform.png +0 -0
- data/git_commit.sh +1 -1
- data/lib/pwn/ai/agent/assembly.rb +1 -1
- data/lib/pwn/ai/agent/btc.rb +1 -1
- data/lib/pwn/ai/agent/burp_suite.rb +1 -1
- data/lib/pwn/ai/agent/extrospection.rb +618 -0
- data/lib/pwn/ai/agent/gqrx.rb +2 -2
- data/lib/pwn/ai/agent/hacker_one.rb +1 -1
- data/lib/pwn/ai/agent/introspection.rb +91 -0
- data/lib/pwn/ai/agent/learning.rb +6 -4
- data/lib/pwn/ai/agent/loop.rb +15 -0
- data/lib/pwn/ai/agent/prompt_builder.rb +10 -1
- data/lib/pwn/ai/agent/sast.rb +1 -1
- data/lib/pwn/ai/agent/swarm.rb +437 -0
- data/lib/pwn/ai/agent/tools/cron.rb +163 -0
- data/lib/pwn/ai/agent/tools/extrospection.rb +280 -0
- data/lib/pwn/ai/agent/tools/learning.rb +108 -0
- data/lib/pwn/ai/agent/tools/memory.rb +27 -0
- data/lib/pwn/ai/agent/tools/metrics.rb +61 -0
- data/lib/pwn/ai/agent/tools/sessions.rb +139 -0
- data/lib/pwn/ai/agent/tools/skills.rb +30 -0
- data/lib/pwn/ai/agent/tools/swarm.rb +229 -0
- data/lib/pwn/ai/agent/transparent_browser.rb +1 -1
- data/lib/pwn/ai/agent/vuln_gen.rb +2 -2
- data/lib/pwn/ai/agent.rb +3 -0
- data/lib/pwn/ai/anthropic.rb +19 -4
- data/lib/pwn/ai.rb +0 -1
- data/lib/pwn/config.rb +10 -23
- data/lib/pwn/cron.rb +16 -7
- data/lib/pwn/plugins/repl.rb +90 -281
- data/lib/pwn/sdr/decoder/base.rb +251 -0
- data/lib/pwn/sdr/decoder/gsm.rb +84 -185
- data/lib/pwn/sdr/decoder/pocsag.rb +62 -217
- data/lib/pwn/sdr/decoder.rb +1 -0
- data/lib/pwn/sdr/gqrx.rb +446 -65
- data/lib/pwn/version.rb +1 -1
- data/spec/lib/pwn/ai/agent/extrospection_spec.rb +15 -0
- data/spec/lib/pwn/ai/agent/introspection_spec.rb +15 -0
- data/spec/lib/pwn/ai/agent/swarm_spec.rb +34 -0
- data/spec/lib/pwn/ai/agent/tools/cron_spec.rb +40 -0
- data/spec/lib/pwn/ai/agent/tools/extrospection_spec.rb +40 -0
- data/spec/lib/pwn/ai/agent/tools/metrics_spec.rb +20 -0
- data/spec/lib/pwn/ai/agent/tools/sessions_spec.rb +35 -0
- data/spec/lib/pwn/ai/agent/tools/swarm_spec.rb +17 -0
- data/spec/lib/pwn/{ai/introspection_spec.rb → sdr/decoder/base_spec.rb} +3 -3
- data/third_party/pwn_rdoc.jsonl +199 -37
- metadata +65 -3
- data/lib/pwn/ai/introspection.rb +0 -76
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Sessions — Transcript Persistence
|
|
2
|
+
|
|
3
|
+
Every `pwn-ai` conversation (top-level *and* per-persona in a Swarm) is
|
|
4
|
+
appended as JSON-per-line to `~/.pwn/sessions/<id>.jsonl`.
|
|
5
|
+
|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
## Why keep transcripts?
|
|
9
|
+
|
|
10
|
+
- `learning_reflect(session_id:)` mines them for durable lessons → Memory.
|
|
11
|
+
- `learning_distill_skill(name:, session_id:)` turns a winning run into a
|
|
12
|
+
reusable Skill.
|
|
13
|
+
- `sessions_view` lets you (or a later agent) re-read exactly what happened.
|
|
14
|
+
- Swarm maps each persona to its own session so its private context survives
|
|
15
|
+
across `agent_ask` calls.
|
|
16
|
+
|
|
17
|
+
## Tools
|
|
18
|
+
|
|
19
|
+
| Tool | Purpose |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `sessions_current` | The id *this* conversation is being written to |
|
|
22
|
+
| `sessions_list(limit:)` | Newest-first index (id · size · mtime · lines) |
|
|
23
|
+
| `sessions_view(session_id:, truncate:)` | Read entries |
|
|
24
|
+
| `sessions_delete(session_id:)` | Prune noisy/dev transcripts so `reflect` corpus stays clean |
|
|
25
|
+
| `sessions_stats` | totals across the whole directory |
|
|
26
|
+
|
|
27
|
+
## File format
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{"role":"system","ts":"2026-07-07T22:08:02Z","content":"…"}
|
|
31
|
+
{"role":"user","ts":"…","content":"…"}
|
|
32
|
+
{"role":"assistant","ts":"…","content":"…","tool_calls":[…]}
|
|
33
|
+
{"role":"tool","ts":"…","name":"shell","content":"…"}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**See also:** [Skills, Memory & Learning](Skills-Memory-Learning.md) ·
|
|
37
|
+
[Swarm](Swarm.md) · [Persistence](Persistence.md)
|
|
38
|
+
|
|
39
|
+
[← Home](Home.md)
|
|
@@ -1,44 +1,64 @@
|
|
|
1
|
-
# Skills
|
|
1
|
+
# Memory · Skills · Learning · Metrics — Introspection
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The **inward-facing** half of the pwn-ai feedback loop: how the agent measures
|
|
4
|
+
its own performance and turns wins into permanent capability.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+

|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
## The four stores
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
| Store | File | Write tool | Read tool | Injected as |
|
|
11
|
+
|---|---|---|---|---|
|
|
12
|
+
| **Memory** | `memory.json` | `memory_remember` | `memory_recall` | `MEMORY` block — durable facts / prefs / lessons / env |
|
|
13
|
+
| **Skills** | `skills/*.md` | `skill_create` · `learning_distill_skill` | `skill_list` · `skill_view` | `SKILLS` list — reusable procedures + `references:` (CWE/CVE/ATT&CK/NIST/URL) |
|
|
14
|
+
| **Learning** | `learning.jsonl` | `learning_note_outcome` · `learning_reflect` | `learning_outcomes` · `learning_stats` | `LEARNING` block — recent outcomes + success_rate |
|
|
15
|
+
| **Metrics** | `metrics.json` | *automatic* (every Dispatch) | `metrics_summary` | `TOOL EFFECTIVENESS` block — steer tool choice |
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
## The lifecycle of a lesson
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
```text
|
|
20
|
+
1. Dispatch runs a tool → Metrics.record(tool, ok?, ms)
|
|
21
|
+
2. Final answer produced → Learning.auto_reflect(session_id)
|
|
22
|
+
3. Reflect finds a durable insight → Memory.remember(lesson_xxxx, …)
|
|
23
|
+
4. A whole workflow succeeded → Learning.distill_skill(name, session_id, references:)
|
|
24
|
+
5. Next launch: PromptBuilder injects all four blocks → the model already knows.
|
|
25
|
+
```
|
|
16
26
|
|
|
17
|
-
|
|
27
|
+
## Skill file format
|
|
18
28
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
-
|
|
29
|
+
```markdown
|
|
30
|
+
---
|
|
31
|
+
references:
|
|
32
|
+
- CWE-89
|
|
33
|
+
- T1190
|
|
34
|
+
- https://portswigger.net/web-security/sql-injection
|
|
35
|
+
---
|
|
36
|
+
# sqli_union_enum
|
|
23
37
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- `xai_grok_oauth_device_flow`
|
|
38
|
+
1. Confirm injection with `' AND 1=1 --`.
|
|
39
|
+
2. Find column count with `ORDER BY n`.
|
|
40
|
+
3. …
|
|
28
41
|
|
|
29
|
-
##
|
|
42
|
+
## References
|
|
43
|
+
- CWE-89
|
|
44
|
+
- T1190
|
|
45
|
+
```
|
|
30
46
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
47
|
+
`PWN::Config.parse_skill_references` reads both the YAML front-matter **and**
|
|
48
|
+
the `## References` section, deduplicates, and exposes them via
|
|
49
|
+
`skill_view(name)[:references]`.
|
|
34
50
|
|
|
35
|
-
##
|
|
51
|
+
## Housekeeping
|
|
36
52
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
53
|
+
| Tool | When |
|
|
54
|
+
|---|---|
|
|
55
|
+
| `learning_consolidate(max_entries: 200)` | MEMORY block getting long/noisy |
|
|
56
|
+
| `learning_reset(confirm: true)` | dev-experiment noise polluted success_rate |
|
|
57
|
+
| `metrics_reset(confirm: true)` | fixed a broken tool; stale 0 % is misleading |
|
|
58
|
+
| `skill_delete(name)` | auto-distilled skill turned out low-quality |
|
|
59
|
+
| `learning_auto_reflect_toggle(enabled: false)` | during noisy fuzz loops |
|
|
41
60
|
|
|
42
|
-
|
|
61
|
+
**See also:** [Extrospection](Extrospection.md) — the outward-facing half ·
|
|
62
|
+
[Sessions](Sessions.md) · [Persistence](Persistence.md)
|
|
43
63
|
|
|
44
|
-
[
|
|
64
|
+
[← Home](Home.md)
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Swarm — Native Multi-Agent Orchestration
|
|
2
|
+
|
|
3
|
+
`PWN::AI::Agent::Swarm` replaces the legacy `pwn-irc` (inspircd + weechat +
|
|
4
|
+
PRIVMSG) transport with **first-class sub-agents** built directly on
|
|
5
|
+
`PWN::AI::Agent::Loop`. Each persona is a *full* tool-calling agent — Memory,
|
|
6
|
+
Skills, Learning, Metrics and Extrospection all apply — so the
|
|
7
|
+
self-improvement loop covers the whole swarm.
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
## Files
|
|
12
|
+
|
|
13
|
+
| Path | Contains |
|
|
14
|
+
|---|---|
|
|
15
|
+
| `~/.pwn/agents.yml` | Persona registry (name → role/engine/toolsets/max_iters) |
|
|
16
|
+
| `~/.pwn/swarm/<id>/bus.jsonl` | Append-only chat every persona reads/writes |
|
|
17
|
+
| `~/.pwn/swarm/<id>/personas.json` | persona name → `PWN::Sessions` id |
|
|
18
|
+
|
|
19
|
+
No daemon. Cross-session / cross-process communication == another `pwn-ai` (or
|
|
20
|
+
a `PWN::Cron` job) calling `Swarm.ask` with the same `swarm_id`.
|
|
21
|
+
|
|
22
|
+
## Define personas
|
|
23
|
+
|
|
24
|
+
```ruby
|
|
25
|
+
agent_spawn(name: 'red_team',
|
|
26
|
+
role: 'Offensive operator. Propose the most aggressive next step.',
|
|
27
|
+
engine: 'grok',
|
|
28
|
+
toolsets: %w[terminal pwn memory skills extrospection])
|
|
29
|
+
|
|
30
|
+
agent_spawn(name: 'blue_team',
|
|
31
|
+
role: 'Defender. Critique red_team, flag detection risk & OPSEC.',
|
|
32
|
+
engine: 'anthropic',
|
|
33
|
+
toolsets: %w[pwn memory extrospection])
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
> Omit `swarm` from a persona's toolsets to stop it recursively spawning
|
|
37
|
+
> further sub-agents. Recursion is also hard-capped by
|
|
38
|
+
> `PWN::Env[:ai][:agent][:max_depth]` (default 3).
|
|
39
|
+
|
|
40
|
+
## Verbs
|
|
41
|
+
|
|
42
|
+
| Tool | Use for |
|
|
43
|
+
|---|---|
|
|
44
|
+
| `agent_list` | See who's defined |
|
|
45
|
+
| `agent_spawn` | Define / overwrite a persona |
|
|
46
|
+
| `agent_ask(name, request)` | One turn of one persona → reply comes back to *you* |
|
|
47
|
+
| `agent_debate(names, topic, rounds:)` | Round-robin critique — each sees the bus tail |
|
|
48
|
+
| `agent_broadcast(request)` | Fan-out; returns `{name => reply}` for voting |
|
|
49
|
+
| `swarm_bus(swarm_id)` | Tail a bus to inspect a prior/concurrent conversation |
|
|
50
|
+
| `swarm_list` | Find a `swarm_id` to resume |
|
|
51
|
+
|
|
52
|
+
## Example: adversarial exploit review
|
|
53
|
+
|
|
54
|
+
```ruby
|
|
55
|
+
tx = agent_debate(
|
|
56
|
+
names: %w[red_team blue_team exploit_dev],
|
|
57
|
+
topic: 'Target runs Jenkins 2.426.2 on :8080 — plan initial access.',
|
|
58
|
+
rounds: 3
|
|
59
|
+
)
|
|
60
|
+
# later, in a different pwn-ai process:
|
|
61
|
+
agent_ask(name: 'red_team', swarm_id: tx[:swarm_id],
|
|
62
|
+
request: 'blue_team raised WAF concerns — revise the payload.')
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Because each persona can pin a **different engine**, the debate is real model
|
|
66
|
+
diversity, not one model role-playing.
|
|
67
|
+
|
|
68
|
+
**See also:** [pwn-ai Agent](pwn-ai-Agent.md) ·
|
|
69
|
+
[Agent Tool Registry](Agent-Tool-Registry.md) · [Sessions](Sessions.md)
|
|
70
|
+
|
|
71
|
+
[← Home](Home.md)
|
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `PWN::Plugins::TransparentBrowser`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Watir + Selenium wrapper that gives you a real Chrome/Firefox — headless or
|
|
4
|
+
visible — with proxy support, DevTools protocol access, and cookie/console
|
|
5
|
+
capture. It's the traffic source for [BurpSuite](BurpSuite.md), the engine
|
|
6
|
+
under every [`PWN::WWW`](WWW.md) driver, and the agent's go-to for anything
|
|
7
|
+
JS-heavy.
|
|
4
8
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
- Web spidering / crawling
|
|
8
|
-
- JavaScript-heavy application interaction
|
|
9
|
-
- Automated form submission, auth flows
|
|
10
|
-
- Screenshotting, DOM inspection
|
|
11
|
-
- Proxied browsing (pairs excellently with BurpSuite)
|
|
12
|
-
|
|
13
|
-
## Example Calls
|
|
9
|
+
## Open
|
|
14
10
|
|
|
15
11
|
```ruby
|
|
16
|
-
|
|
17
|
-
browser_type: :chrome
|
|
18
|
-
proxy:
|
|
12
|
+
b = PWN::Plugins::TransparentBrowser.open(
|
|
13
|
+
browser_type: :headless, # :chrome | :firefox | :headless | :rest
|
|
14
|
+
proxy: 'http://127.0.0.1:8080',
|
|
15
|
+
with_devtools: true
|
|
19
16
|
)
|
|
20
|
-
browser.goto 'https://target
|
|
21
|
-
|
|
22
|
-
browser.close
|
|
17
|
+
b[:browser].goto 'https://target'
|
|
18
|
+
b[:browser].text_field(name: 'q').set 'pwn'
|
|
23
19
|
```
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
## Useful bits
|
|
22
|
+
|
|
23
|
+
```ruby
|
|
24
|
+
b[:browser].cookies.to_a
|
|
25
|
+
b[:browser].execute_script('return document.title')
|
|
26
|
+
b[:devtools].send_cmd('Network.enable')
|
|
27
|
+
PWN::Plugins::TransparentBrowser.dump_links(browser_obj: b)
|
|
28
|
+
PWN::Plugins::TransparentBrowser.close(browser_obj: b)
|
|
29
|
+
```
|
|
26
30
|
|
|
27
|
-
##
|
|
31
|
+
## `:rest` mode
|
|
28
32
|
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
`browser_type: :rest` returns a `RestClient`-backed object with the same proxy
|
|
34
|
+
plumbing — for APIs where a full browser is overkill.
|
|
31
35
|
|
|
32
|
-
[[
|
|
36
|
+
[← Home](Home.md) · [BurpSuite](BurpSuite.md) · [WWW](WWW.md)
|
|
@@ -1,38 +1,57 @@
|
|
|
1
1
|
# Troubleshooting
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## SHIFT+ENTER submits instead of newline
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
- 502 errors usually mean upstream proxy not listening or crashed. Check with `ps`, `ss -tlnp`, restart via plugin methods.
|
|
5
|
+
`pwn-ai` / `pwn-asm` need the terminal to send a *distinct* code for
|
|
6
|
+
Shift-Enter. Under **tmux** both sides must be configured:
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- Grok uses OAuth device flow (public client) — see `xai_grok_oauth_device_flow` skill.
|
|
15
|
-
- Store credentials via `PWN::Config` or environment as documented.
|
|
8
|
+
```tmux
|
|
9
|
+
# ~/.tmux.conf
|
|
10
|
+
set -s extended-keys on
|
|
11
|
+
set -as terminal-features 'xterm*:extkeys' # replace xterm* with your $TERM
|
|
12
|
+
```
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
Then fully **detach and re-attach** (a `source-file` isn't enough for
|
|
15
|
+
`terminal-features`). Verify with `tmux display -p '#{client_termfeatures}'`
|
|
16
|
+
— it must include `extkeys`.
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
- Run `sudo chown -R $USER:$USER /opt/pwn` if permission issues after install.
|
|
18
|
+
## `502 Bad Gateway` from a proxy plugin
|
|
23
19
|
|
|
24
|
-
|
|
20
|
+
The upstream (Burp/ZAP) isn't listening. Check:
|
|
25
21
|
|
|
26
22
|
```bash
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
# Inside REPL:
|
|
30
|
-
PWN::Config
|
|
31
|
-
PWN::Plugins::PWNLogger
|
|
23
|
+
ps aux | grep -E 'burp|zap'
|
|
24
|
+
ss -tlnp | grep -E ':8080|:1337'
|
|
32
25
|
```
|
|
33
26
|
|
|
34
|
-
|
|
27
|
+
Restart via `PWN::Plugins::BurpSuite.start` / `PWN::Plugins::Zaproxy.start` or
|
|
28
|
+
fix the port in `~/.pwn/config.yml`.
|
|
29
|
+
|
|
30
|
+
## `Psych::DisallowedClass` on cron/agents YAML
|
|
31
|
+
|
|
32
|
+
Fixed in current `PWN::Cron` / `Swarm` — both loaders now pass
|
|
33
|
+
`permitted_classes: [Symbol]`. If you see it, `git pull && rake install`.
|
|
34
|
+
|
|
35
|
+
## Agent stops early ("max iterations")
|
|
36
|
+
|
|
37
|
+
Raise `ai.agent.max_iters` in `~/.pwn/config.yml`, or split the request.
|
|
38
|
+
|
|
39
|
+
## A tool is stuck at 0 % success
|
|
40
|
+
|
|
41
|
+
If you've since fixed the tool, wipe the stale telemetry so it stops steering
|
|
42
|
+
the agent away: `metrics_reset(confirm: true)`.
|
|
43
|
+
|
|
44
|
+
## LLM auth
|
|
45
|
+
|
|
46
|
+
| Engine | Fix |
|
|
47
|
+
|---|---|
|
|
48
|
+
| grok `oauth: true` | first run prints a `https://accounts.x.ai/…` URL — open it, approve, token is cached |
|
|
49
|
+
| ollama | ensure `ollama serve` is running and `base_url:` matches |
|
|
50
|
+
| others | check `key:` under `ai.<engine>` in `~/.pwn/config.yml` |
|
|
51
|
+
|
|
52
|
+
## Diagrams won't rebuild
|
|
35
53
|
|
|
36
|
-
|
|
54
|
+
`sudo apt install graphviz` (need `dot` on `$PATH`), then
|
|
55
|
+
`cd documentation/diagrams && ./build.sh`.
|
|
37
56
|
|
|
38
|
-
[
|
|
57
|
+
[← Home](Home.md)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `PWN::WWW` — Site-Specific Browser Automations
|
|
2
|
+
|
|
3
|
+
21 modules, each a scripted [`TransparentBrowser`](Transparent-Browser.md)
|
|
4
|
+
session against a real site: log in, navigate, scrape, submit.
|
|
5
|
+
Source: `lib/pwn/www/*.rb`.
|
|
6
|
+
|
|
7
|
+
## Modules
|
|
8
|
+
|
|
9
|
+
| Category | Modules |
|
|
10
|
+
|---|---|
|
|
11
|
+
| **Bug bounty** | `HackerOne` · `BugCrowd` · `Synack` · `AppCobaltIO` |
|
|
12
|
+
| **Search / OSINT** | `Google` · `Bing` · `DuckDuckGo` · `Torch` · `WaybackMachine` · `Pastebin` · `Checkip` |
|
|
13
|
+
| **Social** | `Twitter` · `Facebook` · `LinkedIn` · `Youtube` · `Pandora` |
|
|
14
|
+
| **Finance / Work** | `CoinbasePro` · `Paypal` · `TradingView` · `Uber` · `Upwork` |
|
|
15
|
+
|
|
16
|
+
## Pattern
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
b = PWN::WWW::HackerOne.open(browser_type: :headless,
|
|
20
|
+
proxy: 'http://127.0.0.1:8080')
|
|
21
|
+
PWN::WWW::HackerOne.login(browser_obj: b, username: '…', mfa: '…')
|
|
22
|
+
# ... scripted navigation ...
|
|
23
|
+
PWN::WWW::HackerOne.logout(browser_obj: b)
|
|
24
|
+
PWN::Plugins::TransparentBrowser.close(browser_obj: b)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Because traffic goes through TransparentBrowser, you can point `proxy:` at
|
|
28
|
+
[BurpSuite](BurpSuite.md) and passively capture every request the automation
|
|
29
|
+
makes.
|
|
30
|
+
|
|
31
|
+
[← Home](Home.md) · [Transparent-Browser](Transparent-Browser.md) ·
|
|
32
|
+
[Bounty](Bounty.md)
|
|
@@ -1,34 +1,53 @@
|
|
|
1
1
|
# What is PWN
|
|
2
2
|
|
|
3
|
-
PWN (pronounced /pōn/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
3
|
+
**PWN** (pronounced /pōn/ — "pone") is an open-source **offensive-security
|
|
4
|
+
automation framework** and **continuous-security-integration** platform,
|
|
5
|
+
distributed as a Ruby gem.
|
|
6
|
+
|
|
7
|
+
It gives security researchers, red teamers, bug-bounty hunters and DevSecOps
|
|
8
|
+
engineers a single, scriptable surface over the entire offensive toolchain —
|
|
9
|
+
from OSINT and network discovery, through web/cloud/hardware/radio
|
|
10
|
+
exploitation, to reporting and disclosure — and puts a **self-improving,
|
|
11
|
+
tool-calling AI agent** on top of it.
|
|
12
|
+
|
|
13
|
+
## In numbers
|
|
14
|
+
|
|
15
|
+
| Namespace | Count | What it is |
|
|
16
|
+
|---|---|---|
|
|
17
|
+
| `PWN::Plugins::*` | **66** | Wrappers for external + native tooling (Burp, Nmap, Metasploit, Shodan, browsers, serial, …) |
|
|
18
|
+
| `PWN::SAST::*` | **48** | Static-analysis rules across C/Java/Go/Python/Ruby/Scala/PHP/TS |
|
|
19
|
+
| `PWN::AWS::*` | **90** | One module per AWS service for cloud enumeration |
|
|
20
|
+
| `PWN::WWW::*` | **21** | Site-specific browser automations (HackerOne, BugCrowd, Google, LinkedIn, …) |
|
|
21
|
+
| `PWN::SDR::*` | **6** | GQRX, FlipperZero, RFIDler, SonMicro, decoders, band tables |
|
|
22
|
+
| `PWN::AI::*` | **5** engines | OpenAI, Anthropic, Grok (OAuth device-flow), Gemini, Ollama |
|
|
23
|
+
| `bin/pwn_*` | **52** | Headless CLI drivers for CI/CD |
|
|
24
|
+
| Agent toolsets | **10** | terminal · pwn · memory · skills · sessions · learning · metrics · extrospection · cron · swarm |
|
|
25
|
+
|
|
26
|
+
## The three ways to use it
|
|
27
|
+
|
|
28
|
+
1. **`pwn` REPL** — a Pry shell with the whole `PWN::` namespace pre-loaded.
|
|
29
|
+
Prototype an attack chain interactively, one method call at a time.
|
|
30
|
+
2. **`pwn-ai`** — a natural-language TUI (or `pwn --ai "…"` one-shot) where an
|
|
31
|
+
LLM plans and executes those same method calls for you, records what
|
|
32
|
+
worked, and gets better at it.
|
|
33
|
+
3. **`bin/pwn_*` drivers** — thin CLIs over the plugins, for cron and CI/CD.
|
|
34
|
+
|
|
35
|
+
## What makes it different
|
|
36
|
+
|
|
37
|
+
- **Everything is Ruby, everything is a method.** No YAML DSLs, no plugins-in-a-
|
|
38
|
+
black-box. If you can call it in the REPL, the AI agent can call it, a driver
|
|
39
|
+
can call it, and a cron job can call it.
|
|
40
|
+
- **Closed self-improvement loop.** Metrics + Learning (introspection) and
|
|
41
|
+
Snapshot + Drift + Intel (extrospection) feed `extro_correlate`, which tells
|
|
42
|
+
the agent whether a failure was *its* fault or *the world* changed — and
|
|
43
|
+
writes the lesson back into the prompt for next time.
|
|
44
|
+
- **Native multi-agent.** `PWN::AI::Agent::Swarm` runs personas (each a full
|
|
45
|
+
tool-calling agent, optionally on a *different* LLM engine) that debate,
|
|
46
|
+
broadcast and share an append-only bus — no IRC daemon, no external service.
|
|
47
|
+
|
|
48
|
+

|
|
49
|
+
|
|
50
|
+
**Next:** [Why PWN](Why-PWN.md) · [How PWN Works](How-PWN-Works.md) ·
|
|
51
|
+
[Installation](Installation.md)
|
|
52
|
+
|
|
53
|
+
[← Home](Home.md)
|
data/documentation/Why-PWN.md
CHANGED
|
@@ -1,18 +1,48 @@
|
|
|
1
1
|
# Why PWN
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## The problem
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Offensive security is a **toolchain problem**. A single engagement touches
|
|
6
|
+
`nmap`, `burp`, `msfconsole`, a headless browser, `adb`, `gqrx`, three cloud
|
|
7
|
+
consoles, a fuzzer, `radare2`, a spreadsheet of findings, and a bug-bounty
|
|
8
|
+
submission form. Each tool has its own config, its own output format, and its
|
|
9
|
+
own idea of what a "target" is. Gluing them together is 80 % of the job — and
|
|
10
|
+
that glue is rewritten, badly, on every engagement.
|
|
6
11
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- **Collaboration**: Accelerates zero-day discovery and reliable exploit development.
|
|
10
|
-
- **Continuous Security**: Integrates into CI/CD pipelines.
|
|
11
|
-
- **Reusable Intelligence**: AI skills, persistent memory, learning loops.
|
|
12
|
-
- **Accessibility**: Advanced red team / vuln research capabilities available to all.
|
|
12
|
+
Meanwhile, LLM agents are extraordinary at *planning* attack chains but have no
|
|
13
|
+
reliable, auditable way to *execute* them against a real host.
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
## The design bet
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
PWN bets that the right abstraction is **plain Ruby methods with a uniform
|
|
18
|
+
`opts = {}` signature**, exposed simultaneously to:
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
- a human in a REPL,
|
|
21
|
+
- an LLM in a tool-calling loop,
|
|
22
|
+
- a shell script in CI,
|
|
23
|
+
- a cron job at 3 am.
|
|
24
|
+
|
|
25
|
+
Because every capability is a method, the same line of code works in all four
|
|
26
|
+
contexts. Because every method is open-source Ruby, it's auditable — critical
|
|
27
|
+
when the caller is an autonomous agent.
|
|
28
|
+
|
|
29
|
+
## Why open primitives matter
|
|
30
|
+
|
|
31
|
+
| Closed / black-box | PWN |
|
|
32
|
+
|---|---|
|
|
33
|
+
| "Trust our scanner" | `cat lib/pwn/sast/sql.rb` — read the regex yourself |
|
|
34
|
+
| Per-seat licence for the glue | MIT-licensed glue; bring your own Burp Pro / Nessus key |
|
|
35
|
+
| Agent output is a PDF | Agent output is a `PWN::Reports` object *and* a distilled skill *and* a memory entry |
|
|
36
|
+
| One vendor's model | Five interchangeable engines; swarm can pit them against each other |
|
|
37
|
+
|
|
38
|
+
## Why the self-improvement loop matters
|
|
39
|
+
|
|
40
|
+
A pentest framework that doesn't learn repeats the same dead-end scans forever.
|
|
41
|
+
PWN records **per-tool success rate**, **per-task outcome**, **host drift**,
|
|
42
|
+
and **external CVE intel**, then correlates them so tomorrow's run starts where
|
|
43
|
+
today's finished. See [Skills, Memory & Learning](Skills-Memory-Learning.md)
|
|
44
|
+
and [Extrospection](Extrospection.md).
|
|
45
|
+
|
|
46
|
+
**Next:** [How PWN Works](How-PWN-Works.md)
|
|
47
|
+
|
|
48
|
+
[← Home](Home.md)
|