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
data/documentation/Diagrams.md
CHANGED
|
@@ -1,57 +1,140 @@
|
|
|
1
|
-
# PWN Data
|
|
1
|
+
# PWN Data-Flow Diagrams
|
|
2
2
|
|
|
3
|
-
|
|
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:
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
```bash
|
|
8
|
+
cd documentation/diagrams && ./build.sh
|
|
9
|
+
```
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
Every diagram uses strict layer→layer edges (`newrank=true` + `{rank=same}`
|
|
12
|
+
groups) so lines never criss-cross.
|
|
9
13
|
|
|
10
|
-
|
|
11
|
-

|
|
14
|
+
---
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-

|
|
16
|
+
## 1 · Architecture
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
### Overall PWN Architecture
|
|
19
|
+
[source](diagrams/dot/overall-pwn-architecture.dot) · doc: [How PWN Works](How-PWN-Works.md)
|
|
20
|
+

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

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

|
|
23
29
|
|
|
24
|
-
|
|
25
|
-

|
|
30
|
+
---
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-

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

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

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

|
|
37
45
|
|
|
38
|
-
|
|
39
|
-
- These visualize the integration of:
|
|
40
|
-
- `PWN::Plugins` (67+ modules)
|
|
41
|
-
- `PWN::AI::Agent` + tool calling + LLM providers
|
|
42
|
-
- `PWN::Memory`, `PWN::Skills`, and Learning loop
|
|
43
|
-
- `PWN::SAST`, `PWN::Reports`, `PWN::Driver`
|
|
44
|
-
- For the source definitions, see `diagrams/dot/*.dot`.
|
|
45
|
-
- Update these diagrams by editing the `.dot` files and re-rendering with `dot -Tsvg`.
|
|
46
|
+
---
|
|
46
47
|
|
|
47
|
-
##
|
|
48
|
+
## 3 · AI Agent
|
|
48
49
|
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
- [Skills, Memory & Learning](Skills-Memory-Learning.md)
|
|
53
|
-
- [Plugins](Plugins.md)
|
|
54
|
-
- [SAST](SAST.md)
|
|
55
|
-
- [Drivers](Drivers.md)
|
|
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
|
+

|
|
56
53
|
|
|
57
|
-
|
|
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)
|
data/documentation/Drivers.md
CHANGED
|
@@ -1,25 +1,52 @@
|
|
|
1
|
-
# Drivers
|
|
1
|
+
# Drivers — Turn a REPL Session into a Shipped Binary
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A **driver** is a small executable in `bin/` that wires `OptionParser` to one
|
|
4
|
+
or more `PWN::` calls. All 52 shipped `pwn_*` binaries follow the same
|
|
5
|
+
15-line template.
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+

|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
- Loads the `pwn` environment
|
|
9
|
-
- Orchestrates multiple plugins, AI calls, or custom logic
|
|
10
|
-
- Can be scheduled via cron or run standalone
|
|
9
|
+
## Workflow
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
1. **Prototype in the REPL** until the calls work.
|
|
12
|
+
2. `history` → copy the winning lines.
|
|
13
|
+
3. Drop them into the template below as `bin/pwn_<name>`.
|
|
14
|
+
4. `chmod +x bin/pwn_<name>` · add to `pwn.gemspec` executables · `rake install`.
|
|
15
|
+
5. (Optional) `learning_distill_skill(name: '<name>')` so the agent knows the
|
|
16
|
+
procedure too.
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
## Template
|
|
15
19
|
|
|
16
|
-
|
|
20
|
+
```ruby
|
|
21
|
+
#!/usr/bin/env ruby
|
|
22
|
+
# frozen_string_literal: true
|
|
17
23
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
3. Leverage the full plugin + AI surface.
|
|
21
|
-
4. Distill recurring successful patterns into **Skills**.
|
|
24
|
+
require 'optparse'
|
|
25
|
+
require 'pwn'
|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
opts = {}
|
|
28
|
+
OptionParser.new do |o|
|
|
29
|
+
o.banner = "USAGE: #{File.basename($PROGRAM_NAME)} [opts]"
|
|
30
|
+
o.on('-tTARGET', '--target=TARGET', 'Required target') { |v| opts[:target] = v }
|
|
31
|
+
o.on('-oDIR', '--out=DIR', 'Output directory') { |v| opts[:out] = v }
|
|
32
|
+
end.parse!
|
|
24
33
|
|
|
25
|
-
[
|
|
34
|
+
raise OptionParser::MissingArgument, '-t' unless opts[:target]
|
|
35
|
+
|
|
36
|
+
result = PWN::Plugins::NmapIt.port_scan(target: opts[:target])
|
|
37
|
+
PWN::Reports::Fuzz.generate(result: result, dir_path: opts[:out]) if opts[:out]
|
|
38
|
+
puts result
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Three artefact types from one REPL session
|
|
42
|
+
|
|
43
|
+
| Artefact | Made with | Consumed by |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| `bin/pwn_<name>` | template above | shell / CI |
|
|
46
|
+
| `~/.pwn/skills/<name>.md` | `learning_distill_skill` | every future pwn-ai prompt |
|
|
47
|
+
| `cron` job | `cron_create(ruby: '…')` | system crontab → unattended |
|
|
48
|
+
|
|
49
|
+
**See also:** [CLI Drivers](CLI-Drivers.md) · [Cron](Cron.md) ·
|
|
50
|
+
[Skills, Memory & Learning](Skills-Memory-Learning.md)
|
|
51
|
+
|
|
52
|
+
[← Home](Home.md)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Extrospection — World Awareness
|
|
2
|
+
|
|
3
|
+
`PWN::AI::Agent::Extrospection` is the **outward-facing** counterpart to
|
|
4
|
+
[Learning](Skills-Memory-Learning.md). Where Learning/Metrics ask *"how well
|
|
5
|
+
did **I** do?"*, Extrospection asks *"what does the **world** look like right
|
|
6
|
+
now, and has it changed under me?"*
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
## Verbs
|
|
11
|
+
|
|
12
|
+
| Tool | Does | Persists to |
|
|
13
|
+
|---|---|---|
|
|
14
|
+
| `extro_snapshot` | Fingerprint host/net/toolchain/repo/env → hash | `extrospection.json` (`snapshot` + rotates `previous`) |
|
|
15
|
+
| `extro_drift` | Diff live-vs-stored (or stored-vs-previous) | — returns `{changed, added, removed}` with dotted keys |
|
|
16
|
+
| `extro_observe` | Record a recon fact (banner, CVE match, topology note) | `observations[]` |
|
|
17
|
+
| `extro_observations` | Query recorded facts by source/category/target/tag | — |
|
|
18
|
+
| `extro_intel` | Query NVD / CIRCL / Exploit-DB for keyword or CVE | optional `record: true` → `:intel` observations |
|
|
19
|
+
| `extro_correlate` | **Join** introspection ↔ extrospection | — actionable findings |
|
|
20
|
+
| `extro_stats` | snapshot age · observation count · drift counts | — |
|
|
21
|
+
| `extro_reset` | Wipe snapshot + observations (new engagement) | — |
|
|
22
|
+
| `extro_auto_toggle` | Enable/disable auto-snapshot after every final answer | `PWN::Env[:ai][:agent][:auto_extrospect]` |
|
|
23
|
+
|
|
24
|
+
## `extro_correlate` — the point of the whole thing
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
(a) Metrics tools with <50 % success × toolchain drift / missing binaries
|
|
28
|
+
(b) Learning failures on day X × host/net/repo drift on day X
|
|
29
|
+
(c) recorded :intel observations × installed component versions
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Output tells the agent whether a failure was **its own fault** ("I called the
|
|
33
|
+
API wrong") or **the world changed** ("nmap was upgraded and the flag moved")
|
|
34
|
+
— and that distinction is written back into MEMORY so the next run doesn't
|
|
35
|
+
waste iterations rediscovering it.
|
|
36
|
+
|
|
37
|
+
## Typical engagement flow
|
|
38
|
+
|
|
39
|
+
```ruby
|
|
40
|
+
extro_reset(confirm: true) # clean slate for new scope
|
|
41
|
+
extro_snapshot # baseline
|
|
42
|
+
# … recon …
|
|
43
|
+
extro_observe(source: 'nmap', target: '10.0.0.5',
|
|
44
|
+
category: 'recon', data: 'OpenSSH 8.2p1 Ubuntu')
|
|
45
|
+
extro_intel(query: 'OpenSSH 8.2p1', record: true)
|
|
46
|
+
# … days later, something breaks …
|
|
47
|
+
extro_drift # what moved?
|
|
48
|
+
extro_correlate # why did it break?
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**See also:** [Skills, Memory & Learning](Skills-Memory-Learning.md) ·
|
|
52
|
+
[pwn-ai Agent](pwn-ai-Agent.md)
|
|
53
|
+
|
|
54
|
+
[← Home](Home.md)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# `PWN::FFI` — Native Calls
|
|
2
|
+
|
|
3
|
+
`PWN::FFI::Stdio` (`lib/pwn/ffi/stdio.rb`) exposes libc functions to Ruby via
|
|
4
|
+
the `ffi` gem — useful for shellcode testing, format-string research and
|
|
5
|
+
low-level RE without leaving the REPL.
|
|
6
|
+
|
|
7
|
+
```ruby
|
|
8
|
+
PWN::FFI::Stdio.printf(fmt: "leak: %p\n", args: [0x41414141])
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Combine with `PWN::Plugins::Assembly` (opcodes ↔ asm) and `pwn-asm` for a
|
|
12
|
+
minimal in-process exploit-dev workbench.
|
|
13
|
+
|
|
14
|
+
[← Home](Home.md) · [Hardware](Hardware.md)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Fuzzing — `PWN::Plugins::Fuzz` · `Sock` · `Packet`
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
## Generate
|
|
6
|
+
|
|
7
|
+
```ruby
|
|
8
|
+
payloads = PWN::Plugins::Fuzz.generate(
|
|
9
|
+
seed: "GET / HTTP/1.1\r\nHost: t\r\n\r\n",
|
|
10
|
+
strategy: :radamsa, # :radamsa | :bitflip | :dictionary
|
|
11
|
+
count: 500
|
|
12
|
+
)
|
|
13
|
+
enc = PWN::Plugins::Char.url_encode(str: payloads.first)
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Deliver
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
payloads.each do |p|
|
|
20
|
+
PWN::Plugins::Sock.connect(target: '10.0.0.5', port: 8080) do |s|
|
|
21
|
+
s.write(p); s.read
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
For raw L2/L3: `PWN::Plugins::Packet`.
|
|
27
|
+
CLI network fuzzer: `pwn_fuzz_net_app_proto -t HOST -p PORT -f seeds/`
|
|
28
|
+
|
|
29
|
+
## Monitor & report
|
|
30
|
+
|
|
31
|
+
`PWN::Plugins::PS` watches the target process; `PWN::Plugins::Log` tails its
|
|
32
|
+
log; `PWN::Reports::Fuzz` renders crash → HTML/JSON.
|
|
33
|
+
|
|
34
|
+
Feed unique crashes back as new seeds (`Log → Fuzz` dashed edge in the diagram).
|
|
35
|
+
|
|
36
|
+
[← Home](Home.md) · [Reporting](Reporting.md)
|
|
@@ -1,40 +1,60 @@
|
|
|
1
|
-
# General
|
|
1
|
+
# General Usage — Day-One Cheat Sheet
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Launch
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
$ pwn
|
|
7
|
-
pwn
|
|
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
|
|
8
9
|
```
|
|
9
10
|
|
|
10
|
-
##
|
|
11
|
+
## Inside the REPL
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
## Recommended Workflow
|
|
21
|
-
|
|
22
|
-
1. Launch `pwn`
|
|
23
|
-
2. Start `pwn-ai`
|
|
24
|
-
3. Give natural language tasks that leverage plugins, skills, memory.
|
|
25
|
-
4. Use `SHIFT+ENTER` for multi-line prompts.
|
|
26
|
-
|
|
27
|
-
## Updating PWN
|
|
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
|
+
```
|
|
28
21
|
|
|
29
|
-
|
|
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
|
+
```
|
|
30
54
|
|
|
31
|
-
|
|
55
|
+
Then say the same thing in English inside `pwn-ai` and watch the agent do it.
|
|
32
56
|
|
|
33
|
-
|
|
34
|
-
-
|
|
35
|
-
- `memory.json`
|
|
36
|
-
- `learning.jsonl`
|
|
37
|
-
- `metrics.json`
|
|
38
|
-
- sessions, cron jobs, etc.
|
|
57
|
+
**Next:** [pwn REPL](pwn-REPL.md) · [pwn-ai Agent](pwn-ai-Agent.md) ·
|
|
58
|
+
[CLI Drivers](CLI-Drivers.md)
|
|
39
59
|
|
|
40
|
-
[
|
|
60
|
+
[← Home](Home.md)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Hardware & Physical-Layer Hacking
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+
|
|
6
|
+
## Serial / Bus
|
|
7
|
+
|
|
8
|
+
| Module | Use |
|
|
9
|
+
|---|---|
|
|
10
|
+
| `PWN::Plugins::Serial` | Generic UART (`/dev/ttyUSB*`) — read/write, baud detect |
|
|
11
|
+
| `PWN::Plugins::BusPirate` | SPI/I²C/1-Wire via Bus Pirate |
|
|
12
|
+
| `PWN::Plugins::MSR206` | ISO magstripe read/write (tracks 1-3) |
|
|
13
|
+
|
|
14
|
+
CLI: `pwn_serial_msr206`, `pwn_serial_qualcomm_commands`,
|
|
15
|
+
`pwn_serial_check_voicemail`, `pwn_serial_son_micro_sm132_rfid`
|
|
16
|
+
|
|
17
|
+
## Mobile
|
|
18
|
+
|
|
19
|
+
`PWN::Plugins::Android` — `adb_net_connect`, `adb_sh`, `adb_push/pull`,
|
|
20
|
+
`take_screenshot`, `screen_record`, `list_installed_apps`, `dumpsys`,
|
|
21
|
+
`open_app`, `find_hidden_codes`, `swipe`, `input`, `input_special`,
|
|
22
|
+
`invoke_event_listener`. CLI war-dialer: `pwn_android_war_dialer`.
|
|
23
|
+
|
|
24
|
+
## Voice / Telephony
|
|
25
|
+
|
|
26
|
+
`PWN::Plugins::BareSIP` (SIP recon/war-dial), `PWN::Plugins::Voice` (TTS).
|
|
27
|
+
CLI: `pwn_phone`.
|
|
28
|
+
|
|
29
|
+
## Radio
|
|
30
|
+
|
|
31
|
+
See [SDR](SDR.md) — GQRX, FlipperZero, RFIDler, SonMicro.
|
|
32
|
+
|
|
33
|
+
## Binary / RE
|
|
34
|
+
|
|
35
|
+
- `PWN::Plugins::XXD` — hex dump / patch
|
|
36
|
+
- `PWN::Plugins::Assembly` + `pwn-asm` REPL — opcodes ↔ asm, multi-arch
|
|
37
|
+
- `PWN::Plugins::BlackDuckBinaryAnalysis` — SBOM + CVE match on firmware
|
|
38
|
+
- [`PWN::FFI`](FFI.md) — call libc from Ruby
|
|
39
|
+
|
|
40
|
+
[← Home](Home.md) · [SDR](SDR.md) · [FFI](FFI.md)
|
data/documentation/Home.md
CHANGED
|
@@ -1,51 +1,78 @@
|
|
|
1
|
-
# PWN
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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>
|