pwn 0.5.784 → 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/.ruby-version +1 -1
- data/Gemfile +6 -6
- data/README.md +37 -0
- data/bin/pwn +2 -1
- data/bin/pwn_web_cache_deception +35 -7
- data/build_gem.sh +1 -1
- data/documentation/AI-Integration.md +7 -5
- data/documentation/Agent-Tool-Registry.md +2 -2
- data/documentation/Backup-Retention.md +69 -15
- data/documentation/Configuration.md +10 -6
- data/documentation/Contributing.md +1 -1
- data/documentation/Cron.md +2 -2
- data/documentation/Diagrams.md +2 -2
- data/documentation/General-PWN-Usage.md +4 -3
- data/documentation/Harness-Evaluation.md +1 -1
- data/documentation/Home.md +6 -5
- data/documentation/How-PWN-Works.md +6 -5
- data/documentation/Installation.md +12 -9
- data/documentation/Mission-Cancellation.md +134 -0
- data/documentation/Operability.md +18 -0
- data/documentation/Persistence.md +7 -5
- data/documentation/Plugin-Degradation.md +14 -0
- data/documentation/Plugins.md +3 -2
- data/documentation/Policy-Benchmark.md +32 -33
- data/documentation/Runtime-Source-Protection.md +162 -0
- data/documentation/Transparent-Browser.md +11 -0
- data/documentation/Troubleshooting.md +3 -2
- data/documentation/What-is-PWN.md +2 -2
- data/documentation/YubiKey-Vaults.md +185 -0
- data/documentation/YubiKey.md +218 -0
- data/documentation/diagrams/cron-scheduling.svg +130 -130
- data/documentation/diagrams/dot/cron-scheduling.dot +3 -3
- data/documentation/diagrams/dot/persistence-filesystem.dot +5 -3
- data/documentation/diagrams/dot/plugin-ecosystem.dot +2 -2
- data/documentation/diagrams/dot/pwn-ai-feedback-learning-loop.dot +1 -1
- data/documentation/diagrams/dot/reinforcement-learning.dot +2 -2
- data/documentation/diagrams/persistence-filesystem.svg +172 -142
- data/documentation/diagrams/plugin-ecosystem.svg +64 -64
- data/documentation/diagrams/pwn-ai-feedback-learning-loop.svg +1 -1
- data/documentation/diagrams/reinforcement-learning.svg +89 -89
- data/documentation/pwn-ai-Agent.md +10 -4
- data/etc/default_cron/session_cleanup.rb +43 -27
- data/etc/default_skills/pwn/ai/agent/mission_namespace/SKILL.md +21 -0
- data/etc/default_skills/pwn/ai/agent/tools/browser_act/SKILL.md +45 -0
- data/etc/default_skills/pwn/ai/agent/tools/loot_query/SKILL.md +27 -26
- data/etc/default_skills/pwn/ai/agent/tools/recon_run/SKILL.md +25 -15
- data/etc/default_skills/pwn/ai/agent/tools/workspace_tool/SKILL.md +24 -0
- data/etc/default_skills/pwn/ai/server_tools/SKILL.md +25 -0
- data/etc/default_skills/pwn/backups/SKILL.md +54 -0
- data/etc/default_skills/pwn/plugins/recon/SKILL.md +12 -1
- data/etc/default_skills/pwn/plugins/yubikey/SKILL.md +157 -0
- data/etc/default_skills/pwn/plugins/yubikey/fido/SKILL.md +189 -0
- data/etc/default_skills/pwn/plugins/yubikey/hsmauth/SKILL.md +83 -0
- data/etc/default_skills/pwn/plugins/yubikey/management/SKILL.md +80 -0
- data/etc/default_skills/pwn/plugins/yubikey/oath/SKILL.md +115 -0
- data/etc/default_skills/pwn/plugins/yubikey/openpgp/SKILL.md +144 -0
- data/etc/default_skills/pwn/plugins/yubikey/otp/SKILL.md +97 -0
- data/etc/default_skills/pwn/plugins/yubikey/piv/SKILL.md +110 -0
- data/etc/default_skills/pwn/plugins/yubikey/protocol/SKILL.md +21 -0
- data/etc/default_skills/pwn/plugins/yubikey/security_domain/SKILL.md +75 -0
- data/etc/default_skills/pwn/plugins/yubikey/security_domain/scp/SKILL.md +46 -0
- data/etc/default_skills/pwn/plugins/yubikey/transport/SKILL.md +98 -0
- data/etc/default_skills/pwn/redaction/SKILL.md +13 -1
- data/lib/pwn/ai/agent/dispatch.rb +26 -15
- data/lib/pwn/ai/agent/learning.rb +14 -18
- data/lib/pwn/ai/agent/loop.rb +17 -1
- data/lib/pwn/ai/agent/mission_namespace.rb +331 -0
- data/lib/pwn/ai/agent/policy_evaluation.rb +334 -36
- data/lib/pwn/ai/agent/prompt_builder.rb +13 -2
- data/lib/pwn/ai/agent/request_runtime.rb +122 -18
- data/lib/pwn/ai/agent/reward.rb +5 -3
- data/lib/pwn/ai/agent/skill_consolidation.rb +3 -2
- data/lib/pwn/ai/agent/skill_review.rb +9 -5
- data/lib/pwn/ai/agent/swarm.rb +4 -0
- data/lib/pwn/ai/agent/tools/browser_act.rb +32 -0
- data/lib/pwn/ai/agent/tools/loot_query.rb +11 -1
- data/lib/pwn/ai/agent/tools/recon_run.rb +11 -1
- data/lib/pwn/ai/agent/tools/workspace_tool.rb +29 -0
- data/lib/pwn/ai/agent/turn_finalizer.rb +6 -2
- data/lib/pwn/ai/agent.rb +1 -0
- data/lib/pwn/ai/anthropic.rb +8 -33
- data/lib/pwn/ai/cli.rb +34 -5
- data/lib/pwn/ai/gemini.rb +1 -0
- data/lib/pwn/ai/grok.rb +39 -28
- data/lib/pwn/ai/ollama.rb +4 -2
- data/lib/pwn/ai/open_ai.rb +11 -32
- data/lib/pwn/ai/open_web_ui.rb +62 -4
- data/lib/pwn/ai/router.rb +8 -1
- data/lib/pwn/ai/server_tools.rb +231 -0
- data/lib/pwn/ai.rb +1 -0
- data/lib/pwn/backups.rb +349 -0
- data/lib/pwn/config.rb +70 -39
- data/lib/pwn/migrate.rb +85 -280
- data/lib/pwn/module_skills.rb +7 -0
- data/lib/pwn/plugins/ai_sandbox.rb +538 -1
- data/lib/pwn/plugins/authentication_helper.rb +74 -4
- data/lib/pwn/plugins/basic_auth.rb +2 -1
- data/lib/pwn/plugins/google_workspace.rb +4 -21
- data/lib/pwn/plugins/jobs.rb +1 -1
- data/lib/pwn/plugins/log.rb +3 -1
- data/lib/pwn/plugins/preflight_checker.rb +34 -9
- data/lib/pwn/plugins/recon.rb +4 -1
- data/lib/pwn/plugins/repl/ai.rb +293 -26
- data/lib/pwn/plugins/repl/ai_console.rb +268 -88
- data/lib/pwn/plugins/repl/ai_swarm.rb +177 -58
- data/lib/pwn/plugins/repl/mesh.rb +14 -19
- data/lib/pwn/plugins/repl/vault.rb +4 -15
- data/lib/pwn/plugins/repl.rb +9 -216
- data/lib/pwn/plugins/sandbox/driver.rb +4 -0
- data/lib/pwn/plugins/transparent_browser.rb +215 -0
- data/lib/pwn/plugins/vault.rb +412 -135
- data/lib/pwn/plugins/yubikey/fido.rb +1288 -0
- data/lib/pwn/plugins/yubikey/hsmauth.rb +439 -0
- data/lib/pwn/plugins/yubikey/management.rb +686 -0
- data/lib/pwn/plugins/yubikey/oath.rb +766 -0
- data/lib/pwn/plugins/yubikey/openpgp.rb +1063 -0
- data/lib/pwn/plugins/yubikey/otp.rb +897 -0
- data/lib/pwn/plugins/yubikey/piv.rb +1315 -0
- data/lib/pwn/plugins/yubikey/protocol.rb +341 -0
- data/lib/pwn/plugins/yubikey/security_domain/scp.rb +482 -0
- data/lib/pwn/plugins/yubikey/security_domain.rb +464 -0
- data/lib/pwn/plugins/yubikey/transport.rb +1017 -0
- data/lib/pwn/plugins/yubikey.rb +844 -0
- data/lib/pwn/plugins.rb +1 -0
- data/lib/pwn/redaction.rb +69 -12
- data/lib/pwn/session_trace.rb +4 -0
- data/lib/pwn/setup.rb +114 -24
- data/lib/pwn/version.rb +1 -1
- data/lib/pwn/www/app_cobalt_io.rb +16 -5
- data/lib/pwn/www/bug_crowd.rb +16 -5
- data/lib/pwn/www/coinbase_pro.rb +16 -5
- data/lib/pwn/www/github.rb +30 -14
- data/lib/pwn/www/paypal.rb +15 -4
- data/lib/pwn/www/synack.rb +16 -5
- data/lib/pwn/www/twitter.rb +17 -6
- data/lib/pwn.rb +1 -0
- data/spec/documentation/installation_md_spec.rb +1 -1
- data/spec/fixtures/yubikey/apdu_frames.json +162 -0
- data/spec/integration/authentication_helper_oath_spec.rb +117 -0
- data/spec/integration/controller_spill_spec.rb +48 -0
- data/spec/integration/harness_process_spec.rb +97 -0
- data/spec/integration/mission_cancel_spec.rb +79 -0
- data/spec/integration/mission_curses_pty_spec.rb +44 -0
- data/spec/integration/readme_security_spec.rb +47 -0
- data/spec/integration/web_cache_deception_yubikey_spec.rb +159 -0
- data/spec/lib/pwn/ai/agent/dispatch_spec.rb +6 -3
- data/spec/lib/pwn/ai/agent/dispatch_vault_safety_spec.rb +86 -0
- data/spec/lib/pwn/ai/agent/injection_guard_spec.rb +2 -0
- data/spec/lib/pwn/ai/agent/learning_spec.rb +4 -4
- data/spec/lib/pwn/ai/agent/loop_artifacts_spec.rb +5 -0
- data/spec/lib/pwn/ai/agent/loop_spec.rb +104 -29
- data/spec/lib/pwn/ai/agent/mission_namespace_spec.rb +138 -0
- data/spec/lib/pwn/ai/agent/policy_evaluation_spec.rb +10 -23
- data/spec/lib/pwn/ai/agent/request_runtime_spec.rb +48 -0
- data/spec/lib/pwn/ai/agent/shell_search_effect_spec.rb +44 -0
- data/spec/lib/pwn/ai/agent/solve_spec.rb +6 -4
- data/spec/lib/pwn/ai/agent/tools/browser_act_spec.rb +44 -0
- data/spec/lib/pwn/ai/agent/tools/loot_query_yubikey_spec.rb +55 -0
- data/spec/lib/pwn/ai/agent/tools/recon_run_yubikey_spec.rb +43 -0
- data/spec/lib/pwn/ai/agent/tools/workspace_tool_spec.rb +20 -0
- data/spec/lib/pwn/ai/agent/turn_finalizer_spec.rb +7 -0
- data/spec/lib/pwn/ai/anthropic_vault_enrollment_spec.rb +37 -0
- data/spec/lib/pwn/ai/cli_spec.rb +8 -16
- data/spec/lib/pwn/ai/oauth_vault_persistence_spec.rb +195 -0
- data/spec/lib/pwn/ai/open_ai_spec.rb +2 -2
- data/spec/lib/pwn/ai/open_web_ui_workspace_spec.rb +36 -0
- data/spec/lib/pwn/ai/router_spec.rb +1 -1
- data/spec/lib/pwn/ai/server_tools_spec.rb +39 -0
- data/spec/lib/pwn/backups_spec.rb +129 -0
- data/spec/lib/pwn/config_redaction_yubikey_spec.rb +28 -0
- data/spec/lib/pwn/config_yubikey_spec.rb +92 -0
- data/spec/lib/pwn/migrate_spec.rb +29 -81
- data/spec/lib/pwn/migrate_yubikey_spec.rb +128 -0
- data/spec/lib/pwn/module_skills_spec.rb +8 -0
- data/spec/lib/pwn/plugins/ai_sandbox_spec.rb +230 -0
- data/spec/lib/pwn/plugins/authentication_helper_native_yubikey_spec.rb +40 -0
- data/spec/lib/pwn/plugins/authentication_helper_yubikey_spec.rb +90 -0
- data/spec/lib/pwn/plugins/capability_broker/daemon_spec.rb +1 -1
- data/spec/lib/pwn/plugins/google_workspace_spec.rb +17 -35
- data/spec/lib/pwn/plugins/log_yubikey_spec.rb +47 -0
- data/spec/lib/pwn/plugins/preflight_checker_native_yubikey_spec.rb +19 -0
- data/spec/lib/pwn/plugins/preflight_checker_yubikey_spec.rb +55 -0
- data/spec/lib/pwn/plugins/recon_yubikey_spec.rb +43 -0
- data/spec/lib/pwn/plugins/repl/ai_console_spec.rb +110 -75
- data/spec/lib/pwn/plugins/repl/ai_legacy_containment_spec.rb +200 -0
- data/spec/lib/pwn/plugins/repl/ai_swarm_spec.rb +19 -16
- data/spec/lib/pwn/plugins/repl/ai_vault_edit_yubikey_spec.rb +103 -0
- data/spec/lib/pwn/plugins/repl/ai_yubikey_spec.rb +48 -0
- data/spec/lib/pwn/plugins/repl/mesh_vault_persistence_spec.rb +149 -0
- data/spec/lib/pwn/plugins/repl/vault_yaml_serialization_spec.rb +11 -0
- data/spec/lib/pwn/plugins/repl/vault_yubikey_spec.rb +39 -0
- data/spec/lib/pwn/plugins/repl_mesh_layout_spec.rb +2 -0
- data/spec/lib/pwn/plugins/repl_spec.rb +56 -5
- data/spec/lib/pwn/plugins/transparent_browser_jev_spec.rb +46 -0
- data/spec/lib/pwn/plugins/vault_native_yubikey_spec.rb +29 -0
- data/spec/lib/pwn/plugins/vault_publication_safety_spec.rb +258 -0
- data/spec/lib/pwn/plugins/vault_store_safety_spec.rb +241 -0
- data/spec/lib/pwn/plugins/vault_yubikey_safety_spec.rb +168 -0
- data/spec/lib/pwn/plugins/vault_yubikey_spec.rb +128 -0
- data/spec/lib/pwn/plugins/vault_yubikey_vector_spec.rb +45 -0
- data/spec/lib/pwn/plugins/yubikey/fido_spec.rb +854 -0
- data/spec/lib/pwn/plugins/yubikey/hsmauth_spec.rb +235 -0
- data/spec/lib/pwn/plugins/yubikey/management_spec.rb +277 -0
- data/spec/lib/pwn/plugins/yubikey/oath_spec.rb +349 -0
- data/spec/lib/pwn/plugins/yubikey/openpgp_spec.rb +810 -0
- data/spec/lib/pwn/plugins/yubikey/otp_spec.rb +337 -0
- data/spec/lib/pwn/plugins/yubikey/piv_spec.rb +646 -0
- data/spec/lib/pwn/plugins/yubikey/protocol_secure_spec.rb +28 -0
- data/spec/lib/pwn/plugins/yubikey/protocol_spec.rb +149 -0
- data/spec/lib/pwn/plugins/yubikey/protocol_vectors_spec.rb +18 -0
- data/spec/lib/pwn/plugins/yubikey/security_domain/scp_spec.rb +256 -0
- data/spec/lib/pwn/plugins/yubikey/security_domain/support.rb +153 -0
- data/spec/lib/pwn/plugins/yubikey/security_domain_spec.rb +296 -0
- data/spec/lib/pwn/plugins/yubikey/transport_spec.rb +760 -0
- data/spec/lib/pwn/plugins/yubikey_security_spec.rb +260 -0
- data/spec/lib/pwn/plugins/yubikey_spec.rb +209 -0
- data/spec/lib/pwn/plugins/yubikey_terminal_spec.rb +147 -0
- data/spec/lib/pwn/redaction_yubikey_spec.rb +61 -0
- data/spec/lib/pwn/session_cleanup_default_spec.rb +7 -5
- data/spec/lib/pwn/session_cleanup_payload_spec.rb +11 -11
- data/spec/lib/pwn/session_cleanup_recovery_spec.rb +34 -20
- data/spec/lib/pwn/setup_native_yubikey_spec.rb +66 -0
- data/spec/lib/pwn/setup_vault_yubikey_spec.rb +61 -0
- data/spec/lib/pwn/setup_yubikey_spec.rb +40 -0
- data/spec/lib/pwn/www/login_yubikey_spec.rb +273 -0
- data/spec/spec_helper.rb +15 -0
- data/spec/support/harness/cli_faults.rb +13 -9
- data/spec/support/harness/controller_spill.rb +26 -0
- data/spec/support/harness/controller_state.rb +54 -0
- data/spec/support/harness/evaluate.rb +12 -1
- data/spec/support/harness/experiments.rb +1 -1
- data/spec/support/harness/fake_provider.rb +22 -6
- data/spec/support/harness/fault_preload.rb +3 -1
- data/spec/support/harness/mission_console.rb +54 -0
- data/spec/support/harness/mission_curses_pty.rb +41 -0
- data/spec/support/harness/mission_dispatch.rb +30 -0
- data/spec/support/harness/mission_fixture_preload.rb +24 -0
- data/spec/support/harness/mission_job_lifetime.rb +25 -0
- data/spec/support/harness/mission_legacy.rb +25 -0
- data/spec/support/harness/mission_normal_exit.rb +34 -0
- data/spec/support/harness/mission_swarm.rb +23 -0
- data/spec/support/harness/mission_unsupported.rb +29 -0
- data/spec/support/harness/package_acceptance.rb +33 -5
- data/spec/support/harness/session_acceptance.rb +4 -4
- data/spec/support/harness/swarm_acceptance.rb +1 -1
- data/spec/support/harness/swarm_control.rb +44 -0
- data/spec/support/mission_namespace.rb +14 -0
- data/spec/support/mission_pipe_queue.rb +33 -0
- data/third_party/pwn_rdoc.jsonl +605 -19
- metadata +129 -16
- data/scripts/benchmark_policy.rb +0 -376
- data/scripts/build_gate.rb +0 -58
- data/spec/integration/build_gate_spec.rb +0 -73
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pwn-ai-agent-mission-namespace
|
|
3
|
+
description: Compiler-free Linux mission process ownership.
|
|
4
|
+
preserve: true
|
|
5
|
+
metadata:
|
|
6
|
+
bundled: true
|
|
7
|
+
module: PWN::AI::Agent::MissionNamespace
|
|
8
|
+
source: pwn/ai/agent/mission_namespace.rb
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# PWN::AI::Agent::MissionNamespace
|
|
12
|
+
|
|
13
|
+
Launch typed mission descriptors using util-linux `unshare`, Ruby stdlib
|
|
14
|
+
Fiddle pidfds, and private inherited sockets. Install `pwn setup --profile ai`.
|
|
15
|
+
Linux user/PID namespaces and pidfds must be enabled. Unsupported hosts fail
|
|
16
|
+
closed; there is no process-group or uncontained fallback.
|
|
17
|
+
|
|
18
|
+
The controller remains outside namespaces. Each request transfers its private
|
|
19
|
+
configuration snapshot in memory, then owns a PID namespace. Cancellation kills
|
|
20
|
+
namespace PID 1 and waits for the supervisor to reap it. Arbitrary Ruby closures
|
|
21
|
+
are only supported inside an already-owned mission for protected tool workers.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pwn-ai-agent-tools-browseract
|
|
3
|
+
description: Drive PWN::Ai::Agent::Tools::BrowserAct from pwn_eval.
|
|
4
|
+
license: MIT
|
|
5
|
+
allowed-tools: [pwn, pwn_eval]
|
|
6
|
+
metadata:
|
|
7
|
+
bundled: true
|
|
8
|
+
generated: true
|
|
9
|
+
module: PWN::Ai::Agent::Tools::BrowserAct
|
|
10
|
+
source: pwn/ai/agent/tools/browser_act.rb
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# PWN::Ai::Agent::Tools::BrowserAct
|
|
14
|
+
|
|
15
|
+
Public API for PWN::Ai::Agent::Tools::BrowserAct.
|
|
16
|
+
|
|
17
|
+
## When to use
|
|
18
|
+
|
|
19
|
+
Call `PWN::Ai::Agent::Tools::BrowserAct` from `pwn_eval` when the task needs this module.
|
|
20
|
+
Do not reimplement it in shell.
|
|
21
|
+
|
|
22
|
+
## Methodologies
|
|
23
|
+
|
|
24
|
+
Generated from `pwn/ai/agent/tools/browser_act.rb`. Prefer the public class methods below.
|
|
25
|
+
Class methods take `(opts = {})` and read `opts`.
|
|
26
|
+
|
|
27
|
+
## How to call
|
|
28
|
+
|
|
29
|
+
```ruby
|
|
30
|
+
PWN::Ai::Agent::Tools::BrowserAct.help
|
|
31
|
+
PWN::Ai::Agent::Tools::BrowserAct.help(opts)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Public methods
|
|
35
|
+
|
|
36
|
+
- _(no public class methods parsed)_
|
|
37
|
+
|
|
38
|
+
## Source
|
|
39
|
+
|
|
40
|
+
`pwn/ai/agent/tools/browser_act.rb`
|
|
41
|
+
|
|
42
|
+
## Verification
|
|
43
|
+
|
|
44
|
+
`PWN::Ai::Agent::Tools::BrowserAct.respond_to?(:help)` after the
|
|
45
|
+
module is loaded. Read the source for parameter names.
|
|
@@ -1,45 +1,46 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pwn-ai-agent-tools-lootquery
|
|
3
|
-
description:
|
|
3
|
+
description: Query and capture encrypted engagement loot.
|
|
4
4
|
license: MIT
|
|
5
5
|
allowed-tools: [pwn, pwn_eval]
|
|
6
6
|
metadata:
|
|
7
7
|
bundled: true
|
|
8
|
-
generated:
|
|
9
|
-
module: PWN::Ai::Agent::Tools::LootQuery
|
|
8
|
+
generated: false
|
|
10
9
|
source: pwn/ai/agent/tools/loot_query.rb
|
|
11
10
|
---
|
|
12
11
|
|
|
13
|
-
#
|
|
12
|
+
# loot_query
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## When to use
|
|
18
|
-
|
|
19
|
-
Call `PWN::Ai::Agent::Tools::LootQuery` from `pwn_eval` when the task needs this module.
|
|
20
|
-
Do not reimplement it in shell.
|
|
21
|
-
|
|
22
|
-
## Methodologies
|
|
23
|
-
|
|
24
|
-
Generated from `pwn/ai/agent/tools/loot_query.rb`. Prefer the public class methods below.
|
|
25
|
-
Class methods take `(opts = {})` and read `opts`.
|
|
14
|
+
Use the registered `loot_query` tool to query, store, ingest, or offer engagement
|
|
15
|
+
loot. This file registers a tool; it does not define a `Tools::LootQuery` module.
|
|
26
16
|
|
|
27
17
|
## How to call
|
|
28
18
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## Public methods
|
|
19
|
+
Select `op: query` (the default) with `engagement`, `host`, `service`, `kind`, or
|
|
20
|
+
`finding_id` filters to obtain metadata without plaintext credentials. The Vault
|
|
21
|
+
query handler does not decrypt or open a device. Dispatch's separate output
|
|
22
|
+
redaction can require access to stored hardware secrets.
|
|
35
23
|
|
|
36
|
-
|
|
24
|
+
For `store` or `ingest`, pass `yubikey: {slot: 2, serial: "12345678", timeout: 30}`
|
|
25
|
+
only when hardware protection is intended. The slot must already be provisioned
|
|
26
|
+
for HMAC-SHA1. An empty selector chooses hardware defaults. The model-facing
|
|
27
|
+
schema allows only `slot`, `serial`, and `timeout`; never put a PIN, PUK, key,
|
|
28
|
+
password, or executable path in the selector. `offer` can use the same selector
|
|
29
|
+
when decrypting matching hardware loot.
|
|
37
30
|
|
|
38
|
-
##
|
|
31
|
+
## Pitfalls
|
|
39
32
|
|
|
40
|
-
|
|
33
|
+
- Missing hardware or failed touch raises; do not retry with software protection.
|
|
34
|
+
- Replacing an existing hardware label without a selector retains that backend.
|
|
35
|
+
- Treat `offer` results as secrets. Dispatch redacts array results before returning
|
|
36
|
+
them; direct Ruby callers must not print or persist plaintext credentials.
|
|
37
|
+
- `VAULT_EXPANSION_FAILED` means Dispatch did not execute the handler.
|
|
38
|
+
`VAULT_REDACTION_FAILED` with `handler_executed: true` means it already ran;
|
|
39
|
+
reconcile effects before retrying.
|
|
41
40
|
|
|
42
41
|
## Verification
|
|
43
42
|
|
|
44
|
-
`PWN::
|
|
45
|
-
|
|
43
|
+
Use `PWN::AI::Agent::Registry.lookup(name: 'loot_query')` to inspect its schema
|
|
44
|
+
and handler after discovery. Offline tests stub only the device HMAC boundary,
|
|
45
|
+
use an isolated home, verify encrypted loot has no disk master key, and reject
|
|
46
|
+
selector executable overrides through Dispatch before any vault access.
|
|
@@ -1,39 +1,48 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pwn-ai-agent-tools-reconrun
|
|
3
|
-
description:
|
|
3
|
+
description: Run recon pipelines with optional hardware-protected loot.
|
|
4
4
|
license: MIT
|
|
5
5
|
allowed-tools: [pwn, pwn_eval]
|
|
6
6
|
metadata:
|
|
7
7
|
bundled: true
|
|
8
|
-
|
|
8
|
+
preserve: true
|
|
9
9
|
module: PWN::Ai::Agent::Tools::ReconRun
|
|
10
10
|
source: pwn/ai/agent/tools/recon_run.rb
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
#
|
|
13
|
+
# recon_run registry tool
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Use the registered `recon_run` tool or `PWN::Plugins::Recon.run`; this file
|
|
16
|
+
registers a tool, not a Ruby class named `PWN::Ai::Agent::Tools::ReconRun`.
|
|
16
17
|
|
|
17
18
|
## When to use
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
Run selected recon modules against a single authorized target and persist their
|
|
21
|
+
asset/evidence model. Scanner observations are not proven findings.
|
|
21
22
|
|
|
22
23
|
## Methodologies
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
Supply `target` and a nonempty `modules` array from `nmap`, `banner`, `tls`,
|
|
26
|
+
`subfinder`, `nuclei`. Optional `ports`, `engagement_id`, positive `timeout` up to
|
|
27
|
+
300 seconds and `ingest` control the pipeline; tool ingestion defaults to true.
|
|
26
28
|
|
|
27
29
|
## How to call
|
|
28
30
|
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
PWN::Ai::Agent::Tools::ReconRun.help(opts)
|
|
31
|
+
```json
|
|
32
|
+
{"target":"app.example.test","modules":["banner"],"ports":[443],"ingest":false,"yubikey":{"slot":2}}
|
|
32
33
|
```
|
|
33
34
|
|
|
34
|
-
##
|
|
35
|
+
## Hardware protection
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
The optional `yubikey` selector accepts only integer `slot` 1/2, decimal String
|
|
38
|
+
`serial`, and positive `timeout` seconds. An empty object chooses hardware
|
|
39
|
+
defaults. It forwards into Vault ingestion without provisioning or software
|
|
40
|
+
fallback. Device access errors remain failures. PINs, seeds, arbitrary executable
|
|
41
|
+
paths and secret selector fields are forbidden by the tool schema.
|
|
42
|
+
|
|
43
|
+
Only harvested loot is hardware encrypted. Raw scanner evidence and the asset
|
|
44
|
+
model remain ordinary files; protect those separately. Do not claim a completed
|
|
45
|
+
scan when harvesting failed, or replay an expensive scan blindly after device loss.
|
|
37
46
|
|
|
38
47
|
## Source
|
|
39
48
|
|
|
@@ -41,5 +50,6 @@ PWN::Ai::Agent::Tools::ReconRun.help(opts)
|
|
|
41
50
|
|
|
42
51
|
## Verification
|
|
43
52
|
|
|
44
|
-
`
|
|
45
|
-
|
|
53
|
+
Run `spec/lib/pwn/ai/agent/tools/recon_run_spec.rb` and
|
|
54
|
+
`spec/lib/pwn/ai/agent/tools/recon_run_yubikey_spec.rb`. The latter exercises the
|
|
55
|
+
real handler/Recon/Vault path with fake socket/device boundaries and no live scan.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pwn-ai-agent-tools-workspacetool
|
|
3
|
+
description: Drive PWN::Ai::Agent::Tools::WorkspaceTool from pwn_eval.
|
|
4
|
+
license: MIT
|
|
5
|
+
allowed-tools: [pwn, pwn_eval]
|
|
6
|
+
metadata:
|
|
7
|
+
bundled: true
|
|
8
|
+
generated: true
|
|
9
|
+
module: PWN::Ai::Agent::Tools::WorkspaceTool
|
|
10
|
+
source: pwn/ai/agent/tools/workspace_tool.rb
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# PWN::Ai::Agent::Tools::WorkspaceTool
|
|
14
|
+
|
|
15
|
+
Public API for PWN::Ai::Agent::Tools::WorkspaceTool.
|
|
16
|
+
|
|
17
|
+
## When to use
|
|
18
|
+
|
|
19
|
+
Call `workspace_tool` when the task needs a provider-hosted tool. Ask Jev is
|
|
20
|
+
an Open WebUI workspace tool. Do not reimplement it in shell.
|
|
21
|
+
|
|
22
|
+
## Source
|
|
23
|
+
|
|
24
|
+
`pwn/ai/agent/tools/workspace_tool.rb`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pwn-ai-servertools
|
|
3
|
+
description: Use provider-hosted tools without replacing Registry client tools.
|
|
4
|
+
license: MIT
|
|
5
|
+
allowed-tools: [pwn, pwn_eval]
|
|
6
|
+
metadata:
|
|
7
|
+
bundled: true
|
|
8
|
+
generated: true
|
|
9
|
+
module: PWN::AI::ServerTools
|
|
10
|
+
source: pwn/ai/server_tools.rb
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# PWN::AI::ServerTools
|
|
14
|
+
|
|
15
|
+
Open WebUI is the only engine with a user-installed tool workspace. Ask Jev
|
|
16
|
+
runs there through `workspace_tool` or `chat(server_tools:)`. Do not send a
|
|
17
|
+
client `tools` array on that same Open WebUI request.
|
|
18
|
+
|
|
19
|
+
Anthropic, Gemini, and OpenAI Responses can carry their fixed hosted tools
|
|
20
|
+
beside Registry tools. xAI hosted tools use the Responses API, not
|
|
21
|
+
chat/completions. Ollama has no server-side tool workspace.
|
|
22
|
+
|
|
23
|
+
## Source
|
|
24
|
+
|
|
25
|
+
`pwn/ai/server_tools.rb`
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pwn-backups
|
|
3
|
+
description: Drive PWN::Backups from pwn_eval.
|
|
4
|
+
license: MIT
|
|
5
|
+
allowed-tools: [pwn, pwn_eval]
|
|
6
|
+
metadata:
|
|
7
|
+
bundled: true
|
|
8
|
+
generated: true
|
|
9
|
+
module: PWN::Backups
|
|
10
|
+
source: pwn/backups.rb
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# PWN::Backups
|
|
14
|
+
|
|
15
|
+
All first-party recovery copies share one serialized seven-generation store. Evidence artifacts are not recovery copies and must not enter this store.
|
|
16
|
+
|
|
17
|
+
## When to use
|
|
18
|
+
|
|
19
|
+
Call `PWN::Backups` from `pwn_eval` when the task needs this module.
|
|
20
|
+
Do not reimplement it in shell.
|
|
21
|
+
|
|
22
|
+
## Methodologies
|
|
23
|
+
|
|
24
|
+
Generated from `pwn/backups.rb`. Prefer the public class methods below.
|
|
25
|
+
Class methods take `(opts = {})` and read `opts`.
|
|
26
|
+
|
|
27
|
+
## How to call
|
|
28
|
+
|
|
29
|
+
```ruby
|
|
30
|
+
PWN::Backups.help
|
|
31
|
+
PWN::Backups.active(opts)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Public methods
|
|
35
|
+
|
|
36
|
+
- `active`
|
|
37
|
+
- `transaction`
|
|
38
|
+
- `directory`
|
|
39
|
+
- `capture`
|
|
40
|
+
- `configure`
|
|
41
|
+
- `reconcile`
|
|
42
|
+
- `relocate_legacy`
|
|
43
|
+
- `authors`
|
|
44
|
+
- `help`
|
|
45
|
+
- `active?`
|
|
46
|
+
|
|
47
|
+
## Source
|
|
48
|
+
|
|
49
|
+
`pwn/backups.rb`
|
|
50
|
+
|
|
51
|
+
## Verification
|
|
52
|
+
|
|
53
|
+
`PWN::Backups.respond_to?(:active)` after the
|
|
54
|
+
module is loaded. Read the source for parameter names.
|
|
@@ -6,6 +6,7 @@ allowed-tools: [pwn, pwn_eval]
|
|
|
6
6
|
metadata:
|
|
7
7
|
bundled: true
|
|
8
8
|
generated: true
|
|
9
|
+
preserve: true
|
|
9
10
|
module: PWN::Plugins::Recon
|
|
10
11
|
source: pwn/plugins/recon.rb
|
|
11
12
|
---
|
|
@@ -26,9 +27,19 @@ Class methods take `(opts = {})` and read `opts`.
|
|
|
26
27
|
|
|
27
28
|
## How to call
|
|
28
29
|
|
|
30
|
+
Pass an explicit `yubikey: {slot: 2, serial: '12345678', timeout: 30}` to `run`
|
|
31
|
+
or `harvest_loot` to encrypt harvested credentials with an already provisioned
|
|
32
|
+
HMAC-SHA1 OTP slot. Both entry points preserve the selector through Vault.ingest.
|
|
33
|
+
Device failure raises without falling back to a software master key. Raw scan
|
|
34
|
+
evidence remains governed by the existing recon persistence contract; selecting
|
|
35
|
+
hardware loot protection does not encrypt the entire asset/evidence directory.
|
|
36
|
+
|
|
37
|
+
Verify offline with a fake banner and a stubbed 20-byte challenge-response; assert
|
|
38
|
+
the saved loot envelope has the hardware KDF and no `.pwn-vault.key` is created.
|
|
39
|
+
|
|
29
40
|
```ruby
|
|
30
41
|
PWN::Plugins::Recon.help
|
|
31
|
-
PWN::Plugins::Recon.required_bins
|
|
42
|
+
PWN::Plugins::Recon.required_bins
|
|
32
43
|
```
|
|
33
44
|
|
|
34
45
|
## Public methods
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pwn-plugins-yubikey
|
|
3
|
+
description: Manage YubiKeys with explicit mutation guards.
|
|
4
|
+
license: MIT
|
|
5
|
+
allowed-tools: [pwn, pwn_eval]
|
|
6
|
+
metadata:
|
|
7
|
+
bundled: true
|
|
8
|
+
preserve: true
|
|
9
|
+
module: PWN::Plugins::YubiKey
|
|
10
|
+
source: pwn/plugins/yubikey.rb
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# PWN::Plugins::YubiKey
|
|
14
|
+
|
|
15
|
+
Use the native Ruby wrapper around the official `ykman` executable. Never
|
|
16
|
+
provision, overwrite, repair or reset a slot as part of routine inventory,
|
|
17
|
+
authentication or vault access. See `documentation/YubiKey.md` for the device
|
|
18
|
+
contract and `documentation/YubiKey-Vaults.md` for storage/recovery integration.
|
|
19
|
+
|
|
20
|
+
## When to use
|
|
21
|
+
|
|
22
|
+
- Inventory and application status, or explicit YubiKey management requests.
|
|
23
|
+
- Binary HMAC-SHA1 challenge-response from an **already provisioned** OTP slot.
|
|
24
|
+
- OATH account listing and retrieval with consent for authentication, remembered-key
|
|
25
|
+
cleanup, counter and credential-repair effects.
|
|
26
|
+
- Do not use device management as a substitute for browser WebAuthn ceremonies.
|
|
27
|
+
|
|
28
|
+
## Prerequisites
|
|
29
|
+
|
|
30
|
+
Install the official `yubikey-manager` separately. `required_bins` returns
|
|
31
|
+
`['ykman']`; `available?` probes `--version` without opening a device. Use a trusted
|
|
32
|
+
explicit `ykman:` path when PATH selection is unsuitable. The reviewed management
|
|
33
|
+
grammar is 5.9.1; automatic provisioning intentionally accepts only that version.
|
|
34
|
+
Use decimal String serials, integer slots 1 or 2, and a finite positive timeout.
|
|
35
|
+
|
|
36
|
+
## How to call
|
|
37
|
+
|
|
38
|
+
```ruby
|
|
39
|
+
PWN::Plugins::YubiKey.help
|
|
40
|
+
PWN::Plugins::YubiKey.available?
|
|
41
|
+
PWN::Plugins::YubiKey.devices
|
|
42
|
+
PWN::Plugins::YubiKey.info(serial: '12345678')
|
|
43
|
+
PWN::Plugins::YubiKey.otp(args: ['info'], serial: '12345678')
|
|
44
|
+
PWN::Plugins::YubiKey.cli_help(path: %w[piv keys generate])
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Serials above are placeholders. Family methods take an `args:` argv Array after
|
|
48
|
+
the family name; omission returns official help. Use long options as separate
|
|
49
|
+
array elements, not a shell string or `--option=value`. `command` takes the full
|
|
50
|
+
management argv. All return raw output without logging it; successful output can
|
|
51
|
+
still contain secrets and must not be echoed into a transcript.
|
|
52
|
+
|
|
53
|
+
## Public methods
|
|
54
|
+
|
|
55
|
+
- `required_bins`, `available?`, `devices`, `info`, `cli_help`, `help`, `authors`
|
|
56
|
+
- `command`, `interact`, `config`, `otp`, `oath`, `fido`, `piv`, `openpgp`, `hsmauth`,
|
|
57
|
+
`security_domain` (official **sd** family), `apdu`
|
|
58
|
+
- `challenge_response`, `provision_challenge_response`, `oath_code`
|
|
59
|
+
|
|
60
|
+
## Procedure
|
|
61
|
+
|
|
62
|
+
1. Identify the intended device and application with read-only inventory. Pin a
|
|
63
|
+
serial when selecting a device; never choose the first key automatically.
|
|
64
|
+
2. Read the specific command's help. The wrapper guards the complete reviewed
|
|
65
|
+
management tree, but model/firmware/interface support still belongs to ykman.
|
|
66
|
+
3. Obtain explicit `confirm: true` for every non-allowlisted operation, including
|
|
67
|
+
resets, provisioning, authentication attempts, exports, OATH listing/calculation and
|
|
68
|
+
all raw APDUs. Unknown commands stay rejected even after consent. Do not add
|
|
69
|
+
`--force` merely to make a command succeed.
|
|
70
|
+
4. Keep credentials out of argv, environment variables, history and logs. Generic
|
|
71
|
+
calls close stdin. Use `interact(args: ..., confirm: true)` only in a private
|
|
72
|
+
operator terminal outside curses/recorded tool sessions. It bridges a native
|
|
73
|
+
PTY, returns only `:completed`, restores terminal mode and descriptor status flags,
|
|
74
|
+
and bounds total traffic and elapsed time, including human input. Its terminal
|
|
75
|
+
must be readable and writable, including the Ruby wrapper mode; validation
|
|
76
|
+
consumes no input and never closes caller-owned IO. Some upstream secret prompts
|
|
77
|
+
are not masked. Never guess a PIN. Key imports and SCP11 use protected existing files;
|
|
78
|
+
custom SCP03 import KIDs are refused before filename checks, even when the
|
|
79
|
+
inline key string names an existing file. SCP11 file-import KIDs accept unsigned
|
|
80
|
+
decimal, `0x` hex or `SCP11a`/`SCP11b`/`SCP11c` names, without coercion.
|
|
81
|
+
5. Read the exact result or device state after a mutation. A timeout is uncertain
|
|
82
|
+
device state, not proof that nothing changed. Do not automatically retry.
|
|
83
|
+
|
|
84
|
+
### Existing HMAC slot
|
|
85
|
+
|
|
86
|
+
```ruby
|
|
87
|
+
challenge = SecureRandom.random_bytes(32)
|
|
88
|
+
response = PWN::Plugins::YubiKey.challenge_response(
|
|
89
|
+
challenge: challenge, slot: 2, serial: '12345678', timeout: 30
|
|
90
|
+
); nil
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Pass **raw 1–64 bytes**, not pre-encoded hex. The wrapper sends `otp calculate
|
|
94
|
+
SLOT HEX_CHALLENGE` and returns exactly **20 binary bytes**. Slot 2 is only a
|
|
95
|
+
selector default, never implicit provisioning. Touch the device if required;
|
|
96
|
+
the wrapper suppresses the CLI's stderr prompt. The challenge is public in argv;
|
|
97
|
+
never use a password as the challenge. Keep the response out of transcripts.
|
|
98
|
+
|
|
99
|
+
### Explicit provisioning
|
|
100
|
+
|
|
101
|
+
Only after inspecting the slot and obtaining consent, use
|
|
102
|
+
`provision_challenge_response(key: key_bytes, serial: serial, slot: 2,
|
|
103
|
+
confirm: true)`. `key_bytes` must be exactly 20 raw bytes acquired in local memory,
|
|
104
|
+
not a literal pasted into a console. The method checks ykman 5.9.1, supplies a
|
|
105
|
+
validated key/consent sequence through stdin without `--force`, enables touch,
|
|
106
|
+
and verifies a fresh random challenge with Ruby OpenSSL before returning
|
|
107
|
+
`:verified`. It overwrites the slot. Plan and test independent recovery before
|
|
108
|
+
discarding the key. Protected slots and other CLI versions require the separately
|
|
109
|
+
reviewed private-terminal workflow described in `documentation/YubiKey.md`.
|
|
110
|
+
No Ruby zeroization guarantee is made.
|
|
111
|
+
|
|
112
|
+
### Exact OATH
|
|
113
|
+
|
|
114
|
+
`oath_code(account: exact_identifier, serial: serial, confirm: true)` returns
|
|
115
|
+
6–8 digits, retaining leading zeros, or raises. It verifies a unique full
|
|
116
|
+
inventory identifier and the returned account label; substring-only, ambiguous,
|
|
117
|
+
changed-identity and nonnumeric output is refused. Official 5.9.1 has **no
|
|
118
|
+
--exact** option; `--single` alone is not exact matching. Confirmation is mandatory
|
|
119
|
+
for listing too: upstream may authenticate using a remembered key and delete/persist
|
|
120
|
+
that key if authentication fails, even without `--remember`. HOTP advances counters
|
|
121
|
+
and upstream code can delete corrupted credentials automatically. Do not treat
|
|
122
|
+
this as a read-only operation or use it for SMS/passkey
|
|
123
|
+
challenges. Password-protected OATH may require the private terminal workflow.
|
|
124
|
+
|
|
125
|
+
## Pitfalls
|
|
126
|
+
|
|
127
|
+
- Missing executable, unsupported device capability or malformed output is an
|
|
128
|
+
error, not permission to reset, provision or fall back to a software key.
|
|
129
|
+
- `ykman script`, debug/traffic logging, secret argv fields, arbitrary stdin and
|
|
130
|
+
unreviewed future commands are intentionally unavailable.
|
|
131
|
+
- Raw APDU bytes are visible in argv. Never put credentials in arbitrary payloads;
|
|
132
|
+
the wrapper cannot infer their confidentiality.
|
|
133
|
+
- Noninteractive mutations needing prompts can abort/time out. Confirmation in
|
|
134
|
+
Ruby does not bypass the CLI's own confirmation except the fixed provisioning
|
|
135
|
+
stdin flow; no force flag is inserted.
|
|
136
|
+
- `timeout` defaults to 30 seconds and combined output to 1 MiB. Timeout/output
|
|
137
|
+
failures kill the Unix child process group and reap the direct child. This is
|
|
138
|
+
not a sandbox against a malicious executable escaping its process group.
|
|
139
|
+
- FIDO credential/PIN/fingerprint management is not website authentication.
|
|
140
|
+
Browser and relying party must perform genuine security-key ceremonies.
|
|
141
|
+
|
|
142
|
+
## Verification
|
|
143
|
+
|
|
144
|
+
Run the paired offline suites:
|
|
145
|
+
|
|
146
|
+
```text
|
|
147
|
+
bundle exec rspec spec/lib/pwn/plugins/yubikey_spec.rb spec/lib/pwn/plugins/yubikey_security_spec.rb spec/lib/pwn/plugins/yubikey_terminal_spec.rb
|
|
148
|
+
bundle exec rubocop lib/pwn/plugins/yubikey.rb spec/lib/pwn/plugins/yubikey_spec.rb spec/lib/pwn/plugins/yubikey_security_spec.rb spec/lib/pwn/plugins/yubikey_terminal_spec.rb
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Specs exercise real child processes with fake device executables, argument guards,
|
|
152
|
+
binary HMAC vectors, exact OATH parsing, validated provisioning, private PTY
|
|
153
|
+
prompts, descriptor/terminal restoration on success and failure, pre-spawn duplex
|
|
154
|
+
validation without consuming input, and cleanup. The
|
|
155
|
+
real 5.9.1 CLI's management help tree and Click stdin contract were separately
|
|
156
|
+
checked offline. None of this proves USB/NFC hardware, physical touches, PIN
|
|
157
|
+
protection, every firmware variant, or live website login. Report those boundaries.
|