pwn 0.5.785 → 0.5.787
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/build_gem.sh +1 -1
- data/documentation/Backup-Retention.md +8 -9
- data/documentation/Harness-Evaluation.md +1 -1
- data/documentation/Installation.md +1 -1
- data/documentation/Operability.md +1 -0
- data/documentation/Plugin-Degradation.md +5 -3
- data/documentation/Plugins.md +1 -1
- data/documentation/Policy-Benchmark.md +32 -33
- data/documentation/YubiKey-Vaults.md +13 -11
- data/documentation/YubiKey.md +149 -270
- data/documentation/diagrams/dot/pwn-ai-feedback-learning-loop.dot +1 -1
- data/documentation/diagrams/dot/reinforcement-learning.dot +2 -2
- data/documentation/diagrams/pwn-ai-feedback-learning-loop.svg +1 -1
- data/documentation/diagrams/reinforcement-learning.svg +89 -89
- data/lib/pwn/ai/agent/policy_evaluation.rb +326 -28
- data/lib/pwn/backups.rb +3 -1
- data/lib/pwn/plugins/repl/mesh.rb +11 -3
- data/lib/pwn/plugins/repl.rb +8 -0
- data/lib/pwn/version.rb +1 -1
- data/spec/lib/pwn/ai/agent/policy_evaluation_spec.rb +10 -23
- data/spec/lib/pwn/ai/cli_spec.rb +2 -7
- data/spec/lib/pwn/backups_spec.rb +15 -0
- data/spec/lib/pwn/plugins/repl_mesh_layout_spec.rb +2 -0
- data/third_party/pwn_rdoc.jsonl +16 -0
- metadata +1 -4
- data/scripts/benchmark_policy.rb +0 -376
- data/scripts/build_gate.rb +0 -58
- data/spec/integration/build_gate_spec.rb +0 -73
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ce00a627ad7114375ec35258f45bd003f3fb0799851af992d5a1031d59d1a2d6
|
|
4
|
+
data.tar.gz: 6687afae44eb7e95191584266cc65c09033c68cc42c0b649091dcc6e7ff269d4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 23d19fc265c256a615ec04fc1f6772f7c3924ffad70e94b8725afadba0651319610e4cf2fbfb57803122e3ca7e69cbd01f9517292414b9294538661f8d84fe58
|
|
7
|
+
data.tar.gz: 476d7566a80d68b207d3c2e947bcba724251ad4adee393a5dca8992e52ed8953f8dc8f4f9b7ad7358c7eb8514db4c787739e25786d1b3206bf036e76ba31cc12
|
data/build_gem.sh
CHANGED
|
@@ -44,7 +44,7 @@ if [[ $old_ruby_version == $new_ruby_version ]]; then
|
|
|
44
44
|
export rvmsudo_secure_path=1
|
|
45
45
|
rvmsudo /bin/bash --login -c "cd ${pwn_root} && ./reinstall_gemset.sh"
|
|
46
46
|
cd /tmp && cd "$pwn_root"
|
|
47
|
-
|
|
47
|
+
rvmsudo /bin/bash --login -c "cd ${pwn_root} && bundle exec rake"
|
|
48
48
|
rvmsudo /bin/bash --login -c "cd ${pwn_root} && bundle exec rake install"
|
|
49
49
|
rvmsudo /bin/bash --login -c "cd ${pwn_root} && bundle exec rake rerdoc"
|
|
50
50
|
echo "Invoking bundle-audit Gemfile Scanner..."
|
|
@@ -32,15 +32,14 @@ maintenance. Learning reentrancy is bound to the owning PID and thread; an
|
|
|
32
32
|
attempt to acquire Learning underneath an unowned backup transaction is rejected.
|
|
33
33
|
Maintenance still defers when the Learning writer is busy.
|
|
34
34
|
|
|
35
|
-
Before a new folder is admitted, oldest completed
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
live store or grant permission to prune it.
|
|
35
|
+
Before a new folder is admitted, oldest completed generations may be expired
|
|
36
|
+
to make room. That includes a capture pin that is not listed in the retention
|
|
37
|
+
policy and not named by current evidence. Prepared/interrupted generations,
|
|
38
|
+
retention-policy pins and current literal evidence references remain protected.
|
|
39
|
+
Malformed reference data fails closed when expiry would be needed. If those
|
|
40
|
+
protected folders occupy the seven-folder limit, the next producer fails before
|
|
41
|
+
modifying its source. Unknown legacy folders count toward capacity but are not
|
|
42
|
+
silently certified or expired.
|
|
44
43
|
|
|
45
44
|
Transactions publish `prepared` before payload/source changes and `complete`
|
|
46
45
|
only after successful return. Exceptions, interrupted/blocked results and failed
|
|
@@ -64,7 +64,7 @@ replay potentially destructive historical actions.
|
|
|
64
64
|
|
|
65
65
|
Reuse the existing policy CLI (`pwn-ai --policy evaluate`, `promote`, `rollback`)
|
|
66
66
|
and frozen snapshots, rather than updating live stores during evaluation.
|
|
67
|
-
`PolicyEvaluation.evaluate` runs
|
|
67
|
+
`PolicyEvaluation.evaluate` runs a fresh worker with a cleared
|
|
68
68
|
environment and disposable HOME; off/baseline/candidate use frozen policy bytes
|
|
69
69
|
and independently checked tasks. The split-corpus executable experiments clone
|
|
70
70
|
frozen training HOMEs per trial, check input/snapshot hashes and reject duplicate
|
|
@@ -315,7 +315,7 @@ pwn setup --list-profiles
|
|
|
315
315
|
| `vision` | `OCR` · `ScannableCodes` · `Reports` · `extro_vision` · tesseract / zbar / graphviz |
|
|
316
316
|
| `voice` | `PWN::Plugins::Voice` · `extro_voice` · espeak-ng / sox |
|
|
317
317
|
| `exploit` | `Metasploit` · `sqlmap` |
|
|
318
|
-
| `hardware` | `Serial` · `BusPirate` · `Android` · `BareSIP` · `YubiKey` (`ykman`) · `extro_serial` · `extro_telecomm` |
|
|
318
|
+
| `hardware` | `Serial` · `BusPirate` · `Android` · `BareSIP` · `YubiKey` (HIDAPI/PC/SC, no `ykman`) · `extro_serial` · `extro_telecomm` |
|
|
319
319
|
| `re` | `Radare2` · `GDB` · `ExploitDev` · `Frida` · Android RE (`apktool`/`jadx`) · `pwndbg` · `ropper` · `rizin` |
|
|
320
320
|
| `full` | everything above |
|
|
321
321
|
|
|
@@ -68,6 +68,7 @@ a process that is already running. Restart after installing the matching package
|
|
|
68
68
|
| Mission lifetime | CTRL+C kills the mission through `PWN::AI::Agent::MissionNamespace`. That owner is Ruby plus util-linux `unshare` and Linux pidfds. There is no compiled `pwn_mission` extension and no systemd fallback. |
|
|
69
69
|
| Recovery copies | Every PWN recovery producer uses `PWN::Backups` and `~/.pwn/backup/`, seven generation folders total. Adjacent `.bak` files are not the current producer. |
|
|
70
70
|
| Housekeeping | A fresh install seeds one internal `session_cleanup` coordinator. Curriculum jobs are not seeded. Housekeeping never uses systemd. |
|
|
71
|
+
| YubiKey | `PWN::Plugins::YubiKey` is native Ruby over HIDAPI and PC/SC. `required_bins` is empty and no `ykman` process is started. A library probe is not a connected device. Fixture coverage is not physical interoperability. See [YubiKey](YubiKey.md). |
|
|
71
72
|
|
|
72
73
|
Details: [Runtime Source Protection](Runtime-Source-Protection.md),
|
|
73
74
|
[Mission Cancellation](Mission-Cancellation.md),
|
|
@@ -77,9 +77,11 @@ Required: `subfinder`, `httpx`. Fallback: `NmapIt.scan` + `Corpus.get`.
|
|
|
77
77
|
|
|
78
78
|
## pwn-plugins-yubikey
|
|
79
79
|
|
|
80
|
-
Required: `
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
Required: none. `required_bins` is empty. Preflight probes HIDAPI and PC/SC
|
|
81
|
+
through `available?` and reports `FIDO native transport` or
|
|
82
|
+
`PC/SC native transport` when a library is missing. It never opens a device,
|
|
83
|
+
requests a PIN, or performs a challenge. An `ok` library probe does not
|
|
84
|
+
establish device availability, provisioning, or authorization.
|
|
83
85
|
Hardware-backed vault operations require the selected YubiKey and its existing
|
|
84
86
|
HMAC-SHA1 OTP slot; missing devices, denied touch, or authentication failures
|
|
85
87
|
raise without falling back to a disk master key or software MFA. Restore device
|
data/documentation/Plugins.md
CHANGED
|
@@ -64,7 +64,7 @@ show-source PWN::Plugins::Fuzz.http
|
|
|
64
64
|
|---|---|
|
|
65
65
|
| `OAuth2` · `BasicAuth` · `AuthenticationHelper` | credential flows |
|
|
66
66
|
| `Vault` | Local encrypted configuration and engagement loot helpers; not a HashiCorp Vault client |
|
|
67
|
-
| [`YubiKey`](YubiKey.md) |
|
|
67
|
+
| [`YubiKey`](YubiKey.md) | Native Ruby HID/PC/SC operations, HMAC-backed vaults and OATH codes |
|
|
68
68
|
|
|
69
69
|
### Hardware / Physical
|
|
70
70
|
| Module | Purpose | Doc |
|
|
@@ -9,37 +9,37 @@ not a simulated language model.
|
|
|
9
9
|
|
|
10
10
|
## Run from a source checkout
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
There is no standalone `scripts/benchmark_policy.rb`. The worker lives in
|
|
13
|
+
`PWN::AI::Agent::PolicyEvaluation` and runs only in a fresh Ruby process.
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
require './lib/pwn/ai/agent/policy_evaluation'
|
|
17
|
+
PWN::AI::Agent::PolicyEvaluation.export_training(dir: '/tmp/pwn-policy-snapshots')
|
|
16
18
|
```
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
overlap, a negative control succeeds, or a positive control fails. Self-checks
|
|
26
|
-
also require actual training updates in the on arm and none in the off arm.
|
|
27
|
-
They deliberately do **not** require an improvement of a predetermined size.
|
|
20
|
+
`export_training` writes `off.json` and `on.json` under a new directory whose
|
|
21
|
+
parent is a real directory, then returns held-out reports for seeds 0 and 1.
|
|
22
|
+
It does not promote. Frozen snapshots are compared with `evaluate` or
|
|
23
|
+
`pwn-ai --policy evaluate`. Do not load this from the live agent console.
|
|
24
|
+
The worker exits nonzero if persistence changes during evaluation, splits
|
|
25
|
+
overlap, a negative control succeeds, or a positive control fails.
|
|
26
|
+
It does **not** require an improvement of a predetermined size.
|
|
28
27
|
|
|
29
28
|
## Relation to existing evaluation
|
|
30
29
|
|
|
31
30
|
`lib/pwn/ai/agent/curriculum.rb` provides live self-play, judge-based practice,
|
|
32
31
|
mistake-derived evaluation prompts, and adapter training/promotion gates. This
|
|
33
|
-
|
|
32
|
+
module does not invoke those paths. It provides a small, independently
|
|
34
33
|
scored experiment where the training labels come from actual task achievement,
|
|
35
34
|
not `Reward.judge`, model prose, or a previously assigned reward. It calls
|
|
36
35
|
`Policy.begin_episode`, `observe_step`, and `finish` with those labels during
|
|
37
36
|
training. This is not a test of Reward's verification-record binding, the live
|
|
38
37
|
Loop, Metrics learning, memory retrieval, or adapter training.
|
|
39
38
|
|
|
40
|
-
The experimental driver
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
The experimental driver is `PWN::AI::Agent::PolicyEvaluation`. Its public
|
|
40
|
+
methods spawn a fresh Ruby process that loads only Policy and Registry after
|
|
41
|
+
clearing the environment. Loading the module does not enable evaluation or
|
|
42
|
+
promotion.
|
|
43
43
|
|
|
44
44
|
## Protocol
|
|
45
45
|
|
|
@@ -161,21 +161,19 @@ usage records. Do not present this controller experiment as that study.
|
|
|
161
161
|
|
|
162
162
|
## Opt-in independent snapshot evaluation (R5)
|
|
163
163
|
|
|
164
|
-
|
|
165
|
-
export snapshots and run repeated evaluations in **fresh subprocesses**, use:
|
|
164
|
+
To export snapshots and run repeated evaluations in **fresh subprocesses**:
|
|
166
165
|
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
--output /tmp/pwn-policy-heldout.json
|
|
166
|
+
```ruby
|
|
167
|
+
require './lib/pwn/ai/agent/policy_evaluation'
|
|
168
|
+
PWN::AI::Agent::PolicyEvaluation.export_training(dir: '/tmp/pwn-policy-snapshots')
|
|
171
169
|
```
|
|
172
170
|
|
|
173
|
-
The snapshot directory must be **new
|
|
174
|
-
`off.json` and `on.json` are genuine Policy JSON tables after
|
|
175
|
-
training schedule. Exported `updated_at` metadata is normalized
|
|
176
|
-
reproducible snapshot digests; no Q entries or rewards are
|
|
177
|
-
happens before that arm's evaluation.
|
|
178
|
-
|
|
171
|
+
The snapshot directory must be **new**. Its parent must be a real directory,
|
|
172
|
+
not a symlink. `off.json` and `on.json` are genuine Policy JSON tables after
|
|
173
|
+
the same real training schedule. Exported `updated_at` metadata is normalized
|
|
174
|
+
to `null` for reproducible snapshot digests; no Q entries or rewards are
|
|
175
|
+
fabricated. Export happens before that arm's evaluation. Export does not
|
|
176
|
+
promote anything or discover/read a real home-directory policy.
|
|
179
177
|
|
|
180
178
|
The added `heldout` array contains protocol `pwn-policy-heldout-v2`, for suite
|
|
181
179
|
indices 0 and 1. Each worker runs three frozen arms: `off` (baseline snapshot,
|
|
@@ -231,13 +229,14 @@ not train or write the live policy. The Ruby API supports other indices 0..7.
|
|
|
231
229
|
|
|
232
230
|
From a source checkout, this disposable demonstration stays entirely under a
|
|
233
231
|
new `/tmp` directory (use `pwn-ai` instead of `ruby -Ilib bin/pwn-ai` for an
|
|
234
|
-
installed executable)
|
|
232
|
+
installed executable). Export writes `off.json` and `on.json`; it does not
|
|
233
|
+
promote:
|
|
235
234
|
|
|
236
235
|
```sh
|
|
237
236
|
umask 077
|
|
238
237
|
work=$(mktemp -d /tmp/pwn-offline-policy.XXXXXX)
|
|
239
|
-
ruby
|
|
240
|
-
|
|
238
|
+
ruby -Ilib -rpwn/ai/agent/policy_evaluation -e \
|
|
239
|
+
"PWN::AI::Agent::PolicyEvaluation.export_training(dir: '$work/snapshots')"
|
|
241
240
|
ruby -Ilib bin/pwn-ai --policy evaluate \
|
|
242
241
|
--baseline "$work/snapshots/off.json" --candidate "$work/snapshots/on.json" \
|
|
243
242
|
> "$work/reports.json"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# YubiKey-backed vaults and authentication
|
|
2
2
|
|
|
3
|
-
See [YubiKey device operations](YubiKey.md) for
|
|
4
|
-
provisioning safeguards and
|
|
3
|
+
See [YubiKey device operations](YubiKey.md) for native HID/PC/SC operations,
|
|
4
|
+
provisioning safeguards and the firmware boundary. No `ykman` process is used.
|
|
5
5
|
|
|
6
6
|
## Encryption model
|
|
7
7
|
|
|
@@ -53,7 +53,9 @@ end
|
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
`yubikey` is a Hash accepting `slot` (integer 1 or 2; default 2), optional
|
|
56
|
-
`serial`, optional
|
|
56
|
+
exact decimal `serial`, optional `reader` or `device_path`, and bounded
|
|
57
|
+
`timeout` seconds. An executable path such as `ykman` is rejected. The
|
|
58
|
+
envelope stores slot and serial only; it never stores a backend path.
|
|
57
59
|
`dump`, `decrypt`, `open_credentials` and hardware loot retrieval otherwise use
|
|
58
60
|
the slot/serial stored in their envelope. Selecting another serial permits an
|
|
59
61
|
explicitly provisioned recovery key with the same slot secret; the authentication
|
|
@@ -151,10 +153,10 @@ challenge does not accept an authenticator code.
|
|
|
151
153
|
|
|
152
154
|
For `pwn_web_cache_deception`, add `--yubikey-account='Example:alice'`, optionally
|
|
153
155
|
`--yubikey-serial=12345678`, and the required `--yubikey-confirm` to the normal
|
|
154
|
-
arguments for a compatible login module. The flag authorizes
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
arguments for a compatible login module. The flag authorizes native OATH
|
|
157
|
+
authentication and HOTP counter advancement. It does not authorize deleting or
|
|
158
|
+
repairing a corrupted credential. It is required for TOTP too; PWN never
|
|
159
|
+
silently supplies consent.
|
|
158
160
|
Confirmation/serial flags without an account are rejected before login.
|
|
159
161
|
|
|
160
162
|
## Scope boundaries
|
|
@@ -177,7 +179,7 @@ existing evidence-storage behavior and need separate access/at-rest protection.
|
|
|
177
179
|
harvested loot; metadata-only Vault queries do not unlock a device, but Dispatch's
|
|
178
180
|
separate output-redaction step can still require access to protected secrets.
|
|
179
181
|
|
|
180
|
-
Verification uses
|
|
181
|
-
exercise real Ruby encryption, authentication failures, selector validation
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
Verification uses synthetic native connections and HMAC responses. Tests
|
|
183
|
+
exercise real Ruby encryption, authentication failures, selector validation
|
|
184
|
+
and persistence entry points. They are not evidence of a physical YubiKey,
|
|
185
|
+
live website authentication or every firmware variant.
|