pwn 0.5.627 → 0.5.629
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/.rubocop_todo.yml +20 -30
- data/Gemfile +1 -1
- data/README.md +29 -21
- data/bin/pwn +35 -1
- data/bin/pwn_setup +64 -0
- data/documentation/AI-Integration.md +48 -9
- data/documentation/AWS.md +1 -1
- data/documentation/Agent-Tool-Registry.md +24 -0
- data/documentation/BurpSuite.md +4 -1
- data/documentation/CLI-Drivers.md +27 -10
- data/documentation/Configuration.md +37 -10
- data/documentation/Contributing.md +13 -3
- data/documentation/Extrospection.md +108 -98
- data/documentation/FFI.md +14 -2
- data/documentation/Fuzzing.md +3 -0
- data/documentation/General-PWN-Usage.md +12 -0
- data/documentation/Hardware.md +4 -0
- data/documentation/Home.md +4 -4
- data/documentation/How-PWN-Works.md +2 -1
- data/documentation/Installation.md +201 -37
- data/documentation/Metasploit.md +4 -1
- data/documentation/NmapIt.md +3 -0
- data/documentation/Persistence.md +5 -2
- data/documentation/Reporting.md +3 -0
- data/documentation/SDR.md +4 -0
- data/documentation/Skills-Memory-Learning.md +24 -11
- data/documentation/Swarm.md +20 -0
- data/documentation/Transparent-Browser.md +3 -0
- data/documentation/Troubleshooting.md +63 -7
- data/documentation/What-is-PWN.md +1 -1
- data/documentation/diagrams/agent-tool-registry.svg +120 -109
- data/documentation/diagrams/ai-integration-tool-calling.svg +76 -65
- data/documentation/diagrams/dot/agent-tool-registry.dot +5 -3
- data/documentation/diagrams/dot/ai-integration-tool-calling.dot +3 -2
- data/documentation/diagrams/dot/memory-skills-detailed.dot +26 -4
- data/documentation/diagrams/dot/overall-pwn-architecture.dot +6 -4
- data/documentation/diagrams/dot/persistence-filesystem.dot +4 -2
- data/documentation/diagrams/dot/pwn-ai-feedback-learning-loop.dot +31 -10
- data/documentation/diagrams/dot/swarm-multi-agent.dot +7 -1
- data/documentation/diagrams/extrospection-world-awareness.svg +129 -129
- data/documentation/diagrams/memory-skills-detailed.svg +268 -137
- data/documentation/diagrams/overall-pwn-architecture.svg +188 -171
- data/documentation/diagrams/persistence-filesystem.svg +115 -85
- data/documentation/diagrams/pwn-ai-feedback-learning-loop.svg +407 -255
- data/documentation/diagrams/sdr-radio-flow.svg +51 -51
- data/documentation/diagrams/swarm-multi-agent.svg +156 -119
- data/documentation/pwn-REPL.md +1 -0
- data/documentation/pwn-ai-Agent.md +50 -22
- data/lib/pwn/ai/agent/dispatch.rb +76 -4
- data/lib/pwn/ai/agent/learning.rb +124 -1
- data/lib/pwn/ai/agent/loop.rb +144 -12
- data/lib/pwn/ai/agent/metrics.rb +60 -27
- data/lib/pwn/ai/agent/prompt_builder.rb +63 -12
- data/lib/pwn/ai/agent/reflect.rb +41 -7
- data/lib/pwn/ai/agent/registry.rb +69 -4
- data/lib/pwn/ai/ollama.rb +39 -10
- data/lib/pwn/config.rb +13 -2
- data/lib/pwn/ffi/liquid.rb +179 -0
- data/lib/pwn/memory.rb +15 -0
- data/lib/pwn/memory_index.rb +233 -0
- data/lib/pwn/plugins/repl.rb +26 -2
- data/lib/pwn/sdr/decoder/bluetooth.rb +141 -75
- data/lib/pwn/sdr/decoder/dect.rb +89 -63
- data/lib/pwn/sdr/decoder/dsp.rb +443 -0
- data/lib/pwn/sdr/decoder/gps.rb +93 -73
- data/lib/pwn/sdr/decoder/gsm.rb +167 -63
- data/lib/pwn/sdr/decoder/lora.rb +118 -65
- data/lib/pwn/sdr/decoder/lte.rb +188 -65
- data/lib/pwn/sdr/decoder/p25.rb +83 -67
- data/lib/pwn/sdr/decoder/zigbee.rb +140 -67
- data/lib/pwn/setup.rb +563 -0
- data/lib/pwn/version.rb +1 -1
- data/lib/pwn.rb +2 -0
- data/spec/lib/pwn/memory_index_spec.rb +15 -0
- data/spec/lib/pwn/setup_spec.rb +28 -0
- data/third_party/pwn_rdoc.jsonl +79 -8
- metadata +10 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2f0c536ea0f5b7dbd2c88621241adfa866f7ed726ee4e2109abe83aef13b0385
|
|
4
|
+
data.tar.gz: 7e3bc1436b9ce27c63da25dc609eab317a009b1339a843a6cdfe03469386b195
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 572496cd5d2754022fdb35c360db8e5fec65cd91693ea196f8e44666c28141f198b3353146cd658aa07b93d0add52e3808448fe0836b38830c2fb1b553d8dad2
|
|
7
|
+
data.tar.gz: 7dc0f6160402b01d8acb694e72d86daef36743fd9b9f0b84a2f87da0d77367798e8ef429463e25f36747f359c5b621615e61e26df29033de9561a24d926af4a6
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2026-
|
|
3
|
+
# on 2026-07-10 16:56:14 UTC using RuboCop version 1.88.2.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
@@ -13,7 +13,7 @@ Layout/TrailingWhitespace:
|
|
|
13
13
|
Exclude:
|
|
14
14
|
- 'lib/pwn/banner/radare2_ai.rb'
|
|
15
15
|
|
|
16
|
-
# Offense count:
|
|
16
|
+
# Offense count: 14
|
|
17
17
|
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
18
18
|
Lint/NestedMethodDefinition:
|
|
19
19
|
Exclude:
|
|
@@ -30,17 +30,16 @@ Lint/RedundantTypeConversion:
|
|
|
30
30
|
- 'lib/pwn/plugins/jenkins.rb'
|
|
31
31
|
- 'lib/pwn/plugins/repl.rb'
|
|
32
32
|
|
|
33
|
-
# Offense count:
|
|
34
|
-
Lint/ShadowedException:
|
|
35
|
-
Exclude:
|
|
36
|
-
- 'lib/pwn/sdr/decoder/flex.rb'
|
|
37
|
-
- 'lib/pwn/sdr/decoder/pocsag.rb'
|
|
38
|
-
|
|
39
|
-
# Offense count: 302
|
|
33
|
+
# Offense count: 296
|
|
40
34
|
# This cop supports safe autocorrection (--autocorrect).
|
|
41
35
|
Lint/UselessAssignment:
|
|
42
36
|
Enabled: false
|
|
43
37
|
|
|
38
|
+
# Offense count: 2
|
|
39
|
+
Lint/UselessConstantScoping:
|
|
40
|
+
Exclude:
|
|
41
|
+
- 'lib/pwn/sdr/decoder/bluetooth.rb'
|
|
42
|
+
|
|
44
43
|
# Offense count: 1
|
|
45
44
|
# This cop supports safe autocorrection (--autocorrect).
|
|
46
45
|
# Configuration parameters: CheckForMethodsWithNoSideEffects.
|
|
@@ -49,7 +48,7 @@ Lint/Void:
|
|
|
49
48
|
- 'bin/pwn_web_cache_deception'
|
|
50
49
|
|
|
51
50
|
# Offense count: 1
|
|
52
|
-
# Configuration parameters:
|
|
51
|
+
# Configuration parameters: Max.
|
|
53
52
|
Metrics/CollectionLiteralLength:
|
|
54
53
|
Exclude:
|
|
55
54
|
- 'lib/pwn/plugins/uri_scheme.rb'
|
|
@@ -66,7 +65,7 @@ Metrics/MethodLength:
|
|
|
66
65
|
Exclude:
|
|
67
66
|
- 'lib/pwn/banner/code_cave.rb'
|
|
68
67
|
|
|
69
|
-
# Offense count:
|
|
68
|
+
# Offense count: 9
|
|
70
69
|
Naming/AccessorMethodName:
|
|
71
70
|
Exclude:
|
|
72
71
|
- 'lib/pwn/ai/anthropic.rb'
|
|
@@ -78,6 +77,13 @@ Naming/AccessorMethodName:
|
|
|
78
77
|
- 'lib/pwn/plugins/jira_data_center.rb'
|
|
79
78
|
- 'lib/pwn/plugins/vin.rb'
|
|
80
79
|
|
|
80
|
+
# Offense count: 5
|
|
81
|
+
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
|
82
|
+
# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
|
|
83
|
+
Naming/MethodParameterName:
|
|
84
|
+
Exclude:
|
|
85
|
+
- 'lib/pwn/sdr/decoder/lora.rb'
|
|
86
|
+
|
|
81
87
|
# Offense count: 2
|
|
82
88
|
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
|
|
83
89
|
# SupportedStyles: snake_case, normalcase, non_integer
|
|
@@ -98,7 +104,7 @@ Style/Alias:
|
|
|
98
104
|
Style/ClassVars:
|
|
99
105
|
Enabled: false
|
|
100
106
|
|
|
101
|
-
# Offense count:
|
|
107
|
+
# Offense count: 277
|
|
102
108
|
# This cop supports safe autocorrection (--autocorrect).
|
|
103
109
|
# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
|
|
104
110
|
# SupportedStyles: assign_to_condition, assign_inside_condition
|
|
@@ -150,13 +156,11 @@ Style/MultipleComparison:
|
|
|
150
156
|
- 'lib/pwn/www/duckduckgo.rb'
|
|
151
157
|
- 'lib/pwn/www/twitter.rb'
|
|
152
158
|
|
|
153
|
-
# Offense count:
|
|
159
|
+
# Offense count: 1
|
|
154
160
|
# This cop supports safe autocorrection (--autocorrect).
|
|
155
161
|
Style/RedundantBegin:
|
|
156
162
|
Exclude:
|
|
157
163
|
- 'lib/pwn/plugins/transparent_browser.rb'
|
|
158
|
-
- 'lib/pwn/sdr/decoder/flex.rb'
|
|
159
|
-
- 'lib/pwn/sdr/decoder/pocsag.rb'
|
|
160
164
|
|
|
161
165
|
# Offense count: 94
|
|
162
166
|
# This cop supports safe autocorrection (--autocorrect).
|
|
@@ -172,13 +176,6 @@ Style/RedundantParentheses:
|
|
|
172
176
|
Exclude:
|
|
173
177
|
- 'lib/pwn/plugins/xxd.rb'
|
|
174
178
|
|
|
175
|
-
# Offense count: 2
|
|
176
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
177
|
-
Style/RedundantSelf:
|
|
178
|
-
Exclude:
|
|
179
|
-
- 'lib/pwn/sdr/decoder/flex.rb'
|
|
180
|
-
- 'lib/pwn/sdr/decoder/pocsag.rb'
|
|
181
|
-
|
|
182
179
|
# Offense count: 12
|
|
183
180
|
# This cop supports safe autocorrection (--autocorrect).
|
|
184
181
|
Style/RedundantStringEscape:
|
|
@@ -189,14 +186,7 @@ Style/RedundantStringEscape:
|
|
|
189
186
|
- 'lib/pwn/sast/redos.rb'
|
|
190
187
|
- 'vagrant/provisioners/kali_customize.rb'
|
|
191
188
|
|
|
192
|
-
# Offense count:
|
|
193
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
194
|
-
Style/RescueModifier:
|
|
195
|
-
Exclude:
|
|
196
|
-
- 'lib/pwn/sdr/decoder/flex.rb'
|
|
197
|
-
- 'lib/pwn/sdr/decoder/pocsag.rb'
|
|
198
|
-
|
|
199
|
-
# Offense count: 19
|
|
189
|
+
# Offense count: 17
|
|
200
190
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
201
191
|
Style/SlicingWithRange:
|
|
202
192
|
Exclude:
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -33,7 +33,7 @@ hardware / radio exploitation, to reporting and disclosure — and puts a
|
|
|
33
33
|
**self-improving, tool-calling, multi-agent AI** on top of it.
|
|
34
34
|
|
|
35
35
|
**In numbers:** 66 `PWN::Plugins` · 48 `PWN::SAST` rules · 90 `PWN::AWS`
|
|
36
|
-
service wrappers · 21 `PWN::WWW` site drivers ·
|
|
36
|
+
service wrappers · 21 `PWN::WWW` site drivers · 53 `bin/pwn_*` CLI drivers ·
|
|
37
37
|
5 LLM engines · 10 agent toolsets · 45+ LLM-callable tools.
|
|
38
38
|
|
|
39
39
|
Full page: [What is PWN](documentation/What-is-PWN.md)
|
|
@@ -86,7 +86,7 @@ The complete wiki lives in this repo at **[`documentation/Home.md`](documentatio
|
|
|
86
86
|
|---|---|---|---|
|
|
87
87
|
| [What is PWN](documentation/What-is-PWN.md) | [`pwn` REPL](documentation/pwn-REPL.md) | [AI / LLM Integration](documentation/AI-Integration.md) | [Plugins (66)](documentation/Plugins.md) |
|
|
88
88
|
| [Why PWN](documentation/Why-PWN.md) | [`pwn-ai` Agent](documentation/pwn-ai-Agent.md) | [Agent Tool Registry](documentation/Agent-Tool-Registry.md) | [SAST (48)](documentation/SAST.md) |
|
|
89
|
-
| [How PWN Works](documentation/How-PWN-Works.md) | [CLI Drivers (
|
|
89
|
+
| [How PWN Works](documentation/How-PWN-Works.md) | [CLI Drivers (53)](documentation/CLI-Drivers.md) | [Memory · Skills · Learning](documentation/Skills-Memory-Learning.md) | [AWS (90)](documentation/AWS.md) |
|
|
90
90
|
| [Installation](documentation/Installation.md) | [Build a Driver](documentation/Drivers.md) | [Mistakes (neg-feedback)](documentation/Mistakes.md) | [WWW (21)](documentation/WWW.md) |
|
|
91
91
|
| [General Usage](documentation/General-PWN-Usage.md) | | [Extrospection](documentation/Extrospection.md) | [SDR / Radio](documentation/SDR.md) |
|
|
92
92
|
| [Configuration](documentation/Configuration.md) | | [Swarm (multi-agent)](documentation/Swarm.md) | [Hardware](documentation/Hardware.md) |
|
|
@@ -103,18 +103,31 @@ Rebuild every SVG from its Graphviz source:
|
|
|
103
103
|
|
|
104
104
|
### **Installation** ###
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
PWN is a **single gem** with a built-in post-install doctor/provisioner —
|
|
107
|
+
`pwn setup` — that detects your package manager (`apt` · `dnf` · `pacman` ·
|
|
108
|
+
`brew` · `port`) and installs exactly the OS headers + external tools each
|
|
109
|
+
`PWN::` capability needs. Tested on Kali/Debian/Ubuntu, Fedora, Arch, macOS.
|
|
107
110
|
|
|
108
111
|
```
|
|
109
|
-
$
|
|
110
|
-
$
|
|
111
|
-
$
|
|
112
|
-
$ ./install.sh
|
|
113
|
-
$ ./install.sh ruby-gem
|
|
112
|
+
$ gem install pwn
|
|
113
|
+
$ pwn setup # read-only doctor: which capabilities are usable?
|
|
114
|
+
$ pwn setup --profile full --yes # provision everything (or: web | net | sdr | vision | …)
|
|
114
115
|
$ pwn
|
|
115
|
-
pwn[v0.5.
|
|
116
|
+
pwn[v0.5.629]:001 >>> PWN.help
|
|
116
117
|
```
|
|
117
118
|
|
|
119
|
+
Only need a subset?
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
$ pwn setup --list-profiles
|
|
123
|
+
$ pwn setup --profile web # TransparentBrowser · Burp · ZAP · Tor · sqlmap
|
|
124
|
+
$ pwn setup --profile sdr --yes # GQRX · rtl-sdr · hackrf · SoapySDR · FFI DSP
|
|
125
|
+
$ pwn setup --profile net --dry-run
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Also available as `pwn_setup` (standalone driver) and `pwn --setup[=PROFILE]`.
|
|
129
|
+
The doctor exits non-zero when capabilities are degraded, so CI can gate on it.
|
|
130
|
+
|
|
118
131
|
[](https://youtu.be/G7iLUY4FzsI)
|
|
119
132
|
|
|
120
133
|
Full page: [Installation](documentation/Installation.md) ·
|
|
@@ -131,20 +144,16 @@ Update PWN frequently — new plugins, agent tools, skills and zero-day tooling
|
|
|
131
144
|
land regularly:
|
|
132
145
|
|
|
133
146
|
```
|
|
134
|
-
$
|
|
135
|
-
$
|
|
136
|
-
$ gem uninstall --all --executables pwn
|
|
137
|
-
$ gem install --verbose pwn
|
|
147
|
+
$ gem update pwn
|
|
148
|
+
$ pwn setup # re-doctor — new versions may add capabilities
|
|
138
149
|
$ pwn
|
|
139
|
-
pwn[v0.5.
|
|
150
|
+
pwn[v0.5.629]:001 >>> PWN.help
|
|
140
151
|
```
|
|
141
152
|
|
|
142
|
-
|
|
153
|
+
From a git checkout:
|
|
143
154
|
|
|
144
155
|
```
|
|
145
|
-
$
|
|
146
|
-
$ rvmsudo gem uninstall --all --executables pwn
|
|
147
|
-
$ rvmsudo gem install --verbose pwn
|
|
156
|
+
$ cd /opt/pwn && git pull && rake install && pwn setup
|
|
148
157
|
```
|
|
149
158
|
|
|
150
159
|
**Inside the `pwn` REPL:**
|
|
@@ -160,11 +169,10 @@ $ echo "$LONG_PROMPT" | pwn --ai -
|
|
|
160
169
|
$ pwn -Y ./ci/pwn.yaml --ai 'Run pwn_sast against ./src and summarise HIGH findings' > findings.txt
|
|
161
170
|
```
|
|
162
171
|
|
|
163
|
-
|
|
164
|
-
Easiest upgrade of Ruby + pwn from a previous install:
|
|
172
|
+
**Provision a CI runner / Docker image:**
|
|
165
173
|
|
|
166
174
|
```
|
|
167
|
-
$
|
|
175
|
+
$ pwn setup --profile web --yes && pwn setup --check # exits 1 if degraded
|
|
168
176
|
```
|
|
169
177
|
|
|
170
178
|
---
|
data/bin/pwn
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
|
|
4
4
|
require 'pwn'
|
|
5
5
|
|
|
6
|
+
# ----------------------------------------------------------------------
|
|
7
|
+
# Bare-word subcommand: `pwn setup [...]` → delegate to bin/pwn_setup so
|
|
8
|
+
# `gem install pwn && pwn setup` is the canonical two-step install path.
|
|
9
|
+
# Must be handled BEFORE OptionParser (which would reject `setup`).
|
|
10
|
+
# ----------------------------------------------------------------------
|
|
11
|
+
if ARGV.first == 'setup'
|
|
12
|
+
ARGV.shift
|
|
13
|
+
setup_bin = File.expand_path('pwn_setup', __dir__)
|
|
14
|
+
setup_bin = Gem.bin_path('pwn', 'pwn_setup') unless File.file?(setup_bin)
|
|
15
|
+
load setup_bin
|
|
16
|
+
exit
|
|
17
|
+
end
|
|
18
|
+
|
|
6
19
|
opts = PWN::Env[:driver_opts]
|
|
7
20
|
pwn_driver = PWN::Driver::Parser.new do |options|
|
|
8
21
|
options.on(
|
|
@@ -14,6 +27,16 @@ pwn_driver = PWN::Driver::Parser.new do |options|
|
|
|
14
27
|
) do |a|
|
|
15
28
|
opts[:ai] = a
|
|
16
29
|
end
|
|
30
|
+
|
|
31
|
+
options.on(
|
|
32
|
+
'-S[PROFILE]',
|
|
33
|
+
'--setup[=PROFILE]',
|
|
34
|
+
'<Optional - Post-install doctor / capability provisioner. With no ' \
|
|
35
|
+
"PROFILE runs a read-only check; with PROFILE (#{PWN::Setup::PROFILES.keys.join('|')}) " \
|
|
36
|
+
'installs OS deps for that capability set. Same as `pwn setup` / `pwn_setup`>'
|
|
37
|
+
) do |p|
|
|
38
|
+
opts[:setup] = p || true
|
|
39
|
+
end
|
|
17
40
|
end
|
|
18
41
|
pwn_driver.auto_opts_help = false
|
|
19
42
|
pwn_driver.parse!
|
|
@@ -21,7 +44,18 @@ pwn_driver.parse!
|
|
|
21
44
|
begin
|
|
22
45
|
pwn_pid = Process.pid
|
|
23
46
|
|
|
24
|
-
if opts[:
|
|
47
|
+
if opts[:setup]
|
|
48
|
+
# ------------------------------------------------------------------
|
|
49
|
+
# `pwn --setup` → PWN::Setup.check (read-only doctor)
|
|
50
|
+
# `pwn --setup=web` → PWN::Setup.deps(profile: :web)
|
|
51
|
+
# ------------------------------------------------------------------
|
|
52
|
+
if opts[:setup] == true
|
|
53
|
+
r = PWN::Setup.check
|
|
54
|
+
exit(r[:ok] ? 0 : 1)
|
|
55
|
+
else
|
|
56
|
+
PWN::Setup.deps(profile: opts[:setup])
|
|
57
|
+
end
|
|
58
|
+
elsif opts[:ai]
|
|
25
59
|
# ------------------------------------------------------------------
|
|
26
60
|
# Headless pwn-ai: behave as if the user typed PROMPT at the pwn-ai
|
|
27
61
|
# TUI, but non-interactively — a single agent-loop turn with native
|
data/bin/pwn_setup
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require 'pwn'
|
|
5
|
+
|
|
6
|
+
opts = PWN::Env[:driver_opts]
|
|
7
|
+
pwn_driver = PWN::Driver::Parser.new do |options|
|
|
8
|
+
options.banner = "USAGE: #{File.basename($PROGRAM_NAME)} [opts]\n " \
|
|
9
|
+
"Post-install doctor & capability provisioner for the PWN gem.\n " \
|
|
10
|
+
"With no options, runs a read-only capability check.\n"
|
|
11
|
+
|
|
12
|
+
options.on('-c', '--check',
|
|
13
|
+
'<Optional - Read-only doctor: which PWN capabilities are usable on this host? (default action)>') do |o|
|
|
14
|
+
opts[:check] = o
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
options.on('-d', '--deps',
|
|
18
|
+
'<Optional - Install OS headers + external tools + rebuild native gems for --profile (default: full)>') do |o|
|
|
19
|
+
opts[:deps] = o
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
options.on('-pNAME', '--profile=NAME',
|
|
23
|
+
"<Optional - Capability profile: #{PWN::Setup::PROFILES.keys.join(' | ')} (default: full)>") do |o|
|
|
24
|
+
opts[:profile] = o
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
options.on('-l', '--list-profiles',
|
|
28
|
+
'<Optional - List capability profiles and exit>') do |o|
|
|
29
|
+
opts[:list] = o
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
options.on('-y', '--yes',
|
|
33
|
+
'<Optional - Assume yes; non-interactive (CI-friendly)>') do |o|
|
|
34
|
+
opts[:yes] = o
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
options.on('-n', '--dry-run',
|
|
38
|
+
'<Optional - Print the commands that would run, do not execute>') do |o|
|
|
39
|
+
opts[:dry_run] = o
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
pwn_driver.auto_opts_help = false
|
|
43
|
+
pwn_driver.parse!
|
|
44
|
+
|
|
45
|
+
begin
|
|
46
|
+
if opts[:list]
|
|
47
|
+
PWN::Setup.list_profiles
|
|
48
|
+
elsif opts[:deps] || opts[:profile]
|
|
49
|
+
PWN::Setup.deps(
|
|
50
|
+
profile: opts[:profile],
|
|
51
|
+
yes: opts[:yes],
|
|
52
|
+
dry_run: opts[:dry_run]
|
|
53
|
+
)
|
|
54
|
+
else
|
|
55
|
+
r = PWN::Setup.check
|
|
56
|
+
exit 1 unless r[:ok]
|
|
57
|
+
end
|
|
58
|
+
rescue Interrupt
|
|
59
|
+
puts "\naborted."
|
|
60
|
+
exit 130
|
|
61
|
+
rescue StandardError => e
|
|
62
|
+
warn "pwn_setup: #{e.class}: #{e.message}"
|
|
63
|
+
exit 1
|
|
64
|
+
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# AI / LLM Integration — `PWN::AI`
|
|
2
2
|
|
|
3
3
|
One agent loop, five interchangeable engines. Swap providers by changing one
|
|
4
|
-
line in `~/.pwn/
|
|
4
|
+
line in `~/.pwn/pwn.yaml`; the tool-calling contract is normalised so the
|
|
5
5
|
agent code never cares which model is behind it.
|
|
6
6
|
|
|
7
7
|

|
|
@@ -14,23 +14,58 @@ agent code never cares which model is behind it.
|
|
|
14
14
|
| `anthropic` | `PWN::AI::Anthropic` | `key:` | tool-use native |
|
|
15
15
|
| `grok` | `PWN::AI::Grok` | `key:` **or** `oauth: true` | OAuth = RFC-8628 device-code flow using xAI's public Grok-CLI client id (no secret) — see skill `xai_grok_oauth_device_flow` |
|
|
16
16
|
| `gemini` | `PWN::AI::Gemini` | `key:` | function-calling native |
|
|
17
|
-
| `ollama` | `PWN::AI::Ollama` | none | local
|
|
17
|
+
| `ollama` | `PWN::AI::Ollama` | none | local — native `/api/chat` (`num_ctx`, `keep_alive`, low-temp + `format:'json'` on tool turns) and `/api/embed` for `PWN::MemoryIndex` |
|
|
18
|
+
|
|
19
|
+
> PWN is **model-agnostic**. `ai.<engine>.model` is passed straight through to
|
|
20
|
+
> the provider — the codebase and docs deliberately never name a specific
|
|
21
|
+
> model id so you can point each engine at whatever the vendor currently
|
|
22
|
+
> ships (or whatever `ollama list` shows locally).
|
|
18
23
|
|
|
19
24
|
## Selecting an engine
|
|
20
25
|
|
|
21
26
|
```yaml
|
|
22
|
-
# ~/.pwn/
|
|
27
|
+
# ~/.pwn/pwn.yaml
|
|
23
28
|
ai:
|
|
24
|
-
|
|
29
|
+
active: grok
|
|
25
30
|
grok:
|
|
26
|
-
oauth:
|
|
31
|
+
oauth:
|
|
32
|
+
enroll: true # first run opens https://accounts.x.ai/… device page
|
|
27
33
|
```
|
|
28
34
|
|
|
29
35
|
```ruby
|
|
30
36
|
# at runtime
|
|
31
|
-
PWN::Env[:ai][:
|
|
37
|
+
PWN::Env[:ai][:active] = :ollama
|
|
32
38
|
```
|
|
33
39
|
|
|
40
|
+
## Engine-aware behaviour
|
|
41
|
+
|
|
42
|
+
The harness adapts to the *class* of engine, not the model name:
|
|
43
|
+
|
|
44
|
+
| Concern | Frontier (`openai` · `anthropic` · `grok` · `gemini`) | Local (`ollama`) |
|
|
45
|
+
|---|---|---|
|
|
46
|
+
| **PromptBuilder.budget** | full MEMORY / METRICS / MISTAKES / LEARNING / EXTRO blocks | tightened via `ai.ollama.prompt_budget` (extro off by default) |
|
|
47
|
+
| **MEMORY ranking** | relevance-ranked when a local Ollama `embed_model` is reachable, else newest-first | relevance-ranked via `PWN::MemoryIndex` (`~/.pwn/memory.idx`) |
|
|
48
|
+
| **Tool schemas shipped** | all toolsets | `CORE_TOOLS` + top-K keyword matches when `ai.agent.tool_router` is on |
|
|
49
|
+
| **Pre-pass** | none | `plan_first` numbered tool plan before first dispatch |
|
|
50
|
+
| **Few-shot** | none | `Learning.exemplars_for(request)` splices a prior successful trace |
|
|
51
|
+
| **Dispatch parsing** | strict | tolerant — Levenshtein tool-name repair + JSON5-ish arg cleanup, each repair fingerprinted into `Mistakes` |
|
|
52
|
+
| **Post-answer** | `auto_introspect` | `auto_introspect` **+** `fact_check_local_final` (auto `extro_verify` on CVE/version-shaped claims) |
|
|
53
|
+
| **Metrics bucket** | `metrics.json[:tools][name][:engines][:<engine>]` | same — the `TOOL EFFECTIVENESS` block is per-engine so local telemetry never blends with frontier |
|
|
54
|
+
|
|
55
|
+
## Teacher-student reflection
|
|
56
|
+
|
|
57
|
+
`ai.reflect_engine` decouples *doing* from *learning-about-doing*:
|
|
58
|
+
|
|
59
|
+
```yaml
|
|
60
|
+
ai:
|
|
61
|
+
active: ollama # the local model executes tools and answers
|
|
62
|
+
reflect_engine: anthropic # a frontier model writes the durable Memory :lesson
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`PWN::AI::Agent::Reflect.on` temporarily flips the active engine for the
|
|
66
|
+
introspection call only, so the local model reads back distilled reasoning it
|
|
67
|
+
could not have produced itself.
|
|
68
|
+
|
|
34
69
|
## Direct client use (no agent)
|
|
35
70
|
|
|
36
71
|
```ruby
|
|
@@ -43,10 +78,14 @@ puts resp[:content]
|
|
|
43
78
|
## Model diversity in Swarm
|
|
44
79
|
|
|
45
80
|
Because each persona in [`agents.yml`](Swarm.md) can override `engine:`, an
|
|
46
|
-
`agent_debate` can
|
|
47
|
-
|
|
81
|
+
`agent_debate` can pit five *different providers* against each other — real
|
|
82
|
+
antagonism, not one model role-playing three voices. The same mechanism backs
|
|
83
|
+
`ai.agent.escalation_persona`: when a local model is stuck, `Loop.run` asks a
|
|
84
|
+
frontier persona for a 3-line corrective hint and injects it as a synthetic
|
|
85
|
+
tool result.
|
|
48
86
|
|
|
49
87
|
**See also:** [pwn-ai Agent](pwn-ai-Agent.md) ·
|
|
50
|
-
[Agent Tool Registry](Agent-Tool-Registry.md) · [Swarm](Swarm.md)
|
|
88
|
+
[Agent Tool Registry](Agent-Tool-Registry.md) · [Swarm](Swarm.md) ·
|
|
89
|
+
[Configuration](Configuration.md)
|
|
51
90
|
|
|
52
91
|
[← Home](Home.md)
|
data/documentation/AWS.md
CHANGED
|
@@ -10,7 +10,7 @@ with the PWN `opts = {}` convention so they compose in the REPL and in
|
|
|
10
10
|
|
|
11
11
|
Standard AWS SDK chain: `~/.aws/credentials` profile, env vars
|
|
12
12
|
(`AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` / `AWS_SESSION_TOKEN`), or
|
|
13
|
-
instance profile. Optionally pin in `~/.pwn/
|
|
13
|
+
instance profile. Optionally pin in `~/.pwn/pwn.yaml` under `aws:`.
|
|
14
14
|
|
|
15
15
|
## Quick enumeration
|
|
16
16
|
|
|
@@ -21,6 +21,30 @@ toolsets; the JSON-Schema for each tool is what the model actually sees.
|
|
|
21
21
|
| `cron` | `cron_list` · `cron_create` · `cron_run` · `cron_enable` · `cron_disable` · `cron_remove` | `PWN::Cron` → `~/.pwn/cron/jobs.yml` |
|
|
22
22
|
| `swarm` | `agent_list` · `agent_spawn` · `agent_ask` · `agent_debate` · `agent_broadcast` · `swarm_bus` · `swarm_list` | `PWN::AI::Agent::Swarm` → `~/.pwn/agents.yml` + `~/.pwn/swarm/` |
|
|
23
23
|
|
|
24
|
+
|
|
25
|
+
## Dynamic tool-set slimming (`ai.agent.tool_router`)
|
|
26
|
+
|
|
27
|
+
Shipping every schema on every turn overwhelms a small local model — the
|
|
28
|
+
choice space is huge and it mis-routes (e.g. picks an RF tool for a git
|
|
29
|
+
question). When `ai.agent.tool_router: true` **and** `Loop.run` passes the
|
|
30
|
+
user request through as `relevance:`, `Registry.definitions` shrinks the
|
|
31
|
+
pool to:
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
CORE_TOOLS = shell · pwn_eval · memory_remember · memory_recall
|
|
35
|
+
mistakes_record · mistakes_resolve · learning_note_outcome
|
|
36
|
+
+ top-K keyword-ranked matches for THIS request
|
|
37
|
+
(ties break on Metrics per-engine success_rate → the router
|
|
38
|
+
itself is a learned component)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```ruby
|
|
42
|
+
PWN::AI::Agent::Registry.definitions(relevance: 'nmap sweep 10.0.0.0/8', top_k: 10)
|
|
43
|
+
PWN::AI::Agent::Registry.rank(query: 'run a shell command') # inspect ranking
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Frontier engines leave `tool_router` off and receive the full set.
|
|
47
|
+
|
|
24
48
|
## Adding a tool
|
|
25
49
|
|
|
26
50
|
```ruby
|
data/documentation/BurpSuite.md
CHANGED
|
@@ -6,10 +6,13 @@ Professional's headless mode + REST API.
|
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
9
|
+
> **Install:** `pwn setup --profile web` — burpsuite · zaproxy · chromium ·
|
|
10
|
+
> geckodriver · sqlmap · tor. See [Installation](Installation.md).
|
|
11
|
+
|
|
9
12
|
## Configure
|
|
10
13
|
|
|
11
14
|
```yaml
|
|
12
|
-
# ~/.pwn/
|
|
15
|
+
# ~/.pwn/pwn.yaml (edit via `pwn-vault`)
|
|
13
16
|
burp:
|
|
14
17
|
jar: /opt/burpsuite_pro/burpsuite_pro.jar
|
|
15
18
|
api_key: <REST-API-KEY>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CLI Drivers — `bin/pwn_*`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
53 headless executables, each a thin `OptionParser` wrapper over one plugin
|
|
4
4
|
(or one workflow). They exist so CI/CD can call PWN without a REPL or an LLM.
|
|
5
5
|
|
|
6
6
|

|
|
@@ -26,19 +26,34 @@ pwn_crt_sh pwn_serial_check_voicemail
|
|
|
26
26
|
pwn_defectdojo_engagement_create pwn_serial_msr206
|
|
27
27
|
pwn_defectdojo_importscan pwn_serial_qualcomm_commands
|
|
28
28
|
pwn_defectdojo_reimportscan pwn_serial_son_micro_sm132_rfid
|
|
29
|
-
pwn_diff_csv_files_w_column_exclude
|
|
30
|
-
pwn_domain_reversewhois
|
|
31
|
-
pwn_fuzz_net_app_proto
|
|
32
|
-
pwn_gqrx_scanner
|
|
33
|
-
pwn_jenkins_create_job
|
|
34
|
-
pwn_jenkins_create_view
|
|
35
|
-
pwn_jenkins_install_plugin
|
|
36
|
-
pwn_zaproxy_active_rest_api_scan
|
|
37
|
-
pwn_zaproxy_active_scan
|
|
29
|
+
pwn_diff_csv_files_w_column_exclude pwn_setup
|
|
30
|
+
pwn_domain_reversewhois pwn_shodan_graphql_introspection
|
|
31
|
+
pwn_fuzz_net_app_proto pwn_shodan_search
|
|
32
|
+
pwn_gqrx_scanner pwn_simple_http_server
|
|
33
|
+
pwn_jenkins_create_job pwn_web_cache_deception
|
|
34
|
+
pwn_jenkins_create_view pwn_www_checkip
|
|
35
|
+
pwn_jenkins_install_plugin pwn_www_uri_buster
|
|
38
36
|
```
|
|
39
37
|
|
|
40
38
|
Run any with `--help` for its flags.
|
|
41
39
|
|
|
40
|
+
## `pwn_setup` — post-install doctor & capability provisioner
|
|
41
|
+
|
|
42
|
+
The one driver that isn't a plugin wrapper. It grows a bare `gem install pwn`
|
|
43
|
+
into a fully-armed host by installing OS headers / external tools for whatever
|
|
44
|
+
capability profile you ask for. Also reachable as `pwn setup` and
|
|
45
|
+
`pwn --setup[=PROFILE]`.
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pwn_setup # read-only doctor; exit 1 if degraded
|
|
49
|
+
pwn_setup --list-profiles
|
|
50
|
+
pwn_setup --profile web --yes # CI-friendly, non-interactive
|
|
51
|
+
pwn_setup --deps --dry-run # print the apt/dnf/pacman/brew/port commands only
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
See [Installation](Installation.md) for the full profile table and
|
|
55
|
+
`PWN::Setup` API.
|
|
56
|
+
|
|
42
57
|
## Typical CI usage
|
|
43
58
|
|
|
44
59
|
```yaml
|
|
@@ -46,6 +61,8 @@ Run any with `--help` for its flags.
|
|
|
46
61
|
sast:
|
|
47
62
|
image: 0dayinc/pwn:latest
|
|
48
63
|
script:
|
|
64
|
+
- pwn_setup --profile net --yes
|
|
65
|
+
- pwn_setup --check # gate: exit 1 if degraded
|
|
49
66
|
- pwn_sast -d "$CI_PROJECT_DIR" -o sast_out/
|
|
50
67
|
- pwn_defectdojo_importscan -f sast_out/report.json -e "$DD_ENGAGEMENT"
|
|
51
68
|
```
|