pwn 0.5.613 → 0.5.617
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/Gemfile +10 -10
- data/README.md +117 -17
- data/bin/pwn +47 -2
- data/bin/pwn_gqrx_scanner +75 -18
- data/documentation/AI-Integration.md +36 -0
- data/documentation/BurpSuite.md +26 -0
- data/documentation/Contributing.md +31 -0
- data/documentation/Diagrams.md +140 -0
- data/documentation/Drivers.md +25 -0
- data/documentation/General-PWN-Usage.md +60 -0
- data/documentation/Home.md +78 -0
- data/documentation/How-PWN-Works.md +62 -0
- data/documentation/Installation.md +75 -0
- data/documentation/NmapIt.md +18 -0
- data/documentation/Plugins.md +59 -0
- data/documentation/Reporting.md +28 -0
- data/documentation/SAST.md +32 -0
- data/documentation/Skills-Memory-Learning.md +44 -0
- data/documentation/Transparent-Browser.md +32 -0
- data/documentation/Troubleshooting.md +38 -0
- data/documentation/What-is-PWN.md +53 -0
- data/documentation/Why-PWN.md +48 -0
- data/documentation/diagrams/ai-integration-tool-calling.svg +172 -0
- data/documentation/diagrams/build.sh +20 -0
- data/documentation/diagrams/burp-vs-zap-preference.svg +69 -0
- data/documentation/diagrams/code-scanning-sast.svg +172 -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 +50 -0
- data/documentation/diagrams/dot/aws-cloud-security.dot +48 -0
- data/documentation/diagrams/dot/burp-vs-zap-preference.dot +26 -0
- data/documentation/diagrams/dot/code-scanning-sast.dot +49 -0
- data/documentation/diagrams/dot/cron-scheduling.dot +40 -0
- data/documentation/diagrams/dot/driver-framework.dot +39 -0
- data/documentation/diagrams/dot/extrospection-world-awareness.dot +55 -0
- data/documentation/diagrams/dot/fuzzing-workflow.dot +47 -0
- data/documentation/diagrams/dot/history-to-drivers.dot +34 -0
- data/documentation/diagrams/dot/memory-skills-detailed.dot +60 -0
- data/documentation/diagrams/dot/network-infra-testing.dot +54 -0
- data/documentation/diagrams/dot/overall-pwn-architecture.dot +115 -0
- data/documentation/diagrams/dot/penetration-testing-workflow.dot +60 -0
- data/documentation/diagrams/dot/plugin-ecosystem.dot +45 -0
- data/documentation/diagrams/dot/pwn-ai-feedback-learning-loop.dot +98 -0
- data/documentation/diagrams/dot/pwn-repl-prototyping.dot +56 -0
- data/documentation/diagrams/dot/reporting-pipeline.dot +46 -0
- data/documentation/diagrams/dot/reverse-engineering-flow.dot +43 -0
- data/documentation/diagrams/dot/sdr-radio-flow.dot +45 -0
- data/documentation/diagrams/dot/sessions-cron-automation.dot +44 -0
- data/documentation/diagrams/dot/swarm-multi-agent.dot +70 -0
- data/documentation/diagrams/dot/web-application-testing.dot +49 -0
- data/documentation/diagrams/dot/zero-day-research-flow.dot +49 -0
- data/documentation/diagrams/driver-framework.svg +111 -0
- data/documentation/diagrams/fuzzing-workflow.svg +160 -0
- data/documentation/diagrams/history-to-drivers.svg +119 -0
- data/documentation/diagrams/memory-skills-detailed.svg +202 -0
- data/documentation/diagrams/network-infra-testing.svg +183 -0
- data/documentation/diagrams/overall-pwn-architecture.svg +405 -0
- data/documentation/diagrams/penetration-testing-workflow.svg +201 -0
- data/documentation/diagrams/plugin-ecosystem.svg +276 -0
- data/documentation/diagrams/pwn-ai-feedback-learning-loop.svg +306 -0
- data/documentation/diagrams/pwn-repl-prototyping.svg +168 -0
- data/documentation/diagrams/reporting-pipeline.svg +151 -0
- data/documentation/diagrams/reverse-engineering-flow.svg +134 -0
- data/documentation/diagrams/sessions-cron-automation.svg +136 -0
- data/documentation/diagrams/web-application-testing.svg +173 -0
- data/documentation/diagrams/zero-day-research-flow.svg +153 -0
- data/documentation/pwn-REPL.md +33 -0
- data/documentation/pwn-ai-Agent.md +43 -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 +379 -0
- data/lib/pwn/ai/agent/loop.rb +33 -3
- data/lib/pwn/ai/agent/metrics.rb +155 -0
- data/lib/pwn/ai/agent/prompt_builder.rb +32 -3
- 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 +221 -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 +124 -8
- 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 +5 -0
- data/lib/pwn/ai/anthropic.rb +19 -4
- data/lib/pwn/ai/grok.rb +249 -106
- data/lib/pwn/ai.rb +0 -1
- data/lib/pwn/config.rb +96 -36
- data/lib/pwn/cron.rb +16 -7
- data/lib/pwn/plugins/monkey_patch.rb +2 -2
- data/lib/pwn/plugins/repl.rb +158 -284
- 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/learning_spec.rb +68 -0
- data/spec/lib/pwn/ai/agent/metrics_spec.rb +27 -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/learning_spec.rb +30 -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 +178 -33
- metadata +110 -36
- data/documentation/PWN.png +0 -0
- data/documentation/PWN_Contributors_and_Users.png +0 -0
- data/documentation/fax-spectrogram.png +0 -0
- data/documentation/fax-waveform.png +0 -0
- data/documentation/frozen_string_literal_files_changed_from_false_to_true.txt +0 -54
- data/documentation/lifecycle_authz_replay.example.yaml +0 -27
- 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/documentation/vulnerability_report_template.md +0 -37
- data/lib/pwn/ai/introspection.rb +0 -76
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# PWN Data-Flow Diagrams
|
|
2
|
+
|
|
3
|
+
26 SVG diagrams, all rendered from Graphviz sources in
|
|
4
|
+
[`diagrams/dot/`](diagrams/dot/) with a single shared visual theme
|
|
5
|
+
(see [`_THEME.md`](diagrams/dot/_THEME.md)). Rebuild everything with:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
cd documentation/diagrams && ./build.sh
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Every diagram uses strict layer→layer edges (`newrank=true` + `{rank=same}`
|
|
12
|
+
groups) so lines never criss-cross.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 1 · Architecture
|
|
17
|
+
|
|
18
|
+
### Overall PWN Architecture
|
|
19
|
+
[source](diagrams/dot/overall-pwn-architecture.dot) · doc: [How PWN Works](How-PWN-Works.md)
|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
### `~/.pwn/` Persistence Map
|
|
23
|
+
[source](diagrams/dot/persistence-filesystem.dot) · doc: [Persistence](Persistence.md)
|
|
24
|
+

|
|
25
|
+
|
|
26
|
+
### Plugin Ecosystem (66 modules)
|
|
27
|
+
[source](diagrams/dot/plugin-ecosystem.dot) · doc: [Plugins](Plugins.md)
|
|
28
|
+

|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 2 · Entry Points
|
|
33
|
+
|
|
34
|
+
### `pwn` REPL Prototyping
|
|
35
|
+
[source](diagrams/dot/pwn-repl-prototyping.dot) · doc: [pwn REPL](pwn-REPL.md)
|
|
36
|
+

|
|
37
|
+
|
|
38
|
+
### REPL History → Reusable Driver / Skill
|
|
39
|
+
[source](diagrams/dot/history-to-drivers.dot) · doc: [Drivers](Drivers.md)
|
|
40
|
+

|
|
41
|
+
|
|
42
|
+
### Driver Anatomy (`bin/pwn_*`)
|
|
43
|
+
[source](diagrams/dot/driver-framework.dot) · doc: [CLI Drivers](CLI-Drivers.md)
|
|
44
|
+

|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 3 · AI Agent
|
|
49
|
+
|
|
50
|
+
### pwn-ai Closed Self-Improvement Loop
|
|
51
|
+
[source](diagrams/dot/pwn-ai-feedback-learning-loop.dot) · doc: [Skills, Memory & Learning](Skills-Memory-Learning.md)
|
|
52
|
+

|
|
53
|
+
|
|
54
|
+
### Multi-Provider LLM Integration
|
|
55
|
+
[source](diagrams/dot/ai-integration-tool-calling.dot) · doc: [AI Integration](AI-Integration.md)
|
|
56
|
+

|
|
57
|
+
|
|
58
|
+
### Agent Tool Registry (10 toolsets)
|
|
59
|
+
[source](diagrams/dot/agent-tool-registry.dot) · doc: [Agent Tool Registry](Agent-Tool-Registry.md)
|
|
60
|
+

|
|
61
|
+
|
|
62
|
+
### Memory · Skills · Sessions Detail
|
|
63
|
+
[source](diagrams/dot/memory-skills-detailed.dot) · doc: [Skills, Memory & Learning](Skills-Memory-Learning.md)
|
|
64
|
+

|
|
65
|
+
|
|
66
|
+
### Extrospection — World Awareness
|
|
67
|
+
[source](diagrams/dot/extrospection-world-awareness.dot) · doc: [Extrospection](Extrospection.md)
|
|
68
|
+

|
|
69
|
+
|
|
70
|
+
### Swarm — Native Multi-Agent
|
|
71
|
+
[source](diagrams/dot/swarm-multi-agent.dot) · doc: [Swarm](Swarm.md)
|
|
72
|
+

|
|
73
|
+
|
|
74
|
+
### Cron — Scheduled Jobs
|
|
75
|
+
[source](diagrams/dot/cron-scheduling.dot) · doc: [Cron](Cron.md)
|
|
76
|
+

|
|
77
|
+
|
|
78
|
+
### Sessions ↔ Cron ↔ Swarm Continuity
|
|
79
|
+
[source](diagrams/dot/sessions-cron-automation.dot) · doc: [Sessions](Sessions.md)
|
|
80
|
+

|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 4 · Security Workflows
|
|
85
|
+
|
|
86
|
+
### End-to-End Penetration Test
|
|
87
|
+
[source](diagrams/dot/penetration-testing-workflow.dot)
|
|
88
|
+

|
|
89
|
+
|
|
90
|
+
### Web Application Testing
|
|
91
|
+
[source](diagrams/dot/web-application-testing.dot) · doc: [BurpSuite](BurpSuite.md)
|
|
92
|
+

|
|
93
|
+
|
|
94
|
+
### Burp ⭐ vs ZAP Selection
|
|
95
|
+
[source](diagrams/dot/burp-vs-zap-preference.dot)
|
|
96
|
+

|
|
97
|
+
|
|
98
|
+
### Network & Infrastructure Testing
|
|
99
|
+
[source](diagrams/dot/network-infra-testing.dot) · doc: [NmapIt](NmapIt.md)
|
|
100
|
+

|
|
101
|
+
|
|
102
|
+
### SAST / Code Scanning
|
|
103
|
+
[source](diagrams/dot/code-scanning-sast.dot) · doc: [SAST](SAST.md)
|
|
104
|
+

|
|
105
|
+
|
|
106
|
+
### Fuzzing
|
|
107
|
+
[source](diagrams/dot/fuzzing-workflow.dot) · doc: [Fuzzing](Fuzzing.md)
|
|
108
|
+

|
|
109
|
+
|
|
110
|
+
### Reverse Engineering & Binary Exploitation
|
|
111
|
+
[source](diagrams/dot/reverse-engineering-flow.dot) · doc: [Hardware](Hardware.md)
|
|
112
|
+

|
|
113
|
+
|
|
114
|
+
### Zero-Day Research Lifecycle
|
|
115
|
+
[source](diagrams/dot/zero-day-research-flow.dot)
|
|
116
|
+

|
|
117
|
+
|
|
118
|
+
### Reporting Pipeline
|
|
119
|
+
[source](diagrams/dot/reporting-pipeline.dot) · doc: [Reporting](Reporting.md)
|
|
120
|
+

|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 5 · Domain-Specific
|
|
125
|
+
|
|
126
|
+
### AWS Cloud Security (90 services)
|
|
127
|
+
[source](diagrams/dot/aws-cloud-security.dot) · doc: [AWS](AWS.md)
|
|
128
|
+

|
|
129
|
+
|
|
130
|
+
### SDR / Radio Hacking
|
|
131
|
+
[source](diagrams/dot/sdr-radio-flow.dot) · doc: [SDR](SDR.md)
|
|
132
|
+

|
|
133
|
+
|
|
134
|
+
### Hardware & Physical-Layer
|
|
135
|
+
[source](diagrams/dot/hardware-hacking.dot) · doc: [Hardware](Hardware.md)
|
|
136
|
+

|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
[← Back to Home](Home.md)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Drivers & Custom Automation
|
|
2
|
+
|
|
3
|
+
`PWN::Driver` and the `/opt/pwn/bin/` directory provide patterns for packaging reusable security automation.
|
|
4
|
+
|
|
5
|
+
## What is a Driver?
|
|
6
|
+
|
|
7
|
+
A self-contained Ruby script or gem that:
|
|
8
|
+
- Loads the `pwn` environment
|
|
9
|
+
- Orchestrates multiple plugins, AI calls, or custom logic
|
|
10
|
+
- Can be scheduled via cron or run standalone
|
|
11
|
+
|
|
12
|
+
## Examples
|
|
13
|
+
|
|
14
|
+
Look in `/opt/pwn/bin/` (shipped with the gem).
|
|
15
|
+
|
|
16
|
+
## Creating New Drivers
|
|
17
|
+
|
|
18
|
+
1. Study existing examples in `bin/`.
|
|
19
|
+
2. Use `PWN::Driver` helpers where appropriate.
|
|
20
|
+
3. Leverage the full plugin + AI surface.
|
|
21
|
+
4. Distill recurring successful patterns into **Skills**.
|
|
22
|
+
|
|
23
|
+
Drivers + Skills + Agent = extremely powerful autonomous red teaming / research platform.
|
|
24
|
+
|
|
25
|
+
[[Diagrams]]
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# General Usage — Day-One Cheat Sheet
|
|
2
|
+
|
|
3
|
+
## Launch
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
$ pwn # interactive REPL
|
|
7
|
+
$ pwn --ai "scan 10.0.0.0/24 with NmapIt and summarise open services"
|
|
8
|
+
$ pwn_nmap_discover_tcp_udp -t 10.0.0.0/24 -o out/ # headless driver
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Inside the REPL
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
PWN.help # top-level help
|
|
15
|
+
PWN::Plugins.constants.sort # list all 66 plugins
|
|
16
|
+
PWN::Plugins::NmapIt.help # per-plugin usage
|
|
17
|
+
ls PWN::Plugins::BurpSuite # Pry: list methods
|
|
18
|
+
show-source PWN::SAST::SQL.scan # Pry: read the code
|
|
19
|
+
history # what you've typed → copy into a driver
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Custom REPL commands
|
|
23
|
+
|
|
24
|
+
| Command | Does |
|
|
25
|
+
|---|---|
|
|
26
|
+
| `pwn-ai` | Enter the agent TUI (SHIFT+ENTER = newline, ENTER = submit) |
|
|
27
|
+
| `pwn-asm` | Multi-line assembly ↔ opcode workbench |
|
|
28
|
+
| `pwn-ai-memory` | Inspect / edit `~/.pwn/memory.json` |
|
|
29
|
+
| `pwn-ai-sessions` | List / view / delete transcripts |
|
|
30
|
+
| `pwn-ai-cron` | List / run scheduled jobs |
|
|
31
|
+
| `pwn-ai-delegate` | Hand a task to a Swarm persona |
|
|
32
|
+
| `welcome-banner` | Redraw a random `PWN::Banner` |
|
|
33
|
+
| `toggle-pager` | Pry pager on/off |
|
|
34
|
+
|
|
35
|
+
## A 60-second attack chain
|
|
36
|
+
|
|
37
|
+
```ruby
|
|
38
|
+
# 1. discover
|
|
39
|
+
nmap = PWN::Plugins::NmapIt.port_scan(target: 'scanme.nmap.org')
|
|
40
|
+
|
|
41
|
+
# 2. drive traffic through Burp
|
|
42
|
+
burp = PWN::Plugins::BurpSuite.start(headless: true)
|
|
43
|
+
b = PWN::Plugins::TransparentBrowser.open(
|
|
44
|
+
browser_type: :headless, proxy: 'http://127.0.0.1:8080')
|
|
45
|
+
b[:browser].goto 'http://scanme.nmap.org'
|
|
46
|
+
|
|
47
|
+
# 3. active scan
|
|
48
|
+
scan = PWN::Plugins::BurpSuite.active_scan(burp_obj: burp,
|
|
49
|
+
target_url: 'http://scanme.nmap.org')
|
|
50
|
+
|
|
51
|
+
# 4. report
|
|
52
|
+
PWN::Reports::SAST.generate(dir_path: '/tmp/src', output_dir: '/tmp/out')
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Then say the same thing in English inside `pwn-ai` and watch the agent do it.
|
|
56
|
+
|
|
57
|
+
**Next:** [pwn REPL](pwn-REPL.md) · [pwn-ai Agent](pwn-ai-Agent.md) ·
|
|
58
|
+
[CLI Drivers](CLI-Drivers.md)
|
|
59
|
+
|
|
60
|
+
[← Home](Home.md)
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# PWN Documentation
|
|
2
|
+
|
|
3
|
+
> **PWN** (/pōn/) — an open-source offensive-security automation framework and
|
|
4
|
+
> continuous-security-integration platform written in Ruby.
|
|
5
|
+
> 66 plugins · 48 SAST rules · 90 AWS wrappers · 21 WWW drivers · 52 CLI
|
|
6
|
+
> drivers · 5 LLM engines · a self-improving multi-agent AI · one REPL.
|
|
7
|
+
|
|
8
|
+
**Repo root:** `/opt/pwn` · **This wiki:** `/opt/pwn/documentation/` ·
|
|
9
|
+
**Rebuild diagrams:** `documentation/diagrams/build.sh`
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 🗺️ Start Here
|
|
14
|
+
|
|
15
|
+
| | |
|
|
16
|
+
|---|---|
|
|
17
|
+
| [What is PWN](What-is-PWN.md) | One-paragraph elevator pitch |
|
|
18
|
+
| [Why PWN](Why-PWN.md) | Design philosophy — why another framework |
|
|
19
|
+
| [How PWN Works](How-PWN-Works.md) | The five layers, with the architecture diagram |
|
|
20
|
+
| [Installation](Installation.md) | RVM, gem, `./install.sh`, first launch |
|
|
21
|
+
| [General Usage](General-PWN-Usage.md) | Day-one cheat sheet |
|
|
22
|
+
| [Configuration](Configuration.md) | `~/.pwn/config.yml` — engines, keys, agent options |
|
|
23
|
+
| **[All Data-Flow Diagrams](Diagrams.md)** | **26 SVGs** in one scrollable page |
|
|
24
|
+
|
|
25
|
+
## 🚪 Entry Points
|
|
26
|
+
|
|
27
|
+
| | |
|
|
28
|
+
|---|---|
|
|
29
|
+
| [The `pwn` REPL](pwn-REPL.md) | Pry shell with the whole `PWN::` namespace pre-loaded |
|
|
30
|
+
| [`pwn-ai` Autonomous Agent](pwn-ai-Agent.md) | Natural-language TUI + `pwn --ai PROMPT` one-shot |
|
|
31
|
+
| [CLI Drivers `bin/pwn_*`](CLI-Drivers.md) | 52 headless executables for CI/CD |
|
|
32
|
+
| [Drivers (build your own)](Drivers.md) | Turn a REPL session into a shipped binary |
|
|
33
|
+
|
|
34
|
+
## 🤖 AI Subsystem (`PWN::AI`)
|
|
35
|
+
|
|
36
|
+
| | |
|
|
37
|
+
|---|---|
|
|
38
|
+
| [AI / LLM Integration](AI-Integration.md) | OpenAI · Anthropic · Grok (OAuth) · Gemini · Ollama |
|
|
39
|
+
| [Agent Tool Registry](Agent-Tool-Registry.md) | 10 toolsets · 45+ LLM-callable tools |
|
|
40
|
+
| [Memory · Skills · Learning](Skills-Memory-Learning.md) | Introspection — the self-improvement loop |
|
|
41
|
+
| [Extrospection](Extrospection.md) | World-awareness — snapshot · drift · intel · correlate |
|
|
42
|
+
| [Swarm (Multi-Agent)](Swarm.md) | Personas · ask · debate · broadcast · shared bus |
|
|
43
|
+
| [Sessions](Sessions.md) | Transcript persistence + reflection |
|
|
44
|
+
| [Cron](Cron.md) | Scheduled autonomous jobs |
|
|
45
|
+
|
|
46
|
+
## 🧩 Capability Namespaces (`lib/pwn/*`)
|
|
47
|
+
|
|
48
|
+
| | |
|
|
49
|
+
|---|---|
|
|
50
|
+
| [Plugins (66)](Plugins.md) | Every `PWN::Plugins::*` module by category |
|
|
51
|
+
| ↳ [BurpSuite](BurpSuite.md) ⭐ | Preferred web proxy / scanner |
|
|
52
|
+
| ↳ [TransparentBrowser](Transparent-Browser.md) | Headless / visible browser automation |
|
|
53
|
+
| ↳ [NmapIt](NmapIt.md) | Network discovery |
|
|
54
|
+
| ↳ [Metasploit](Metasploit.md) | RPC exploitation |
|
|
55
|
+
| ↳ [Fuzzing](Fuzzing.md) | `Fuzz` · `Sock` · `Packet` |
|
|
56
|
+
| ↳ [Hardware](Hardware.md) | Serial · BusPirate · MSR206 · Android · BareSIP |
|
|
57
|
+
| [SAST (48 rules)](SAST.md) | Static analysis + test-case engine |
|
|
58
|
+
| [WWW (21 drivers)](WWW.md) | Browser automations for real sites |
|
|
59
|
+
| [AWS (90 services)](AWS.md) | Cloud-security enumeration |
|
|
60
|
+
| [SDR](SDR.md) | GQRX · FlipperZero · RFIDler · SonMicro |
|
|
61
|
+
| [Blockchain](Blockchain.md) | BTC · ETH helpers |
|
|
62
|
+
| [Bounty](Bounty.md) | Lifecycle / auth-replay tooling |
|
|
63
|
+
| [Reports](Reporting.md) | HTML/JSON output + DefectDojo/Jira |
|
|
64
|
+
| [FFI](FFI.md) | Native calls |
|
|
65
|
+
| [Banner](Banner.md) | 15 startup banners |
|
|
66
|
+
|
|
67
|
+
## 🛠️ Meta
|
|
68
|
+
|
|
69
|
+
| | |
|
|
70
|
+
|---|---|
|
|
71
|
+
| [`~/.pwn/` Filesystem Map](Persistence.md) | Every file PWN writes and why |
|
|
72
|
+
| [Troubleshooting](Troubleshooting.md) | Common errors and fixes |
|
|
73
|
+
| [Contributing](Contributing.md) | Conventions, RuboCop, spec rules |
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
<sub>Generated by pwn-ai. Edit any `.md` directly; edit any diagram in
|
|
78
|
+
`documentation/diagrams/dot/*.dot` then run `./build.sh`.</sub>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# How PWN Works
|
|
2
|
+
|
|
3
|
+
PWN is five layers, each visible in the source tree. Edges only ever go
|
|
4
|
+
**down** one layer (or sideways within a layer), which is why the diagrams
|
|
5
|
+
below have no criss-crossing lines.
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
## L0 — Actors
|
|
10
|
+
|
|
11
|
+
Humans (`pwn` REPL, `pwn-ai` TUI), CI runners (`pwn --ai "…"`, `bin/pwn_*`),
|
|
12
|
+
LLM providers (over HTTPS), and targets (hosts, web apps, clouds, radios,
|
|
13
|
+
hardware).
|
|
14
|
+
|
|
15
|
+
## L1 — Entry points (`bin/`)
|
|
16
|
+
|
|
17
|
+
| Entry | File | Purpose |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| `pwn` REPL | `lib/pwn/plugins/repl.rb` | Pry with `PWN::` pre-loaded + custom commands |
|
|
20
|
+
| `pwn-ai` | `lib/pwn/ai/agent/loop.rb` | Agent TUI inside the REPL |
|
|
21
|
+
| `pwn --ai PROMPT` | `bin/pwn` | Headless one-shot agent (CI-friendly) |
|
|
22
|
+
| `bin/pwn_*` | 52 files | Thin OptionParser wrappers over one plugin each |
|
|
23
|
+
| `PWN::Cron` | `lib/pwn/cron.rb` | Scheduled jobs → any of the above |
|
|
24
|
+
|
|
25
|
+
## L2 — AI agent core (`lib/pwn/ai/agent/`)
|
|
26
|
+
|
|
27
|
+
| Module | Role |
|
|
28
|
+
|---|---|
|
|
29
|
+
| `Loop` | plan → dispatch tool_calls → observe → repeat until final answer |
|
|
30
|
+
| `Registry` | JSON-Schema function definitions grouped into 10 **toolsets** |
|
|
31
|
+
| `Dispatch` / `Result` | execute a tool, capture stdout/value/error/duration |
|
|
32
|
+
| `PromptBuilder` | inject MEMORY / SKILLS / LEARNING / EXTROSPECTION blocks |
|
|
33
|
+
| `Metrics` · `Learning` | **introspection** — how well am I doing? |
|
|
34
|
+
| `Extrospection` | **extrospection** — what does the world look like? |
|
|
35
|
+
| `Swarm` | multi-agent personas over a shared JSONL bus |
|
|
36
|
+
|
|
37
|
+
See [Agent Tool Registry](Agent-Tool-Registry.md) for every tool the LLM can call.
|
|
38
|
+
|
|
39
|
+
## L3 — Capability namespaces (`lib/pwn/*`)
|
|
40
|
+
|
|
41
|
+
`Plugins` (66) · `SAST` (48) · `WWW` (21) · `AWS` (90) · `SDR` · `Blockchain` ·
|
|
42
|
+
`Bounty` · `Reports` · `FFI` · `Banner`. Each is a plain module of
|
|
43
|
+
`public_class_method def self.x(opts = {})` methods — callable identically from
|
|
44
|
+
the REPL, from `pwn_eval`, or from a driver.
|
|
45
|
+
|
|
46
|
+
## L4 — Persistence (`~/.pwn/`)
|
|
47
|
+
|
|
48
|
+
Everything the framework remembers between processes lives in one directory:
|
|
49
|
+
|
|
50
|
+

|
|
51
|
+
|
|
52
|
+
See [Persistence](Persistence.md) for the byte-level layout of each file.
|
|
53
|
+
|
|
54
|
+
## The feedback loop
|
|
55
|
+
|
|
56
|
+
The reason L2 exists is to close this loop on every turn:
|
|
57
|
+
|
|
58
|
+

|
|
59
|
+
|
|
60
|
+
**Next:** [pwn REPL](pwn-REPL.md) · [pwn-ai Agent](pwn-ai-Agent.md)
|
|
61
|
+
|
|
62
|
+
[← Home](Home.md)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
|
|
3
|
+
PWN is tested on **Debian-based Linux** (Kali, Ubuntu) and **macOS**, using
|
|
4
|
+
Ruby via **RVM**.
|
|
5
|
+
|
|
6
|
+
## Quick install (recommended)
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
cd /opt
|
|
10
|
+
sudo git clone https://github.com/0dayinc/pwn
|
|
11
|
+
cd /opt/pwn
|
|
12
|
+
./install.sh # system deps (nmap, chromium, graphviz, …)
|
|
13
|
+
./install.sh ruby-gem # rvm gemset + bundle install + rake install
|
|
14
|
+
pwn # launch the REPL
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
pwn[v0.5.616]:001 >>> PWN.help
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Gem-only install
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
rvm install ruby-4.0.5
|
|
25
|
+
rvm use ruby-4.0.5@pwn --create
|
|
26
|
+
gem install --verbose pwn
|
|
27
|
+
pwn
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Upgrading
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
rvm use ruby-4.0.5@pwn
|
|
34
|
+
gem uninstall --all --executables pwn
|
|
35
|
+
gem install --verbose pwn
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
or from a checkout:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
cd /opt/pwn && git pull && rvmsudo rake install
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## First-run configuration
|
|
45
|
+
|
|
46
|
+
`pwn` creates `~/.pwn/` on first launch. Add at least one LLM engine to
|
|
47
|
+
`~/.pwn/config.yml` to enable `pwn-ai` — see [Configuration](Configuration.md).
|
|
48
|
+
|
|
49
|
+
## Optional external tools
|
|
50
|
+
|
|
51
|
+
PWN wraps these when present on `$PATH`; none are hard requirements:
|
|
52
|
+
|
|
53
|
+
| Tool | Used by |
|
|
54
|
+
|---|---|
|
|
55
|
+
| `nmap` | `PWN::Plugins::NmapIt` |
|
|
56
|
+
| Burp Suite Pro (+ REST API) | `PWN::Plugins::BurpSuite` |
|
|
57
|
+
| `msfconsole` / msfrpcd | `PWN::Plugins::Metasploit` |
|
|
58
|
+
| `chromium` / `google-chrome` | `PWN::Plugins::TransparentBrowser` |
|
|
59
|
+
| `zaproxy` | `PWN::Plugins::Zaproxy` (fallback) |
|
|
60
|
+
| `gqrx` | `PWN::SDR::GQRX` |
|
|
61
|
+
| `adb` | `PWN::Plugins::Android` |
|
|
62
|
+
| `graphviz` (`dot`) | rebuilding these diagrams |
|
|
63
|
+
| `tor` | `PWN::Plugins::Tor` |
|
|
64
|
+
|
|
65
|
+
## Verify
|
|
66
|
+
|
|
67
|
+
```ruby
|
|
68
|
+
pwn[v0.5.616]:001 >>> PWN::Plugins.constants.count # => 66
|
|
69
|
+
pwn[v0.5.616]:002 >>> PWN::SAST.constants.count # => 48
|
|
70
|
+
pwn[v0.5.616]:003 >>> pwn-ai # launches agent TUI
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Next:** [Configuration](Configuration.md) · [General Usage](General-PWN-Usage.md)
|
|
74
|
+
|
|
75
|
+
[← Home](Home.md)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# NmapIt
|
|
2
|
+
|
|
3
|
+
`PWN::Plugins::NmapIt` provides a convenient Ruby wrapper around Nmap for reconnaissance.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Easy target specification (hosts, ranges, CIDR)
|
|
8
|
+
- Parsing of XML output into usable Ruby structures
|
|
9
|
+
- Service version detection, script execution support
|
|
10
|
+
- Integration with other plugins (e.g. feed into TransparentBrowser or Shodan)
|
|
11
|
+
|
|
12
|
+
Commonly used early in agent workflows:
|
|
13
|
+
|
|
14
|
+
> "Run NmapIt against 10.0.0.0/24, identify web services, then spider with TransparentBrowser."
|
|
15
|
+
|
|
16
|
+
See source in `lib/pwn/plugins/nmap_it.rb`.
|
|
17
|
+
|
|
18
|
+
[[Diagrams]]
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Plugins
|
|
2
|
+
|
|
3
|
+
PWN ships with **66+** plugins under `PWN::Plugins::*`.
|
|
4
|
+
|
|
5
|
+
## Browsing Plugins
|
|
6
|
+
|
|
7
|
+
```ruby
|
|
8
|
+
PWN::Plugins.constants.sort
|
|
9
|
+
PWN::Plugins::BurpSuite.methods(false).sort # preferred web proxy/scanner
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Major Categories & Highlights
|
|
13
|
+
|
|
14
|
+
### Web / Proxy / Scanning
|
|
15
|
+
- **burp_suite** (preferred) — Headless + live interaction with Burp Suite Professional
|
|
16
|
+
- **zaproxy** — OWASP ZAP support (fallback)
|
|
17
|
+
- **transparent_browser** — Headless/visible browser automation, spidering, JS execution
|
|
18
|
+
- **spider**
|
|
19
|
+
- **nmap_it** — Nmap wrapper + parsing
|
|
20
|
+
- **nessus_cloud**, **nexpose_vuln_scan**, **openvas**
|
|
21
|
+
|
|
22
|
+
### Exploitation & Post-Exploitation
|
|
23
|
+
- **metasploit**
|
|
24
|
+
- **assembly**
|
|
25
|
+
- **fuzz**
|
|
26
|
+
- **packet**
|
|
27
|
+
- **beef** (Browser Exploitation Framework)
|
|
28
|
+
- **tor**
|
|
29
|
+
|
|
30
|
+
### Recon / OSINT
|
|
31
|
+
- **shodan**
|
|
32
|
+
- **hunter**
|
|
33
|
+
- **ip_info**
|
|
34
|
+
- **github**
|
|
35
|
+
- **hacker_one**
|
|
36
|
+
|
|
37
|
+
### Data & Auth
|
|
38
|
+
- **authentication_helper**, **basic_auth**, **oauth2**
|
|
39
|
+
- **dao_ldap**, **dao_mongo**, **dao_postgres**, **dao_sqlite3**
|
|
40
|
+
- **vault**
|
|
41
|
+
|
|
42
|
+
### Mobile / Hardware / Misc
|
|
43
|
+
- **android**
|
|
44
|
+
- **serial**, **bus_pirate**, **msr206**
|
|
45
|
+
- **ocr**, **pdf_parse**, **voice**
|
|
46
|
+
- **blockchain**, **bounty** (HackerOne), **defect_dojo**
|
|
47
|
+
|
|
48
|
+
### Utility
|
|
49
|
+
- **file_fu**, **json_pathify**, **log**, **pwn_logger**, **thread_pool**
|
|
50
|
+
- **monkey_patch**, **xxd**, **char**, **vin**, **ssn**, **credit_card**
|
|
51
|
+
|
|
52
|
+
Full list (current as of build):
|
|
53
|
+
`android assembly authentication_helper baresip basic_auth beef black_duck_binary_analysis burp_suite bus_pirate char credit_card dao_ldap dao_mongo dao_postgres dao_sqlite3 defect_dojo detect_os ein file_fu fuzz git github hacker_one hunter ip_info irc jenkins jira_data_center json_pathify log mail_agent metasploit monkey_patch msr206 nessus_cloud nexpose_vuln_scan nmap_it oauth2 ocr open_api openvas packet pdf_parse pony ps pwn_logger rabbit_mq repl scannable_codes serial shodan slack_client sock spider ssn thread_pool tor transparent_browser twitter_api uri_scheme vault vin voice vsphere xxd zaproxy`
|
|
54
|
+
|
|
55
|
+
Each plugin has self-documenting method signatures viewable via the REPL or source in `lib/pwn/plugins/`.
|
|
56
|
+
|
|
57
|
+
See individual plugin pages or source for details. Many plugins accept common options and return rich Ruby objects.
|
|
58
|
+
|
|
59
|
+
[[Diagrams]]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Reporting
|
|
2
|
+
|
|
3
|
+
`PWN::Reports` generates structured output from scans, agent runs, SAST results, and manual findings.
|
|
4
|
+
|
|
5
|
+
## Capabilities
|
|
6
|
+
|
|
7
|
+
- Vulnerability report templating (Markdown + other formats)
|
|
8
|
+
- Integration with defect trackers (`PWN::Plugins::DefectDojo`, Jira, etc.)
|
|
9
|
+
- Automated report generation after agent tasks or plugin runs
|
|
10
|
+
- Custom report drivers
|
|
11
|
+
|
|
12
|
+
## Template
|
|
13
|
+
|
|
14
|
+
See example report templates in the PWN repo (or generate with `PWN::Reports`). Full pipeline in [Diagrams](Diagrams.md).
|
|
15
|
+
|
|
16
|
+
## Usage Patterns
|
|
17
|
+
|
|
18
|
+
Typically invoked at the end of reconnaissance → scanning → exploitation → analysis workflows:
|
|
19
|
+
|
|
20
|
+
```ruby
|
|
21
|
+
PWN::Reports.generate(...)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The `pwn-ai` agent is frequently instructed to "analyze findings and produce a report."
|
|
25
|
+
|
|
26
|
+
Combined with `PWN::Plugins::HackerOne` / bounty modules for streamlined disclosure workflows.
|
|
27
|
+
|
|
28
|
+
[[Diagrams]]
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# SAST (Static Application Security Testing)
|
|
2
|
+
|
|
3
|
+
`PWN::SAST` provides a growing collection of static analysis signatures and test case generators.
|
|
4
|
+
|
|
5
|
+
## Location
|
|
6
|
+
|
|
7
|
+
`lib/pwn/sast/` — one file per vulnerability class or mechanism.
|
|
8
|
+
|
|
9
|
+
## Current Coverage (examples)
|
|
10
|
+
|
|
11
|
+
- Command execution (multiple languages)
|
|
12
|
+
- Deserialization (Java, etc.)
|
|
13
|
+
- Eval / dangerous functions
|
|
14
|
+
- CSRF, redirect, inner HTML, postMessage issues
|
|
15
|
+
- Log4j, ReDoS, path traversal patterns
|
|
16
|
+
- Credential / secret patterns (keystore, passwords, AWS keys)
|
|
17
|
+
- Modern issues: prototype pollution, etc.
|
|
18
|
+
- Custom signature engine + factory
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```ruby
|
|
23
|
+
PWN::SAST.constants
|
|
24
|
+
PWN::SAST::TestCaseEngine.generate(...)
|
|
25
|
+
# Or call specific check modules
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
SAST results feed directly into reporting and can be orchestrated by the `pwn-ai` agent or custom drivers.
|
|
29
|
+
|
|
30
|
+
See `lib/pwn/sast/` source for the full and growing list of modules.
|
|
31
|
+
|
|
32
|
+
[[Diagrams]]
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Skills, Memory & Learning
|
|
2
|
+
|
|
3
|
+
One of PWN's most powerful features is its self-improving closed loop.
|
|
4
|
+
|
|
5
|
+
## Memory (`PWN::Memory`)
|
|
6
|
+
|
|
7
|
+
Persistent facts, preferences, lessons, and environment data stored in `~/.pwn/memory.json`.
|
|
8
|
+
|
|
9
|
+
Use from REPL / agent:
|
|
10
|
+
- `PWN::Memory.remember(key, value, category: :fact)`
|
|
11
|
+
- `PWN::Memory.recall(query)`
|
|
12
|
+
|
|
13
|
+
Injected into every future `pwn-ai` session.
|
|
14
|
+
|
|
15
|
+
## Skills
|
|
16
|
+
|
|
17
|
+
Reusable, versionable markdown procedures stored in `~/.pwn/skills/`.
|
|
18
|
+
|
|
19
|
+
- Created automatically via distillation of successful agent runs.
|
|
20
|
+
- Manually via `skill_create` or editing YAML+markdown files.
|
|
21
|
+
- Contain front-matter `references:` (CWE, CVE, ATT&CK, NIST, URLs).
|
|
22
|
+
- Exposed to the agent and listed via `skill_list` / `skill_view`.
|
|
23
|
+
|
|
24
|
+
Example skills:
|
|
25
|
+
- `deep_exploitation`
|
|
26
|
+
- `vulnerability_research_fundamentals`
|
|
27
|
+
- `xai_grok_oauth_device_flow`
|
|
28
|
+
|
|
29
|
+
## Learning Loop
|
|
30
|
+
|
|
31
|
+
- `PWN::AI::Agent::Metrics` — per-tool success rate + duration (`~/.pwn/metrics.json`)
|
|
32
|
+
- `PWN::AI::Agent::Learning` — outcomes, reflections, skill distillation (`~/.pwn/learning.jsonl`)
|
|
33
|
+
- Successful workflows become durable skills available to all future sessions.
|
|
34
|
+
|
|
35
|
+
## Management Commands (REPL)
|
|
36
|
+
|
|
37
|
+
- `pwn-ai-memory`
|
|
38
|
+
- `pwn-ai-sessions`
|
|
39
|
+
- `pwn-ai-cron`
|
|
40
|
+
- `skill_list`, `skill_view`, `skill_create`, `skill_add_reference`
|
|
41
|
+
|
|
42
|
+
This system turns one-off wins into institutional knowledge.
|
|
43
|
+
|
|
44
|
+
[[Diagrams]]
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Transparent Browser
|
|
2
|
+
|
|
3
|
+
`PWN::Plugins::TransparentBrowser` — powerful browser automation (headless + visible) built on top of Selenium / Watir / Ferrum / similar.
|
|
4
|
+
|
|
5
|
+
## Primary Uses
|
|
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
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
browser = PWN::Plugins::TransparentBrowser.open_browser(
|
|
17
|
+
browser_type: :chrome,
|
|
18
|
+
proxy: 'http://127.0.0.1:8080' # Burp
|
|
19
|
+
)
|
|
20
|
+
browser.goto 'https://target.example.com'
|
|
21
|
+
# ... interact ...
|
|
22
|
+
browser.close
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Agent-friendly.
|
|
26
|
+
|
|
27
|
+
## See Also
|
|
28
|
+
|
|
29
|
+
- [Burp Suite](BurpSuite.md)
|
|
30
|
+
- [Plugins](Plugins.md)
|
|
31
|
+
|
|
32
|
+
[[Diagrams]]
|