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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fef74967cd315acf1e070378d8e12000d552604b8d0f273d42638014d0a13a8c
4
- data.tar.gz: 3d68aa5c28678b95a4b20acbe878a36c6d0cd8c04357ee3d18c768a7e0435c75
3
+ metadata.gz: ce00a627ad7114375ec35258f45bd003f3fb0799851af992d5a1031d59d1a2d6
4
+ data.tar.gz: 6687afae44eb7e95191584266cc65c09033c68cc42c0b649091dcc6e7ff269d4
5
5
  SHA512:
6
- metadata.gz: '0871b196e754cfe2134ba0372f4108b24113d9a1f7b0355257b31a032833c4b91bd1e52f53ff467a4e9e817375b9138b5691c15ef621c6026a34d32672f77d2b'
7
- data.tar.gz: 2fef6064addee1ba16706d641f19af7a8bbf99432dfb1a13426fbd1d534d01b89d4a7f4dced9db9ad934d30db94dfcf908e88c993cb779424b706a0296db1cd2
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
- ruby "${pwn_root}/scripts/build_gate.rb" rvmsudo /bin/bash --login -c "cd ${pwn_root} && bundle exec rake"
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, unpinned generations may be
36
- expired to make room. Prepared/interrupted generations, explicit pins and current
37
- literal evidence references remain protected. Malformed reference data fails
38
- closed when expiry would be needed. Pins count **inside** the seven-folder limit:
39
- if they occupy capacity, the next producer fails before modifying its source.
40
- Unknown legacy folders count toward capacity but are not silently certified or
41
- expired. A pre-existing over-limit store can therefore block admission until an
42
- explicit offline remediation is performed; importing this source does not fix a
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 the existing standalone worker with a cleared
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: `ykman` (YubiKey Manager CLI). Preflight checks executable presence
81
- only; it never opens a device, requests a PIN, or performs a challenge. An `ok`
82
- status does not establish device availability, provisioning, or authorization.
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
@@ -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) | Guarded ykman operations, HMAC-backed authenticated vaults and OATH codes |
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
- ```sh
13
- ruby scripts/benchmark_policy.rb --self-check
14
- ruby scripts/benchmark_policy.rb --output /tmp/pwn-policy-benchmark.json
15
- bundle exec rubocop scripts/benchmark_policy.rb
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
- The experiment uses Ruby and its standard libraries; it does not require the
19
- full application boot sequence. Use a fresh Ruby process, not the live agent
20
- console. JSON is printed to stdout and optionally written to `--output`.
21
- `--self-check` runs independent scorer tests, both complete experimental arms,
22
- and two fresh snapshot workers; it prints short pass messages instead of a
23
- report. Use the options separately.
24
- The benchmark exits nonzero if persistence changes during evaluation, splits
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
- standalone script does not invoke those paths. It provides a small, independently
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 remains in `scripts/`. The opt-in `PolicyEvaluation`
41
- module launches only this fixed runner; it does not load the live agent in its
42
- workers. Its module autoload does not enable evaluation or promotion.
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
- The original commands and `off`/`on` report shape still work. To additionally
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
- ```sh
168
- ruby scripts/benchmark_policy.rb --heldout \
169
- --snapshot-dir /tmp/pwn-policy-snapshots \
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**, below `/tmp`, with no symlink parents.
174
- `off.json` and `on.json` are genuine Policy JSON tables after the same real
175
- training schedule. Exported `updated_at` metadata is normalized to `null` for
176
- reproducible snapshot digests; no Q entries or rewards are fabricated. Export
177
- happens before that arm's evaluation. Neither `--heldout` nor `--snapshot-dir`
178
- promotes anything or discovers/reads a real home-directory policy.
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 scripts/benchmark_policy.rb --heldout \
240
- --snapshot-dir "$work/snapshots" --output "$work/benchmark.json"
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 the `ykman` command families,
4
- provisioning safeguards and supported hardware/firmware boundaries.
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 local `ykman` executable path and bounded `timeout` seconds.
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 HOTP counter
155
- advancement, remembered-key authentication and deletion of invalid cached keys
156
- during account listing, and upstream `ykman` cleanup that may delete a corrupted
157
- OATH credential. It is required for TOTP too; PWN never silently supplies consent.
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 fake device processes and synthetic HMAC responses. Tests
181
- exercise real Ruby encryption, authentication failures, selector validation,
182
- subprocess cleanup and persistence entry points, but are not evidence of a
183
- physical YubiKey, live website authentication or every firmware variant.
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.