pwn 0.5.795 → 0.5.798
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/Gemfile +8 -8
- data/bin/pwn_autoinc_version +4 -5
- data/bin/pwn_web_cache_deception +40 -29
- data/documentation/AWS.md +15 -5
- data/documentation/Diagrams.md +1 -1
- data/documentation/Home.md +2 -2
- data/documentation/How-PWN-Works.md +1 -1
- data/documentation/Mission-Cancellation.md +6 -4
- data/documentation/Operability.md +1 -1
- data/documentation/What-is-PWN.md +1 -1
- data/documentation/diagrams/aws-cloud-security.svg +1 -1
- data/documentation/diagrams/dot/aws-cloud-security.dot +1 -1
- data/documentation/diagrams/dot/network-infra-testing.dot +1 -1
- data/documentation/diagrams/network-infra-testing.svg +1 -1
- data/etc/default_cron/session_cleanup.rb +84 -51
- data/etc/default_skills/pwn/ai/agent/mission_namespace/SKILL.md +6 -4
- data/lib/pwn/ai/agent/assembly.rb +0 -2
- data/lib/pwn/ai/agent/btc.rb +0 -2
- data/lib/pwn/ai/agent/burp_suite.rb +0 -2
- data/lib/pwn/ai/agent/curriculum.rb +2 -2
- data/lib/pwn/ai/agent/dispatch.rb +3 -0
- data/lib/pwn/ai/agent/engagement.rb +96 -41
- data/lib/pwn/ai/agent/extrospection/osint/bridges.rb +2 -0
- data/lib/pwn/ai/agent/extrospection.rb +50 -13
- data/lib/pwn/ai/agent/gqrx.rb +0 -2
- data/lib/pwn/ai/agent/hacker_one.rb +0 -2
- data/lib/pwn/ai/agent/learning.rb +45 -13
- data/lib/pwn/ai/agent/loop.rb +16 -11
- data/lib/pwn/ai/agent/metrics.rb +1 -1
- data/lib/pwn/ai/agent/mission.rb +6 -3
- data/lib/pwn/ai/agent/mission_namespace.rb +70 -14
- data/lib/pwn/ai/agent/policy.rb +1 -1
- data/lib/pwn/ai/agent/policy_evaluation.rb +2 -2
- data/lib/pwn/ai/agent/reflect.rb +1 -0
- data/lib/pwn/ai/agent/request_runtime.rb +1 -1
- data/lib/pwn/ai/agent/reward.rb +155 -53
- data/lib/pwn/ai/agent/sast.rb +0 -2
- data/lib/pwn/ai/agent/task_dag.rb +5 -3
- data/lib/pwn/ai/agent/task_summarizer.rb +21 -11
- data/lib/pwn/ai/agent/tool_guard.rb +19 -0
- data/lib/pwn/ai/agent/tools/ruby_eval.rb +1 -1
- data/lib/pwn/ai/agent/tools/verify.rb +7 -3
- data/lib/pwn/ai/agent/transparent_browser.rb +0 -2
- data/lib/pwn/ai/agent/turn_finalizer.rb +3 -0
- data/lib/pwn/ai/anthropic.rb +3 -3
- data/lib/pwn/ai/context.rb +2 -1
- data/lib/pwn/ai/gemini.rb +7 -5
- data/lib/pwn/ai/grok.rb +37 -18
- data/lib/pwn/ai/mcp.rb +17 -5
- data/lib/pwn/ai/ollama.rb +76 -35
- data/lib/pwn/ai/open_ai.rb +7 -19
- data/lib/pwn/ai/open_web_ui.rb +76 -40
- data/lib/pwn/aws/cloud_search_domain.rb +6 -0
- data/lib/pwn/aws/iam.rb +2 -2
- data/lib/pwn/aws/workspaces.rb +2 -2
- data/lib/pwn/aws.rb +0 -5
- data/lib/pwn/bounty/lifecycle_authz_replay.rb +1 -1
- data/lib/pwn/config.rb +17 -10
- data/lib/pwn/corpus.rb +33 -5
- data/lib/pwn/cron.rb +60 -17
- data/lib/pwn/driver.rb +2 -3
- data/lib/pwn/engagement.rb +28 -10
- data/lib/pwn/ffi/capstone.rb +3 -2
- data/lib/pwn/ffi/fftw.rb +8 -6
- data/lib/pwn/ffi/keystone.rb +3 -2
- data/lib/pwn/ffi/soapy_sdr.rb +10 -6
- data/lib/pwn/json_text.rb +25 -13
- data/lib/pwn/memory_index.rb +6 -4
- data/lib/pwn/module_skills.rb +3 -1
- data/lib/pwn/plugins/aflplusplus.rb +1 -0
- data/lib/pwn/plugins/ai_sandbox.rb +42 -10
- data/lib/pwn/plugins/android.rb +429 -466
- data/lib/pwn/plugins/artifact_registry.rb +12 -2
- data/lib/pwn/plugins/assembly.rb +9 -42
- data/lib/pwn/plugins/authentication_helper.rb +4 -3
- data/lib/pwn/plugins/baresip.rb +70 -28
- data/lib/pwn/plugins/binary_analysis.rb +14 -5
- data/lib/pwn/plugins/binary_parser.rb +42 -7
- data/lib/pwn/plugins/black_duck_binary_analysis.rb +3 -3
- data/lib/pwn/plugins/burp_suite.rb +15 -12
- data/lib/pwn/plugins/bus_pirate.rb +3 -7
- data/lib/pwn/plugins/char.rb +9 -3
- data/lib/pwn/plugins/credit_card.rb +7 -0
- data/lib/pwn/plugins/dao_ldap.rb +2 -2
- data/lib/pwn/plugins/dao_mongo.rb +1 -1
- data/lib/pwn/plugins/debugger.rb +1 -1
- data/lib/pwn/plugins/defect_dojo.rb +7 -3
- data/lib/pwn/plugins/detect_os.rb +1 -1
- data/lib/pwn/plugins/detonate.rb +9 -19
- data/lib/pwn/plugins/exploit_db.rb +1 -1
- data/lib/pwn/plugins/file_fu.rb +4 -1
- data/lib/pwn/plugins/findings.rb +76 -2
- data/lib/pwn/plugins/fuzz.rb +12 -3
- data/lib/pwn/plugins/gdb.rb +7 -2
- data/lib/pwn/plugins/gdbmi.rb +10 -6
- data/lib/pwn/plugins/git.rb +18 -13
- data/lib/pwn/plugins/github.rb +11 -6
- data/lib/pwn/plugins/google_workspace.rb +11 -3
- data/lib/pwn/plugins/hacker_one.rb +5 -1
- data/lib/pwn/plugins/httpx.rb +24 -8
- data/lib/pwn/plugins/ip_info.rb +11 -8
- data/lib/pwn/plugins/irc.rb +73 -45
- data/lib/pwn/plugins/jenkins.rb +2 -2
- data/lib/pwn/plugins/jira_data_center.rb +13 -6
- data/lib/pwn/plugins/jobs.rb +62 -4
- data/lib/pwn/plugins/log.rb +1 -1
- data/lib/pwn/plugins/monkey_patch.rb +1 -1
- data/lib/pwn/plugins/msr206.rb +157 -182
- data/lib/pwn/plugins/nessus_cloud.rb +2 -2
- data/lib/pwn/plugins/nexpose_vuln_scan.rb +44 -33
- data/lib/pwn/plugins/nuclei.rb +24 -8
- data/lib/pwn/plugins/ocr.rb +3 -1
- data/lib/pwn/plugins/open_api.rb +0 -4
- data/lib/pwn/plugins/openvas.rb +31 -43
- data/lib/pwn/plugins/packet.rb +40 -25
- data/lib/pwn/plugins/pony.rb +2 -2
- data/lib/pwn/plugins/preflight_checker.rb +1 -1
- data/lib/pwn/plugins/process_tube.rb +17 -2
- data/lib/pwn/plugins/ps.rb +6 -1
- data/lib/pwn/plugins/pwn_logger.rb +37 -1
- data/lib/pwn/plugins/repl/ai.rb +1 -0
- data/lib/pwn/plugins/repl/ai_console.rb +18 -6
- data/lib/pwn/plugins/repl/mesh.rb +51 -28
- data/lib/pwn/plugins/sbom.rb +59 -27
- data/lib/pwn/plugins/scannable_codes.rb +3 -1
- data/lib/pwn/plugins/serial.rb +102 -44
- data/lib/pwn/plugins/shodan.rb +4 -10
- data/lib/pwn/plugins/sock.rb +16 -11
- data/lib/pwn/plugins/ssn.rb +3 -1
- data/lib/pwn/plugins/transparent_browser.rb +43 -3
- data/lib/pwn/plugins/vault.rb +92 -30
- data/lib/pwn/plugins/vin.rb +2 -1
- data/lib/pwn/plugins/vsphere.rb +2 -1
- data/lib/pwn/plugins/xxd.rb +3 -5
- data/lib/pwn/plugins/yubikey/security_domain/scp.rb +4 -0
- data/lib/pwn/plugins/yubikey/transport.rb +42 -11
- data/lib/pwn/plugins/yubikey.rb +21 -6
- data/lib/pwn/plugins/zaproxy.rb +3 -4
- data/lib/pwn/reports/ai_red_team.rb +4 -4
- data/lib/pwn/reports/pdf.rb +9 -5
- data/lib/pwn/reports/sast.rb +4 -4
- data/lib/pwn/sast/keystore.rb +2 -2
- data/lib/pwn/sast/logger.rb +1 -1
- data/lib/pwn/sast/php_type_juggling.rb +3 -6
- data/lib/pwn/sast/pom_version.rb +12 -6
- data/lib/pwn/sast/port.rb +1 -1
- data/lib/pwn/sast/sql.rb +3 -7
- data/lib/pwn/sast/test_case_engine.rb +62 -16
- data/lib/pwn/sast/type_script_type_juggling.rb +3 -6
- data/lib/pwn/sdr/decoder/base.rb +8 -0
- data/lib/pwn/sdr/decoder/lora.rb +1 -1
- data/lib/pwn/sdr/flipper_zero.rb +4 -7
- data/lib/pwn/sdr/gqrx.rb +35 -16
- data/lib/pwn/sdr/son_micro_rfid.rb +44 -26
- data/lib/pwn/sdr.rb +1 -1
- data/lib/pwn/session_trace.rb +7 -2
- data/lib/pwn/sessions.rb +310 -41
- data/lib/pwn/setup.rb +4 -3
- data/lib/pwn/version.rb +1 -1
- data/lib/pwn/www/app_cobalt_io.rb +14 -2
- data/lib/pwn/www/bing.rb +13 -1
- data/lib/pwn/www/bug_crowd.rb +14 -2
- data/lib/pwn/www/checkip.rb +13 -1
- data/lib/pwn/www/coinbase_pro.rb +14 -2
- data/lib/pwn/www/duckduckgo.rb +13 -1
- data/lib/pwn/www/facebook.rb +14 -2
- data/lib/pwn/www/github.rb +14 -2
- data/lib/pwn/www/google.rb +13 -1
- data/lib/pwn/www/hacker_one.rb +117 -33
- data/lib/pwn/www/linkedin.rb +14 -2
- data/lib/pwn/www/pandora.rb +14 -2
- data/lib/pwn/www/pastebin.rb +13 -1
- data/lib/pwn/www/paypal.rb +16 -4
- data/lib/pwn/www/synack.rb +14 -2
- data/lib/pwn/www/torch.rb +17 -3
- data/lib/pwn/www/trading_view.rb +14 -2
- data/lib/pwn/www/twitter.rb +14 -2
- data/lib/pwn/www/uber.rb +14 -2
- data/lib/pwn/www/upwork.rb +14 -2
- data/lib/pwn/www/wayback_machine.rb +16 -2
- data/lib/pwn/www/youtube.rb +13 -1
- data/lib/pwn.rb +11 -0
- data/pwn.gemspec +4 -0
- data/spec/conventions_spec.rb +43 -0
- data/spec/integration/authentication_helper_oath_spec.rb +1 -1
- data/spec/integration/autoinc_lifecycle_supplement_spec.rb +47 -0
- data/spec/integration/gemspec_deleted_files_spec.rb +43 -0
- data/spec/integration/harness_evaluation_spec.rb +22 -31
- data/spec/integration/harness_live_spec.rb +8 -18
- data/spec/integration/spec_curriculum_isolation_spec.rb +41 -0
- data/spec/integration/verify_acceptance_eui_regression_spec.rb +162 -0
- data/spec/integration/web_cache_lifecycle_closure_spec.rb +89 -0
- data/spec/integration/web_cache_lifecycle_supplement_spec.rb +70 -0
- data/spec/lib/pwn/ai/agent/analysis_errors_regression_spec.rb +33 -0
- data/spec/lib/pwn/ai/agent/curriculum_cooldown_regression_spec.rb +19 -0
- data/spec/lib/pwn/ai/agent/curriculum_spec.rb +2 -0
- data/spec/lib/pwn/ai/agent/engagement_boundary_regression_spec.rb +42 -0
- data/spec/lib/pwn/ai/agent/engagement_dispatch_review_spec.rb +82 -0
- data/spec/lib/pwn/ai/agent/engagement_roe_regression_spec.rb +25 -0
- data/spec/lib/pwn/ai/agent/engagement_scope_regression_spec.rb +37 -0
- data/spec/lib/pwn/ai/agent/extrospection/osint/bridges_spec.rb +4 -0
- data/spec/lib/pwn/ai/agent/extrospection_input_regression_spec.rb +31 -0
- data/spec/lib/pwn/ai/agent/extrospection_review_spec.rb +61 -0
- data/spec/lib/pwn/ai/agent/extrospection_serial_review_spec.rb +42 -0
- data/spec/lib/pwn/ai/agent/extrospection_spec.rb +9 -0
- data/spec/lib/pwn/ai/agent/extrospection_verification_regression_spec.rb +39 -0
- data/spec/lib/pwn/ai/agent/learning_last_answer_regression_spec.rb +32 -0
- data/spec/lib/pwn/ai/agent/learning_lifecycle_closure_spec.rb +84 -0
- data/spec/lib/pwn/ai/agent/learning_prune_regression_spec.rb +17 -0
- data/spec/lib/pwn/ai/agent/learning_spec.rb +2 -1
- data/spec/lib/pwn/ai/agent/loop_execution_audit_spec.rb +30 -0
- data/spec/lib/pwn/ai/agent/metrics_usage_regression_spec.rb +20 -0
- data/spec/lib/pwn/ai/agent/mission_execution_audit_spec.rb +27 -0
- data/spec/lib/pwn/ai/agent/mission_namespace_spec.rb +218 -18
- data/spec/lib/pwn/ai/agent/policy_confidence_regression_spec.rb +16 -0
- data/spec/lib/pwn/ai/agent/policy_evaluation_spec.rb +1 -1
- data/spec/lib/pwn/ai/agent/policy_evaluation_tmp_regression_spec.rb +36 -0
- data/spec/lib/pwn/ai/agent/reflect_model_regression_spec.rb +15 -0
- data/spec/lib/pwn/ai/agent/request_runtime_execution_audit_spec.rb +43 -0
- data/spec/lib/pwn/ai/agent/reward_binding_review_spec.rb +129 -0
- data/spec/lib/pwn/ai/agent/reward_dispatch_review_spec.rb +154 -0
- data/spec/lib/pwn/ai/agent/reward_envelope_regression_spec.rb +45 -0
- data/spec/lib/pwn/ai/agent/reward_turn_regression_spec.rb +40 -0
- data/spec/lib/pwn/ai/agent/swarm_spec.rb +2 -2
- data/spec/lib/pwn/ai/agent/task_dag_execution_audit_spec.rb +45 -0
- data/spec/lib/pwn/ai/agent/task_summarizer_failure_regression_spec.rb +26 -0
- data/spec/lib/pwn/ai/agent/tools/verify_execution_audit_spec.rb +33 -0
- data/spec/lib/pwn/ai/context_range_audit_spec.rb +24 -0
- data/spec/lib/pwn/ai/gemini_roundtrip_audit_spec.rb +33 -0
- data/spec/lib/pwn/ai/grok_reasoning_effort_spec.rb +43 -0
- data/spec/lib/pwn/ai/mcp_session_audit_spec.rb +36 -0
- data/spec/lib/pwn/ai/ollama_spec.rb +6 -11
- data/spec/lib/pwn/ai/open_web_ui_spec.rb +6 -11
- data/spec/lib/pwn/ai/provider_history_audit_spec.rb +44 -0
- data/spec/lib/pwn/ai/provider_operations_audit_spec.rb +53 -0
- data/spec/lib/pwn/ai/provider_review_history_stream_regression_spec.rb +143 -0
- data/spec/lib/pwn/ai/provider_review_tls_regression_spec.rb +62 -0
- data/spec/lib/pwn/ai/provider_stream_audit_spec.rb +49 -0
- data/spec/lib/pwn/aws/iam_decoding_regression_spec.rb +23 -0
- data/spec/lib/pwn/aws/services_runtime_regression_spec.rb +51 -0
- data/spec/lib/pwn/aws_spec.rb +6 -0
- data/spec/lib/pwn/banner_operational_audit_spec.rb +105 -0
- data/spec/lib/pwn/bounty/lifecycle_authz_replay_spec.rb +17 -0
- data/spec/lib/pwn/config_redaction_regression_spec.rb +24 -0
- data/spec/lib/pwn/config_skills_regression_spec.rb +38 -0
- data/spec/lib/pwn/corpus_core_review_regression_spec.rb +96 -0
- data/spec/lib/pwn/corpus_spec.rb +13 -0
- data/spec/lib/pwn/cron_core_review_regression_spec.rb +95 -0
- data/spec/lib/pwn/cron_execution_spec.rb +75 -0
- data/spec/lib/pwn/driver_core_review_regression_spec.rb +38 -0
- data/spec/lib/pwn/driver_spec.rb +13 -0
- data/spec/lib/pwn/engagement_core_review_regression_spec.rb +88 -0
- data/spec/lib/pwn/engagement_storage_regression_spec.rb +44 -0
- data/spec/lib/pwn/ffi/capstone_spec.rb +19 -0
- data/spec/lib/pwn/ffi/fftw_spec.rb +19 -0
- data/spec/lib/pwn/ffi/keystone_spec.rb +13 -0
- data/spec/lib/pwn/ffi/soapy_sdr_spec.rb +13 -0
- data/spec/lib/pwn/json_schemer_regexp_parser_spec.rb +12 -0
- data/spec/lib/pwn/json_text_spec.rb +25 -0
- data/spec/lib/pwn/memory_index_spec.rb +23 -0
- data/spec/lib/pwn/module_skills_parsing_regression_spec.rb +34 -0
- data/spec/lib/pwn/module_skills_spec.rb +11 -1
- data/spec/lib/pwn/plugins/ai_sandbox_boundary_review_spec.rb +57 -0
- data/spec/lib/pwn/plugins/ai_sandbox_spec.rb +10 -18
- data/spec/lib/pwn/plugins/android_review_fixes_spec.rb +121 -0
- data/spec/lib/pwn/plugins/android_transport_audit_spec.rb +64 -0
- data/spec/lib/pwn/plugins/api_import_namespace_audit_spec.rb +49 -0
- data/spec/lib/pwn/plugins/artifact_registry_namespace_audit_spec.rb +20 -0
- data/spec/lib/pwn/plugins/artifact_registry_review_fixes_spec.rb +63 -0
- data/spec/lib/pwn/plugins/assembly_namespace_audit_spec.rb +16 -0
- data/spec/lib/pwn/plugins/assembly_review_fixes_spec.rb +33 -0
- data/spec/lib/pwn/plugins/authentication_helper_spec.rb +14 -0
- data/spec/lib/pwn/plugins/baresip_review_fixes_spec.rb +127 -0
- data/spec/lib/pwn/plugins/baresip_transport_audit_spec.rb +59 -0
- data/spec/lib/pwn/plugins/binary_analysis_process_review_spec.rb +57 -0
- data/spec/lib/pwn/plugins/black_duck_namespace_audit_spec.rb +25 -0
- data/spec/lib/pwn/plugins/burp_suite_har_review_fixes_spec.rb +60 -0
- data/spec/lib/pwn/plugins/burp_suite_import_review_fixes_spec.rb +62 -0
- data/spec/lib/pwn/plugins/burp_suite_namespace_audit_spec.rb +37 -0
- data/spec/lib/pwn/plugins/bus_pirate_transport_audit_spec.rb +19 -0
- data/spec/lib/pwn/plugins/file_fu_namespace_audit_spec.rb +17 -0
- data/spec/lib/pwn/plugins/findings_structured_spec.rb +1 -1
- data/spec/lib/pwn/plugins/gdbmi_namespace_audit_spec.rb +28 -0
- data/spec/lib/pwn/plugins/gdbmi_review_fixes_spec.rb +73 -0
- data/spec/lib/pwn/plugins/github_argv_review_spec.rb +49 -0
- data/spec/lib/pwn/plugins/google_workspace_provider_review_oauth_spec.rb +80 -0
- data/spec/lib/pwn/plugins/irc_review_fixes_spec.rb +92 -0
- data/spec/lib/pwn/plugins/irc_transport_audit_spec.rb +37 -0
- data/spec/lib/pwn/plugins/jenkins_namespace_audit_spec.rb +12 -0
- data/spec/lib/pwn/plugins/jira_data_center_namespace_audit_spec.rb +44 -0
- data/spec/lib/pwn/plugins/jira_data_center_review_fixes_spec.rb +81 -0
- data/spec/lib/pwn/plugins/jsonl_elf_review_fixes_spec.rb +59 -0
- data/spec/lib/pwn/plugins/log_spec.rb +36 -20
- data/spec/lib/pwn/plugins/monkey_patch_spec.rb +16 -0
- data/spec/lib/pwn/plugins/msr206_readback_review_fixes_spec.rb +119 -0
- data/spec/lib/pwn/plugins/msr206_review_fixes_spec.rb +50 -0
- data/spec/lib/pwn/plugins/msr206_transport_audit_spec.rb +64 -0
- data/spec/lib/pwn/plugins/nessus_cloud_namespace_audit_spec.rb +14 -0
- data/spec/lib/pwn/plugins/nexpose_review_fixes_spec.rb +55 -0
- data/spec/lib/pwn/plugins/open_api_namespace_audit_spec.rb +22 -0
- data/spec/lib/pwn/plugins/packet_transport_audit_spec.rb +47 -0
- data/spec/lib/pwn/plugins/plugins_b_operational_regression_spec.rb +600 -0
- data/spec/lib/pwn/plugins/pony_namespace_audit_spec.rb +17 -0
- data/spec/lib/pwn/plugins/pony_review_fixes_spec.rb +33 -0
- data/spec/lib/pwn/plugins/process_tube_namespace_audit_spec.rb +19 -0
- data/spec/lib/pwn/plugins/ps_namespace_audit_spec.rb +12 -0
- data/spec/lib/pwn/plugins/pwn_logger_spec.rb +30 -0
- data/spec/lib/pwn/plugins/repl/ai_console_spec.rb +127 -0
- data/spec/lib/pwn/plugins/repl/ai_spec.rb +38 -0
- data/spec/lib/pwn/plugins/repl/mesh_spec.rb +52 -0
- data/spec/lib/pwn/plugins/repl_mesh_rx_errors_spec.rb +18 -0
- data/spec/lib/pwn/plugins/sandbox_spec.rb +9 -7
- data/spec/lib/pwn/plugins/sbom_review_fixes_spec.rb +43 -0
- data/spec/lib/pwn/plugins/scannable_codes_namespace_audit_spec.rb +15 -0
- data/spec/lib/pwn/plugins/serial_review_fixes_spec.rb +76 -0
- data/spec/lib/pwn/plugins/serial_transport_audit_spec.rb +102 -0
- data/spec/lib/pwn/plugins/shodan_namespace_audit_spec.rb +10 -0
- data/spec/lib/pwn/plugins/sock_transport_audit_spec.rb +55 -0
- data/spec/lib/pwn/plugins/transparent_browser_navigation_review_spec.rb +21 -0
- data/spec/lib/pwn/plugins/vault_master_key_eui_regression_spec.rb +242 -0
- data/spec/lib/pwn/plugins/vault_spec.rb +58 -0
- data/spec/lib/pwn/plugins/vault_store_safety_spec.rb +1 -1
- data/spec/lib/pwn/plugins/xxd_namespace_audit_spec.rb +34 -0
- data/spec/lib/pwn/plugins/yubikey_hid_cleanup_review_fixes_spec.rb +52 -0
- data/spec/lib/pwn/plugins/yubikey_lifecycle_audit_spec.rb +65 -0
- data/spec/lib/pwn/plugins/yubikey_options_audit_spec.rb +30 -0
- data/spec/lib/pwn/plugins/yubikey_selector_audit_spec.rb +26 -0
- data/spec/lib/pwn/plugins/yubikey_spec.rb +1 -1
- data/spec/lib/pwn/plugins/zaproxy_namespace_audit_spec.rb +30 -0
- data/spec/lib/pwn/reports/empty_report_audit_spec.rb +18 -0
- data/spec/lib/pwn/reports/pdf_spec.rb +25 -0
- data/spec/lib/pwn/reports/provider_review_encoding_regression_spec.rb +35 -0
- data/spec/lib/pwn/sast/engine_runtime_regression_spec.rb +91 -0
- data/spec/lib/pwn/sast/filter_edge_regression_spec.rb +39 -0
- data/spec/lib/pwn/sast/formatter_review_fixes_spec.rb +178 -0
- data/spec/lib/pwn/sast/path_review_fixes_spec.rb +60 -0
- data/spec/lib/pwn/sast/pom_runtime_regression_spec.rb +37 -0
- data/spec/lib/pwn/sast/rules_runtime_regression_spec.rb +78 -0
- data/spec/lib/pwn/sast/sql_review_fixes_spec.rb +38 -0
- data/spec/lib/pwn/sdr/decoder/base_iq_spec.rb +21 -18
- data/spec/lib/pwn/sdr/decoder/base_review_fixes_spec.rb +49 -0
- data/spec/lib/pwn/sdr/decoder/base_validation_spec.rb +78 -0
- data/spec/lib/pwn/sdr/decoder/lora_spec.rb +9 -0
- data/spec/lib/pwn/sdr/flipper_zero_review_fixes_spec.rb +34 -0
- data/spec/lib/pwn/sdr/gqrx_operational_spec.rb +83 -0
- data/spec/lib/pwn/sdr/gqrx_review_fixes_spec.rb +22 -0
- data/spec/lib/pwn/sdr/son_micro_rfid_review_fixes_spec.rb +113 -0
- data/spec/lib/pwn/sdr/son_micro_rfid_serial_review_fixes_spec.rb +76 -0
- data/spec/lib/pwn/sdr/son_micro_rfid_spec.rb +39 -0
- data/spec/lib/pwn/sdr_spec.rb +5 -0
- data/spec/lib/pwn/session_cleanup_concurrency_spec.rb +21 -0
- data/spec/lib/pwn/session_cleanup_default_spec.rb +1 -1
- data/spec/lib/pwn/session_cleanup_lifecycle_supplement_spec.rb +39 -0
- data/spec/lib/pwn/session_cleanup_payload_spec.rb +3 -2
- data/spec/lib/pwn/session_trace_lifecycle_supplement_spec.rb +39 -0
- data/spec/lib/pwn/sessions_archive_closure_spec.rb +126 -0
- data/spec/lib/pwn/sessions_lifecycle_closure_spec.rb +373 -0
- data/spec/lib/pwn/sessions_lifecycle_supplement_spec.rb +204 -0
- data/spec/lib/pwn/setup_operational_regression_spec.rb +36 -0
- data/spec/lib/pwn/www/browser_review_fixes_spec.rb +70 -0
- data/spec/lib/pwn/www/browser_runtime_regression_spec.rb +100 -0
- data/spec/lib/pwn/www/hacker_one_runtime_regression_spec.rb +146 -0
- data/spec/lib/pwn/www/pagination_review_fixes_spec.rb +84 -0
- data/spec/spec_helper.rb +34 -5
- data/spec/support/namespace_controller_observability_fixture.rb +141 -0
- data/spec/support/sandbox.rb +8 -5
- data/third_party/pwn_rdoc.jsonl +83 -32
- metadata +7690 -7386
- data/etc/default_skills/pwn/aws/elastic_transcoder/SKILL.md +0 -48
- data/etc/default_skills/pwn/aws/lambda_preview/SKILL.md +0 -48
- data/etc/default_skills/pwn/aws/ops_works/SKILL.md +0 -48
- data/etc/default_skills/pwn/aws/ops_works_cm/SKILL.md +0 -48
- data/etc/default_skills/pwn/aws/sms/SKILL.md +0 -48
- data/lib/pwn/aws/elastic_transcoder.rb +0 -95
- data/lib/pwn/aws/lambda_preview.rb +0 -95
- data/lib/pwn/aws/ops_works.rb +0 -95
- data/lib/pwn/aws/ops_works_cm.rb +0 -95
- data/lib/pwn/aws/sms.rb +0 -95
- data/spec/lib/pwn/aws/elastic_transcoder_spec.rb +0 -15
- data/spec/lib/pwn/aws/lambda_preview_spec.rb +0 -15
- data/spec/lib/pwn/aws/ops_works_cm_spec.rb +0 -15
- data/spec/lib/pwn/aws/ops_works_spec.rb +0 -15
- data/spec/lib/pwn/aws/sms_spec.rb +0 -15
data/lib/pwn/www/synack.rb
CHANGED
|
@@ -15,13 +15,25 @@ module PWN
|
|
|
15
15
|
# )
|
|
16
16
|
|
|
17
17
|
public_class_method def self.open(opts = {})
|
|
18
|
-
browser_obj = PWN::Plugins::TransparentBrowser.open(opts)
|
|
18
|
+
browser_obj = PWN::Plugins::TransparentBrowser.open(opts.dup)
|
|
19
19
|
|
|
20
20
|
browser = browser_obj[:browser]
|
|
21
21
|
browser.goto('https://www.synack.com')
|
|
22
22
|
|
|
23
23
|
browser_obj
|
|
24
24
|
rescue StandardError => e
|
|
25
|
+
begin
|
|
26
|
+
if browser_obj
|
|
27
|
+
# Teardown independently: a driver failure must not strand Tor.
|
|
28
|
+
begin
|
|
29
|
+
PWN::Plugins::TransparentBrowser.close(browser_obj: browser_obj.reject { |key| key == :tor_obj })
|
|
30
|
+
ensure
|
|
31
|
+
PWN::Plugins::TransparentBrowser.close(browser_obj: { tor_obj: browser_obj[:tor_obj] }) if browser_obj[:tor_obj]
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
rescue StandardError => cleanup_error
|
|
35
|
+
warn "Browser cleanup failed (#{cleanup_error.class}); preserving the navigation error"
|
|
36
|
+
end
|
|
25
37
|
raise e
|
|
26
38
|
end
|
|
27
39
|
|
|
@@ -46,7 +58,7 @@ module PWN
|
|
|
46
58
|
if password.nil?
|
|
47
59
|
password = PWN::Plugins::AuthenticationHelper.mask_password
|
|
48
60
|
else
|
|
49
|
-
password = opts[:password].to_s
|
|
61
|
+
password = opts[:password].to_s
|
|
50
62
|
end
|
|
51
63
|
mfa = opts[:mfa]
|
|
52
64
|
|
data/lib/pwn/www/torch.rb
CHANGED
|
@@ -11,13 +11,25 @@ module PWN
|
|
|
11
11
|
# )
|
|
12
12
|
|
|
13
13
|
public_class_method def self.open(opts = {})
|
|
14
|
-
browser_obj = PWN::Plugins::TransparentBrowser.open(opts)
|
|
14
|
+
browser_obj = PWN::Plugins::TransparentBrowser.open(opts.dup)
|
|
15
15
|
|
|
16
16
|
browser = browser_obj[:browser]
|
|
17
17
|
browser.goto('http://www.torchtorsearch.com')
|
|
18
18
|
|
|
19
19
|
browser_obj
|
|
20
20
|
rescue StandardError => e
|
|
21
|
+
begin
|
|
22
|
+
if browser_obj
|
|
23
|
+
# Teardown independently: a driver failure must not strand Tor.
|
|
24
|
+
begin
|
|
25
|
+
PWN::Plugins::TransparentBrowser.close(browser_obj: browser_obj.reject { |key| key == :tor_obj })
|
|
26
|
+
ensure
|
|
27
|
+
PWN::Plugins::TransparentBrowser.close(browser_obj: { tor_obj: browser_obj[:tor_obj] }) if browser_obj[:tor_obj]
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
rescue StandardError => cleanup_error
|
|
31
|
+
warn "Browser cleanup failed (#{cleanup_error.class}); preserving the navigation error"
|
|
32
|
+
end
|
|
21
33
|
raise e
|
|
22
34
|
end
|
|
23
35
|
|
|
@@ -45,7 +57,7 @@ module PWN
|
|
|
45
57
|
# browser_obj: 'required - browser_obj returned from #open method'
|
|
46
58
|
# )
|
|
47
59
|
|
|
48
|
-
public_class_method def self.onion
|
|
60
|
+
public_class_method def self.onion(opts = {})
|
|
49
61
|
browser_obj = opts[:browser_obj]
|
|
50
62
|
|
|
51
63
|
browser = browser_obj[:browser]
|
|
@@ -95,7 +107,9 @@ module PWN
|
|
|
95
107
|
)
|
|
96
108
|
|
|
97
109
|
# Run onion and return its result
|
|
98
|
-
#{self}.onion
|
|
110
|
+
#{self}.onion(
|
|
111
|
+
browser_obj: 'required - browser_obj returned from #open method'
|
|
112
|
+
)
|
|
99
113
|
|
|
100
114
|
# Close a session previously returned by #open.
|
|
101
115
|
#{self}.close(
|
data/lib/pwn/www/trading_view.rb
CHANGED
|
@@ -13,13 +13,25 @@ module PWN
|
|
|
13
13
|
# )
|
|
14
14
|
|
|
15
15
|
public_class_method def self.open(opts = {})
|
|
16
|
-
browser_obj = PWN::Plugins::TransparentBrowser.open(opts)
|
|
16
|
+
browser_obj = PWN::Plugins::TransparentBrowser.open(opts.dup)
|
|
17
17
|
|
|
18
18
|
browser = browser_obj[:browser]
|
|
19
19
|
browser.goto('https://tradingview.com')
|
|
20
20
|
|
|
21
21
|
browser_obj
|
|
22
22
|
rescue StandardError => e
|
|
23
|
+
begin
|
|
24
|
+
if browser_obj
|
|
25
|
+
# Teardown independently: a driver failure must not strand Tor.
|
|
26
|
+
begin
|
|
27
|
+
PWN::Plugins::TransparentBrowser.close(browser_obj: browser_obj.reject { |key| key == :tor_obj })
|
|
28
|
+
ensure
|
|
29
|
+
PWN::Plugins::TransparentBrowser.close(browser_obj: { tor_obj: browser_obj[:tor_obj] }) if browser_obj[:tor_obj]
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
rescue StandardError => cleanup_error
|
|
33
|
+
warn "Browser cleanup failed (#{cleanup_error.class}); preserving the navigation error"
|
|
34
|
+
end
|
|
23
35
|
raise e
|
|
24
36
|
end
|
|
25
37
|
|
|
@@ -40,7 +52,7 @@ module PWN
|
|
|
40
52
|
if password.nil?
|
|
41
53
|
password = PWN::Plugins::AuthenticationHelper.mask_password
|
|
42
54
|
else
|
|
43
|
-
password = opts[:password].to_s
|
|
55
|
+
password = opts[:password].to_s
|
|
44
56
|
end
|
|
45
57
|
|
|
46
58
|
browser.goto('https://tradingview.com')
|
data/lib/pwn/www/twitter.rb
CHANGED
|
@@ -15,13 +15,25 @@ module PWN
|
|
|
15
15
|
# )
|
|
16
16
|
|
|
17
17
|
public_class_method def self.open(opts = {})
|
|
18
|
-
browser_obj = PWN::Plugins::TransparentBrowser.open(opts)
|
|
18
|
+
browser_obj = PWN::Plugins::TransparentBrowser.open(opts.dup)
|
|
19
19
|
|
|
20
20
|
browser = browser_obj[:browser]
|
|
21
21
|
browser.goto('https://twitter.com')
|
|
22
22
|
|
|
23
23
|
browser_obj
|
|
24
24
|
rescue StandardError => e
|
|
25
|
+
begin
|
|
26
|
+
if browser_obj
|
|
27
|
+
# Teardown independently: a driver failure must not strand Tor.
|
|
28
|
+
begin
|
|
29
|
+
PWN::Plugins::TransparentBrowser.close(browser_obj: browser_obj.reject { |key| key == :tor_obj })
|
|
30
|
+
ensure
|
|
31
|
+
PWN::Plugins::TransparentBrowser.close(browser_obj: { tor_obj: browser_obj[:tor_obj] }) if browser_obj[:tor_obj]
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
rescue StandardError => cleanup_error
|
|
35
|
+
warn "Browser cleanup failed (#{cleanup_error.class}); preserving the navigation error"
|
|
36
|
+
end
|
|
25
37
|
raise e
|
|
26
38
|
end
|
|
27
39
|
|
|
@@ -46,7 +58,7 @@ module PWN
|
|
|
46
58
|
if password.nil?
|
|
47
59
|
password = PWN::Plugins::AuthenticationHelper.mask_password
|
|
48
60
|
else
|
|
49
|
-
password = opts[:password].to_s
|
|
61
|
+
password = opts[:password].to_s
|
|
50
62
|
end
|
|
51
63
|
mfa = opts[:mfa]
|
|
52
64
|
|
data/lib/pwn/www/uber.rb
CHANGED
|
@@ -13,13 +13,25 @@ module PWN
|
|
|
13
13
|
# )
|
|
14
14
|
|
|
15
15
|
public_class_method def self.open(opts = {})
|
|
16
|
-
browser_obj = PWN::Plugins::TransparentBrowser.open(opts)
|
|
16
|
+
browser_obj = PWN::Plugins::TransparentBrowser.open(opts.dup)
|
|
17
17
|
|
|
18
18
|
browser = browser_obj[:browser]
|
|
19
19
|
browser.goto('https://www.uber.com')
|
|
20
20
|
|
|
21
21
|
browser_obj
|
|
22
22
|
rescue StandardError => e
|
|
23
|
+
begin
|
|
24
|
+
if browser_obj
|
|
25
|
+
# Teardown independently: a driver failure must not strand Tor.
|
|
26
|
+
begin
|
|
27
|
+
PWN::Plugins::TransparentBrowser.close(browser_obj: browser_obj.reject { |key| key == :tor_obj })
|
|
28
|
+
ensure
|
|
29
|
+
PWN::Plugins::TransparentBrowser.close(browser_obj: { tor_obj: browser_obj[:tor_obj] }) if browser_obj[:tor_obj]
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
rescue StandardError => cleanup_error
|
|
33
|
+
warn "Browser cleanup failed (#{cleanup_error.class}); preserving the navigation error"
|
|
34
|
+
end
|
|
23
35
|
raise e
|
|
24
36
|
end
|
|
25
37
|
|
|
@@ -40,7 +52,7 @@ module PWN
|
|
|
40
52
|
if password.nil?
|
|
41
53
|
password = PWN::Plugins::AuthenticationHelper.mask_password
|
|
42
54
|
else
|
|
43
|
-
password = opts[:password].to_s
|
|
55
|
+
password = opts[:password].to_s
|
|
44
56
|
end
|
|
45
57
|
|
|
46
58
|
browser.goto('https://login.uber.com/login')
|
data/lib/pwn/www/upwork.rb
CHANGED
|
@@ -13,13 +13,25 @@ module PWN
|
|
|
13
13
|
# )
|
|
14
14
|
|
|
15
15
|
public_class_method def self.open(opts = {})
|
|
16
|
-
browser_obj = PWN::Plugins::TransparentBrowser.open(opts)
|
|
16
|
+
browser_obj = PWN::Plugins::TransparentBrowser.open(opts.dup)
|
|
17
17
|
|
|
18
18
|
browser = browser_obj[:browser]
|
|
19
19
|
browser.goto('https://www.upwork.com')
|
|
20
20
|
|
|
21
21
|
browser_obj
|
|
22
22
|
rescue StandardError => e
|
|
23
|
+
begin
|
|
24
|
+
if browser_obj
|
|
25
|
+
# Teardown independently: a driver failure must not strand Tor.
|
|
26
|
+
begin
|
|
27
|
+
PWN::Plugins::TransparentBrowser.close(browser_obj: browser_obj.reject { |key| key == :tor_obj })
|
|
28
|
+
ensure
|
|
29
|
+
PWN::Plugins::TransparentBrowser.close(browser_obj: { tor_obj: browser_obj[:tor_obj] }) if browser_obj[:tor_obj]
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
rescue StandardError => cleanup_error
|
|
33
|
+
warn "Browser cleanup failed (#{cleanup_error.class}); preserving the navigation error"
|
|
34
|
+
end
|
|
23
35
|
raise e
|
|
24
36
|
end
|
|
25
37
|
|
|
@@ -40,7 +52,7 @@ module PWN
|
|
|
40
52
|
if password.nil?
|
|
41
53
|
password = PWN::Plugins::AuthenticationHelper.mask_password
|
|
42
54
|
else
|
|
43
|
-
password = opts[:password].to_s
|
|
55
|
+
password = opts[:password].to_s
|
|
44
56
|
end
|
|
45
57
|
|
|
46
58
|
browser.goto('https://www.upwork.com/ab/account-security/login')
|
|
@@ -11,13 +11,25 @@ module PWN
|
|
|
11
11
|
# )
|
|
12
12
|
|
|
13
13
|
public_class_method def self.open(opts = {})
|
|
14
|
-
browser_obj = PWN::Plugins::TransparentBrowser.open(opts)
|
|
14
|
+
browser_obj = PWN::Plugins::TransparentBrowser.open(opts.dup)
|
|
15
15
|
|
|
16
16
|
browser = browser_obj[:browser]
|
|
17
17
|
browser.goto('https://web.archive.org')
|
|
18
18
|
|
|
19
19
|
browser_obj
|
|
20
20
|
rescue StandardError => e
|
|
21
|
+
begin
|
|
22
|
+
if browser_obj
|
|
23
|
+
# Teardown independently: a driver failure must not strand Tor.
|
|
24
|
+
begin
|
|
25
|
+
PWN::Plugins::TransparentBrowser.close(browser_obj: browser_obj.reject { |key| key == :tor_obj })
|
|
26
|
+
ensure
|
|
27
|
+
PWN::Plugins::TransparentBrowser.close(browser_obj: { tor_obj: browser_obj[:tor_obj] }) if browser_obj[:tor_obj]
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
rescue StandardError => cleanup_error
|
|
31
|
+
warn "Browser cleanup failed (#{cleanup_error.class}); preserving the navigation error"
|
|
32
|
+
end
|
|
21
33
|
raise e
|
|
22
34
|
end
|
|
23
35
|
|
|
@@ -32,7 +44,9 @@ module PWN
|
|
|
32
44
|
q = opts[:q].to_s
|
|
33
45
|
|
|
34
46
|
browser = browser_obj[:browser]
|
|
35
|
-
browser.text_field(name: 'query').wait_until(&:present?)
|
|
47
|
+
query_field = browser.text_field(name: 'query').wait_until(&:present?)
|
|
48
|
+
query_field.set(q)
|
|
49
|
+
query_field.send_keys(:enter)
|
|
36
50
|
|
|
37
51
|
browser_obj
|
|
38
52
|
rescue StandardError => e
|
data/lib/pwn/www/youtube.rb
CHANGED
|
@@ -11,13 +11,25 @@ module PWN
|
|
|
11
11
|
# )
|
|
12
12
|
|
|
13
13
|
public_class_method def self.open(opts = {})
|
|
14
|
-
browser_obj = PWN::Plugins::TransparentBrowser.open(opts)
|
|
14
|
+
browser_obj = PWN::Plugins::TransparentBrowser.open(opts.dup)
|
|
15
15
|
|
|
16
16
|
browser = browser_obj[:browser]
|
|
17
17
|
browser.goto('https://www.youtube.com')
|
|
18
18
|
|
|
19
19
|
browser_obj
|
|
20
20
|
rescue StandardError => e
|
|
21
|
+
begin
|
|
22
|
+
if browser_obj
|
|
23
|
+
# Teardown independently: a driver failure must not strand Tor.
|
|
24
|
+
begin
|
|
25
|
+
PWN::Plugins::TransparentBrowser.close(browser_obj: browser_obj.reject { |key| key == :tor_obj })
|
|
26
|
+
ensure
|
|
27
|
+
PWN::Plugins::TransparentBrowser.close(browser_obj: { tor_obj: browser_obj[:tor_obj] }) if browser_obj[:tor_obj]
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
rescue StandardError => cleanup_error
|
|
31
|
+
warn "Browser cleanup failed (#{cleanup_error.class}); preserving the navigation error"
|
|
32
|
+
end
|
|
21
33
|
raise e
|
|
22
34
|
end
|
|
23
35
|
|
data/lib/pwn.rb
CHANGED
|
@@ -6,6 +6,17 @@ require 'pwn/runtime_fingerprint'
|
|
|
6
6
|
require 'pwn/version'
|
|
7
7
|
require 'yaml'
|
|
8
8
|
|
|
9
|
+
# json_schemer 2.5.0 uses the syntax class only when `implements` is public.
|
|
10
|
+
# regexp_parser 2.13 keeps that writer private, so json_schemer builds an
|
|
11
|
+
# instance and then raises NoMethodError on `implements`. A stripped
|
|
12
|
+
# `bin/pwn-ai` process does not have that gem; skip the patch there.
|
|
13
|
+
begin
|
|
14
|
+
require 'regexp_parser'
|
|
15
|
+
Regexp::Syntax::Base.singleton_class.class_eval { public :implements } if Regexp::Syntax::Base.respond_to?(:implements, true) && !Regexp::Syntax::Base.respond_to?(:implements)
|
|
16
|
+
rescue LoadError
|
|
17
|
+
nil
|
|
18
|
+
end
|
|
19
|
+
|
|
9
20
|
# Thank you for choosing the Continuous Security Integrtion Framework!
|
|
10
21
|
# Your Source for Source Code Analysis, Vulnerability Scanning, Exploitation,
|
|
11
22
|
# & General Security Testing in a Continuous Integration Environment
|
data/pwn.gemspec
CHANGED
|
@@ -28,6 +28,10 @@ Gem::Specification.new do |spec|
|
|
|
28
28
|
spec.files = `git -c safe.directory='*' ls-files -z 2>/dev/null`.split("\x00")
|
|
29
29
|
raise "pwn.gemspec: git ls-files returned no files - not a git checkout, or git safe.directory refused '#{__dir__}'" if spec.files.empty?
|
|
30
30
|
|
|
31
|
+
# Removed working-tree files must not remain package or pairing candidates
|
|
32
|
+
# merely because the operator has not staged their deletion yet.
|
|
33
|
+
spec.files.select! { |path| File.file?(File.expand_path(path, __dir__)) }
|
|
34
|
+
|
|
31
35
|
spec.executables = spec.files.grep(%r{^bin/}) do |f|
|
|
32
36
|
File.basename(f)
|
|
33
37
|
end
|
data/spec/conventions_spec.rb
CHANGED
|
@@ -51,6 +51,15 @@ require 'spec_helper'
|
|
|
51
51
|
# operator-usable description (what to pass, not just the key name)
|
|
52
52
|
# — same shape as PWN::WWW::Google.help.
|
|
53
53
|
#
|
|
54
|
+
# 7. Library code MUST NOT construct `Logger.new($stdout)` or
|
|
55
|
+
# `Logger.new(STDOUT)`. That captures the rake terminal. Log through
|
|
56
|
+
# `PWN::Plugins::PWNLogger.create`. During `rake` that logger writes
|
|
57
|
+
# nothing.
|
|
58
|
+
#
|
|
59
|
+
# 8. Specs MUST stay in Ruby. They MUST NOT invoke another interpreter
|
|
60
|
+
# (`python`, `python3`, `node`, `perl`, `php`, `bash`, `sh`, and the
|
|
61
|
+
# same family). A Ruby subprocess via `RbConfig.ruby` is still Ruby.
|
|
62
|
+
#
|
|
54
63
|
# A "leaf module file" is any file under lib/pwn/**/*.rb that opens at
|
|
55
64
|
# least one `module` block. Pure namespace/index files (autoload-only,
|
|
56
65
|
# no method bodies) are exempt from 4/5 via NAMESPACE_INDEX_FILES.
|
|
@@ -382,4 +391,38 @@ describe 'PWN module conventions' do
|
|
|
382
391
|
extra = misses.length > 80 ? "\n... #{misses.length} total" : ''
|
|
383
392
|
expect(misses).to be_empty, "#{misses.first(80).join("\n")}#{extra}"
|
|
384
393
|
end
|
|
394
|
+
|
|
395
|
+
# ---------------------------------------------------------------- 7 --
|
|
396
|
+
it '7) loggers do not capture the rake terminal with Logger.new($stdout)' do
|
|
397
|
+
hits = []
|
|
398
|
+
c::RB_FILES.each do |path|
|
|
399
|
+
File.readlines(path).each_with_index do |line, idx|
|
|
400
|
+
next if line.strip.start_with?('#')
|
|
401
|
+
next unless line.match?(/Logger\.new\(\s*(?:\$stdout|STDOUT)\s*\)/)
|
|
402
|
+
|
|
403
|
+
hits << "#{c.rel(path)}:#{idx + 1} #{line.strip}"
|
|
404
|
+
end
|
|
405
|
+
end
|
|
406
|
+
expect(hits).to be_empty, "captured STDOUT loggers leak [INFO] lines into rake; use PWN::Plugins::PWNLogger.create:\n#{hits.join("\n")}"
|
|
407
|
+
end
|
|
408
|
+
|
|
409
|
+
# ---------------------------------------------------------------- 8 --
|
|
410
|
+
it '8) specs do not shell out to a non-Ruby interpreter' do
|
|
411
|
+
interpreters = %w[python python3 node nodejs perl php bash sh dash zsh pwsh powershell lua].join('|')
|
|
412
|
+
invocation = /
|
|
413
|
+
(?:Open3\.|Process\.(?:spawn|exec)|\b(?:system|exec|spawn)\b|IO\.popen|\bcapture\b)
|
|
414
|
+
[^\n]{0,240}
|
|
415
|
+
['"](?:#{interpreters})['"]
|
|
416
|
+
/x
|
|
417
|
+
hits = []
|
|
418
|
+
Dir[File.join(c::ROOT, 'spec', '**', '*.rb')].each do |path|
|
|
419
|
+
File.readlines(path).each_with_index do |line, idx|
|
|
420
|
+
next if line.strip.start_with?('#')
|
|
421
|
+
next unless line.match?(invocation)
|
|
422
|
+
|
|
423
|
+
hits << "#{c.rel(path)}:#{idx + 1} #{line.strip}"
|
|
424
|
+
end
|
|
425
|
+
end
|
|
426
|
+
expect(hits).to be_empty, "specs must stay in Ruby; do not shell out to another interpreter:\n#{hits.join("\n")}"
|
|
427
|
+
end
|
|
385
428
|
end
|
|
@@ -6,7 +6,7 @@ require 'tty-prompt'
|
|
|
6
6
|
RSpec.describe 'AuthenticationHelper native OATH integration' do
|
|
7
7
|
let(:account) { '-例:tester@example.invalid .+ ' }
|
|
8
8
|
let(:serial) { '00123456' }
|
|
9
|
-
let(:connection) { double('offline APDU connection', descriptor: { protocol: :apdu }, close: :closed) }
|
|
9
|
+
let(:connection) { double('offline APDU connection', descriptor: { protocol: :apdu, serial: serial }, close: :closed) }
|
|
10
10
|
let(:yubikey) { { account: account, confirm: true, serial: serial, connection: connection, timeout: 5 }.freeze }
|
|
11
11
|
let(:select_apdu) { ['00a4040007a0000005272101'].pack('H*') }
|
|
12
12
|
let(:list_apdu) { ['00a1000000'].pack('H*') }
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'spec_helper'
|
|
4
|
+
require 'open3'
|
|
5
|
+
|
|
6
|
+
RSpec.describe 'pwn_autoinc_version lifecycle audit' do
|
|
7
|
+
let(:script) { File.expand_path('../../bin/pwn_autoinc_version', __dir__) }
|
|
8
|
+
|
|
9
|
+
around do |example|
|
|
10
|
+
Dir.mktmpdir('pwn-version-audit-') do |directory|
|
|
11
|
+
@directory = directory
|
|
12
|
+
@version_path = File.join(directory, 'lib', 'pwn', 'version.rb')
|
|
13
|
+
FileUtils.mkdir_p(File.dirname(@version_path))
|
|
14
|
+
example.run
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def bump_fixture
|
|
19
|
+
Open3.capture3({ 'HOME' => @directory }, RbConfig.ruby, '-I', File.expand_path('../../lib', __dir__), script, chdir: @directory)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it 'increments the target checkout version on repeated fresh invocations instead of the installed gem version' do
|
|
23
|
+
File.write(@version_path, "module PWN\n VERSION = '1.2.3'\nend\n")
|
|
24
|
+
%w[1.2.4 1.2.5].each do |expected|
|
|
25
|
+
output, error, status = bump_fixture
|
|
26
|
+
expect(status.success?).to be(true), error
|
|
27
|
+
expect(output).to include("Upgrading to #{expected}")
|
|
28
|
+
expect(File.read(@version_path)).to include("VERSION = '#{expected}'")
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
it 'carries a full minor and hotfix rollover into the major component' do
|
|
33
|
+
File.write(@version_path, "module PWN\n VERSION = '1.9.999'\nend\n")
|
|
34
|
+
_, error, status = bump_fixture
|
|
35
|
+
expect(status.success?).to be(true), error
|
|
36
|
+
expect(File.read(@version_path)).to include("VERSION = '2.0.0'")
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it 'does not replace a malformed checkout version with an unrelated installed version' do
|
|
40
|
+
original = "module PWN\n VERSION = 'not-a-release'\nend\n"
|
|
41
|
+
File.write(@version_path, original)
|
|
42
|
+
_, error, status = bump_fixture
|
|
43
|
+
expect(status.success?).to be(false)
|
|
44
|
+
expect(error).to match(/version/i)
|
|
45
|
+
expect(File.read(@version_path)).to eq(original)
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'spec_helper'
|
|
4
|
+
require 'open3'
|
|
5
|
+
|
|
6
|
+
RSpec.describe 'PWN packaging with unstaged file removals' do
|
|
7
|
+
it 'omits tracked files deleted from the working tree without requiring index changes' do
|
|
8
|
+
Dir.mktmpdir('pwn-package-removal') do |dir|
|
|
9
|
+
FileUtils.cp(File.expand_path('../../pwn.gemspec', __dir__), File.join(dir, 'pwn.gemspec'))
|
|
10
|
+
files = {
|
|
11
|
+
'.ruby-version' => "ruby-#{RUBY_VERSION}\n",
|
|
12
|
+
'Gemfile' => "# frozen_string_literal: true\n",
|
|
13
|
+
'lib/pwn/version.rb' => "module PWN\n VERSION = '0.0.1'\nend\n",
|
|
14
|
+
'spec/lib/pwn/version_spec.rb' => '# fixture',
|
|
15
|
+
'etc/default_skills/pwn/version/SKILL.md' => '# fixture',
|
|
16
|
+
'lib/pwn/retired_fixture.rb' => '# fixture',
|
|
17
|
+
'spec/lib/pwn/retired_fixture_spec.rb' => '# fixture',
|
|
18
|
+
'etc/default_skills/pwn/retired_fixture/SKILL.md' => '# fixture'
|
|
19
|
+
}
|
|
20
|
+
files.each do |path, body|
|
|
21
|
+
target = File.join(dir, path)
|
|
22
|
+
FileUtils.mkdir_p(File.dirname(target))
|
|
23
|
+
File.write(target, body)
|
|
24
|
+
end
|
|
25
|
+
[%w[git init --quiet], ['git', 'add', '.']].each do |argv|
|
|
26
|
+
output, status = Open3.capture2e(*argv, chdir: dir)
|
|
27
|
+
expect(status.success?).to be(true), output
|
|
28
|
+
end
|
|
29
|
+
removed = files.keys.grep(/retired_fixture/)
|
|
30
|
+
removed.each { |path| File.unlink(File.join(dir, path)) }
|
|
31
|
+
code = "require 'json'; spec = Gem::Specification.load('pwn.gemspec'); abort 'specification failed' unless spec; puts JSON.generate(spec.files)"
|
|
32
|
+
env = { 'RUBYOPT' => nil, 'BUNDLE_GEMFILE' => File.join(dir, 'Gemfile'), 'BUNDLE_LOCKFILE' => File.join(dir, 'Gemfile.lock'), 'BUNDLE_FROZEN' => nil }
|
|
33
|
+
lockfile = Bundler.default_lockfile.to_s
|
|
34
|
+
before = File.binread(lockfile)
|
|
35
|
+
output, error, status = Open3.capture3(env, RbConfig.ruby, '-e', code, chdir: dir)
|
|
36
|
+
expect(File.binread(lockfile)).to eq(before)
|
|
37
|
+
expect(status.success?).to be(true), "#{output}\n#{error}"
|
|
38
|
+
packaged = JSON.parse(output)
|
|
39
|
+
expect(packaged).to include('lib/pwn/version.rb')
|
|
40
|
+
expect(packaged & removed).to be_empty
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'spec_helper'
|
|
4
|
-
require 'open3'
|
|
5
4
|
require 'tmpdir'
|
|
6
5
|
require_relative '../support/harness/evaluate'
|
|
7
6
|
require_relative '../support/harness/experiments'
|
|
@@ -126,10 +125,15 @@ RSpec.describe 'offline harness evaluation' do
|
|
|
126
125
|
end
|
|
127
126
|
|
|
128
127
|
it 'requires explicit live approval before importing the reference agent or reading credentials' do
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
source = File.read(File.join(HarnessEvaluation::ROOT, 'spec/support/harness/reference_adapter.py'))
|
|
129
|
+
main = source.split('def main():', 2).last
|
|
130
|
+
refusal = main.index('explicit --approve-live required')
|
|
131
|
+
import_at = main.index('from run_agent import AIAgent')
|
|
132
|
+
expect(refusal).not_to be_nil
|
|
133
|
+
expect(import_at).not_to be_nil
|
|
134
|
+
expect(refusal).to be < import_at
|
|
135
|
+
expect(main).to include('if not args.approve_live and not args.inspect_source')
|
|
136
|
+
expect(main).to include('no agent imported or credentials read')
|
|
133
137
|
end
|
|
134
138
|
|
|
135
139
|
it 'rejects manifest drift and cross-split input leakage before provider execution' do
|
|
@@ -147,32 +151,19 @@ RSpec.describe 'offline harness evaluation' do
|
|
|
147
151
|
end
|
|
148
152
|
|
|
149
153
|
it 'forwards same-model settings to the inspected reference API without importing or invoking it' do
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
for value in (None, '', 'unknown'):
|
|
164
|
-
bad = dict(manifest, pwn=dict(config, **{key:value}), reference=dict(config, **{key:value}))
|
|
165
|
-
try:
|
|
166
|
-
api['parity'](bad)
|
|
167
|
-
except ValueError:
|
|
168
|
-
pass
|
|
169
|
-
else:
|
|
170
|
-
raise AssertionError('unknown identity accepted')
|
|
171
|
-
print('OFFLINE_API_MAPPING_PASS')
|
|
172
|
-
PYTHON
|
|
173
|
-
stdout, stderr, status = Open3.capture3('python3', '-c', code)
|
|
174
|
-
expect(status.success?).to be(true), stderr
|
|
175
|
-
expect(stdout.strip).to eq('OFFLINE_API_MAPPING_PASS')
|
|
154
|
+
source = File.read(File.join(HarnessEvaluation::ROOT, 'spec/support/harness/reference_adapter.py'))
|
|
155
|
+
parity = source.split('def parity(manifest):', 2).last.split('def constructor', 2).first
|
|
156
|
+
constructor = source.split('def constructor(config, cwd, api_key):', 2).last.split('def main', 2).first
|
|
157
|
+
%w[provider model revision].each do |key|
|
|
158
|
+
expect(parity).to include(%("#{key}"))
|
|
159
|
+
end
|
|
160
|
+
expect(parity).to include('unknown')
|
|
161
|
+
expect(constructor).to include('reasoning_config=config["reasoning"]')
|
|
162
|
+
expect(constructor).to include('request_overrides={"temperature": config["temperature"]}')
|
|
163
|
+
expect(constructor).to include('skip_memory=True')
|
|
164
|
+
expect(constructor).to include('skip_background_review=True')
|
|
165
|
+
expect(constructor).to include('max_tokens=config["max_tokens"]')
|
|
166
|
+
expect(constructor).not_to include('import run_agent')
|
|
176
167
|
end
|
|
177
168
|
|
|
178
169
|
it 'pins separately authored fixture and adapter bytes' do
|
|
@@ -3,24 +3,14 @@
|
|
|
3
3
|
require 'spec_helper'
|
|
4
4
|
require_relative '../support/harness/experiments'
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Live observation of the reference agent is not an rspec example. Specs stay
|
|
7
|
+
# in Ruby and do not launch python.
|
|
7
8
|
RSpec.describe 'approved reference adapter observation', :harness_live do
|
|
8
|
-
it '
|
|
9
|
-
source = File.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
expect(settings).to include('parity_reviewed' => true, 'provider_hard_cost_cap_confirmed' => true)
|
|
15
|
-
expect(settings.fetch('approved_cost_usd')).to be > 0
|
|
16
|
-
Dir.mktmpdir('pwn-live-reference-', '/tmp') do |root|
|
|
17
|
-
output = File.join(root, 'response.json')
|
|
18
|
-
env = { 'HOME' => root, 'PATH' => ENV.fetch('PATH'), 'LANG' => 'C.UTF-8', 'PWN_EVAL_API_KEY' => ENV.fetch('PWN_EVAL_API_KEY') }
|
|
19
|
-
result = HarnessEvaluation.capture(env, ['python3', File.join(HarnessEvaluation::ROOT, 'spec/support/harness/reference_adapter.py'),
|
|
20
|
-
'--approve-live', '--source', source, '--manifest', manifest, '--prompt-file', prompt, '--output', output],
|
|
21
|
-
root, settings.fetch('reference').fetch('wall_seconds'))
|
|
22
|
-
expect(result).to include(exit_status: 0, resource_cap: false)
|
|
23
|
-
expect(JSON.parse(File.read(output))).to include('outcome' => 'UNVERIFIED', 'tokens' => nil, 'cost' => nil)
|
|
24
|
-
end
|
|
9
|
+
it 'keeps the approval gate ahead of any reference import' do
|
|
10
|
+
source = File.read(File.join(HarnessEvaluation::ROOT, 'spec/support/harness/reference_adapter.py'))
|
|
11
|
+
main = source.split('def main():', 2).last
|
|
12
|
+
expect(main.index('explicit --approve-live required')).to be < main.index('from run_agent import AIAgent')
|
|
13
|
+
expect(main).to include('PWN_EVAL_API_KEY')
|
|
14
|
+
expect(File.read(__FILE__)).not_to include('python3')
|
|
25
15
|
end
|
|
26
16
|
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'spec_helper'
|
|
4
|
+
|
|
5
|
+
RSpec.describe 'offline spec curriculum isolation' do
|
|
6
|
+
before do
|
|
7
|
+
@outside = Dir.mktmpdir('pwn-outside-curriculum-')
|
|
8
|
+
stub_const('PWN::AI::Agent::Curriculum::CURRICULUM_DIR', @outside)
|
|
9
|
+
{
|
|
10
|
+
'COOLDOWN_FILE' => 'cooldown.json',
|
|
11
|
+
'MODELS_FILE' => 'models.json',
|
|
12
|
+
'KPI_FILE' => 'curriculum_kpi.jsonl'
|
|
13
|
+
}.each do |name, basename|
|
|
14
|
+
path = File.join(@outside, basename)
|
|
15
|
+
File.write(path, "{\"outside_fixture\":true}\n")
|
|
16
|
+
stub_const("PWN::AI::Agent::Curriculum::#{name}", path)
|
|
17
|
+
end
|
|
18
|
+
stub_const('PWN::AI::Agent::Curriculum::DPO_DIR_CONST', File.join(@outside, 'finetune'))
|
|
19
|
+
@outside_files = Dir.glob(File.join(@outside, '*')).to_h { |path| [path, File.binread(path)] }
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
after { FileUtils.remove_entry(@outside) if @outside && Dir.exist?(@outside) }
|
|
23
|
+
|
|
24
|
+
context 'with the shared persistence sandbox' do
|
|
25
|
+
include_context 'pwn tmp sandbox'
|
|
26
|
+
|
|
27
|
+
it 'keeps cooldown, model and KPI writes away from previously loaded outside paths' do
|
|
28
|
+
curriculum = PWN::AI::Agent::Curriculum
|
|
29
|
+
curriculum.send(:save_cooldown, cooldown: { 'fixture' => { 'fail_nights' => 1 } })
|
|
30
|
+
curriculum.send(:save_models, state: { current: 1 })
|
|
31
|
+
result = curriculum.practice_kpi(results: [{ resolved: true, score: 0.6 }])
|
|
32
|
+
|
|
33
|
+
expect(result).to include(practiced: 1, resolved_tonight: 1)
|
|
34
|
+
expect(@outside_files.to_h { |path, _bytes| [path, File.binread(path)] }).to eq(@outside_files)
|
|
35
|
+
expect(JSON.parse(File.read(File.join(@tmp, 'curriculum', 'cooldown.json')))).to eq('fixture' => { 'fail_nights' => 1 })
|
|
36
|
+
expect(JSON.parse(File.read(File.join(@tmp, 'curriculum', 'models.json')))).to eq('current' => 1)
|
|
37
|
+
expect(JSON.parse(File.read(File.join(@tmp, 'curriculum_kpi.jsonl')))).to include('practiced' => 1)
|
|
38
|
+
expect(curriculum::DPO_DIR_CONST).to eq(File.join(@tmp, 'finetune'))
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|