pwn 0.5.708 → 0.5.710
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 +2 -2
- data/documentation/Installation.md +1 -0
- data/etc/default_skills/exploitdev/SKILL.md +38 -0
- data/etc/default_skills/pwn/ai/agent/extrospection/osint/bridges/SKILL.md +30 -8
- data/etc/default_skills/pwn/ai/agent/extrospection/osint/social/SKILL.md +30 -8
- data/etc/default_skills/pwn/ai/agent/extrospection/osint/social/references/urls.md +1 -1
- data/etc/default_skills/pwn/ai/agent/extrospection/references/urls.md +0 -1
- data/etc/default_skills/pwn/memory_index/SKILL.md +0 -4
- data/etc/default_skills/pwn/plugins/aflplusplus/SKILL.md +49 -0
- data/etc/default_skills/pwn/plugins/android/SKILL.md +1 -0
- data/etc/default_skills/pwn/plugins/artifact_registry/SKILL.md +49 -0
- data/etc/default_skills/pwn/plugins/binary_parser/SKILL.md +54 -0
- data/etc/default_skills/pwn/plugins/credential_attack/SKILL.md +58 -0
- data/etc/default_skills/pwn/plugins/credential_attack/references/urls.md +3 -0
- data/etc/default_skills/pwn/plugins/exploit_db/SKILL.md +49 -0
- data/etc/default_skills/pwn/plugins/exploit_dev/SKILL.md +63 -0
- data/etc/default_skills/pwn/plugins/frida/SKILL.md +51 -0
- data/etc/default_skills/pwn/plugins/fuzz/SKILL.md +2 -0
- data/etc/default_skills/pwn/plugins/gdb/SKILL.md +53 -0
- data/etc/default_skills/pwn/plugins/jobs/SKILL.md +51 -0
- data/etc/default_skills/pwn/plugins/k8s/SKILL.md +51 -0
- data/etc/default_skills/pwn/plugins/nuclei/SKILL.md +50 -0
- data/etc/default_skills/pwn/plugins/preflight_checker/SKILL.md +59 -0
- data/etc/default_skills/pwn/plugins/process_tube/SKILL.md +53 -0
- data/etc/default_skills/pwn/plugins/radare2/SKILL.md +59 -0
- data/etc/default_skills/pwn/plugins/recon/SKILL.md +57 -0
- data/etc/default_skills/pwn/plugins/recon/references/urls.md +6 -0
- data/etc/default_skills/pwn/plugins/semgrep/SKILL.md +48 -0
- data/etc/default_skills/pwn/plugins/sqlmap/SKILL.md +48 -0
- data/etc/default_skills/pwn/plugins/transparent_browser/SKILL.md +0 -4
- data/etc/default_skills/pwn/plugins/volatility/SKILL.md +49 -0
- data/lib/pwn/ai/agent/assembly.rb +4 -1
- data/lib/pwn/ai/agent/btc.rb +4 -1
- data/lib/pwn/ai/agent/burp_suite.rb +5 -2
- data/lib/pwn/ai/agent/curriculum.rb +89 -30
- data/lib/pwn/ai/agent/dispatch.rb +27 -16
- data/lib/pwn/ai/agent/extrospection/osint/bridges.rb +9 -18
- data/lib/pwn/ai/agent/extrospection/osint/social.rb +9 -18
- data/lib/pwn/ai/agent/extrospection.rb +185 -60
- data/lib/pwn/ai/agent/gqrx.rb +4 -1
- data/lib/pwn/ai/agent/hacker_one.rb +5 -2
- data/lib/pwn/ai/agent/learning.rb +142 -25
- data/lib/pwn/ai/agent/loop.rb +53 -46
- data/lib/pwn/ai/agent/metrics.rb +133 -23
- data/lib/pwn/ai/agent/mistakes.rb +126 -17
- data/lib/pwn/ai/agent/open_goal.rb +25 -9
- data/lib/pwn/ai/agent/policy.rb +158 -18
- data/lib/pwn/ai/agent/prompt_builder.rb +21 -11
- data/lib/pwn/ai/agent/prompt_cache.rb +44 -13
- data/lib/pwn/ai/agent/reflect.rb +9 -5
- data/lib/pwn/ai/agent/registry.rb +65 -12
- data/lib/pwn/ai/agent/result.rb +19 -10
- data/lib/pwn/ai/agent/reward.rb +150 -32
- data/lib/pwn/ai/agent/sast.rb +4 -1
- data/lib/pwn/ai/agent/swarm.rb +72 -36
- data/lib/pwn/ai/agent/task_summarizer.rb +165 -36
- data/lib/pwn/ai/agent/tool_guard.rb +105 -6
- data/lib/pwn/ai/agent/tools/sessions.rb +8 -1
- data/lib/pwn/ai/agent/transparent_browser.rb +4 -1
- data/lib/pwn/ai/agent/turn_finalizer.rb +41 -21
- data/lib/pwn/ai/agent/vuln_gen.rb +6 -3
- data/lib/pwn/ai/agent.rb +4 -0
- data/lib/pwn/ai/anthropic.rb +41 -7
- data/lib/pwn/ai/gemini.rb +21 -11
- data/lib/pwn/ai/grok.rb +44 -6
- data/lib/pwn/ai/http_retry.rb +40 -12
- data/lib/pwn/ai/ollama.rb +19 -10
- data/lib/pwn/ai/open_ai.rb +81 -30
- data/lib/pwn/ai/open_web_ui.rb +20 -14
- data/lib/pwn/ai/red_team/agent_protocol_abuse.rb +7 -1
- data/lib/pwn/ai/red_team/data_and_model_poisoning.rb +7 -1
- data/lib/pwn/ai/red_team/excessive_agency.rb +7 -1
- data/lib/pwn/ai/red_team/hidden_context_exposure.rb +7 -1
- data/lib/pwn/ai/red_team/insecure_output_handling.rb +7 -1
- data/lib/pwn/ai/red_team/jailbreak.rb +7 -1
- data/lib/pwn/ai/red_team/memory_poisoning.rb +7 -1
- data/lib/pwn/ai/red_team/multimodal_injection.rb +7 -1
- data/lib/pwn/ai/red_team/overreliance.rb +7 -1
- data/lib/pwn/ai/red_team/payload_splitting.rb +7 -1
- data/lib/pwn/ai/red_team/prompt_injection.rb +7 -1
- data/lib/pwn/ai/red_team/rag_poisoning.rb +7 -1
- data/lib/pwn/ai/red_team/sensitive_information_disclosure.rb +7 -1
- data/lib/pwn/ai/red_team/supply_chain.rb +7 -1
- data/lib/pwn/ai/red_team/system_prompt_extraction.rb +7 -1
- data/lib/pwn/ai/red_team/test_case_engine.rb +12 -9
- data/lib/pwn/ai/red_team/token_smuggling.rb +7 -1
- data/lib/pwn/ai/red_team/unbounded_consumption.rb +7 -1
- data/lib/pwn/ai/red_team/vector_and_embedding_weaknesses.rb +7 -1
- data/lib/pwn/ai/red_team.rb +4 -0
- data/lib/pwn/ai.rb +4 -0
- data/lib/pwn/aws/acm.rb +5 -2
- data/lib/pwn/aws/api_gateway.rb +10 -7
- data/lib/pwn/aws/app_stream.rb +5 -2
- data/lib/pwn/aws/application_auto_scaling.rb +5 -2
- data/lib/pwn/aws/application_discovery_service.rb +5 -2
- data/lib/pwn/aws/auto_scaling.rb +5 -2
- data/lib/pwn/aws/batch.rb +5 -2
- data/lib/pwn/aws/budgets.rb +5 -2
- data/lib/pwn/aws/cloud_formation.rb +5 -2
- data/lib/pwn/aws/cloud_front.rb +7 -4
- data/lib/pwn/aws/cloud_hsm.rb +5 -2
- data/lib/pwn/aws/cloud_search.rb +5 -2
- data/lib/pwn/aws/cloud_search_domain.rb +5 -2
- data/lib/pwn/aws/cloud_trail.rb +5 -2
- data/lib/pwn/aws/cloud_watch.rb +5 -2
- data/lib/pwn/aws/cloud_watch_events.rb +5 -2
- data/lib/pwn/aws/cloud_watch_logs.rb +5 -2
- data/lib/pwn/aws/code_build.rb +5 -2
- data/lib/pwn/aws/code_commit.rb +5 -2
- data/lib/pwn/aws/code_deploy.rb +5 -2
- data/lib/pwn/aws/code_pipeline.rb +5 -2
- data/lib/pwn/aws/cognito_identity.rb +5 -2
- data/lib/pwn/aws/cognito_identity_provider.rb +5 -2
- data/lib/pwn/aws/cognito_sync.rb +5 -2
- data/lib/pwn/aws/config_service.rb +5 -2
- data/lib/pwn/aws/data_pipleline.rb +5 -2
- data/lib/pwn/aws/database_migration_service.rb +5 -2
- data/lib/pwn/aws/device_farm.rb +5 -2
- data/lib/pwn/aws/direct_connect.rb +5 -2
- data/lib/pwn/aws/directory_service.rb +5 -2
- data/lib/pwn/aws/dynamo_db.rb +5 -2
- data/lib/pwn/aws/dynamo_db_streams.rb +5 -2
- data/lib/pwn/aws/ec2.rb +5 -2
- data/lib/pwn/aws/ecr.rb +5 -2
- data/lib/pwn/aws/ecs.rb +5 -2
- data/lib/pwn/aws/efs.rb +5 -2
- data/lib/pwn/aws/elasti_cache.rb +5 -2
- data/lib/pwn/aws/elastic_beanstalk.rb +8 -5
- data/lib/pwn/aws/elastic_load_balancing.rb +5 -2
- data/lib/pwn/aws/elastic_load_balancing_v2.rb +6 -3
- data/lib/pwn/aws/elastic_transcoder.rb +5 -2
- data/lib/pwn/aws/elasticsearch_service.rb +5 -2
- data/lib/pwn/aws/emr.rb +5 -2
- data/lib/pwn/aws/firehose.rb +5 -2
- data/lib/pwn/aws/game_lift.rb +5 -2
- data/lib/pwn/aws/glacier.rb +6 -3
- data/lib/pwn/aws/health.rb +5 -2
- data/lib/pwn/aws/iam.rb +10 -4
- data/lib/pwn/aws/import_export.rb +5 -2
- data/lib/pwn/aws/inspector.rb +5 -2
- data/lib/pwn/aws/iot.rb +5 -2
- data/lib/pwn/aws/iot_data_plane.rb +5 -2
- data/lib/pwn/aws/kinesis.rb +5 -2
- data/lib/pwn/aws/kinesis_analytics.rb +5 -2
- data/lib/pwn/aws/kms.rb +5 -2
- data/lib/pwn/aws/lambda.rb +5 -2
- data/lib/pwn/aws/lambda_preview.rb +5 -2
- data/lib/pwn/aws/lex.rb +5 -2
- data/lib/pwn/aws/lightsail.rb +5 -2
- data/lib/pwn/aws/machine_learning.rb +5 -2
- data/lib/pwn/aws/marketplace_commerce_analytics.rb +5 -2
- data/lib/pwn/aws/marketplace_metering.rb +5 -2
- data/lib/pwn/aws/ops_works.rb +5 -2
- data/lib/pwn/aws/ops_works_cm.rb +5 -2
- data/lib/pwn/aws/pinpoint.rb +5 -2
- data/lib/pwn/aws/polly.rb +5 -2
- data/lib/pwn/aws/rds.rb +5 -2
- data/lib/pwn/aws/redshift.rb +5 -2
- data/lib/pwn/aws/rekognition.rb +5 -2
- data/lib/pwn/aws/route53.rb +5 -2
- data/lib/pwn/aws/route53_domains.rb +5 -2
- data/lib/pwn/aws/s3.rb +5 -2
- data/lib/pwn/aws/service_catalog.rb +5 -2
- data/lib/pwn/aws/ses.rb +5 -2
- data/lib/pwn/aws/shield.rb +5 -2
- data/lib/pwn/aws/simple_db.rb +5 -2
- data/lib/pwn/aws/sms.rb +5 -2
- data/lib/pwn/aws/snowball.rb +5 -2
- data/lib/pwn/aws/sns.rb +5 -2
- data/lib/pwn/aws/sqs.rb +5 -2
- data/lib/pwn/aws/ssm.rb +5 -2
- data/lib/pwn/aws/states.rb +5 -2
- data/lib/pwn/aws/storage_gateway.rb +5 -2
- data/lib/pwn/aws/sts.rb +4 -1
- data/lib/pwn/aws/support.rb +5 -2
- data/lib/pwn/aws/swf.rb +5 -2
- data/lib/pwn/aws/waf.rb +5 -2
- data/lib/pwn/aws/waf_regional.rb +5 -2
- data/lib/pwn/aws/workspaces.rb +5 -2
- data/lib/pwn/aws/x_ray.rb +5 -2
- data/lib/pwn/aws.rb +4 -0
- data/lib/pwn/banner/anon.rb +3 -0
- data/lib/pwn/banner/bubble.rb +3 -0
- data/lib/pwn/banner/cheshire.rb +3 -0
- data/lib/pwn/banner/code_cave.rb +3 -0
- data/lib/pwn/banner/dont_panic.rb +3 -0
- data/lib/pwn/banner/f_society.rb +3 -0
- data/lib/pwn/banner/fork_bomb.rb +3 -0
- data/lib/pwn/banner/jmp_esp.rb +3 -0
- data/lib/pwn/banner/matrix.rb +5 -1
- data/lib/pwn/banner/ninja.rb +3 -0
- data/lib/pwn/banner/off_the_air.rb +3 -0
- data/lib/pwn/banner/pirate.rb +3 -0
- data/lib/pwn/banner/radare2.rb +3 -0
- data/lib/pwn/banner/radare2_ai.rb +3 -0
- data/lib/pwn/banner/white_rabbit.rb +3 -0
- data/lib/pwn/banner.rb +6 -2
- data/lib/pwn/blockchain/btc.rb +8 -3
- data/lib/pwn/blockchain/eth.rb +10 -3
- data/lib/pwn/blockchain.rb +4 -0
- data/lib/pwn/bounty/lifecycle_authz_replay.rb +46 -27
- data/lib/pwn/bounty.rb +4 -0
- data/lib/pwn/config.rb +79 -13
- data/lib/pwn/cron.rb +297 -20
- data/lib/pwn/driver.rb +2 -18
- data/lib/pwn/ffi/adalm_pluto.rb +65 -11
- data/lib/pwn/ffi/fftw.rb +31 -6
- data/lib/pwn/ffi/hack_rf.rb +59 -8
- data/lib/pwn/ffi/liquid.rb +63 -10
- data/lib/pwn/ffi/rtl_sdr.rb +35 -5
- data/lib/pwn/ffi/soapy_sdr.rb +60 -10
- data/lib/pwn/ffi/stdio.rb +7 -8
- data/lib/pwn/ffi/volk.rb +36 -7
- data/lib/pwn/ffi.rb +12 -0
- data/lib/pwn/memory.rb +136 -16
- data/lib/pwn/memory_index.rb +34 -19
- data/lib/pwn/migrate.rb +34 -24
- data/lib/pwn/module_skills.rb +39 -8
- data/lib/pwn/plugins/aflplusplus.rb +72 -0
- data/lib/pwn/plugins/android.rb +71 -245
- data/lib/pwn/plugins/artifact_registry.rb +71 -0
- data/lib/pwn/plugins/assembly.rb +9 -4
- data/lib/pwn/plugins/authentication_helper.rb +8 -5
- data/lib/pwn/plugins/baresip.rb +59 -12
- data/lib/pwn/plugins/basic_auth.rb +9 -3
- data/lib/pwn/plugins/beef.rb +28 -18
- data/lib/pwn/plugins/binary_parser.rb +133 -0
- data/lib/pwn/plugins/black_duck_binary_analysis.rb +63 -39
- data/lib/pwn/plugins/burp_suite.rb +98 -68
- data/lib/pwn/plugins/bus_pirate.rb +15 -8
- data/lib/pwn/plugins/char.rb +33 -3
- data/lib/pwn/plugins/credential_attack.rb +158 -0
- data/lib/pwn/plugins/credit_card.rb +6 -1
- data/lib/pwn/plugins/dao_ldap.rb +19 -13
- data/lib/pwn/plugins/dao_mongo.rb +11 -5
- data/lib/pwn/plugins/dao_postgres.rb +28 -19
- data/lib/pwn/plugins/dao_sqlite3.rb +15 -6
- data/lib/pwn/plugins/defect_dojo.rb +38 -22
- data/lib/pwn/plugins/detect_os.rb +5 -0
- data/lib/pwn/plugins/ein.rb +3 -0
- data/lib/pwn/plugins/exploit_db.rb +69 -0
- data/lib/pwn/plugins/exploit_dev.rb +330 -0
- data/lib/pwn/plugins/file_fu.rb +11 -8
- data/lib/pwn/plugins/frida.rb +112 -0
- data/lib/pwn/plugins/fuzz.rb +42 -6
- data/lib/pwn/plugins/gdb.rb +115 -0
- data/lib/pwn/plugins/git.rb +19 -14
- data/lib/pwn/plugins/github.rb +38 -15
- data/lib/pwn/plugins/google_workspace.rb +188 -45
- data/lib/pwn/plugins/hacker_one.rb +159 -35
- data/lib/pwn/plugins/hunter.rb +6 -3
- data/lib/pwn/plugins/ip_info.rb +9 -4
- data/lib/pwn/plugins/irc.rb +28 -15
- data/lib/pwn/plugins/jenkins.rb +65 -57
- data/lib/pwn/plugins/jira_data_center.rb +30 -22
- data/lib/pwn/plugins/jobs.rb +110 -0
- data/lib/pwn/plugins/json_pathify.rb +9 -5
- data/lib/pwn/plugins/k8s.rb +73 -0
- data/lib/pwn/plugins/log.rb +113 -13
- data/lib/pwn/plugins/mail_agent.rb +87 -79
- data/lib/pwn/plugins/metasploit.rb +11 -6
- data/lib/pwn/plugins/monkey_patch.rb +3 -0
- data/lib/pwn/plugins/msr206.rb +42 -28
- data/lib/pwn/plugins/nessus_cloud.rb +44 -4
- data/lib/pwn/plugins/nexpose_vuln_scan.rb +40 -24
- data/lib/pwn/plugins/nmap_it.rb +14 -34
- data/lib/pwn/plugins/nuclei.rb +90 -0
- data/lib/pwn/plugins/oauth2.rb +11 -5
- data/lib/pwn/plugins/ocr.rb +3 -0
- data/lib/pwn/plugins/open_api.rb +5 -2
- data/lib/pwn/plugins/openvas.rb +33 -25
- data/lib/pwn/plugins/packet.rb +152 -31
- data/lib/pwn/plugins/pdf_parse.rb +5 -2
- data/lib/pwn/plugins/pony.rb +86 -1
- data/lib/pwn/plugins/preflight_checker.rb +166 -0
- data/lib/pwn/plugins/process_tube.rb +139 -0
- data/lib/pwn/plugins/ps.rb +7 -1
- data/lib/pwn/plugins/pwn_logger.rb +6 -2
- data/lib/pwn/plugins/rabbit_mq.rb +12 -7
- data/lib/pwn/plugins/radare2.rb +253 -0
- data/lib/pwn/plugins/recon.rb +196 -0
- data/lib/pwn/plugins/repl.rb +122 -1
- data/lib/pwn/plugins/scannable_codes.rb +5 -1
- data/lib/pwn/plugins/semgrep.rb +61 -0
- data/lib/pwn/plugins/serial.rb +24 -14
- data/lib/pwn/plugins/shodan.rb +54 -35
- data/lib/pwn/plugins/slack_client.rb +11 -6
- data/lib/pwn/plugins/sock.rb +17 -8
- data/lib/pwn/plugins/spider.rb +5 -2
- data/lib/pwn/plugins/sqlmap.rb +49 -0
- data/lib/pwn/plugins/ssn.rb +3 -0
- data/lib/pwn/plugins/thread_pool.rb +6 -9
- data/lib/pwn/plugins/tor.rb +9 -4
- data/lib/pwn/plugins/transparent_browser.rb +62 -107
- data/lib/pwn/plugins/tty_spinner.rb +16 -2
- data/lib/pwn/plugins/twitter_api.rb +6 -2
- data/lib/pwn/plugins/uri_scheme.rb +4 -1
- data/lib/pwn/plugins/vault.rb +12 -3
- data/lib/pwn/plugins/vin.rb +24 -12
- data/lib/pwn/plugins/voice.rb +7 -2
- data/lib/pwn/plugins/volatility.rb +67 -0
- data/lib/pwn/plugins/vsphere.rb +9 -5
- data/lib/pwn/plugins/xxd.rb +12 -43
- data/lib/pwn/plugins/zaproxy.rb +30 -16
- data/lib/pwn/plugins.rb +22 -0
- data/lib/pwn/reports/ai_red_team.rb +6 -2
- data/lib/pwn/reports/csv.rb +8 -1
- data/lib/pwn/reports/fuzz.rb +5 -2
- data/lib/pwn/reports/html.rb +8 -1
- data/lib/pwn/reports/html_footer.rb +4 -3
- data/lib/pwn/reports/html_header.rb +6 -2
- data/lib/pwn/reports/json.rb +8 -1
- data/lib/pwn/reports/markdown.rb +8 -1
- data/lib/pwn/reports/pdf.rb +8 -1
- data/lib/pwn/reports/phone.rb +5 -2
- data/lib/pwn/reports/sast.rb +6 -2
- data/lib/pwn/reports/uri_buster.rb +5 -2
- data/lib/pwn/reports/xml.rb +8 -1
- data/lib/pwn/reports.rb +19 -0
- data/lib/pwn/sast/amqp_connect_as_guest.rb +9 -3
- data/lib/pwn/sast/apache_file_system_util_api.rb +9 -3
- data/lib/pwn/sast/aws.rb +9 -3
- data/lib/pwn/sast/banned_function_calls_c.rb +9 -3
- data/lib/pwn/sast/base64.rb +9 -3
- data/lib/pwn/sast/beef_hook.rb +9 -3
- data/lib/pwn/sast/cmd_execution_go_lang.rb +9 -3
- data/lib/pwn/sast/cmd_execution_java.rb +9 -3
- data/lib/pwn/sast/cmd_execution_python.rb +9 -3
- data/lib/pwn/sast/cmd_execution_ruby.rb +9 -3
- data/lib/pwn/sast/cmd_execution_scala.rb +9 -3
- data/lib/pwn/sast/csrf.rb +9 -3
- data/lib/pwn/sast/deserial_java.rb +9 -3
- data/lib/pwn/sast/emoticon.rb +9 -3
- data/lib/pwn/sast/eval.rb +9 -3
- data/lib/pwn/sast/factory.rb +9 -3
- data/lib/pwn/sast/http_authorization_header.rb +9 -3
- data/lib/pwn/sast/inner_html.rb +9 -3
- data/lib/pwn/sast/keystore.rb +9 -3
- data/lib/pwn/sast/local_storage.rb +9 -3
- data/lib/pwn/sast/location_hash.rb +9 -3
- data/lib/pwn/sast/log4j.rb +9 -3
- data/lib/pwn/sast/logger.rb +9 -3
- data/lib/pwn/sast/md5.rb +9 -3
- data/lib/pwn/sast/outer_html.rb +9 -3
- data/lib/pwn/sast/padding_oracle.rb +9 -3
- data/lib/pwn/sast/password.rb +9 -3
- data/lib/pwn/sast/php_input_mechanisms.rb +9 -3
- data/lib/pwn/sast/php_type_juggling.rb +9 -3
- data/lib/pwn/sast/pom_version.rb +9 -3
- data/lib/pwn/sast/port.rb +9 -3
- data/lib/pwn/sast/post_message.rb +9 -3
- data/lib/pwn/sast/private_key.rb +9 -3
- data/lib/pwn/sast/redirect.rb +9 -3
- data/lib/pwn/sast/redos.rb +9 -3
- data/lib/pwn/sast/shell.rb +9 -3
- data/lib/pwn/sast/signature.rb +9 -3
- data/lib/pwn/sast/sql.rb +9 -3
- data/lib/pwn/sast/ssl.rb +9 -3
- data/lib/pwn/sast/sudo.rb +9 -3
- data/lib/pwn/sast/task_tag.rb +9 -3
- data/lib/pwn/sast/test_case_engine.rb +11 -7
- data/lib/pwn/sast/throw_errors.rb +9 -3
- data/lib/pwn/sast/token.rb +9 -3
- data/lib/pwn/sast/type_script_type_juggling.rb +9 -3
- data/lib/pwn/sast/use_after_free.rb +9 -3
- data/lib/pwn/sast/version.rb +9 -3
- data/lib/pwn/sast/window_location_hash.rb +9 -3
- data/lib/pwn/sast.rb +4 -0
- data/lib/pwn/sdr/decoder/adsb.rb +36 -5
- data/lib/pwn/sdr/decoder/apt.rb +9 -6
- data/lib/pwn/sdr/decoder/base.rb +74 -22
- data/lib/pwn/sdr/decoder/bluetooth.rb +17 -5
- data/lib/pwn/sdr/decoder/dect.rb +12 -3
- data/lib/pwn/sdr/decoder/dsp.rb +229 -39
- data/lib/pwn/sdr/decoder/flex.rb +59 -11
- data/lib/pwn/sdr/decoder/gps.rb +12 -3
- data/lib/pwn/sdr/decoder/gsm.rb +24 -4
- data/lib/pwn/sdr/decoder/iridium.rb +12 -3
- data/lib/pwn/sdr/decoder/lora.rb +13 -4
- data/lib/pwn/sdr/decoder/lte.rb +27 -3
- data/lib/pwn/sdr/decoder/morse.rb +12 -3
- data/lib/pwn/sdr/decoder/p25.rb +12 -3
- data/lib/pwn/sdr/decoder/pager.rb +8 -5
- data/lib/pwn/sdr/decoder/pocsag.rb +29 -9
- data/lib/pwn/sdr/decoder/rds.rb +14 -8
- data/lib/pwn/sdr/decoder/rfid.rb +12 -3
- data/lib/pwn/sdr/decoder/rtl433.rb +12 -3
- data/lib/pwn/sdr/decoder/rtty.rb +8 -5
- data/lib/pwn/sdr/decoder/wifi.rb +12 -3
- data/lib/pwn/sdr/decoder/zigbee.rb +12 -3
- data/lib/pwn/sdr/decoder.rb +9 -0
- data/lib/pwn/sdr/flipper_zero.rb +17 -10
- data/lib/pwn/sdr/frequency_allocation.rb +4 -1
- data/lib/pwn/sdr/gqrx.rb +178 -119
- data/lib/pwn/sdr/rfidler.rb +4 -1
- data/lib/pwn/sdr/son_micro_rfid.rb +37 -24
- data/lib/pwn/sdr.rb +14 -0
- data/lib/pwn/sessions.rb +86 -16
- data/lib/pwn/setup.rb +106 -37
- data/lib/pwn/version.rb +1 -1
- data/lib/pwn/www/app_cobalt_io.rb +11 -5
- data/lib/pwn/www/bing.rb +10 -5
- data/lib/pwn/www/bug_crowd.rb +11 -5
- data/lib/pwn/www/checkip.rb +8 -4
- data/lib/pwn/www/coinbase_pro.rb +11 -5
- data/lib/pwn/www/duckduckgo.rb +12 -6
- data/lib/pwn/www/facebook.rb +11 -5
- data/lib/pwn/www/github.rb +11 -5
- data/lib/pwn/www/google.rb +11 -5
- data/lib/pwn/www/hacker_one.rb +20 -9
- data/lib/pwn/www/linkedin.rb +11 -5
- data/lib/pwn/www/pandora.rb +11 -5
- data/lib/pwn/www/pastebin.rb +9 -4
- data/lib/pwn/www/paypal.rb +19 -11
- data/lib/pwn/www/synack.rb +11 -5
- data/lib/pwn/www/torch.rb +13 -8
- data/lib/pwn/www/trading_view.rb +11 -5
- data/lib/pwn/www/twitter.rb +11 -5
- data/lib/pwn/www/uber.rb +11 -5
- data/lib/pwn/www/upwork.rb +11 -5
- data/lib/pwn/www/wayback_machine.rb +12 -6
- data/lib/pwn/www/youtube.rb +10 -5
- data/lib/pwn/www.rb +4 -0
- data/spec/conventions_spec.rb +118 -2
- data/spec/integration/help_contract_spec.rb +2 -0
- data/spec/lib/pwn/ai/agent/reward_spec.rb +9 -0
- data/spec/lib/pwn/plugins/aflplusplus_spec.rb +13 -0
- data/spec/lib/pwn/plugins/artifact_registry_spec.rb +13 -0
- data/spec/lib/pwn/plugins/binary_parser_spec.rb +21 -0
- data/spec/lib/pwn/plugins/credential_attack_spec.rb +13 -0
- data/spec/lib/pwn/plugins/exploit_db_spec.rb +13 -0
- data/spec/lib/pwn/plugins/exploit_dev_spec.rb +23 -0
- data/spec/lib/pwn/plugins/frida_spec.rb +13 -0
- data/spec/lib/pwn/plugins/gdb_spec.rb +13 -0
- data/spec/lib/pwn/plugins/jobs_spec.rb +13 -0
- data/spec/lib/pwn/plugins/k8s_spec.rb +13 -0
- data/spec/lib/pwn/plugins/nuclei_spec.rb +13 -0
- data/spec/lib/pwn/plugins/preflight_checker_spec.rb +23 -0
- data/spec/lib/pwn/plugins/process_tube_spec.rb +13 -0
- data/spec/lib/pwn/plugins/radare2_spec.rb +13 -0
- data/spec/lib/pwn/plugins/recon_spec.rb +26 -0
- data/spec/lib/pwn/plugins/semgrep_spec.rb +13 -0
- data/spec/lib/pwn/plugins/sqlmap_spec.rb +13 -0
- data/spec/lib/pwn/plugins/volatility_spec.rb +13 -0
- data/spec/lib/pwn/req_queue_spec.rb +168 -0
- data/third_party/pwn_rdoc.jsonl +160 -5
- metadata +63 -7
- data/etc/default_skills/pwn/memory_index/references/urls.md +0 -4
- data/etc/default_skills/pwn/plugins/transparent_browser/references/urls.md +0 -3
data/lib/pwn/ai/agent/policy.rb
CHANGED
|
@@ -665,24 +665,164 @@ module PWN
|
|
|
665
665
|
end
|
|
666
666
|
|
|
667
667
|
public_class_method def self.help
|
|
668
|
-
puts
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
668
|
+
puts "USAGE:
|
|
669
|
+
# Feature → discrete state
|
|
670
|
+
#{self}.state(
|
|
671
|
+
kind: 'optional - statement|question|autonomous_goal|…',
|
|
672
|
+
request: 'optional - user text / active English task',
|
|
673
|
+
last_action: 'optional - previous tool name',
|
|
674
|
+
fails: 'optional - in-turn failure count',
|
|
675
|
+
engine: 'optional - active engine',
|
|
676
|
+
request_kind: 'optional - request kind value consumed by #state',
|
|
677
|
+
task: 'optional - task value consumed by #state',
|
|
678
|
+
ts_state: 'optional - ts state value consumed by #state',
|
|
679
|
+
final: 'optional - final value consumed by #state',
|
|
680
|
+
score: 'optional - score value consumed by #state',
|
|
681
|
+
last: 'optional - last value consumed by #state',
|
|
682
|
+
fail_n: 'optional - fail n value consumed by #state'
|
|
683
|
+
)
|
|
684
|
+
|
|
685
|
+
# Run cold and return its result
|
|
686
|
+
#{self}.cold?
|
|
687
|
+
|
|
688
|
+
# Run warm and return its result
|
|
689
|
+
#{self}.warm?
|
|
690
|
+
|
|
691
|
+
# True once live returns, warmup-replayed trajectories, or a
|
|
692
|
+
#{self}.episode_budget_met?
|
|
693
|
+
|
|
694
|
+
# Episode / environment loop
|
|
695
|
+
#{self}.begin_episode(
|
|
696
|
+
session_id: 'optional - PWN::Sessions id (defaults to ep_)',
|
|
697
|
+
request: 'optional - user request',
|
|
698
|
+
kind: 'optional - request kind',
|
|
699
|
+
intent: 'optional - Loop.request_intent',
|
|
700
|
+
engine: 'optional - active engine',
|
|
701
|
+
ts_state: 'optional - TaskSummarizer state hash'
|
|
702
|
+
)
|
|
703
|
+
|
|
704
|
+
# Run observe step and return its result
|
|
705
|
+
#{self}.observe_step(
|
|
706
|
+
session_id: 'optional - must match begin_episode when set',
|
|
707
|
+
action: 'required - tool name',
|
|
708
|
+
ok: 'required - Boolean, Reward.semantic_ok',
|
|
709
|
+
duration: 'optional - Float seconds',
|
|
710
|
+
ts_state: 'optional - TaskSummarizer state',
|
|
711
|
+
request: 'optional - used if episode was not begun',
|
|
712
|
+
kind: 'optional - kind value consumed by #observe_step',
|
|
713
|
+
engine: 'optional - engine value consumed by #observe_step'
|
|
714
|
+
)
|
|
715
|
+
|
|
716
|
+
# Run finish and return its result
|
|
717
|
+
#{self}.finish(
|
|
718
|
+
session_id: 'optional - active episode id',
|
|
719
|
+
score: 'optional - Reward.judge 0..1 (training target)',
|
|
720
|
+
verdict: 'optional - solved|partial|wrong|refused',
|
|
721
|
+
proxy_ok: 'optional - Boolean fallback when no judge score',
|
|
722
|
+
ts_state: 'optional - ts state value consumed by #finish',
|
|
723
|
+
final: 'optional - final value consumed by #finish',
|
|
724
|
+
confidence: 'optional - confidence value consumed by #finish'
|
|
725
|
+
)
|
|
726
|
+
|
|
727
|
+
# Value-based update (Q-learning) + policy-gradient (REINFORCE)
|
|
728
|
+
#{self}.update_q!(
|
|
729
|
+
transition: 'required - Hash with :state :action :reward :next_state :terminal (defaults to opts)'
|
|
730
|
+
)
|
|
731
|
+
|
|
732
|
+
# Run update pg and return its result
|
|
733
|
+
#{self}.update_pg!(
|
|
734
|
+
state: 'required - state value consumed by #update_pg!',
|
|
735
|
+
action: 'required - action value consumed by #update_pg!',
|
|
736
|
+
advantage: 'required - scalar G_t − V(s)'
|
|
737
|
+
)
|
|
738
|
+
|
|
739
|
+
# Run q and return its result
|
|
740
|
+
#{self}.q(
|
|
741
|
+
state: 'optional - state value consumed by #q',
|
|
742
|
+
action: 'optional - action value consumed by #q'
|
|
743
|
+
)
|
|
744
|
+
|
|
745
|
+
# Run value and return its result
|
|
746
|
+
#{self}.value(
|
|
747
|
+
state: 'optional - state value consumed by #value'
|
|
748
|
+
)
|
|
749
|
+
|
|
750
|
+
# Q(s,a) − V(s). Unknown / cold-start pairs return 0 so rank is unchanged
|
|
751
|
+
#{self}.advantage(
|
|
752
|
+
state: 'optional - state value consumed by #advantage (defaults to current_state)',
|
|
753
|
+
action: 'optional - action value consumed by #advantage'
|
|
754
|
+
)
|
|
755
|
+
|
|
756
|
+
# Run recommend and return its result
|
|
757
|
+
#{self}.recommend(
|
|
758
|
+
state: 'optional - default current episode state',
|
|
759
|
+
actions: 'required - Array of tool names',
|
|
760
|
+
epsilon: 'optional - explore probability (default EPSILON)'
|
|
761
|
+
)
|
|
762
|
+
|
|
763
|
+
# Run current state and return its result
|
|
764
|
+
#{self}.current_state
|
|
765
|
+
|
|
766
|
+
# Run current episode and return its result
|
|
767
|
+
#{self}.current_episode
|
|
768
|
+
|
|
769
|
+
# Hermes split: snapshot + clear the live episode so Loop.maybe_finish_policy
|
|
770
|
+
#{self}.detach_episode!
|
|
771
|
+
|
|
772
|
+
# Run attach episode and return its result
|
|
773
|
+
#{self}.attach_episode!(
|
|
774
|
+
episode: 'optional - episode value consumed by #attach_episode!'
|
|
775
|
+
)
|
|
776
|
+
|
|
777
|
+
# Persistence / eval
|
|
778
|
+
#{self}.load
|
|
779
|
+
|
|
780
|
+
# Run save and return its result
|
|
781
|
+
#{self}.save(
|
|
782
|
+
table: 'optional - table value consumed by #save (defaults to load)'
|
|
783
|
+
)
|
|
784
|
+
|
|
785
|
+
# Run trajectories and return its result
|
|
786
|
+
#{self}.trajectories(
|
|
787
|
+
limit: 'optional - limit value consumed by #trajectories'
|
|
788
|
+
)
|
|
789
|
+
|
|
790
|
+
# Run stats and return its result
|
|
791
|
+
#{self}.stats
|
|
792
|
+
|
|
793
|
+
# Replay stored trajectories under the current Q table
|
|
794
|
+
#{self}.evaluate(
|
|
795
|
+
limit: 'optional - limit value consumed by #evaluate'
|
|
796
|
+
)
|
|
797
|
+
|
|
798
|
+
# Run to context and return its result
|
|
799
|
+
#{self}.to_context(
|
|
800
|
+
limit: 'optional - limit value consumed by #to_context'
|
|
801
|
+
)
|
|
802
|
+
|
|
803
|
+
# Run lean and return its result
|
|
804
|
+
#{self}.lean!(
|
|
805
|
+
dry_run: 'optional - dry run value consumed by #lean!'
|
|
806
|
+
)
|
|
807
|
+
|
|
808
|
+
# Run reset and return its result
|
|
809
|
+
#{self}.reset
|
|
810
|
+
|
|
811
|
+
# Run enabled and return its result
|
|
812
|
+
#{self}.enabled?
|
|
813
|
+
|
|
814
|
+
# Print the AUTHOR(S) string for this module.
|
|
815
|
+
#{self}.authors
|
|
816
|
+
|
|
817
|
+
# Replay stored trajectories into Q so a cold table is not empty advice
|
|
818
|
+
#{self}.warmup!(
|
|
819
|
+
limit: 'optional - limit value consumed by #warmup!'
|
|
820
|
+
)
|
|
821
|
+
|
|
822
|
+
# Run maybe warmup and return its result
|
|
823
|
+
#{self}.maybe_warmup!
|
|
824
|
+
"
|
|
825
|
+
constants.sort
|
|
686
826
|
end
|
|
687
827
|
|
|
688
828
|
# ----------------------------------------------------------------
|
|
@@ -199,8 +199,10 @@ module PWN
|
|
|
199
199
|
eval_s = ToolGuard.deadline_s(kind: :eval) if defined?(ToolGuard)
|
|
200
200
|
shell_s = ToolGuard.deadline_s(kind: :shell) if defined?(ToolGuard)
|
|
201
201
|
load_line = "load1=#{snap[:load1]} ncpu=#{snap[:ncpu]} mem_avail_mb=#{snap[:mem_avail_mb]}"
|
|
202
|
+
doc = (PWN::Plugins::PreflightChecker.host_summary if defined?(PWN::Plugins::PreflightChecker))
|
|
202
203
|
"#{load_line} pwn_eval/shell timeout = conservative seconds for this host " \
|
|
203
|
-
"(defaults eval=#{eval_s || 20}s shell=#{shell_s || 30}s, clamped)."
|
|
204
|
+
"(defaults eval=#{eval_s || 20}s shell=#{shell_s || 30}s, clamped). " \
|
|
205
|
+
"#{doc}"
|
|
204
206
|
rescue StandardError
|
|
205
207
|
'load unknown — pass a conservative timeout on pwn_eval/shell anyway.'
|
|
206
208
|
end
|
|
@@ -359,16 +361,24 @@ module PWN
|
|
|
359
361
|
# Display Usage for this Module
|
|
360
362
|
|
|
361
363
|
public_class_method def self.help
|
|
362
|
-
puts
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
PWN::
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
#
|
|
371
|
-
|
|
364
|
+
puts "USAGE:
|
|
365
|
+
# Run build and return its result
|
|
366
|
+
#{self}.build(
|
|
367
|
+
session_id: 'optional - PWN::Sessions id to embed in the ENV block',
|
|
368
|
+
request: 'optional - user request; enables relevance-ranked MEMORY when provided',
|
|
369
|
+
thin: 'optional - thin value consumed by #build',
|
|
370
|
+
mode: 'optional - mode value consumed by #build',
|
|
371
|
+
expand_harness: 'optional - expand harness value consumed by #build',
|
|
372
|
+
stuck: 'optional - stuck value consumed by #build'
|
|
373
|
+
)
|
|
374
|
+
|
|
375
|
+
# Run budget and return its result
|
|
376
|
+
#{self}.budget
|
|
377
|
+
|
|
378
|
+
# Print the AUTHOR(S) string for this module.
|
|
379
|
+
#{self}.authors
|
|
380
|
+
"
|
|
381
|
+
constants.sort
|
|
372
382
|
end
|
|
373
383
|
end
|
|
374
384
|
end
|
|
@@ -197,19 +197,50 @@ module PWN
|
|
|
197
197
|
end
|
|
198
198
|
|
|
199
199
|
public_class_method def self.help
|
|
200
|
-
puts
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
200
|
+
puts "USAGE:
|
|
201
|
+
# Run enabled and return its result
|
|
202
|
+
#{self}.enabled?(
|
|
203
|
+
engine: 'optional - engine value consumed by #enabled?'
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
# Run split system and return its result
|
|
207
|
+
#{self}.split_system(
|
|
208
|
+
text: 'required - text value consumed by #split_system'
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
# Run anthropic system blocks and return its result
|
|
212
|
+
#{self}.anthropic_system_blocks(
|
|
213
|
+
text: 'required - text value consumed by #anthropic_system_blocks'
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
# Run openai messages and return its result
|
|
217
|
+
#{self}.openai_messages(
|
|
218
|
+
messages: 'required - Array messages value consumed by #openai_messages'
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
# Run gemini system instruction and return its result
|
|
222
|
+
#{self}.gemini_system_instruction(
|
|
223
|
+
text: 'required - text value consumed by #gemini_system_instruction'
|
|
224
|
+
)
|
|
225
|
+
|
|
226
|
+
# Run cache key and return its result
|
|
227
|
+
#{self}.cache_key(
|
|
228
|
+
key: 'optional - key value consumed by #cache_key',
|
|
229
|
+
text: 'optional - text value consumed by #cache_key'
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
# Run cache marks and return its result
|
|
233
|
+
#{self}.cache_marks(
|
|
234
|
+
blocks: 'optional - Array blocks value consumed by #cache_marks'
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
# Run supports and return its result
|
|
238
|
+
#{self}.supports
|
|
239
|
+
|
|
240
|
+
# Print the AUTHOR(S) string for this module.
|
|
241
|
+
#{self}.authors
|
|
242
|
+
"
|
|
243
|
+
constants.sort
|
|
213
244
|
end
|
|
214
245
|
|
|
215
246
|
private_class_method def self.first_dynamic_index(opts = {})
|
data/lib/pwn/ai/agent/reflect.rb
CHANGED
|
@@ -175,19 +175,23 @@ module PWN
|
|
|
175
175
|
|
|
176
176
|
public_class_method def self.help
|
|
177
177
|
puts "USAGE:
|
|
178
|
+
# Run on and return its result
|
|
178
179
|
#{self}.on(
|
|
179
180
|
request: 'required - String - What you want the AI to reflect on',
|
|
180
181
|
system_role_content: 'optional - context to set up the model behavior for reflection',
|
|
181
|
-
engine: 'optional - override engine
|
|
182
|
+
engine: 'optional - override engine for THIS reflection only (Symbol/String); defaults to PWN::Env[:ai][:reflect_engine] || :active',
|
|
183
|
+
model: 'optional - override model on the reflection engine for THIS call only; defaults to PWN::Env[:ai][:reflect_model]',
|
|
182
184
|
spinner: 'optional - Boolean - Display spinner during operation (default: false)',
|
|
183
|
-
suppress_pii_warning: 'optional - Boolean - Suppress PII Warnings (default: false)'
|
|
185
|
+
suppress_pii_warning: 'optional - Boolean - Suppress PII Warnings (default: false)',
|
|
186
|
+
timeout: 'optional - seconds to wait before giving up',
|
|
187
|
+
temp: 'optional - temp value consumed by #on',
|
|
188
|
+
quiet: 'optional - quiet value consumed by #on'
|
|
184
189
|
)
|
|
185
190
|
|
|
186
|
-
|
|
187
|
-
PWN::Env[:ai][:reflect_engine] = :anthropic # execute on :active, critique on :anthropic
|
|
188
|
-
|
|
191
|
+
# Print the AUTHOR(S) string for this module.
|
|
189
192
|
#{self}.authors
|
|
190
193
|
"
|
|
194
|
+
constants.sort
|
|
191
195
|
end
|
|
192
196
|
end
|
|
193
197
|
end
|
|
@@ -347,18 +347,71 @@ module PWN
|
|
|
347
347
|
# Display Usage for this Module
|
|
348
348
|
|
|
349
349
|
public_class_method def self.help
|
|
350
|
-
puts
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
350
|
+
puts "USAGE:
|
|
351
|
+
# Run register and return its result
|
|
352
|
+
#{self}.register(
|
|
353
|
+
name: 'required - tool name exposed to the model',
|
|
354
|
+
toolset: 'required - grouping for enable/disable (terminal, file, pwn, memory…)',
|
|
355
|
+
schema: 'required - OpenAI function schema {name:, description:, parameters:}',
|
|
356
|
+
handler: 'required - ->(args_hash) { ... } returning a JSON-serialisable object',
|
|
357
|
+
check: 'optional - -> { bool } gate; tool only advertised when truthy',
|
|
358
|
+
max_chars: 'optional - cap on serialised result (default 24_000)'
|
|
359
|
+
)
|
|
360
|
+
|
|
361
|
+
# Run lookup and return its result
|
|
362
|
+
#{self}.lookup(
|
|
363
|
+
name: 'required - registered tool name'
|
|
364
|
+
)
|
|
365
|
+
|
|
366
|
+
# Run all and return its result
|
|
367
|
+
#{self}.all
|
|
368
|
+
|
|
369
|
+
# Run toolsets and return its result
|
|
370
|
+
#{self}.toolsets
|
|
371
|
+
|
|
372
|
+
# Run definitions and return its result
|
|
373
|
+
#{self}.definitions(
|
|
374
|
+
enabled: 'optional - Array of toolset names to include; nil = all whose check passes',
|
|
375
|
+
relevance: 'optional - user request; when set AND :tool_router is enabled, slim to CORE + top-K keyword matches',
|
|
376
|
+
top_k: 'optional - keyword-ranked tools to keep beyond CORE (default 10)',
|
|
377
|
+
order: 'optional - preference list forwarded only when this key is present',
|
|
378
|
+
preference: 'optional - alias of :order; same key-present rule',
|
|
379
|
+
kind: 'optional - kind value consumed by #definitions',
|
|
380
|
+
intent: 'optional - intent value consumed by #definitions',
|
|
381
|
+
core_only: 'optional - core only value consumed by #definitions'
|
|
382
|
+
)
|
|
383
|
+
|
|
384
|
+
# Run preference order and return its result
|
|
385
|
+
#{self}.preference_order(
|
|
386
|
+
order: 'optional - Array of tool names; explicit nil/[] disables',
|
|
387
|
+
preference: 'optional - alias of :order. Explicit key disables Env/DEFAULT fallback'
|
|
388
|
+
)
|
|
389
|
+
|
|
390
|
+
# Run apply preference and return its result
|
|
391
|
+
#{self}.apply_preference(
|
|
392
|
+
items: 'required - Array of Entry objects or OpenAI tool hashes',
|
|
393
|
+
order: 'optional - forwarded to preference_order only when the key is set',
|
|
394
|
+
preference: 'optional - alias of :order; same key-present rule',
|
|
395
|
+
entries: 'optional - entries value consumed by #apply_preference'
|
|
396
|
+
)
|
|
397
|
+
|
|
398
|
+
# Run rank and return its result
|
|
399
|
+
#{self}.rank(
|
|
400
|
+
query: 'required - user request text',
|
|
401
|
+
entries: 'optional - Entry pool to rank (default .all)',
|
|
402
|
+
order: 'optional - preference list forwarded to preference_order',
|
|
403
|
+
preference: 'optional - preference value consumed by #rank'
|
|
404
|
+
)
|
|
405
|
+
|
|
406
|
+
# Run discover and return its result
|
|
407
|
+
#{self}.discover(
|
|
408
|
+
force: 'optional - re-require tool files even if already discovered (default false)'
|
|
409
|
+
)
|
|
410
|
+
|
|
411
|
+
# Print the AUTHOR(S) string for this module.
|
|
412
|
+
#{self}.authors
|
|
413
|
+
"
|
|
414
|
+
constants.sort
|
|
362
415
|
end
|
|
363
416
|
end
|
|
364
417
|
end
|
data/lib/pwn/ai/agent/result.rb
CHANGED
|
@@ -105,16 +105,25 @@ module PWN
|
|
|
105
105
|
# Display Usage for this Module
|
|
106
106
|
|
|
107
107
|
public_class_method def self.help
|
|
108
|
-
puts
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
108
|
+
puts "USAGE:
|
|
109
|
+
# Run condition and return its result
|
|
110
|
+
#{self}.condition(
|
|
111
|
+
content: 'required - String returned by Dispatch.call',
|
|
112
|
+
entry: 'optional - Registry::Entry (used for max_chars; nil → DEFAULT_MAX)'
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
# Engine-aware default: ollama keeps history inside a tight num_ctx;
|
|
116
|
+
#{self}.default_max
|
|
117
|
+
|
|
118
|
+
# Run redact and return its result
|
|
119
|
+
#{self}.redact(
|
|
120
|
+
content: 'required - String to scrub of credential-shaped substrings'
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
# Print the AUTHOR(S) string for this module.
|
|
124
|
+
#{self}.authors
|
|
125
|
+
"
|
|
126
|
+
constants.sort
|
|
118
127
|
end
|
|
119
128
|
end
|
|
120
129
|
end
|
data/lib/pwn/ai/agent/reward.rb
CHANGED
|
@@ -1331,7 +1331,8 @@ module PWN
|
|
|
1331
1331
|
req_toks = request.downcase.scan(/[a-z0-9_]{3,}/).uniq
|
|
1332
1332
|
fin_toks = final.downcase.scan(/[a-z0-9_]{3,}/).uniq
|
|
1333
1333
|
overlap = req_toks.empty? ? 1.0 : (req_toks & fin_toks).length.to_f / req_toks.length
|
|
1334
|
-
|
|
1334
|
+
long_analytical = final.length >= 800
|
|
1335
|
+
score = [score, 0.35].min if overlap < 0.08 && req_toks.length >= 4 && score > 0.35 && !long_analytical
|
|
1335
1336
|
ev_score = ev ? ev[:score].to_f : 0.0
|
|
1336
1337
|
bad = trace.count { |t| !semantic_ok(name: 'shell', raw: t.to_s)[:semantic_ok] }
|
|
1337
1338
|
ratio = trace.empty? ? 0.5 : 1.0 - (bad.to_f / trace.length)
|
|
@@ -1729,37 +1730,154 @@ module PWN
|
|
|
1729
1730
|
# Display Usage for this Module
|
|
1730
1731
|
|
|
1731
1732
|
public_class_method def self.help
|
|
1732
|
-
puts
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1733
|
+
puts "USAGE:
|
|
1734
|
+
# R1 — LLM Outcome Reward Model
|
|
1735
|
+
#{self}.judge(
|
|
1736
|
+
request: 'required - original user request',
|
|
1737
|
+
final: 'required - assistant final answer',
|
|
1738
|
+
session_id: 'optional - PWN::Sessions id (adds tool trace)',
|
|
1739
|
+
trace: 'optional - Array of tool-result strings (overrides session_id)',
|
|
1740
|
+
commit: 'optional - write score into learning.jsonl / sentinel (default true)',
|
|
1741
|
+
critic_pass: 'optional - critic pass value consumed by #judge',
|
|
1742
|
+
predicted: 'optional - predicted value consumed by #judge',
|
|
1743
|
+
proxy_ok: 'optional - proxy ok value consumed by #judge'
|
|
1744
|
+
)
|
|
1745
|
+
|
|
1746
|
+
# Run promote to success and return its result
|
|
1747
|
+
#{self}.promote_to_success?(
|
|
1748
|
+
orm: 'optional - orm value consumed by #promote_to_success?',
|
|
1749
|
+
verify: 'optional - verify value consumed by #promote_to_success?',
|
|
1750
|
+
critic: 'optional - critic value consumed by #promote_to_success?'
|
|
1751
|
+
)
|
|
1752
|
+
|
|
1753
|
+
# Run prm and return its result
|
|
1754
|
+
#{self}.prm(
|
|
1755
|
+
request: 'required - user goal',
|
|
1756
|
+
session_id: 'optional - session to score in place',
|
|
1757
|
+
trace: 'optional - Array of {name:, args:, result:} or Strings'
|
|
1758
|
+
)
|
|
1759
|
+
|
|
1760
|
+
# Plan-quality soft signal (W3 feature / Learning tag)
|
|
1761
|
+
#{self}.plan_coverage(
|
|
1762
|
+
plan: 'required - Array of task strings or outline text',
|
|
1763
|
+
final: 'required - assistant final answer',
|
|
1764
|
+
request: 'optional - original user request',
|
|
1765
|
+
trace: 'optional - Array of tool-result strings',
|
|
1766
|
+
session_id: 'optional - load trace from session when trace empty'
|
|
1767
|
+
)
|
|
1768
|
+
|
|
1769
|
+
# R3 — Reward-hacking sentinel
|
|
1770
|
+
#{self}.sentinel
|
|
1771
|
+
|
|
1772
|
+
# P4 — scalar 0.0..1.0 haircut applied to Metrics success / Registry β when
|
|
1773
|
+
#{self}.proxy_distrust
|
|
1774
|
+
|
|
1775
|
+
# Run set proxy distrust and return its result
|
|
1776
|
+
#{self}.set_proxy_distrust(
|
|
1777
|
+
gap: 'optional - gap value consumed by #set_proxy_distrust',
|
|
1778
|
+
proxy: 'optional - scheme://proxy_host:port, or tor',
|
|
1779
|
+
judge: 'optional - judge value consumed by #set_proxy_distrust'
|
|
1780
|
+
)
|
|
1781
|
+
|
|
1782
|
+
# Run clear proxy distrust and return its result
|
|
1783
|
+
#{self}.clear_proxy_distrust
|
|
1784
|
+
|
|
1785
|
+
# One-shot: wipe sentinel window + distrust after deploying the
|
|
1786
|
+
#{self}.reset_sentinel
|
|
1787
|
+
|
|
1788
|
+
# P10 — backfill the R3 ring from Learning outcomes so offline/local
|
|
1789
|
+
#{self}.warm_sentinel(
|
|
1790
|
+
limit: 'optional - limit value consumed by #warm_sentinel'
|
|
1791
|
+
)
|
|
1792
|
+
|
|
1793
|
+
# R4 — Structured tool-result classifier
|
|
1794
|
+
#{self}.semantic_ok(
|
|
1795
|
+
name: 'required - tool name',
|
|
1796
|
+
raw: 'required - JSON string returned by Dispatch.call',
|
|
1797
|
+
args: 'optional - the tool call arguments (used for BENIGN_EXIT)'
|
|
1798
|
+
)
|
|
1799
|
+
|
|
1800
|
+
# 2.2 — coarse recoverable shape beside the fingerprint. Paths are
|
|
1801
|
+
#{self}.recoverable_shape(
|
|
1802
|
+
err: 'optional - err value consumed by #recoverable_shape',
|
|
1803
|
+
stderr: 'optional - stderr value consumed by #recoverable_shape',
|
|
1804
|
+
exit_code: 'optional - exit code value consumed by #recoverable_shape'
|
|
1805
|
+
)
|
|
1806
|
+
|
|
1807
|
+
# E3 — verify-as-reward (ground truth without a human)
|
|
1808
|
+
#{self}.verify_as_reward(
|
|
1809
|
+
final: 'optional - final value consumed by #verify_as_reward'
|
|
1810
|
+
)
|
|
1811
|
+
|
|
1812
|
+
# Run record preference and return its result
|
|
1813
|
+
#{self}.record_preference(
|
|
1814
|
+
prompt: 'required - prompt value consumed by #record_preference',
|
|
1815
|
+
rejected: 'required - rejected value consumed by #record_preference',
|
|
1816
|
+
chosen: 'required - chosen value consumed by #record_preference',
|
|
1817
|
+
force: 'optional - force value consumed by #record_preference',
|
|
1818
|
+
source: 'optional - source value consumed by #record_preference (defaults to :unknown))',
|
|
1819
|
+
shape: 'optional - shape value consumed by #record_preference',
|
|
1820
|
+
meta: 'optional - meta value consumed by #record_preference'
|
|
1821
|
+
)
|
|
1822
|
+
|
|
1823
|
+
# Share of `source` among the newest WRITE_SOURCE_WINDOW prefs
|
|
1824
|
+
#{self}.write_source_quota(
|
|
1825
|
+
source: 'optional - source value consumed by #write_source_quota'
|
|
1826
|
+
)
|
|
1827
|
+
|
|
1828
|
+
# P0 — online generator mix report + urgency flags. Controllers
|
|
1829
|
+
#{self}.generator_mix(
|
|
1830
|
+
limit: 'optional - limit value consumed by #generator_mix (defaults to WRITE_SOURCE_WINDOW)'
|
|
1831
|
+
)
|
|
1832
|
+
|
|
1833
|
+
# P0 ops — infer trajectory shape for legacy ledger rows that predate
|
|
1834
|
+
#{self}.infer_shape(
|
|
1835
|
+
row: 'optional - row value consumed by #infer_shape'
|
|
1836
|
+
)
|
|
1837
|
+
|
|
1838
|
+
# P15 — keep only usable preference pairs for balance/export/promote
|
|
1839
|
+
#{self}.usable_preference?(
|
|
1840
|
+
row: 'optional - row value consumed by #usable_preference?'
|
|
1841
|
+
)
|
|
1842
|
+
|
|
1843
|
+
# P15 — one-shot ledger hygiene. Filters in place (rewrite jsonl) or
|
|
1844
|
+
#{self}.scrub_preferences(
|
|
1845
|
+
dry_run: 'optional - dry run value consumed by #scrub_preferences'
|
|
1846
|
+
)
|
|
1847
|
+
|
|
1848
|
+
# P15/P5 — geometry-aware source mix. scrub:true uses usable_preference?
|
|
1849
|
+
#{self}.preference_balance(
|
|
1850
|
+
limit: 'optional - limit value consumed by #preference_balance (defaults to 10_000)',
|
|
1851
|
+
scrub: 'optional - scrub value consumed by #preference_balance'
|
|
1852
|
+
)
|
|
1853
|
+
|
|
1854
|
+
# Run preferences and return its result
|
|
1855
|
+
#{self}.preferences(
|
|
1856
|
+
limit: 'optional - limit value consumed by #preferences (defaults to 500)',
|
|
1857
|
+
source: 'required - source value consumed by #preferences'
|
|
1858
|
+
)
|
|
1859
|
+
|
|
1860
|
+
# Run export dpo and return its result
|
|
1861
|
+
#{self}.export_dpo(
|
|
1862
|
+
format: 'optional - format value consumed by #export_dpo (defaults to :dpo))',
|
|
1863
|
+
out: 'optional - out value consumed by #export_dpo',
|
|
1864
|
+
scrub: 'optional - scrub value consumed by #export_dpo',
|
|
1865
|
+
balance: 'optional - balance value consumed by #export_dpo',
|
|
1866
|
+
source_cap: 'optional - source cap value consumed by #export_dpo'
|
|
1867
|
+
)
|
|
1868
|
+
|
|
1869
|
+
# Run reset and return its result
|
|
1870
|
+
#{self}.reset
|
|
1871
|
+
|
|
1872
|
+
# Weight a judge sample for sentinel / Learning haircuts
|
|
1873
|
+
#{self}.judge_sample_weight(
|
|
1874
|
+
source: 'optional - source value consumed by #judge_sample_weight'
|
|
1875
|
+
)
|
|
1876
|
+
|
|
1877
|
+
# Print the AUTHOR(S) string for this module.
|
|
1878
|
+
#{self}.authors
|
|
1879
|
+
"
|
|
1880
|
+
constants.sort
|
|
1763
1881
|
end
|
|
1764
1882
|
end
|
|
1765
1883
|
end
|