pwn 0.5.615 → 0.5.618

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 (153) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +109 -85
  3. data/README.md.bak +200 -0
  4. data/bin/pwn +47 -2
  5. data/bin/pwn_gqrx_scanner +75 -18
  6. data/documentation/AI-Integration.md +42 -26
  7. data/documentation/AWS.md +57 -0
  8. data/documentation/Agent-Tool-Registry.md +56 -0
  9. data/documentation/Banner.md +17 -0
  10. data/documentation/Blockchain.md +18 -0
  11. data/documentation/Bounty.md +21 -0
  12. data/documentation/BurpSuite.md +41 -16
  13. data/documentation/CLI-Drivers.md +58 -0
  14. data/documentation/Configuration.md +66 -0
  15. data/documentation/Contributing.md +33 -19
  16. data/documentation/Cron.md +47 -0
  17. data/documentation/Diagrams.md +123 -40
  18. data/documentation/Drivers.md +43 -16
  19. data/documentation/Extrospection.md +54 -0
  20. data/documentation/FFI.md +14 -0
  21. data/documentation/Fuzzing.md +36 -0
  22. data/documentation/General-PWN-Usage.md +50 -30
  23. data/documentation/Hardware.md +40 -0
  24. data/documentation/Home.md +78 -51
  25. data/documentation/How-PWN-Works.md +59 -57
  26. data/documentation/Installation.md +53 -28
  27. data/documentation/Metasploit.md +34 -0
  28. data/documentation/NmapIt.md +18 -12
  29. data/documentation/PWN.png +0 -0
  30. data/documentation/PWN_Contributors_and_Users.png +0 -0
  31. data/documentation/Persistence.md +38 -0
  32. data/documentation/Plugins.md +97 -47
  33. data/documentation/Reporting.md +25 -18
  34. data/documentation/SAST.md +39 -22
  35. data/documentation/SDR.md +40 -0
  36. data/documentation/Sessions.md +39 -0
  37. data/documentation/Skills-Memory-Learning.md +49 -29
  38. data/documentation/Swarm.md +71 -0
  39. data/documentation/Transparent-Browser.md +26 -22
  40. data/documentation/Troubleshooting.md +44 -25
  41. data/documentation/WWW.md +32 -0
  42. data/documentation/What-is-PWN.md +51 -32
  43. data/documentation/Why-PWN.md +41 -11
  44. data/documentation/diagrams/agent-tool-registry.svg +284 -0
  45. data/documentation/diagrams/ai-integration-tool-calling.svg +141 -103
  46. data/documentation/diagrams/aws-cloud-security.svg +166 -0
  47. data/documentation/diagrams/build.sh +20 -0
  48. data/documentation/diagrams/burp-vs-zap-preference.svg +47 -62
  49. data/documentation/diagrams/code-scanning-sast.svg +139 -79
  50. data/documentation/diagrams/cron-scheduling.svg +148 -0
  51. data/documentation/diagrams/dot/_THEME.md +27 -0
  52. data/documentation/diagrams/dot/agent-tool-registry.dot +59 -0
  53. data/documentation/diagrams/dot/ai-integration-tool-calling.dot +47 -20
  54. data/documentation/diagrams/dot/aws-cloud-security.dot +48 -0
  55. data/documentation/diagrams/dot/burp-vs-zap-preference.dot +23 -12
  56. data/documentation/diagrams/dot/code-scanning-sast.dot +46 -18
  57. data/documentation/diagrams/dot/cron-scheduling.dot +40 -0
  58. data/documentation/diagrams/dot/driver-framework.dot +36 -14
  59. data/documentation/diagrams/dot/extrospection-world-awareness.dot +55 -0
  60. data/documentation/diagrams/dot/fuzzing-workflow.dot +44 -24
  61. data/documentation/diagrams/dot/hardware-hacking.dot +48 -0
  62. data/documentation/diagrams/dot/history-to-drivers.dot +31 -17
  63. data/documentation/diagrams/dot/memory-skills-detailed.dot +57 -25
  64. data/documentation/diagrams/dot/network-infra-testing.dot +51 -19
  65. data/documentation/diagrams/dot/overall-pwn-architecture.dot +110 -44
  66. data/documentation/diagrams/dot/penetration-testing-workflow.dot +56 -25
  67. data/documentation/diagrams/dot/persistence-filesystem.dot +29 -0
  68. data/documentation/diagrams/dot/plugin-ecosystem.dot +41 -27
  69. data/documentation/diagrams/dot/pwn-ai-feedback-learning-loop.dot +87 -46
  70. data/documentation/diagrams/dot/pwn-repl-prototyping.dot +49 -30
  71. data/documentation/diagrams/dot/reporting-pipeline.dot +43 -14
  72. data/documentation/diagrams/dot/reverse-engineering-flow.dot +40 -18
  73. data/documentation/diagrams/dot/sdr-radio-flow.dot +45 -0
  74. data/documentation/diagrams/dot/sessions-cron-automation.dot +41 -14
  75. data/documentation/diagrams/dot/swarm-multi-agent.dot +70 -0
  76. data/documentation/diagrams/dot/web-application-testing.dot +45 -23
  77. data/documentation/diagrams/dot/zero-day-research-flow.dot +46 -24
  78. data/documentation/diagrams/driver-framework.svg +87 -66
  79. data/documentation/diagrams/extrospection-world-awareness.svg +185 -0
  80. data/documentation/diagrams/fuzzing-workflow.svg +128 -115
  81. data/documentation/diagrams/hardware-hacking.svg +163 -0
  82. data/documentation/diagrams/history-to-drivers.svg +84 -82
  83. data/documentation/diagrams/memory-skills-detailed.svg +167 -119
  84. data/documentation/diagrams/network-infra-testing.svg +146 -84
  85. data/documentation/diagrams/overall-pwn-architecture.svg +356 -185
  86. data/documentation/diagrams/penetration-testing-workflow.svg +161 -108
  87. data/documentation/diagrams/persistence-filesystem.svg +174 -0
  88. data/documentation/diagrams/plugin-ecosystem.svg +225 -121
  89. data/documentation/diagrams/pwn-ai-feedback-learning-loop.svg +257 -185
  90. data/documentation/diagrams/pwn-repl-prototyping.svg +126 -137
  91. data/documentation/diagrams/reporting-pipeline.svg +128 -68
  92. data/documentation/diagrams/reverse-engineering-flow.svg +100 -80
  93. data/documentation/diagrams/sdr-radio-flow.svg +146 -0
  94. data/documentation/diagrams/sessions-cron-automation.svg +112 -68
  95. data/documentation/diagrams/swarm-multi-agent.svg +225 -0
  96. data/documentation/diagrams/web-application-testing.svg +136 -100
  97. data/documentation/diagrams/zero-day-research-flow.svg +116 -112
  98. data/documentation/fax-spectrogram.png +0 -0
  99. data/documentation/fax-waveform.png +0 -0
  100. data/documentation/pwn-REPL.md +40 -24
  101. data/documentation/pwn-ai-Agent.md +59 -30
  102. data/documentation/pwn_android_war_dialer_session.png +0 -0
  103. data/documentation/pwn_install.png +0 -0
  104. data/documentation/pwn_wallpaper.jpg +0 -0
  105. data/documentation/ringing-spectrogram.png +0 -0
  106. data/documentation/ringing-waveform.png +0 -0
  107. data/git_commit.sh +1 -1
  108. data/lib/pwn/ai/agent/assembly.rb +1 -1
  109. data/lib/pwn/ai/agent/btc.rb +1 -1
  110. data/lib/pwn/ai/agent/burp_suite.rb +1 -1
  111. data/lib/pwn/ai/agent/extrospection.rb +618 -0
  112. data/lib/pwn/ai/agent/gqrx.rb +2 -2
  113. data/lib/pwn/ai/agent/hacker_one.rb +1 -1
  114. data/lib/pwn/ai/agent/introspection.rb +91 -0
  115. data/lib/pwn/ai/agent/learning.rb +6 -4
  116. data/lib/pwn/ai/agent/loop.rb +15 -0
  117. data/lib/pwn/ai/agent/prompt_builder.rb +10 -1
  118. data/lib/pwn/ai/agent/sast.rb +1 -1
  119. data/lib/pwn/ai/agent/swarm.rb +437 -0
  120. data/lib/pwn/ai/agent/tools/cron.rb +163 -0
  121. data/lib/pwn/ai/agent/tools/extrospection.rb +280 -0
  122. data/lib/pwn/ai/agent/tools/learning.rb +108 -0
  123. data/lib/pwn/ai/agent/tools/memory.rb +27 -0
  124. data/lib/pwn/ai/agent/tools/metrics.rb +61 -0
  125. data/lib/pwn/ai/agent/tools/sessions.rb +139 -0
  126. data/lib/pwn/ai/agent/tools/skills.rb +30 -0
  127. data/lib/pwn/ai/agent/tools/swarm.rb +229 -0
  128. data/lib/pwn/ai/agent/transparent_browser.rb +1 -1
  129. data/lib/pwn/ai/agent/vuln_gen.rb +2 -2
  130. data/lib/pwn/ai/agent.rb +3 -0
  131. data/lib/pwn/ai/anthropic.rb +19 -4
  132. data/lib/pwn/ai.rb +0 -1
  133. data/lib/pwn/config.rb +10 -23
  134. data/lib/pwn/cron.rb +16 -7
  135. data/lib/pwn/plugins/repl.rb +90 -281
  136. data/lib/pwn/sdr/decoder/base.rb +251 -0
  137. data/lib/pwn/sdr/decoder/gsm.rb +84 -185
  138. data/lib/pwn/sdr/decoder/pocsag.rb +62 -217
  139. data/lib/pwn/sdr/decoder.rb +1 -0
  140. data/lib/pwn/sdr/gqrx.rb +446 -65
  141. data/lib/pwn/version.rb +1 -1
  142. data/spec/lib/pwn/ai/agent/extrospection_spec.rb +15 -0
  143. data/spec/lib/pwn/ai/agent/introspection_spec.rb +15 -0
  144. data/spec/lib/pwn/ai/agent/swarm_spec.rb +34 -0
  145. data/spec/lib/pwn/ai/agent/tools/cron_spec.rb +40 -0
  146. data/spec/lib/pwn/ai/agent/tools/extrospection_spec.rb +40 -0
  147. data/spec/lib/pwn/ai/agent/tools/metrics_spec.rb +20 -0
  148. data/spec/lib/pwn/ai/agent/tools/sessions_spec.rb +35 -0
  149. data/spec/lib/pwn/ai/agent/tools/swarm_spec.rb +17 -0
  150. data/spec/lib/pwn/{ai/introspection_spec.rb → sdr/decoder/base_spec.rb} +3 -3
  151. data/third_party/pwn_rdoc.jsonl +199 -37
  152. metadata +65 -3
  153. data/lib/pwn/ai/introspection.rb +0 -76
@@ -1,57 +1,140 @@
1
- # PWN Data Flow Diagrams (DFDs)
1
+ # PWN Data-Flow Diagrams
2
2
 
3
- This page provides visual SVG Data Flow Diagrams illustrating how the PWN offensive cybersecurity framework operates across its key components and workflows.
3
+ 26 SVG diagrams, all rendered from Graphviz sources in
4
+ [`diagrams/dot/`](diagrams/dot/) with a single shared visual theme
5
+ (see [`_THEME.md`](diagrams/dot/_THEME.md)). Rebuild everything with:
4
6
 
5
- ## Core Architecture & Learning
7
+ ```bash
8
+ cd documentation/diagrams && ./build.sh
9
+ ```
6
10
 
7
- - **PWN-AI Feedback Learning Loop**: The closed-loop self-improvement system using Memory, Skills, Metrics, and Learning to evolve capabilities.
8
- ![PWN AI Feedback Learning Loop](diagrams/pwn-ai-feedback-learning-loop.svg)
11
+ Every diagram uses strict layer→layer edges (`newrank=true` + `{rank=same}`
12
+ groups) so lines never criss-cross.
9
13
 
10
- - **PWN REPL Prototyping**: Interactive development and rapid prototyping inside the full PWN namespace.
11
- ![PWN REPL Prototyping](diagrams/pwn-repl-prototyping.svg)
14
+ ---
12
15
 
13
- - **History Command to Driver Generation**: How REPL exploration and `history` are turned into reusable Drivers and Skills.
14
- ![History to Drivers](diagrams/history-to-drivers.svg)
16
+ ## 1 · Architecture
15
17
 
16
- ## Primary Security Workflows
18
+ ### Overall PWN Architecture
19
+ [source](diagrams/dot/overall-pwn-architecture.dot) · doc: [How PWN Works](How-PWN-Works.md)
20
+ ![overall-pwn-architecture](diagrams/overall-pwn-architecture.svg)
17
21
 
18
- - **Penetration Testing Workflow**: End-to-end red teaming from recon to reporting, leveraging all PWN capabilities.
19
- ![Penetration Testing Workflow](diagrams/penetration-testing-workflow.svg)
22
+ ### `~/.pwn/` Persistence Map
23
+ [source](diagrams/dot/persistence-filesystem.dot) · doc: [Persistence](Persistence.md)
24
+ ![persistence-filesystem](diagrams/persistence-filesystem.svg)
20
25
 
21
- - **Network & Infrastructure Testing**: Discovery, enumeration, scanning, packet crafting, and infra-specific testing (AWS, Jenkins, etc.).
22
- ![Network & Infrastructure Testing](diagrams/network-infra-testing.svg)
26
+ ### Plugin Ecosystem (66 modules)
27
+ [source](diagrams/dot/plugin-ecosystem.dot) · doc: [Plugins](Plugins.md)
28
+ ![plugin-ecosystem](diagrams/plugin-ecosystem.svg)
23
29
 
24
- - **Web Application Testing**: Proxy-driven spidering, active scanning, manual assisted testing, and API security assessment. (BurpSuite preferred)
25
- ![Web Application Testing](diagrams/web-application-testing.svg)
30
+ ---
26
31
 
27
- - **Code Scanning & SAST**: Static analysis, test case generation, and vulnerability reporting using `PWN::SAST`.
28
- ![Code Scanning SAST](diagrams/code-scanning-sast.svg)
32
+ ## 2 · Entry Points
29
33
 
30
- - **Fuzzing Workflows**: Protocol, file, network, and web fuzzing with monitoring and corpus refinement.
31
- ![Fuzzing Workflows](diagrams/fuzzing-workflow.svg)
34
+ ### `pwn` REPL Prototyping
35
+ [source](diagrams/dot/pwn-repl-prototyping.dot) · doc: [pwn REPL](pwn-REPL.md)
36
+ ![pwn-repl-prototyping](diagrams/pwn-repl-prototyping.svg)
32
37
 
33
- - **Reverse Engineering Flow**: Binary/firmware analysis, patching, targeted fuzzing, and exploit crafting.
34
- ![Reverse Engineering Flow](diagrams/reverse-engineering-flow.svg)
38
+ ### REPL History Reusable Driver / Skill
39
+ [source](diagrams/dot/history-to-drivers.dot) · doc: [Drivers](Drivers.md)
40
+ ![history-to-drivers](diagrams/history-to-drivers.svg)
35
41
 
36
- ## Additional Notes
42
+ ### Driver Anatomy (`bin/pwn_*`)
43
+ [source](diagrams/dot/driver-framework.dot) · doc: [CLI Drivers](CLI-Drivers.md)
44
+ ![driver-framework](diagrams/driver-framework.svg)
37
45
 
38
- - Diagrams are generated using Graphviz (dot) from source `.dot` files in `diagrams/dot/`.
39
- - These visualize the integration of:
40
- - `PWN::Plugins` (67+ modules)
41
- - `PWN::AI::Agent` + tool calling + LLM providers
42
- - `PWN::Memory`, `PWN::Skills`, and Learning loop
43
- - `PWN::SAST`, `PWN::Reports`, `PWN::Driver`
44
- - For the source definitions, see `diagrams/dot/*.dot`.
45
- - Update these diagrams by editing the `.dot` files and re-rendering with `dot -Tsvg`.
46
+ ---
46
47
 
47
- ## Related Wiki Pages
48
+ ## 3 · AI Agent
48
49
 
49
- - [How PWN Works](How-PWN-Works.md)
50
- - [pwn-ai Agent](pwn-ai-Agent.md)
51
- - [pwn REPL](pwn-REPL.md)
52
- - [Skills, Memory & Learning](Skills-Memory-Learning.md)
53
- - [Plugins](Plugins.md)
54
- - [SAST](SAST.md)
55
- - [Drivers](Drivers.md)
50
+ ### pwn-ai Closed Self-Improvement Loop
51
+ [source](diagrams/dot/pwn-ai-feedback-learning-loop.dot) · doc: [Skills, Memory & Learning](Skills-Memory-Learning.md)
52
+ ![pwn-ai-feedback-learning-loop](diagrams/pwn-ai-feedback-learning-loop.svg)
56
53
 
57
- [[Diagrams]]
54
+ ### Multi-Provider LLM Integration
55
+ [source](diagrams/dot/ai-integration-tool-calling.dot) · doc: [AI Integration](AI-Integration.md)
56
+ ![ai-integration-tool-calling](diagrams/ai-integration-tool-calling.svg)
57
+
58
+ ### Agent Tool Registry (10 toolsets)
59
+ [source](diagrams/dot/agent-tool-registry.dot) · doc: [Agent Tool Registry](Agent-Tool-Registry.md)
60
+ ![agent-tool-registry](diagrams/agent-tool-registry.svg)
61
+
62
+ ### Memory · Skills · Sessions Detail
63
+ [source](diagrams/dot/memory-skills-detailed.dot) · doc: [Skills, Memory & Learning](Skills-Memory-Learning.md)
64
+ ![memory-skills-detailed](diagrams/memory-skills-detailed.svg)
65
+
66
+ ### Extrospection — World Awareness
67
+ [source](diagrams/dot/extrospection-world-awareness.dot) · doc: [Extrospection](Extrospection.md)
68
+ ![extrospection-world-awareness](diagrams/extrospection-world-awareness.svg)
69
+
70
+ ### Swarm — Native Multi-Agent
71
+ [source](diagrams/dot/swarm-multi-agent.dot) · doc: [Swarm](Swarm.md)
72
+ ![swarm-multi-agent](diagrams/swarm-multi-agent.svg)
73
+
74
+ ### Cron — Scheduled Jobs
75
+ [source](diagrams/dot/cron-scheduling.dot) · doc: [Cron](Cron.md)
76
+ ![cron-scheduling](diagrams/cron-scheduling.svg)
77
+
78
+ ### Sessions ↔ Cron ↔ Swarm Continuity
79
+ [source](diagrams/dot/sessions-cron-automation.dot) · doc: [Sessions](Sessions.md)
80
+ ![sessions-cron-automation](diagrams/sessions-cron-automation.svg)
81
+
82
+ ---
83
+
84
+ ## 4 · Security Workflows
85
+
86
+ ### End-to-End Penetration Test
87
+ [source](diagrams/dot/penetration-testing-workflow.dot)
88
+ ![penetration-testing-workflow](diagrams/penetration-testing-workflow.svg)
89
+
90
+ ### Web Application Testing
91
+ [source](diagrams/dot/web-application-testing.dot) · doc: [BurpSuite](BurpSuite.md)
92
+ ![web-application-testing](diagrams/web-application-testing.svg)
93
+
94
+ ### Burp ⭐ vs ZAP Selection
95
+ [source](diagrams/dot/burp-vs-zap-preference.dot)
96
+ ![burp-vs-zap-preference](diagrams/burp-vs-zap-preference.svg)
97
+
98
+ ### Network & Infrastructure Testing
99
+ [source](diagrams/dot/network-infra-testing.dot) · doc: [NmapIt](NmapIt.md)
100
+ ![network-infra-testing](diagrams/network-infra-testing.svg)
101
+
102
+ ### SAST / Code Scanning
103
+ [source](diagrams/dot/code-scanning-sast.dot) · doc: [SAST](SAST.md)
104
+ ![code-scanning-sast](diagrams/code-scanning-sast.svg)
105
+
106
+ ### Fuzzing
107
+ [source](diagrams/dot/fuzzing-workflow.dot) · doc: [Fuzzing](Fuzzing.md)
108
+ ![fuzzing-workflow](diagrams/fuzzing-workflow.svg)
109
+
110
+ ### Reverse Engineering & Binary Exploitation
111
+ [source](diagrams/dot/reverse-engineering-flow.dot) · doc: [Hardware](Hardware.md)
112
+ ![reverse-engineering-flow](diagrams/reverse-engineering-flow.svg)
113
+
114
+ ### Zero-Day Research Lifecycle
115
+ [source](diagrams/dot/zero-day-research-flow.dot)
116
+ ![zero-day-research-flow](diagrams/zero-day-research-flow.svg)
117
+
118
+ ### Reporting Pipeline
119
+ [source](diagrams/dot/reporting-pipeline.dot) · doc: [Reporting](Reporting.md)
120
+ ![reporting-pipeline](diagrams/reporting-pipeline.svg)
121
+
122
+ ---
123
+
124
+ ## 5 · Domain-Specific
125
+
126
+ ### AWS Cloud Security (90 services)
127
+ [source](diagrams/dot/aws-cloud-security.dot) · doc: [AWS](AWS.md)
128
+ ![aws-cloud-security](diagrams/aws-cloud-security.svg)
129
+
130
+ ### SDR / Radio Hacking
131
+ [source](diagrams/dot/sdr-radio-flow.dot) · doc: [SDR](SDR.md)
132
+ ![sdr-radio-flow](diagrams/sdr-radio-flow.svg)
133
+
134
+ ### Hardware & Physical-Layer
135
+ [source](diagrams/dot/hardware-hacking.dot) · doc: [Hardware](Hardware.md)
136
+ ![hardware-hacking](diagrams/hardware-hacking.svg)
137
+
138
+ ---
139
+
140
+ [← Back to Home](Home.md)
@@ -1,25 +1,52 @@
1
- # Drivers & Custom Automation
1
+ # Drivers Turn a REPL Session into a Shipped Binary
2
2
 
3
- `PWN::Driver` and the `/opt/pwn/bin/` directory provide patterns for packaging reusable security automation.
3
+ A **driver** is a small executable in `bin/` that wires `OptionParser` to one
4
+ or more `PWN::` calls. All 52 shipped `pwn_*` binaries follow the same
5
+ 15-line template.
4
6
 
5
- ## What is a Driver?
7
+ ![History Driver CI](diagrams/history-to-drivers.svg)
6
8
 
7
- A self-contained Ruby script or gem that:
8
- - Loads the `pwn` environment
9
- - Orchestrates multiple plugins, AI calls, or custom logic
10
- - Can be scheduled via cron or run standalone
9
+ ## Workflow
11
10
 
12
- ## Examples
11
+ 1. **Prototype in the REPL** until the calls work.
12
+ 2. `history` → copy the winning lines.
13
+ 3. Drop them into the template below as `bin/pwn_<name>`.
14
+ 4. `chmod +x bin/pwn_<name>` · add to `pwn.gemspec` executables · `rake install`.
15
+ 5. (Optional) `learning_distill_skill(name: '<name>')` so the agent knows the
16
+ procedure too.
13
17
 
14
- Look in `/opt/pwn/bin/` (shipped with the gem).
18
+ ## Template
15
19
 
16
- ## Creating New Drivers
20
+ ```ruby
21
+ #!/usr/bin/env ruby
22
+ # frozen_string_literal: true
17
23
 
18
- 1. Study existing examples in `bin/`.
19
- 2. Use `PWN::Driver` helpers where appropriate.
20
- 3. Leverage the full plugin + AI surface.
21
- 4. Distill recurring successful patterns into **Skills**.
24
+ require 'optparse'
25
+ require 'pwn'
22
26
 
23
- Drivers + Skills + Agent = extremely powerful autonomous red teaming / research platform.
27
+ opts = {}
28
+ OptionParser.new do |o|
29
+ o.banner = "USAGE: #{File.basename($PROGRAM_NAME)} [opts]"
30
+ o.on('-tTARGET', '--target=TARGET', 'Required target') { |v| opts[:target] = v }
31
+ o.on('-oDIR', '--out=DIR', 'Output directory') { |v| opts[:out] = v }
32
+ end.parse!
24
33
 
25
- [[Diagrams]]
34
+ raise OptionParser::MissingArgument, '-t' unless opts[:target]
35
+
36
+ result = PWN::Plugins::NmapIt.port_scan(target: opts[:target])
37
+ PWN::Reports::Fuzz.generate(result: result, dir_path: opts[:out]) if opts[:out]
38
+ puts result
39
+ ```
40
+
41
+ ## Three artefact types from one REPL session
42
+
43
+ | Artefact | Made with | Consumed by |
44
+ |---|---|---|
45
+ | `bin/pwn_<name>` | template above | shell / CI |
46
+ | `~/.pwn/skills/<name>.md` | `learning_distill_skill` | every future pwn-ai prompt |
47
+ | `cron` job | `cron_create(ruby: '…')` | system crontab → unattended |
48
+
49
+ **See also:** [CLI Drivers](CLI-Drivers.md) · [Cron](Cron.md) ·
50
+ [Skills, Memory & Learning](Skills-Memory-Learning.md)
51
+
52
+ [← Home](Home.md)
@@ -0,0 +1,54 @@
1
+ # Extrospection — World Awareness
2
+
3
+ `PWN::AI::Agent::Extrospection` is the **outward-facing** counterpart to
4
+ [Learning](Skills-Memory-Learning.md). Where Learning/Metrics ask *"how well
5
+ did **I** do?"*, Extrospection asks *"what does the **world** look like right
6
+ now, and has it changed under me?"*
7
+
8
+ ![Extrospection engine](diagrams/extrospection-world-awareness.svg)
9
+
10
+ ## Verbs
11
+
12
+ | Tool | Does | Persists to |
13
+ |---|---|---|
14
+ | `extro_snapshot` | Fingerprint host/net/toolchain/repo/env → hash | `extrospection.json` (`snapshot` + rotates `previous`) |
15
+ | `extro_drift` | Diff live-vs-stored (or stored-vs-previous) | — returns `{changed, added, removed}` with dotted keys |
16
+ | `extro_observe` | Record a recon fact (banner, CVE match, topology note) | `observations[]` |
17
+ | `extro_observations` | Query recorded facts by source/category/target/tag | — |
18
+ | `extro_intel` | Query NVD / CIRCL / Exploit-DB for keyword or CVE | optional `record: true` → `:intel` observations |
19
+ | `extro_correlate` | **Join** introspection ↔ extrospection | — actionable findings |
20
+ | `extro_stats` | snapshot age · observation count · drift counts | — |
21
+ | `extro_reset` | Wipe snapshot + observations (new engagement) | — |
22
+ | `extro_auto_toggle` | Enable/disable auto-snapshot after every final answer | `PWN::Env[:ai][:agent][:auto_extrospect]` |
23
+
24
+ ## `extro_correlate` — the point of the whole thing
25
+
26
+ ```text
27
+ (a) Metrics tools with <50 % success × toolchain drift / missing binaries
28
+ (b) Learning failures on day X × host/net/repo drift on day X
29
+ (c) recorded :intel observations × installed component versions
30
+ ```
31
+
32
+ Output tells the agent whether a failure was **its own fault** ("I called the
33
+ API wrong") or **the world changed** ("nmap was upgraded and the flag moved")
34
+ — and that distinction is written back into MEMORY so the next run doesn't
35
+ waste iterations rediscovering it.
36
+
37
+ ## Typical engagement flow
38
+
39
+ ```ruby
40
+ extro_reset(confirm: true) # clean slate for new scope
41
+ extro_snapshot # baseline
42
+ # … recon …
43
+ extro_observe(source: 'nmap', target: '10.0.0.5',
44
+ category: 'recon', data: 'OpenSSH 8.2p1 Ubuntu')
45
+ extro_intel(query: 'OpenSSH 8.2p1', record: true)
46
+ # … days later, something breaks …
47
+ extro_drift # what moved?
48
+ extro_correlate # why did it break?
49
+ ```
50
+
51
+ **See also:** [Skills, Memory & Learning](Skills-Memory-Learning.md) ·
52
+ [pwn-ai Agent](pwn-ai-Agent.md)
53
+
54
+ [← Home](Home.md)
@@ -0,0 +1,14 @@
1
+ # `PWN::FFI` — Native Calls
2
+
3
+ `PWN::FFI::Stdio` (`lib/pwn/ffi/stdio.rb`) exposes libc functions to Ruby via
4
+ the `ffi` gem — useful for shellcode testing, format-string research and
5
+ low-level RE without leaving the REPL.
6
+
7
+ ```ruby
8
+ PWN::FFI::Stdio.printf(fmt: "leak: %p\n", args: [0x41414141])
9
+ ```
10
+
11
+ Combine with `PWN::Plugins::Assembly` (opcodes ↔ asm) and `pwn-asm` for a
12
+ minimal in-process exploit-dev workbench.
13
+
14
+ [← Home](Home.md) · [Hardware](Hardware.md)
@@ -0,0 +1,36 @@
1
+ # Fuzzing — `PWN::Plugins::Fuzz` · `Sock` · `Packet`
2
+
3
+ ![Fuzzing workflow](diagrams/fuzzing-workflow.svg)
4
+
5
+ ## Generate
6
+
7
+ ```ruby
8
+ payloads = PWN::Plugins::Fuzz.generate(
9
+ seed: "GET / HTTP/1.1\r\nHost: t\r\n\r\n",
10
+ strategy: :radamsa, # :radamsa | :bitflip | :dictionary
11
+ count: 500
12
+ )
13
+ enc = PWN::Plugins::Char.url_encode(str: payloads.first)
14
+ ```
15
+
16
+ ## Deliver
17
+
18
+ ```ruby
19
+ payloads.each do |p|
20
+ PWN::Plugins::Sock.connect(target: '10.0.0.5', port: 8080) do |s|
21
+ s.write(p); s.read
22
+ end
23
+ end
24
+ ```
25
+
26
+ For raw L2/L3: `PWN::Plugins::Packet`.
27
+ CLI network fuzzer: `pwn_fuzz_net_app_proto -t HOST -p PORT -f seeds/`
28
+
29
+ ## Monitor & report
30
+
31
+ `PWN::Plugins::PS` watches the target process; `PWN::Plugins::Log` tails its
32
+ log; `PWN::Reports::Fuzz` renders crash → HTML/JSON.
33
+
34
+ Feed unique crashes back as new seeds (`Log → Fuzz` dashed edge in the diagram).
35
+
36
+ [← Home](Home.md) · [Reporting](Reporting.md)
@@ -1,40 +1,60 @@
1
- # General PWN Usage
1
+ # General Usage — Day-One Cheat Sheet
2
2
 
3
- ## Launching PWN
3
+ ## Launch
4
4
 
5
5
  ```bash
6
- $ pwn
7
- pwn[v0.5.613]:001 >>>
6
+ $ pwn # interactive REPL
7
+ $ pwn --ai "scan 10.0.0.0/24 with NmapIt and summarise open services"
8
+ $ pwn_nmap_discover_tcp_udp -t 10.0.0.0/24 -o out/ # headless driver
8
9
  ```
9
10
 
10
- ## Essential Commands Inside REPL
11
+ ## Inside the REPL
11
12
 
12
- - `PWN.help` — overview of top-level modules
13
- - `PWN::Plugins.constants.sort` list all plugins
14
- - `pwn-ai` start the autonomous AI agent TUI (recommended)
15
- - `pwn-asm` — assembly/REPL for low-level work
16
- - `pwn-ai-memory`, `pwn-ai-sessions`, `pwn-ai-cron` — management helpers
17
- - `back` exit `pwn-ai` mode
18
- - Full Ruby expressions work at any time.
19
-
20
- ## Recommended Workflow
21
-
22
- 1. Launch `pwn`
23
- 2. Start `pwn-ai`
24
- 3. Give natural language tasks that leverage plugins, skills, memory.
25
- 4. Use `SHIFT+ENTER` for multi-line prompts.
26
-
27
- ## Updating PWN
13
+ ```ruby
14
+ PWN.help # top-level help
15
+ PWN::Plugins.constants.sort # list all 66 plugins
16
+ PWN::Plugins::NmapIt.help # per-plugin usage
17
+ ls PWN::Plugins::BurpSuite # Pry: list methods
18
+ show-source PWN::SAST::SQL.scan # Pry: read the code
19
+ history # what you've typed copy into a driver
20
+ ```
28
21
 
29
- See [Installation](Installation.md).
22
+ ## Custom REPL commands
23
+
24
+ | Command | Does |
25
+ |---|---|
26
+ | `pwn-ai` | Enter the agent TUI (SHIFT+ENTER = newline, ENTER = submit) |
27
+ | `pwn-asm` | Multi-line assembly ↔ opcode workbench |
28
+ | `pwn-ai-memory` | Inspect / edit `~/.pwn/memory.json` |
29
+ | `pwn-ai-sessions` | List / view / delete transcripts |
30
+ | `pwn-ai-cron` | List / run scheduled jobs |
31
+ | `pwn-ai-delegate` | Hand a task to a Swarm persona |
32
+ | `welcome-banner` | Redraw a random `PWN::Banner` |
33
+ | `toggle-pager` | Pry pager on/off |
34
+
35
+ ## A 60-second attack chain
36
+
37
+ ```ruby
38
+ # 1. discover
39
+ nmap = PWN::Plugins::NmapIt.port_scan(target: 'scanme.nmap.org')
40
+
41
+ # 2. drive traffic through Burp
42
+ burp = PWN::Plugins::BurpSuite.start(headless: true)
43
+ b = PWN::Plugins::TransparentBrowser.open(
44
+ browser_type: :headless, proxy: 'http://127.0.0.1:8080')
45
+ b[:browser].goto 'http://scanme.nmap.org'
46
+
47
+ # 3. active scan
48
+ scan = PWN::Plugins::BurpSuite.active_scan(burp_obj: burp,
49
+ target_url: 'http://scanme.nmap.org')
50
+
51
+ # 4. report
52
+ PWN::Reports::SAST.generate(dir_path: '/tmp/src', output_dir: '/tmp/out')
53
+ ```
30
54
 
31
- ## Persistent State
55
+ Then say the same thing in English inside `pwn-ai` and watch the agent do it.
32
56
 
33
- Everything lives under `~/.pwn/`:
34
- - `skills/`
35
- - `memory.json`
36
- - `learning.jsonl`
37
- - `metrics.json`
38
- - sessions, cron jobs, etc.
57
+ **Next:** [pwn REPL](pwn-REPL.md) · [pwn-ai Agent](pwn-ai-Agent.md) ·
58
+ [CLI Drivers](CLI-Drivers.md)
39
59
 
40
- [[Diagrams]]
60
+ [← Home](Home.md)
@@ -0,0 +1,40 @@
1
+ # Hardware & Physical-Layer Hacking
2
+
3
+ ![Hardware hacking](diagrams/hardware-hacking.svg)
4
+ ![Reverse engineering](diagrams/reverse-engineering-flow.svg)
5
+
6
+ ## Serial / Bus
7
+
8
+ | Module | Use |
9
+ |---|---|
10
+ | `PWN::Plugins::Serial` | Generic UART (`/dev/ttyUSB*`) — read/write, baud detect |
11
+ | `PWN::Plugins::BusPirate` | SPI/I²C/1-Wire via Bus Pirate |
12
+ | `PWN::Plugins::MSR206` | ISO magstripe read/write (tracks 1-3) |
13
+
14
+ CLI: `pwn_serial_msr206`, `pwn_serial_qualcomm_commands`,
15
+ `pwn_serial_check_voicemail`, `pwn_serial_son_micro_sm132_rfid`
16
+
17
+ ## Mobile
18
+
19
+ `PWN::Plugins::Android` — `adb_net_connect`, `adb_sh`, `adb_push/pull`,
20
+ `take_screenshot`, `screen_record`, `list_installed_apps`, `dumpsys`,
21
+ `open_app`, `find_hidden_codes`, `swipe`, `input`, `input_special`,
22
+ `invoke_event_listener`. CLI war-dialer: `pwn_android_war_dialer`.
23
+
24
+ ## Voice / Telephony
25
+
26
+ `PWN::Plugins::BareSIP` (SIP recon/war-dial), `PWN::Plugins::Voice` (TTS).
27
+ CLI: `pwn_phone`.
28
+
29
+ ## Radio
30
+
31
+ See [SDR](SDR.md) — GQRX, FlipperZero, RFIDler, SonMicro.
32
+
33
+ ## Binary / RE
34
+
35
+ - `PWN::Plugins::XXD` — hex dump / patch
36
+ - `PWN::Plugins::Assembly` + `pwn-asm` REPL — opcodes ↔ asm, multi-arch
37
+ - `PWN::Plugins::BlackDuckBinaryAnalysis` — SBOM + CVE match on firmware
38
+ - [`PWN::FFI`](FFI.md) — call libc from Ruby
39
+
40
+ [← Home](Home.md) · [SDR](SDR.md) · [FFI](FFI.md)
@@ -1,51 +1,78 @@
1
- # PWN Wiki
2
-
3
- Welcome to the PWN (pronounced /pōn/) Security Automation Framework Wiki.
4
-
5
- PWN is an open-source offensive cybersecurity automation framework and continuous security integration platform. It enables researchers, red teamers, penetration testers, and vulnerability researchers to discover zero-days, automate exploitation, perform web application testing, conduct SAST, orchestrate reconnaissance, and execute AI-augmented autonomous operations.
6
-
7
- ## Visual Overview (Data Flow Diagrams)
8
-
9
- **Start here for visual understanding** — see [Diagrams.md](Diagrams.md) for 18+ SVG DFDs covering:
10
-
11
- - AI feedback learning loop & self-improvement
12
- - REPL prototyping + history → drivers
13
- - End-to-end penetration testing
14
- - Network / infrastructure testing
15
- - Web application testing (Burp preferred)
16
- - Code scanning / SAST
17
- - Fuzzing
18
- - Reverse engineering
19
- - Zero-day research flow
20
- - Overall architecture
21
- - Tool calling, plugins, memory/skills, reporting, etc.
22
-
23
- ## Quick Navigation
24
-
25
- - [What is PWN](What-is-PWN.md)
26
- - [Why PWN](Why-PWN.md)
27
- - [How PWN Works](How-PWN-Works.md)
28
- - [Installation](Installation.md)
29
- - [General Usage](General-PWN-Usage.md)
30
- - [The pwn REPL](pwn-REPL.md)
31
- - [pwn-ai Autonomous Agent](pwn-ai-Agent.md)
32
- - [Plugins Overview](Plugins.md)
33
- - [AI & LLM Integration](AI-Integration.md)
34
- - [Skills, Memory & Learning](Skills-Memory-Learning.md)
35
- - [SAST](SAST.md)
36
- - [Reporting](Reporting.md)
37
- - [Drivers & Custom Automation](Drivers.md)
38
- - [Diagrams (All SVGs)](Diagrams.md)
39
- - [Troubleshooting](Troubleshooting.md)
40
- - [Contributing](Contributing.md)
41
-
42
- ## Core Commands
43
-
44
- Inside the `pwn` REPL:
45
- - `PWN.help`
46
- - `pwn-ai` — launch AI agent TUI
47
- - See full list via `pwn` command help.
48
-
49
- **Local Wiki Root:** This wiki lives in `/opt/pwn/documentation/`.
50
-
51
- For the latest upstream see the [GitHub Project](https://github.com/0dayInc/pwn) and [rubydoc.info](https://www.rubydoc.info/gems/pwn).
1
+ # PWN Documentation
2
+
3
+ > **PWN** (/pōn/) an open-source offensive-security automation framework and
4
+ > continuous-security-integration platform written in Ruby.
5
+ > 66 plugins · 48 SAST rules · 90 AWS wrappers · 21 WWW drivers · 52 CLI
6
+ > drivers · 5 LLM engines · a self-improving multi-agent AI · one REPL.
7
+
8
+ **Repo root:** `/opt/pwn` · **This wiki:** `/opt/pwn/documentation/` ·
9
+ **Rebuild diagrams:** `documentation/diagrams/build.sh`
10
+
11
+ ---
12
+
13
+ ## 🗺️ Start Here
14
+
15
+ | | |
16
+ |---|---|
17
+ | [What is PWN](What-is-PWN.md) | One-paragraph elevator pitch |
18
+ | [Why PWN](Why-PWN.md) | Design philosophy — why another framework |
19
+ | [How PWN Works](How-PWN-Works.md) | The five layers, with the architecture diagram |
20
+ | [Installation](Installation.md) | RVM, gem, `./install.sh`, first launch |
21
+ | [General Usage](General-PWN-Usage.md) | Day-one cheat sheet |
22
+ | [Configuration](Configuration.md) | `~/.pwn/config.yml` — engines, keys, agent options |
23
+ | **[All Data-Flow Diagrams](Diagrams.md)** | **26 SVGs** in one scrollable page |
24
+
25
+ ## 🚪 Entry Points
26
+
27
+ | | |
28
+ |---|---|
29
+ | [The `pwn` REPL](pwn-REPL.md) | Pry shell with the whole `PWN::` namespace pre-loaded |
30
+ | [`pwn-ai` Autonomous Agent](pwn-ai-Agent.md) | Natural-language TUI + `pwn --ai PROMPT` one-shot |
31
+ | [CLI Drivers `bin/pwn_*`](CLI-Drivers.md) | 52 headless executables for CI/CD |
32
+ | [Drivers (build your own)](Drivers.md) | Turn a REPL session into a shipped binary |
33
+
34
+ ## 🤖 AI Subsystem (`PWN::AI`)
35
+
36
+ | | |
37
+ |---|---|
38
+ | [AI / LLM Integration](AI-Integration.md) | OpenAI · Anthropic · Grok (OAuth) · Gemini · Ollama |
39
+ | [Agent Tool Registry](Agent-Tool-Registry.md) | 10 toolsets · 45+ LLM-callable tools |
40
+ | [Memory · Skills · Learning](Skills-Memory-Learning.md) | Introspection — the self-improvement loop |
41
+ | [Extrospection](Extrospection.md) | World-awareness — snapshot · drift · intel · correlate |
42
+ | [Swarm (Multi-Agent)](Swarm.md) | Personas · ask · debate · broadcast · shared bus |
43
+ | [Sessions](Sessions.md) | Transcript persistence + reflection |
44
+ | [Cron](Cron.md) | Scheduled autonomous jobs |
45
+
46
+ ## 🧩 Capability Namespaces (`lib/pwn/*`)
47
+
48
+ | | |
49
+ |---|---|
50
+ | [Plugins (66)](Plugins.md) | Every `PWN::Plugins::*` module by category |
51
+ | &nbsp;&nbsp;↳ [BurpSuite](BurpSuite.md) | Preferred web proxy / scanner |
52
+ | &nbsp;&nbsp;↳ [TransparentBrowser](Transparent-Browser.md) | Headless / visible browser automation |
53
+ | &nbsp;&nbsp;↳ [NmapIt](NmapIt.md) | Network discovery |
54
+ | &nbsp;&nbsp;↳ [Metasploit](Metasploit.md) | RPC exploitation |
55
+ | &nbsp;&nbsp;↳ [Fuzzing](Fuzzing.md) | `Fuzz` · `Sock` · `Packet` |
56
+ | &nbsp;&nbsp;↳ [Hardware](Hardware.md) | Serial · BusPirate · MSR206 · Android · BareSIP |
57
+ | [SAST (48 rules)](SAST.md) | Static analysis + test-case engine |
58
+ | [WWW (21 drivers)](WWW.md) | Browser automations for real sites |
59
+ | [AWS (90 services)](AWS.md) | Cloud-security enumeration |
60
+ | [SDR](SDR.md) | GQRX · FlipperZero · RFIDler · SonMicro |
61
+ | [Blockchain](Blockchain.md) | BTC · ETH helpers |
62
+ | [Bounty](Bounty.md) | Lifecycle / auth-replay tooling |
63
+ | [Reports](Reporting.md) | HTML/JSON output + DefectDojo/Jira |
64
+ | [FFI](FFI.md) | Native calls |
65
+ | [Banner](Banner.md) | 15 startup banners |
66
+
67
+ ## 🛠️ Meta
68
+
69
+ | | |
70
+ |---|---|
71
+ | [`~/.pwn/` Filesystem Map](Persistence.md) | Every file PWN writes and why |
72
+ | [Troubleshooting](Troubleshooting.md) | Common errors and fixes |
73
+ | [Contributing](Contributing.md) | Conventions, RuboCop, spec rules |
74
+
75
+ ---
76
+
77
+ <sub>Generated by pwn-ai. Edit any `.md` directly; edit any diagram in
78
+ `documentation/diagrams/dot/*.dot` then run `./build.sh`.</sub>