pwn 0.5.613 → 0.5.617

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.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +10 -10
  3. data/README.md +117 -17
  4. data/bin/pwn +47 -2
  5. data/bin/pwn_gqrx_scanner +75 -18
  6. data/documentation/AI-Integration.md +36 -0
  7. data/documentation/BurpSuite.md +26 -0
  8. data/documentation/Contributing.md +31 -0
  9. data/documentation/Diagrams.md +140 -0
  10. data/documentation/Drivers.md +25 -0
  11. data/documentation/General-PWN-Usage.md +60 -0
  12. data/documentation/Home.md +78 -0
  13. data/documentation/How-PWN-Works.md +62 -0
  14. data/documentation/Installation.md +75 -0
  15. data/documentation/NmapIt.md +18 -0
  16. data/documentation/Plugins.md +59 -0
  17. data/documentation/Reporting.md +28 -0
  18. data/documentation/SAST.md +32 -0
  19. data/documentation/Skills-Memory-Learning.md +44 -0
  20. data/documentation/Transparent-Browser.md +32 -0
  21. data/documentation/Troubleshooting.md +38 -0
  22. data/documentation/What-is-PWN.md +53 -0
  23. data/documentation/Why-PWN.md +48 -0
  24. data/documentation/diagrams/ai-integration-tool-calling.svg +172 -0
  25. data/documentation/diagrams/build.sh +20 -0
  26. data/documentation/diagrams/burp-vs-zap-preference.svg +69 -0
  27. data/documentation/diagrams/code-scanning-sast.svg +172 -0
  28. data/documentation/diagrams/dot/_THEME.md +27 -0
  29. data/documentation/diagrams/dot/agent-tool-registry.dot +59 -0
  30. data/documentation/diagrams/dot/ai-integration-tool-calling.dot +50 -0
  31. data/documentation/diagrams/dot/aws-cloud-security.dot +48 -0
  32. data/documentation/diagrams/dot/burp-vs-zap-preference.dot +26 -0
  33. data/documentation/diagrams/dot/code-scanning-sast.dot +49 -0
  34. data/documentation/diagrams/dot/cron-scheduling.dot +40 -0
  35. data/documentation/diagrams/dot/driver-framework.dot +39 -0
  36. data/documentation/diagrams/dot/extrospection-world-awareness.dot +55 -0
  37. data/documentation/diagrams/dot/fuzzing-workflow.dot +47 -0
  38. data/documentation/diagrams/dot/history-to-drivers.dot +34 -0
  39. data/documentation/diagrams/dot/memory-skills-detailed.dot +60 -0
  40. data/documentation/diagrams/dot/network-infra-testing.dot +54 -0
  41. data/documentation/diagrams/dot/overall-pwn-architecture.dot +115 -0
  42. data/documentation/diagrams/dot/penetration-testing-workflow.dot +60 -0
  43. data/documentation/diagrams/dot/plugin-ecosystem.dot +45 -0
  44. data/documentation/diagrams/dot/pwn-ai-feedback-learning-loop.dot +98 -0
  45. data/documentation/diagrams/dot/pwn-repl-prototyping.dot +56 -0
  46. data/documentation/diagrams/dot/reporting-pipeline.dot +46 -0
  47. data/documentation/diagrams/dot/reverse-engineering-flow.dot +43 -0
  48. data/documentation/diagrams/dot/sdr-radio-flow.dot +45 -0
  49. data/documentation/diagrams/dot/sessions-cron-automation.dot +44 -0
  50. data/documentation/diagrams/dot/swarm-multi-agent.dot +70 -0
  51. data/documentation/diagrams/dot/web-application-testing.dot +49 -0
  52. data/documentation/diagrams/dot/zero-day-research-flow.dot +49 -0
  53. data/documentation/diagrams/driver-framework.svg +111 -0
  54. data/documentation/diagrams/fuzzing-workflow.svg +160 -0
  55. data/documentation/diagrams/history-to-drivers.svg +119 -0
  56. data/documentation/diagrams/memory-skills-detailed.svg +202 -0
  57. data/documentation/diagrams/network-infra-testing.svg +183 -0
  58. data/documentation/diagrams/overall-pwn-architecture.svg +405 -0
  59. data/documentation/diagrams/penetration-testing-workflow.svg +201 -0
  60. data/documentation/diagrams/plugin-ecosystem.svg +276 -0
  61. data/documentation/diagrams/pwn-ai-feedback-learning-loop.svg +306 -0
  62. data/documentation/diagrams/pwn-repl-prototyping.svg +168 -0
  63. data/documentation/diagrams/reporting-pipeline.svg +151 -0
  64. data/documentation/diagrams/reverse-engineering-flow.svg +134 -0
  65. data/documentation/diagrams/sessions-cron-automation.svg +136 -0
  66. data/documentation/diagrams/web-application-testing.svg +173 -0
  67. data/documentation/diagrams/zero-day-research-flow.svg +153 -0
  68. data/documentation/pwn-REPL.md +33 -0
  69. data/documentation/pwn-ai-Agent.md +43 -0
  70. data/git_commit.sh +1 -1
  71. data/lib/pwn/ai/agent/assembly.rb +1 -1
  72. data/lib/pwn/ai/agent/btc.rb +1 -1
  73. data/lib/pwn/ai/agent/burp_suite.rb +1 -1
  74. data/lib/pwn/ai/agent/extrospection.rb +618 -0
  75. data/lib/pwn/ai/agent/gqrx.rb +2 -2
  76. data/lib/pwn/ai/agent/hacker_one.rb +1 -1
  77. data/lib/pwn/ai/agent/introspection.rb +91 -0
  78. data/lib/pwn/ai/agent/learning.rb +379 -0
  79. data/lib/pwn/ai/agent/loop.rb +33 -3
  80. data/lib/pwn/ai/agent/metrics.rb +155 -0
  81. data/lib/pwn/ai/agent/prompt_builder.rb +32 -3
  82. data/lib/pwn/ai/agent/sast.rb +1 -1
  83. data/lib/pwn/ai/agent/swarm.rb +437 -0
  84. data/lib/pwn/ai/agent/tools/cron.rb +163 -0
  85. data/lib/pwn/ai/agent/tools/extrospection.rb +280 -0
  86. data/lib/pwn/ai/agent/tools/learning.rb +221 -0
  87. data/lib/pwn/ai/agent/tools/memory.rb +27 -0
  88. data/lib/pwn/ai/agent/tools/metrics.rb +61 -0
  89. data/lib/pwn/ai/agent/tools/sessions.rb +139 -0
  90. data/lib/pwn/ai/agent/tools/skills.rb +124 -8
  91. data/lib/pwn/ai/agent/tools/swarm.rb +229 -0
  92. data/lib/pwn/ai/agent/transparent_browser.rb +1 -1
  93. data/lib/pwn/ai/agent/vuln_gen.rb +2 -2
  94. data/lib/pwn/ai/agent.rb +5 -0
  95. data/lib/pwn/ai/anthropic.rb +19 -4
  96. data/lib/pwn/ai/grok.rb +249 -106
  97. data/lib/pwn/ai.rb +0 -1
  98. data/lib/pwn/config.rb +96 -36
  99. data/lib/pwn/cron.rb +16 -7
  100. data/lib/pwn/plugins/monkey_patch.rb +2 -2
  101. data/lib/pwn/plugins/repl.rb +158 -284
  102. data/lib/pwn/sdr/decoder/base.rb +251 -0
  103. data/lib/pwn/sdr/decoder/gsm.rb +84 -185
  104. data/lib/pwn/sdr/decoder/pocsag.rb +62 -217
  105. data/lib/pwn/sdr/decoder.rb +1 -0
  106. data/lib/pwn/sdr/gqrx.rb +446 -65
  107. data/lib/pwn/version.rb +1 -1
  108. data/spec/lib/pwn/ai/agent/extrospection_spec.rb +15 -0
  109. data/spec/lib/pwn/ai/agent/introspection_spec.rb +15 -0
  110. data/spec/lib/pwn/ai/agent/learning_spec.rb +68 -0
  111. data/spec/lib/pwn/ai/agent/metrics_spec.rb +27 -0
  112. data/spec/lib/pwn/ai/agent/swarm_spec.rb +34 -0
  113. data/spec/lib/pwn/ai/agent/tools/cron_spec.rb +40 -0
  114. data/spec/lib/pwn/ai/agent/tools/extrospection_spec.rb +40 -0
  115. data/spec/lib/pwn/ai/agent/tools/learning_spec.rb +30 -0
  116. data/spec/lib/pwn/ai/agent/tools/metrics_spec.rb +20 -0
  117. data/spec/lib/pwn/ai/agent/tools/sessions_spec.rb +35 -0
  118. data/spec/lib/pwn/ai/agent/tools/swarm_spec.rb +17 -0
  119. data/spec/lib/pwn/{ai/introspection_spec.rb → sdr/decoder/base_spec.rb} +3 -3
  120. data/third_party/pwn_rdoc.jsonl +178 -33
  121. metadata +110 -36
  122. data/documentation/PWN.png +0 -0
  123. data/documentation/PWN_Contributors_and_Users.png +0 -0
  124. data/documentation/fax-spectrogram.png +0 -0
  125. data/documentation/fax-waveform.png +0 -0
  126. data/documentation/frozen_string_literal_files_changed_from_false_to_true.txt +0 -54
  127. data/documentation/lifecycle_authz_replay.example.yaml +0 -27
  128. data/documentation/pwn_android_war_dialer_session.png +0 -0
  129. data/documentation/pwn_install.png +0 -0
  130. data/documentation/pwn_wallpaper.jpg +0 -0
  131. data/documentation/ringing-spectrogram.png +0 -0
  132. data/documentation/ringing-waveform.png +0 -0
  133. data/documentation/vulnerability_report_template.md +0 -37
  134. data/lib/pwn/ai/introspection.rb +0 -76
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0563c6746728c394749e21798be5d36bceea0ce56035d9335c502859d6759e26
4
- data.tar.gz: 9120b0f1dd304181819f92c818aada0410e3e597cb8b5786014d29af645bf414
3
+ metadata.gz: bb16e051629252943b2df67c661ca49455cd5dfd4acfbde1620e75135f858c42
4
+ data.tar.gz: 036cb463b3cd848926f88c60be3f885e5e9b4f738534ac036918d118d18ec893
5
5
  SHA512:
6
- metadata.gz: e568e242a20341084cd27c12f899b31125eb7b91c07c0df0b54782798c293b2787ab78fcdd1ff1f751cd7e83f928777586e534e1e3c0a7d7bbf2f0a0dd355dfe
7
- data.tar.gz: 0e833b7e1ccab11809488dff111ca65c5f41919e7f5f6d62653898f0daf0a72ad86d154814467a74e8b8a2d79c0764a551c616acc1ec2d868b00108878589088
6
+ metadata.gz: d76d992d344b3a2016819f772e7e304fc437d42df677b85b67f33418c988f6436385eefbb6509cbe1d1436c9df585a30f2f44189b00134792160f420af77e81c
7
+ data.tar.gz: 34cdfc754bd3801071a8967b672924764c5d8b894fb13a6bd74dc43f10d930aee94cb781e5c9812b6b00b14b83fbfa34cbcbbcf45d4c6c2332c800b8fe322fe5
data/Gemfile CHANGED
@@ -20,7 +20,7 @@ gem 'base32', '0.3.4'
20
20
  gem 'bitcoin-ruby', '0.0.20'
21
21
  gem 'brakeman', '8.0.5'
22
22
  gem 'bson', '5.2.0'
23
- gem 'bundler', '>=4.0.14'
23
+ gem 'bundler', '>=4.0.15'
24
24
  gem 'bundler-audit', '>=0.9.3'
25
25
  gem 'bunny', '3.1.0'
26
26
  gem 'colorize', '1.1.0'
@@ -36,7 +36,7 @@ gem 'ffi', '1.17.4'
36
36
  gem 'gdb', '1.0.0'
37
37
  gem 'gem-wrappers', '1.4.0'
38
38
  gem 'geocoder', '1.8.6'
39
- gem 'gist', '6.0.0'
39
+ gem 'gist', '6.1.0'
40
40
  gem 'gruff', '0.32.0'
41
41
  gem 'htmlentities', '4.4.2'
42
42
  gem 'ipaddress', '0.8.3'
@@ -48,9 +48,9 @@ gem 'json_schemer', '2.5.0'
48
48
  gem 'jwt', '3.2.0'
49
49
  gem 'libusb', '0.7.2'
50
50
  gem 'luhn', '3.0.0'
51
- gem 'mail', '2.9.0'
52
- gem 'mcp', '0.20.0'
53
- gem 'meshtastic', '0.0.165'
51
+ gem 'mail', '2.9.1'
52
+ gem 'mcp', '0.23.0'
53
+ gem 'meshtastic', '0.0.167'
54
54
  gem 'metasm', '1.0.6'
55
55
  gem 'mongo', '2.24.1'
56
56
  gem 'msfrpc-client', '1.1.2'
@@ -59,7 +59,7 @@ gem 'net-ldap', '0.20.0'
59
59
  gem 'net-openvpn', '0.8.7'
60
60
  gem 'net-smtp', '0.5.1'
61
61
  gem 'nexpose', '7.3.0'
62
- gem 'nokogiri', '1.19.3'
62
+ gem 'nokogiri', '1.19.4'
63
63
  gem 'nokogiri-diff', '0.3.0'
64
64
  gem 'oily_png', '1.2.1'
65
65
  gem 'open3', '0.2.1'
@@ -77,21 +77,21 @@ gem 'rbvmomi2', '3.10.0'
77
77
  gem 'rdoc', '7.0.4'
78
78
  gem 'rest-client', '2.1.0'
79
79
  gem 'rex', '2.0.13'
80
- gem 'rmagick', '7.0.4'
80
+ gem 'rmagick', '7.0.5'
81
81
  gem 'rqrcode', '3.2.0'
82
82
  gem 'rspec', '3.13.2'
83
83
  gem 'rtesseract', '3.1.4'
84
- gem 'rubocop', '1.88.0'
84
+ gem 'rubocop', '1.88.1'
85
85
  gem 'rubocop-rake', '0.7.1'
86
86
  gem 'rubocop-rspec', '3.10.2'
87
87
  gem 'ruby-audio', '1.6.1'
88
88
  gem 'ruby-nmap', '1.0.3'
89
89
  gem 'ruby-saml', '1.18.1'
90
90
  gem 'rvm', '1.11.3.9'
91
- gem 'savon', '2.17.2'
91
+ gem 'savon', '2.17.4'
92
92
  gem 'selenium-devtools', '0.149.0'
93
93
  gem 'selenium-webdriver', '4.45.0'
94
- gem 'slack-ruby-client', '3.1.0'
94
+ gem 'slack-ruby-client', '3.2.0'
95
95
  gem 'socksify', '1.8.1'
96
96
  gem 'spreadsheet', '1.3.5'
97
97
  gem 'sqlite3', '2.9.5'
data/README.md CHANGED
@@ -1,34 +1,92 @@
1
1
  ![PWN](https://raw.githubusercontent.com/0dayInc/pwn/master/documentation/PWN.png)
2
2
 
3
3
  ### **Table of Contents** ###
4
+
4
5
  - [Intro](#intro)
5
6
  * [What is PWN](#what-is-pwn)
6
7
  * [Why PWN](#why-pwn)
7
8
  * [How PWN Works](#how-pwn-works)
9
+ - [[Local PWN Wiki](documentation/Home.md)
8
10
  - [Installation](#installation)
9
11
  - [General Usage](#general-usage)
10
12
  - [Call to Arms](#call-to-arms)
11
13
  - [Module Documentation](#module-documentation)
12
14
  - [Keep Us Caffeinated](#keep-us-caffeinated)
13
- - [0x004D65726368](#0x004D65726368)
14
-
15
+ - [0x004D65726368](#0x004d65726368)
15
16
 
16
17
  ### **Intro** ###
18
+
17
19
  #### **What is PWN** ####
18
- PWN (Pronounced /pōn/ or pone), is an open security automation framework that aims to stand on the shoulders of security giants, promoting trust and innovation. Build your own custom automation drivers freely and easily using pre-built modules.
19
20
 
21
+ PWN (Pronounced /pōn/ or pone), is a powerful open-source offensive cybersecurity automation framework and continuous security integration platform. It enables security researchers, red teamers, penetration testers, and vulnerability researchers to rapidly discover zero-days, automate exploitation, perform advanced web application testing, conduct source code analysis (SAST), orchestrate infrastructure reconnaissance, and execute AI-augmented autonomous security operations.
22
+
23
+ PWN stands on the shoulders of security giants, providing over **66** production-grade plugins, full LLM integration with tool-calling agents, persistent memory, reusable skills, session/cron management, and a highly interactive REPL for prototyping and driving complex security workflows. All core automation primitives are open to promote trust, peer review, and collaborative innovation in adversarial security.
24
+
25
+ **See the full [PWN Wiki](documentation/Home.md) for detailed guides.**
20
26
 
21
27
  #### **Why PWN** ####
22
- It's easy to agree that while corporate automation is a collection of proprietary source code, the core modules used to produce automated solutions should be open for all eyes to continuously promote trust and innovation...broad collaboration is key to any automation framework's success, particularly in the cyber security arena.
23
28
 
29
+ In cybersecurity, where proprietary black-box tools dominate and threats evolve daily, an open framework for core security primitives, vulnerability research, exploitation techniques, and intelligent automation is essential. PWN ensures foundational modules remain transparent and auditable while providing seamless bridges to commercial and open security tools (e.g. Burp Suite Professional, Metasploit, Nmap, Nessus, and multiple LLMs).
30
+
31
+ Broad collaboration accelerates zero-day discovery, reliable exploit development, continuous vulnerability management in CI/CD pipelines, and the creation of reusable AI-driven security skills. PWN makes advanced red team and vuln research capabilities accessible and extensible to all.
32
+
33
+ See [Why PWN](documentation/Why-PWN.md) in the wiki.
24
34
 
25
35
  #### **How PWN Works** ####
26
- Leveraging various pre-built modules and the pwn prototyper, you can mix-and-match modules to test, record, replay, and rollout your own custom security automation packages known as, "drivers." Here are some [example drivers](https://github.com/0dayInc/pwn/tree/master/bin) distributed with PWN.
27
36
 
37
+ #### **PWN AI Feedback Learning Loop (Self-Improving Agent)**
38
+
39
+ The core of pwn-ai is a closed feedback loop for autonomous improvement:
40
+
41
+ ![PWN AI Feedback Learning Loop](documentation/diagrams/pwn-ai-feedback-learning-loop.svg)
42
+
43
+ See full details in [Skills, Memory & Learning](documentation/Skills-Memory-Learning.md) and the [Diagrams](documentation/Diagrams.md) wiki page.
44
+
45
+
46
+ PWN is structured as a Ruby gem with a rich namespace:
47
+
48
+ - `PWN::Plugins::*` — **66+** specialized modules ([BurpSuite](documentation/BurpSuite.md) [preferred for web proxying/scanning], [Zaproxy](documentation/Plugins.md) [fallback], [Metasploit](documentation/Plugins.md), [NmapIt](documentation/NmapIt.md), [TransparentBrowser](documentation/Transparent-Browser.md), Shodan, NessusCloud, NexposeVulnScan, Fuzz, SAST engines, Android analysis, SDR/GQRX, Blockchain, Bounty platforms like HackerOne, hardware interfaces, OCR, packet crafting, etc.).
49
+ - `PWN::AI::*` — Multi-provider LLM clients (OpenAI, Anthropic, Gemini, [Grok OAuth device flow](documentation/AI-Integration.md), Ollama) and autonomous `PWN::AI::Agent` with tool-calling harness (`pwn_eval` for full PWN namespace, shell execution, skills, memory recall/remember, learning loops).
50
+ - `PWN::SAST` — Static application security testing and test case generation. See [SAST Wiki](documentation/SAST.md).
51
+ - `PWN::Reports` — Automated reporting from scans, agents, and findings. See [Reporting](documentation/Reporting.md).
52
+ - `PWN::Memory / Sessions / Cron / Skills / Config` — Persistent facts, conversation sessions, scheduled autonomous tasks, reusable markdown skills (distillable from successful workflows), and environment management. See [Skills, Memory & Learning](documentation/Skills-Memory-Learning.md).
53
+ - `PWN::Driver` — Framework for building custom security automation packages ("drivers"). See [Drivers](documentation/Drivers.md).
54
+
55
+ The **pwn REPL** (launched via the `pwn` command) is the primary interface: a Pry-powered interactive shell with the entire `PWN` namespace pre-loaded. It supports rapid prototyping, direct execution of any plugin method, and custom commands.
56
+
57
+ **Particularly powerful is the `pwn-ai` command** inside the REPL:
58
+ - Activates an autonomous AI agent TUI with multi-line input support (use SHIFT+ENTER to insert newlines; ENTER submits the full prompt).
59
+ - Full awareness of PWN plugins, skills (`~/.pwn/skills`), memory, sessions, and cron.
60
+ - Leverages LLM tool-calling to execute PWN methods (e.g., `PWN::Plugins::BurpSuite`, `PWN::Plugins::NmapIt`, `PWN::Plugins::TransparentBrowser`, `PWN::SAST`, `PWN::Reports`), shell commands, and orchestrate end-to-end tasks.
61
+ - Supports self-improvement via `PWN::AI::Agent::Learning` / Metrics (records per-tool success/duration, distills skills from outcomes).
62
+ - Example instruction: "Use NmapIt to scan target.example.com for open ports, then TransparentBrowser to spider the web app, run SAST analysis if source is available, proxy via BurpSuite, and generate a vulnerability report with PWN::Reports."
63
+ - Additional REPL commands: `pwn-asm` (assembly prototyping with multiline), `pwn-ai-memory`, `pwn-ai-sessions`, `pwn-ai-cron`, `pwn-ai-delegate`, `welcome-banner`, etc.
64
+ - Easily prototype and roll out custom "drivers" (see `/opt/pwn/bin/` examples).
65
+
66
+ Mix and match plugins, invoke via the REPL or `pwn-ai` agent, record/replay sessions, schedule autonomous jobs, and generate reports. PWN is designed for both interactive red teaming and headless/CI automation.
67
+
68
+ Here are some [example drivers](https://github.com/0dayInc/pwn/tree/master/bin) distributed with PWN.
69
+
70
+ #### **Local PWN Wiki** ####
28
71
 
72
+ A full local wiki has been generated in this checkout:
29
73
 
30
- #### **Installation** ####
31
- Tested on Debian-Based Linux Distros, & OSX leveraging Ruby via RVM.
74
+ **`/opt/pwn/documentation/Home.md`**
75
+
76
+ - [Home](documentation/Home.md)
77
+ - [What is PWN](documentation/What-is-PWN.md)
78
+ - [Installation](documentation/Installation.md)
79
+ - [pwn-ai Agent](documentation/pwn-ai-Agent.md)
80
+ - [Plugins](documentation/Plugins.md)
81
+ - [AI Integration](documentation/AI-Integration.md)
82
+ - [Troubleshooting](documentation/Troubleshooting.md)
83
+ - ...and many more
84
+
85
+ Run `cat /opt/pwn/documentation/Home.md` or open in your editor for the complete local documentation.
86
+
87
+ ### **Installation** ###
88
+
89
+ Tested on Debian-Based Linux Distros & OSX leveraging Ruby via RVM.
32
90
 
33
91
  ```
34
92
  $ cd /opt
@@ -37,49 +95,91 @@ $ cd /opt/pwn
37
95
  $ ./install.sh
38
96
  $ ./install.sh ruby-gem
39
97
  $ pwn
40
- pwn[v0.5.613]:001 >>> PWN.help
98
+ pwn[v0.5.617]:001 >>> PWN.help
41
99
  ```
42
100
 
43
101
  [![Installing the pwn Security Automation Framework](https://raw.githubusercontent.com/0dayInc/pwn/master/documentation/pwn_install.png)](https://youtu.be/G7iLUY4FzsI)
44
102
 
103
+ See the dedicated [Installation Wiki](documentation/Installation.md) for more options.
104
+
45
105
  ### **General Usage** ###
106
+
46
107
  [General Usage Quick-Start](https://github.com/0dayinc/pwn/wiki/General-PWN-Usage)
47
108
 
48
- It's wise to update pwn often as numerous versions are released/week:
109
+ Detailed local guide: [General PWN Usage](documentation/General-PWN-Usage.md)
110
+
111
+ It is strongly recommended to update PWN frequently as new capabilities (plugins, AI agents, skills, zero-day tooling) are released regularly:
112
+
49
113
  ```
50
114
  $ rvm list gemsets
51
115
  $ rvm use ruby-4.0.5@pwn
52
116
  $ gem uninstall --all --executables pwn
53
117
  $ gem install --verbose pwn
54
118
  $ pwn
55
- pwn[v0.5.613]:001 >>> PWN.help
119
+ pwn[v0.5.617]:001 >>> PWN.help
56
120
  ```
57
121
 
58
- If you're using a multi-user install of RVM do:
122
+ If using a multi-user install of RVM:
123
+
59
124
  ```
60
125
  $ rvm list gemsets
61
126
  $ rvm use ruby-4.0.5@pwn
62
127
  $ rvmsudo gem uninstall --all --executables pwn
63
128
  $ rvmsudo gem install --verbose pwn
64
129
  $ pwn
65
- pwn[v0.5.613]:001 >>> PWN.help
130
+ pwn[v0.5.617]:001 >>> PWN.help
66
131
  ```
67
132
 
68
- PWN periodically upgrades to the latest version of Ruby which is reflected in `/opt/pwn/.ruby-version`. The easiest way to upgrade to the latest version of Ruby from a previous PWN installation is to run the following script:
133
+ **Inside the pwn REPL (the heart of PWN):**
134
+ - Full access to every PWN class and plugin.
135
+ - `PWN.help` — list all top-level modules.
136
+ - `pwn-ai` — launch the autonomous AI agent (highly recommended for complex tasks). Once active you can issue natural language instructions that leverage PWN's full power.
137
+ - Example flow:
138
+ ```
139
+ pwn[v0.5.617]:001 >>> pwn-ai
140
+ [*] pwn-ai agent TUI activated...
141
+ > Perform active scan of https://target.example.com using preferred tooling, then analyze findings with PWN modules and produce a report.
142
+ ```
143
+ - Other REPL helpers: `pwn-asm`, memory/session/cron management commands, etc.
144
+ - Exit AI mode with `back`; use full Ruby/PWN expressions at any time.
145
+
146
+ **Headless / CI-CD one-shot (`pwn --ai`):**
147
+ Skip the TUI entirely and submit a single pwn-ai request from the shell — ideal for quick lookups, scripting, or CI/CD pipelines. The final answer is written to STDOUT (pipeable); live tool-call activity streams to STDERR.
148
+ ```
149
+ $ pwn --ai 'What ports are listening on this host?'
150
+ $ echo "$LONG_PROMPT" | pwn --ai -
151
+ $ pwn -Y ./ci/pwn.yaml --ai 'Run pwn_sast against ./src and summarise HIGH findings' > findings.txt
152
+ ```
153
+
154
+ PWN periodically upgrades to the latest version of Ruby (reflected in `/opt/pwn/.ruby-version`). The easiest way to upgrade Ruby + pwn from a previous installation:
155
+
69
156
  ```
70
157
  $ /opt/pwn/vagrant/provisioners/pwn.sh
71
158
  ```
72
- This should update Ruby, create the necessary pwn gemset within the latest Ruby version, etc. It's important to note that if you're running an older version of ruby, you can only upgrade the `pwn` gem to the latest version supported by the earlier version of Ruby.
73
159
 
160
+ This updates Ruby, recreates the pwn gemset, etc. Note that older Ruby versions can only use pwn gems compatible with that Ruby.
74
161
 
75
162
  ### **Call to Arms** ###
76
- If you're willing to provide access to commercial security tools (e.g. Rapid7's Nexpose, Tenable Nessus, QualysGuard, HP WebInspect, IBM Appscan, etc) please [email us](mailto:support@0dayinc.com). This will continue to promote PWNs interoperability w/ industry-recognized security tools moving forward. Additionally if you want to contribute to this framework's success, check out our [How to Contribute](https://github.com/0dayInc/pwn/blob/master/CONTRIBUTING.md).
77
163
 
164
+ Contributions that expand PWN's offensive capabilities are welcome. If you can provide access to additional commercial LLMs, security scanners, or bounty platforms (or wish to contribute plugins, AI skills, or exploit modules), please [email us](mailto:support@0dayinc.com). This accelerates interoperability and zero-day research tooling. See our [How to Contribute](https://github.com/0dayInc/pwn/blob/master/CONTRIBUTING.md) and the growing skills system for ways to extend the AI agent.
165
+
166
+ See also the wiki page on [Contributing](documentation/Contributing.md).
78
167
 
79
168
  ### **Module Documentation** ###
80
- Additional documentation on using PWN can be found on [RubyGems.org](https://www.rubydoc.info/gems/pwn)
81
169
 
82
- I hope you enjoy PWN and remember...ensure you always have permission prior to carrying out any sort of hacktivities. Now - go pwn all the things!
170
+ **Primary Documentation:** Browse the embedded local wiki start at [/opt/pwn/documentation/Home.md](documentation/Home.md).
171
+
172
+ Additional documentation on using PWN can be found on [RubyGems.org](https://www.rubydoc.info/gems/pwn). Explore the source under `lib/pwn/plugins/`, `lib/pwn/ai/`, and `PWN::` constants directly in the REPL.
173
+
174
+ Key wiki pages:
175
+ - [Plugins](documentation/Plugins.md)
176
+ - [Burp Suite](documentation/BurpSuite.md)
177
+ - [pwn-ai Agent](documentation/pwn-ai-Agent.md)
178
+ - [SAST](documentation/SAST.md)
179
+ - [AI Integration](documentation/AI-Integration.md)
180
+
181
+ I hope you enjoy PWN and remember... ensure you always have permission prior to carrying out any sort of security testing or hacktivities. Now — go pwn all the things (responsibly)!
182
+
83
183
 
84
184
  ### **Keep Us Caffeinated** ###
85
185
  If you've found this project useful and you're interested in supporting our efforts, we invite you to take a brief moment to keep us caffeinated:
data/bin/pwn CHANGED
@@ -3,13 +3,58 @@
3
3
 
4
4
  require 'pwn'
5
5
 
6
- pwn_driver = PWN::Driver::Parser.new
6
+ opts = PWN::Env[:driver_opts]
7
+ pwn_driver = PWN::Driver::Parser.new do |options|
8
+ options.on(
9
+ '-APROMPT',
10
+ '--ai=PROMPT',
11
+ "<Optional - Headless one-shot pwn-ai request (no TUI). '-' reads PROMPT " \
12
+ 'from STDIN. Final answer goes to STDOUT, tool activity to STDERR. ' \
13
+ 'Useful for quick tasks or CI/CD jobs>'
14
+ ) do |a|
15
+ opts[:ai] = a
16
+ end
17
+ end
7
18
  pwn_driver.auto_opts_help = false
8
19
  pwn_driver.parse!
9
20
 
10
21
  begin
11
22
  pwn_pid = Process.pid
12
- PWN::Plugins::REPL.start
23
+
24
+ if opts[:ai]
25
+ # ------------------------------------------------------------------
26
+ # Headless pwn-ai: behave as if the user typed PROMPT at the pwn-ai
27
+ # TUI, but non-interactively — a single agent-loop turn with native
28
+ # tool-calling. STDOUT receives ONLY the final answer so it can be
29
+ # captured/piped; live tool dispatches stream to STDERR for CI logs.
30
+ # $ pwn --ai 'What ports are listening on this host?'
31
+ # $ echo "$PROMPT" | pwn --ai -
32
+ # ------------------------------------------------------------------
33
+ prompt = opts[:ai].to_s
34
+ prompt = $stdin.read if prompt == '-' || (prompt.strip.empty? && !$stdin.tty?)
35
+ raise 'ERROR: --ai requires a non-empty PROMPT (or pipe one via STDIN with --ai -)' if prompt.to_s.strip.empty?
36
+
37
+ sess = PWN::Sessions.create(
38
+ title: "pwn --ai #{Time.now.strftime('%Y-%m-%d %H:%M')}",
39
+ source: 'pwn-ai-headless'
40
+ )
41
+
42
+ on_tool = lambda do |name, args, result|
43
+ preview = args.is_a?(String) ? args[0, 120] : args.inspect[0, 120]
44
+ warn "[ pwn-ai → #{name} ] #{preview}"
45
+ warn result.to_s[0, 700]
46
+ end
47
+
48
+ final = PWN::AI::Agent::Loop.run(
49
+ request: prompt,
50
+ session_id: sess[:id],
51
+ enabled_toolsets: PWN::Env.dig(:ai, :agent, :toolsets),
52
+ on_tool: on_tool
53
+ )
54
+ puts final
55
+ else
56
+ PWN::Plugins::REPL.start
57
+ end
13
58
  rescue StandardError => e
14
59
  raise e
15
60
  ensure
data/bin/pwn_gqrx_scanner CHANGED
@@ -72,6 +72,33 @@ PWN::Driver::Parser.new do |options|
72
72
  options.on('-wLOC', '--location=LOC', '<Optional - Location string to include in AI analysis (e.g. "New York, NY", 90210, GPS coords, etc.)>') do |l|
73
73
  opts[:location] = l
74
74
  end
75
+ options.on('--fft-scan', '<Optional - Use fast FFT-based panoramic scanning via #fast_scan_range (much faster) instead of #scan_range. Applies to profile or --scan-ranges>') do |f|
76
+ opts[:fft_scan] = f
77
+ end
78
+
79
+ options.on('-SRATE', '--sample-rate=RATE', '<Optional --fft-scan - Visible span/sample_rate in Hz (default 1_000_000)>') do |s|
80
+ opts[:sample_rate] = s
81
+ end
82
+
83
+ options.on('-NINT', '--nfft=INT', '<Optional --fft-scan - FFT bin size (default 2048)>') do |n|
84
+ opts[:nfft] = n
85
+ end
86
+
87
+ options.on('-AINT', '--avg=INT', '<Optional --fft-scan - FFT averages (default 2)>') do |a|
88
+ opts[:avg] = a
89
+ end
90
+
91
+ options.on('-CSEC', '--capture-secs=SEC', '<Optional --fft-scan - Capture seconds per chunk (default 0.03)>') do |c|
92
+ opts[:capture_secs] = c
93
+ end
94
+
95
+ options.on('--keep-spectrum', '<Optional --fft-scan - Keep full spectrum data in output (large)>') do |k|
96
+ opts[:keep_spectrum] = k
97
+ end
98
+
99
+ options.on('-ODB', '--strength-offset-db=FLOAT', '<Optional - Power offset in dB (default 0.0)>') do |o|
100
+ opts[:strength_offset_db] = o
101
+ end
75
102
  end.parse!
76
103
 
77
104
  begin
@@ -146,24 +173,54 @@ begin
146
173
  # Merge opts one last time to ensure parameters passed to the driver are included
147
174
  opts.merge!(band_plans[profile.to_sym]) unless profile.nil?
148
175
 
149
- PWN::SDR::GQRX.scan_range(
150
- gqrx_sock: gqrx_sock,
151
- ranges: ranges,
152
- demodulator_mode: demodulator_mode,
153
- bandwidth: bandwidth,
154
- audio_gain_db: audio_gain_db,
155
- squelch: squelch,
156
- precision: precision,
157
- strength_lock: strength_lock,
158
- rf_gain: rf_gain,
159
- intermediate_gain: intermediate_gain,
160
- baseband_gain: baseband_gain,
161
- keep_looping: keep_looping,
162
- scan_log: scan_log,
163
- decoder: decoder,
164
- location: location
165
- )
166
- puts 'Scan Complete.'
176
+ fft_scan = opts[:fft_scan]
177
+ sample_rate = opts[:sample_rate] || 1_000_000
178
+ sample_rate = sample_rate.to_i
179
+ nfft = opts[:nfft] || 2048
180
+ nfft = nfft.to_i
181
+ avgv = opts[:avg] || 2
182
+ avgv = avgv.to_i
183
+ capture_secs = opts[:capture_secs] || 0.03
184
+ capture_secs = capture_secs.to_f
185
+ keep_spectrum = opts[:keep_spectrum] ? true : false
186
+ strength_offset_db = opts[:strength_offset_db]
187
+ strength_offset_db = strength_offset_db.to_f unless strength_offset_db.nil?
188
+
189
+ if fft_scan
190
+ puts '[*] --fft-scan requested: using fast FFT panoramic mode (#fast_scan_range)'
191
+ fast_resp = PWN::SDR::GQRX.fast_scan_range(
192
+ gqrx_sock: gqrx_sock,
193
+ ranges: ranges,
194
+ sample_rate: sample_rate,
195
+ nfft: nfft,
196
+ avg: avgv,
197
+ capture_secs: capture_secs,
198
+ strength_lock: strength_lock,
199
+ keep_spectrum: keep_spectrum,
200
+ strength_offset_db: strength_offset_db,
201
+ scan_log: scan_log
202
+ )
203
+ puts "FFT Scan complete: #{fast_resp[:total]} signals found."
204
+ else
205
+ PWN::SDR::GQRX.scan_range(
206
+ gqrx_sock: gqrx_sock,
207
+ ranges: ranges,
208
+ demodulator_mode: demodulator_mode,
209
+ bandwidth: bandwidth,
210
+ audio_gain_db: audio_gain_db,
211
+ squelch: squelch,
212
+ precision: precision,
213
+ strength_lock: strength_lock,
214
+ rf_gain: rf_gain,
215
+ intermediate_gain: intermediate_gain,
216
+ baseband_gain: baseband_gain,
217
+ keep_looping: keep_looping,
218
+ scan_log: scan_log,
219
+ decoder: decoder,
220
+ location: location
221
+ )
222
+ puts 'Scan Complete.'
223
+ end
167
224
  rescue StandardError => e
168
225
  raise e
169
226
  rescue Interrupt
@@ -0,0 +1,36 @@
1
+ # AI & LLM Integration
2
+
3
+ PWN integrates deeply with multiple LLMs for both interactive and autonomous operation.
4
+
5
+ ## Supported Providers
6
+
7
+ - OpenAI
8
+ - Anthropic
9
+ - Google Gemini
10
+ - xAI Grok (full OAuth device flow support, public client)
11
+ - Ollama (local)
12
+ - Others via extensible client design
13
+
14
+ ## Primary Entry Points
15
+
16
+ - `PWN::AI::*` (OpenAI, Anthropic, Grok, etc.)
17
+ - `PWN::AI::Agent` — the autonomous tool-calling harness
18
+ - `pwn-ai` command inside REPL launches the TUI
19
+
20
+ ## Tool Calling
21
+
22
+ The agent can call:
23
+ - `pwn_eval` (full PWN namespace + Ruby)
24
+ - `shell`
25
+ - skills
26
+ - memory (recall/remember)
27
+ - learning & metrics
28
+
29
+ OAuth for Grok is configured via `PWN::Config` and follows modern device-code flows (no client secrets).
30
+
31
+ See:
32
+ - [pwn-ai Agent](pwn-ai-Agent.md)
33
+ - [Skills, Memory & Learning](Skills-Memory-Learning.md)
34
+ - `lib/pwn/ai/` in source
35
+
36
+ [[Diagrams]]
@@ -0,0 +1,26 @@
1
+ # Burp Suite Integration
2
+
3
+ **Preferred** web application proxy and scanner in PWN.
4
+
5
+ ## Why Burp Over ZAP
6
+
7
+ Burp Suite Professional offers richer scanning, more comprehensive plugin ecosystem, and better active/passive scanning capabilities for modern web apps. Use `PWN::Plugins::BurpSuite` by default.
8
+
9
+ ## Key Methods (incomplete list - inspect in REPL)
10
+
11
+ - `PWN::Plugins::BurpSuite.start(...)`
12
+ - `PWN::Plugins::BurpSuite.stop`
13
+ - `PWN::Plugins::BurpSuite.get_sitemap(...)`
14
+ - `PWN::Plugins::BurpSuite.send_request(...)`
15
+ - Live spidering and scanning orchestration
16
+ - Integration with TransparentBrowser for proxied browsing
17
+
18
+ ## Typical Usage via Agent
19
+
20
+ > "Start BurpSuite, configure TransparentBrowser to proxy through it, spider target, run active scan, report findings."
21
+
22
+ See `lib/pwn/plugins/burp_suite.rb` for full API and source.
23
+
24
+ Also see [Plugins](Plugins.md) and [pwn-ai Agent](pwn-ai-Agent.md).
25
+
26
+ [[Diagrams]]
@@ -0,0 +1,31 @@
1
+ # Contributing
2
+
3
+ Contributions that expand PWN's offensive capabilities are highly welcome.
4
+
5
+ ## How to Help
6
+
7
+ - New plugins (especially zero-day research, exploitation primitives, novel AI integrations)
8
+ - Improvements to existing modules
9
+ - New SAST signatures
10
+ - AI skills (see [Skills-Memory-Learning](Skills-Memory-Learning.md))
11
+ - Better documentation / wiki pages
12
+ - Bridges to more commercial/open security tools
13
+ - Bug reports with clear reproduction steps
14
+
15
+ ## Process
16
+
17
+ 1. Review [CONTRIBUTING.md](../CONTRIBUTING.md) in the repo root.
18
+ 2. Open an issue or PR on https://github.com/0dayInc/pwn
19
+ 3. For large features, discuss first via email (support@0dayinc.com) or GitHub.
20
+
21
+ ## Code Style
22
+
23
+ Follow RuboCop (project is clean). Write self-documenting methods with parameter descriptions matching existing plugin style.
24
+
25
+ ## Access
26
+
27
+ If you have access to additional commercial LLMs, scanners, or bug bounty programs you are willing to integrate, please reach out.
28
+
29
+ Thank you for helping push the state of open offensive security tooling forward!
30
+
31
+ [[Diagrams]]