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,60 +1,62 @@
1
1
  # How PWN Works
2
2
 
3
- PWN is structured as a Ruby gem with a rich `PWN::` namespace.
4
-
5
- ## Visual Architecture Overview
6
-
7
- See the full set of **[Data Flow Diagrams](Diagrams.md)** (18+ SVGs) for detailed visualization of data flows, including:
8
-
9
- ![Overall PWN Architecture](diagrams/overall-pwn-architecture.svg)
10
-
11
- - [PWN-AI Feedback Learning Loop](diagrams/pwn-ai-feedback-learning-loop.svg) — the core self-improving closed loop
12
- - [REPL Prototyping](diagrams/pwn-repl-prototyping.svg)
13
- - [History → Drivers & Skills](diagrams/history-to-drivers.svg)
14
- - [AI Tool Calling Integration](diagrams/ai-integration-tool-calling.svg)
15
- - [Plugin Ecosystem](diagrams/plugin-ecosystem.svg)
16
- - And many more specific workflows (Pen Testing, Web, Fuzzing, SAST, RE, etc.)
17
-
18
- ## Namespace Overview
19
-
20
- | Namespace | Description |
21
- |--------------------|-------------|
22
- | `PWN::Plugins::*` | 67+ specialized modules (see [Plugins](Plugins.md)) |
23
- | `PWN::AI::*` | Multi-provider LLM clients + autonomous `PWN::AI::Agent` |
24
- | `PWN::SAST` | Static application security testing + test case generation |
25
- | `PWN::Reports` | Automated reporting from scans, agents, findings |
26
- | `PWN::Memory` | Persistent facts across sessions |
27
- | `PWN::Sessions` | Record / replay conversations and workflows |
28
- | `PWN::Cron` | Scheduled autonomous tasks |
29
- | `PWN::Skills` | Reusable markdown procedures (distilled from successful runs) |
30
- | `PWN::Config` | Environment + credential management |
31
- | `PWN::Driver` | Framework for custom security automation packages |
32
-
33
- ## Primary Interfaces
34
-
35
- 1. **pwn REPL** — Pry-powered interactive shell (launched via `pwn` command). Full `PWN` namespace pre-loaded.
36
- 2. **pwn-ai** — Autonomous AI agent TUI inside the REPL (highly recommended). Uses tool calling for `pwn_eval`, shell, skills, memory, etc.
37
- 3. **Custom Drivers** — See `/opt/pwn/bin/` examples and [Drivers](Drivers.md).
38
-
39
- ## LLM Tool Calling
40
-
41
- The agent can:
42
- - Execute any PWN plugin method directly
43
- - Run shell commands
44
- - Recall/remember facts
45
- - Distill new skills from successful workflows
46
- - Use multiple LLM providers (OpenAI, Anthropic, Gemini, Grok OAuth, Ollama, ...)
47
-
48
- Example:
49
- ```
50
- pwn-ai
51
- > Use NmapIt to scan target.example.com, spider with TransparentBrowser, proxy via BurpSuite, run SAST if source available, then generate report.
52
- ```
53
-
54
- See the Diagrams and:
55
- - [pwn REPL](pwn-REPL.md)
56
- - [pwn-ai Agent](pwn-ai-Agent.md)
57
- - [Plugins](Plugins.md)
58
- - [AI Integration](AI-Integration.md)
59
- - [Skills, Memory & Learning](Skills-Memory-Learning.md)
3
+ PWN is five layers, each visible in the source tree. Edges only ever go
4
+ **down** one layer (or sideways within a layer), which is why the diagrams
5
+ below have no criss-crossing lines.
60
6
 
7
+ ![Overall Architecture](diagrams/overall-pwn-architecture.svg)
8
+
9
+ ## L0 — Actors
10
+
11
+ Humans (`pwn` REPL, `pwn-ai` TUI), CI runners (`pwn --ai "…"`, `bin/pwn_*`),
12
+ LLM providers (over HTTPS), and targets (hosts, web apps, clouds, radios,
13
+ hardware).
14
+
15
+ ## L1 — Entry points (`bin/`)
16
+
17
+ | Entry | File | Purpose |
18
+ |---|---|---|
19
+ | `pwn` REPL | `lib/pwn/plugins/repl.rb` | Pry with `PWN::` pre-loaded + custom commands |
20
+ | `pwn-ai` | `lib/pwn/ai/agent/loop.rb` | Agent TUI inside the REPL |
21
+ | `pwn --ai PROMPT` | `bin/pwn` | Headless one-shot agent (CI-friendly) |
22
+ | `bin/pwn_*` | 52 files | Thin OptionParser wrappers over one plugin each |
23
+ | `PWN::Cron` | `lib/pwn/cron.rb` | Scheduled jobs → any of the above |
24
+
25
+ ## L2 — AI agent core (`lib/pwn/ai/agent/`)
26
+
27
+ | Module | Role |
28
+ |---|---|
29
+ | `Loop` | plan → dispatch tool_calls → observe → repeat until final answer |
30
+ | `Registry` | JSON-Schema function definitions grouped into 10 **toolsets** |
31
+ | `Dispatch` / `Result` | execute a tool, capture stdout/value/error/duration |
32
+ | `PromptBuilder` | inject MEMORY / SKILLS / LEARNING / EXTROSPECTION blocks |
33
+ | `Metrics` · `Learning` | **introspection** — how well am I doing? |
34
+ | `Extrospection` | **extrospection** — what does the world look like? |
35
+ | `Swarm` | multi-agent personas over a shared JSONL bus |
36
+
37
+ See [Agent Tool Registry](Agent-Tool-Registry.md) for every tool the LLM can call.
38
+
39
+ ## L3 — Capability namespaces (`lib/pwn/*`)
40
+
41
+ `Plugins` (66) · `SAST` (48) · `WWW` (21) · `AWS` (90) · `SDR` · `Blockchain` ·
42
+ `Bounty` · `Reports` · `FFI` · `Banner`. Each is a plain module of
43
+ `public_class_method def self.x(opts = {})` methods — callable identically from
44
+ the REPL, from `pwn_eval`, or from a driver.
45
+
46
+ ## L4 — Persistence (`~/.pwn/`)
47
+
48
+ Everything the framework remembers between processes lives in one directory:
49
+
50
+ ![~/.pwn map](diagrams/persistence-filesystem.svg)
51
+
52
+ See [Persistence](Persistence.md) for the byte-level layout of each file.
53
+
54
+ ## The feedback loop
55
+
56
+ The reason L2 exists is to close this loop on every turn:
57
+
58
+ ![Self-improvement loop](diagrams/pwn-ai-feedback-learning-loop.svg)
59
+
60
+ **Next:** [pwn REPL](pwn-REPL.md) · [pwn-ai Agent](pwn-ai-Agent.md)
61
+
62
+ [← Home](Home.md)
@@ -1,50 +1,75 @@
1
1
  # Installation
2
2
 
3
- Tested primarily on Debian-based Linux (including Kali) and macOS using RVM-managed Ruby.
3
+ PWN is tested on **Debian-based Linux** (Kali, Ubuntu) and **macOS**, using
4
+ Ruby via **RVM**.
4
5
 
5
- ## Quick Install (Recommended)
6
+ ## Quick install (recommended)
6
7
 
7
8
  ```bash
8
- $ cd /opt
9
- $ sudo git clone https://github.com/0dayInc/pwn
10
- $ cd /opt/pwn
11
- $ ./install.sh
12
- $ ./install.sh ruby-gem
13
- $ pwn
14
- pwn[v0.5.613]:001 >>> PWN.help
9
+ cd /opt
10
+ sudo git clone https://github.com/0dayinc/pwn
11
+ cd /opt/pwn
12
+ ./install.sh # system deps (nmap, chromium, graphviz, …)
13
+ ./install.sh ruby-gem # rvm gemset + bundle install + rake install
14
+ pwn # launch the REPL
15
15
  ```
16
16
 
17
- ## Video Guide
18
-
19
- [![Installing the pwn Security Automation Framework](https://raw.githubusercontent.com/0dayInc/pwn/master/documentation/pwn_install.png)](https://youtu.be/G7iLUY4FzsI)
17
+ ```text
18
+ pwn[v0.5.616]:001 >>> PWN.help
19
+ ```
20
20
 
21
- ## Ruby Gem Updates
21
+ ## Gem-only install
22
22
 
23
23
  ```bash
24
- $ rvm use ruby-4.0.5@pwn
25
- $ gem uninstall --all --executables pwn
26
- $ gem install --verbose pwn
24
+ rvm install ruby-4.0.5
25
+ rvm use ruby-4.0.5@pwn --create
26
+ gem install --verbose pwn
27
+ pwn
27
28
  ```
28
29
 
29
- For multi-user RVM use `rvmsudo` instead of `sudo` on gem commands.
30
+ ## Upgrading
30
31
 
31
- ## Upgrade Path (Ruby + PWN)
32
+ ```bash
33
+ rvm use ruby-4.0.5@pwn
34
+ gem uninstall --all --executables pwn
35
+ gem install --verbose pwn
36
+ ```
32
37
 
33
- Use the vagrant provisioner or:
38
+ or from a checkout:
34
39
 
35
40
  ```bash
36
- $ /opt/pwn/vagrant/provisioners/pwn.sh
41
+ cd /opt/pwn && git pull && rvmsudo rake install
37
42
  ```
38
43
 
39
- This rebuilds the gemset when `.ruby-version` advances.
44
+ ## First-run configuration
45
+
46
+ `pwn` creates `~/.pwn/` on first launch. Add at least one LLM engine to
47
+ `~/.pwn/config.yml` to enable `pwn-ai` — see [Configuration](Configuration.md).
40
48
 
41
- ## Requirements
49
+ ## Optional external tools
42
50
 
43
- - Ruby (via RVM recommended)
44
- - Git
45
- - Build tools (for native extensions)
46
- - Optional: Burp Suite Pro, Metasploit, etc. for full plugin capability
51
+ PWN wraps these when present on `$PATH`; none are hard requirements:
52
+
53
+ | Tool | Used by |
54
+ |---|---|
55
+ | `nmap` | `PWN::Plugins::NmapIt` |
56
+ | Burp Suite Pro (+ REST API) | `PWN::Plugins::BurpSuite` |
57
+ | `msfconsole` / msfrpcd | `PWN::Plugins::Metasploit` |
58
+ | `chromium` / `google-chrome` | `PWN::Plugins::TransparentBrowser` |
59
+ | `zaproxy` | `PWN::Plugins::Zaproxy` (fallback) |
60
+ | `gqrx` | `PWN::SDR::GQRX` |
61
+ | `adb` | `PWN::Plugins::Android` |
62
+ | `graphviz` (`dot`) | rebuilding these diagrams |
63
+ | `tor` | `PWN::Plugins::Tor` |
64
+
65
+ ## Verify
66
+
67
+ ```ruby
68
+ pwn[v0.5.616]:001 >>> PWN::Plugins.constants.count # => 66
69
+ pwn[v0.5.616]:002 >>> PWN::SAST.constants.count # => 48
70
+ pwn[v0.5.616]:003 >>> pwn-ai # launches agent TUI
71
+ ```
47
72
 
48
- See the root [README.md](../README.md) and `install.sh` for latest details.
73
+ **Next:** [Configuration](Configuration.md) · [General Usage](General-PWN-Usage.md)
49
74
 
50
- [[Diagrams]]
75
+ [← Home](Home.md)
@@ -0,0 +1,34 @@
1
+ # `PWN::Plugins::Metasploit`
2
+
3
+ RPC client for `msfrpcd` — search modules, set options, run exploits, interact
4
+ with sessions, all from Ruby.
5
+
6
+ ## Configure
7
+
8
+ ```yaml
9
+ # ~/.pwn/config.yml
10
+ metasploit:
11
+ host: 127.0.0.1
12
+ port: 55553
13
+ user: msf
14
+ pass: …
15
+ ```
16
+
17
+ Start the daemon: `msfrpcd -U msf -P … -a 127.0.0.1 -p 55553 -S`
18
+
19
+ ## Use
20
+
21
+ ```ruby
22
+ msf = PWN::Plugins::Metasploit.connect
23
+ mods = PWN::Plugins::Metasploit.search(msf_obj: msf, query: 'jenkins')
24
+ PWN::Plugins::Metasploit.use(msf_obj: msf,
25
+ module_type: 'exploit',
26
+ module_name: 'multi/http/jenkins_script_console')
27
+ PWN::Plugins::Metasploit.set_option(msf_obj: msf, opt: 'RHOSTS', val: '10.0.0.5')
28
+ job = PWN::Plugins::Metasploit.run(msf_obj: msf)
29
+ PWN::Plugins::Metasploit.sessions(msf_obj: msf)
30
+ ```
31
+
32
+ CLI: `pwn_msf_postgres_login -H 10.0.0.5 -U users.txt -P pass.txt`
33
+
34
+ [← Home](Home.md) · [Plugins](Plugins.md)
@@ -1,18 +1,24 @@
1
- # NmapIt
1
+ # `PWN::Plugins::NmapIt`
2
2
 
3
- `PWN::Plugins::NmapIt` provides a convenient Ruby wrapper around Nmap for reconnaissance.
3
+ Thin, composable wrapper over `nmap` with structured XML parsing.
4
4
 
5
- ## Features
5
+ ![Network & infra testing](diagrams/network-infra-testing.svg)
6
6
 
7
- - Easy target specification (hosts, ranges, CIDR)
8
- - Parsing of XML output into usable Ruby structures
9
- - Service version detection, script execution support
10
- - Integration with other plugins (e.g. feed into TransparentBrowser or Shodan)
7
+ ```ruby
8
+ r = PWN::Plugins::NmapIt.port_scan(
9
+ target: '10.0.0.0/24',
10
+ ports: '1-1024',
11
+ service_scan: true,
12
+ script: 'default,vuln',
13
+ output_xml: '/tmp/scan.xml'
14
+ )
15
+ r[:hosts].each { |h| puts "#{h[:ip]} → #{h[:ports].map { |p| p[:portid] }}" }
16
+ ```
11
17
 
12
- Commonly used early in agent workflows:
18
+ CLI: `pwn_nmap_discover_tcp_udp -t 10.0.0.0/24 -o out/`
13
19
 
14
- > "Run NmapIt against 10.0.0.0/24, identify web services, then spider with TransparentBrowser."
20
+ Pairs with `extro_observe` to persist banners for later
21
+ [correlation](Extrospection.md), and with `PWN::Plugins::Sock` /
22
+ `PWN::Plugins::Metasploit` for follow-up.
15
23
 
16
- See source in `lib/pwn/plugins/nmap_it.rb`.
17
-
18
- [[Diagrams]]
24
+ [← Home](Home.md) · [Plugins](Plugins.md)
Binary file
@@ -0,0 +1,38 @@
1
+ # `~/.pwn/` — Persistence Map
2
+
3
+ Every byte PWN remembers between processes lives here.
4
+
5
+ ![~/.pwn map](diagrams/persistence-filesystem.svg)
6
+
7
+ | Path | Owner | Format | Reset tool | Purpose |
8
+ |---|---|---|---|---|
9
+ | `config.yml` | `PWN::Config` | YAML | edit by hand | engines, keys, agent options |
10
+ | `memory.json` | `PWN::Memory` | JSON array | `memory_clear` | facts · prefs · lessons · env — injected into every prompt |
11
+ | `skills/*.md` | `PWN::Config.load_skills` | Markdown + YAML front-matter | `skill_delete` | reusable procedures + `references:` (CWE/CVE/ATT&CK/NIST) |
12
+ | `learning.jsonl` | `PWN::AI::Agent::Learning` | JSON-per-line | `learning_reset` | task outcome log → success_rate |
13
+ | `metrics.json` | `PWN::AI::Agent::Metrics` | JSON | `metrics_reset` | per-tool calls · success · avg_duration · last_error |
14
+ | `extrospection.json` | `PWN::AI::Agent::Extrospection` | JSON | `extro_reset` | host snapshot + previous baseline + observations[] |
15
+ | `sessions/*.jsonl` | `PWN::Sessions` | JSON-per-line | `sessions_delete` | full transcript per pwn-ai run |
16
+ | `cron/jobs.yml` | `PWN::Cron` | YAML | `cron_remove` | scheduled prompt/ruby/script jobs |
17
+ | `cron/log/*.log` | `PWN::Cron` | text | rm | last_run output |
18
+ | `agents.yml` | `PWN::AI::Agent::Swarm` | YAML | edit / `agent_spawn` | persona registry |
19
+ | `swarm/<id>/bus.jsonl` | `Swarm` | JSON-per-line | rm -rf | append-only multi-agent chat |
20
+ | `swarm/<id>/personas.json` | `Swarm` | JSON | rm | persona → session_id map |
21
+ | `~/.pwn_history` | Pry | text | rm | REPL input history |
22
+
23
+ ## Back it up
24
+
25
+ ```bash
26
+ tar czf pwn-state-$(date +%F).tgz -C "$HOME" .pwn
27
+ ```
28
+
29
+ ## Start fresh for a new engagement
30
+
31
+ ```ruby
32
+ # inside pwn-ai — keeps config & skills, wipes engagement-specific state
33
+ extro_reset(confirm: true) # host snapshot + observations
34
+ learning_reset(confirm: true) # task outcomes (optional)
35
+ metrics_reset(confirm: true) # tool telemetry (optional)
36
+ ```
37
+
38
+ [← Home](Home.md) · [Configuration](Configuration.md)
@@ -1,59 +1,109 @@
1
- # Plugins
1
+ # `PWN::Plugins` — All 66 Modules
2
2
 
3
- PWN ships with **66+** plugins under `PWN::Plugins::*`.
3
+ Every plugin is a plain Ruby module of `public_class_method def self.x(opts = {})`
4
+ methods with self-documenting `.help`. Source: `lib/pwn/plugins/*.rb`.
4
5
 
5
- ## Browsing Plugins
6
+ ![Plugin ecosystem](diagrams/plugin-ecosystem.svg)
7
+
8
+ ## Discover in the REPL
6
9
 
7
10
  ```ruby
8
11
  PWN::Plugins.constants.sort
9
- PWN::Plugins::BurpSuite.methods(false).sort # preferred web proxy/scanner
12
+ PWN::Plugins::BurpSuite.help
13
+ ls PWN::Plugins::NmapIt
14
+ show-source PWN::Plugins::Fuzz.generate
10
15
  ```
11
16
 
12
- ## Major Categories & Highlights
13
-
14
- ### Web / Proxy / Scanning
15
- - **burp_suite** (preferred) — Headless + live interaction with Burp Suite Professional
16
- - **zaproxy** — OWASP ZAP support (fallback)
17
- - **transparent_browser** — Headless/visible browser automation, spidering, JS execution
18
- - **spider**
19
- - **nmap_it** — Nmap wrapper + parsing
20
- - **nessus_cloud**, **nexpose_vuln_scan**, **openvas**
21
-
22
- ### Exploitation & Post-Exploitation
23
- - **metasploit**
24
- - **assembly**
25
- - **fuzz**
26
- - **packet**
27
- - **beef** (Browser Exploitation Framework)
28
- - **tor**
29
-
30
- ### Recon / OSINT
31
- - **shodan**
32
- - **hunter**
33
- - **ip_info**
34
- - **github**
35
- - **hacker_one**
36
-
37
- ### Data & Auth
38
- - **authentication_helper**, **basic_auth**, **oauth2**
39
- - **dao_ldap**, **dao_mongo**, **dao_postgres**, **dao_sqlite3**
40
- - **vault**
41
-
42
- ### Mobile / Hardware / Misc
43
- - **android**
44
- - **serial**, **bus_pirate**, **msr206**
45
- - **ocr**, **pdf_parse**, **voice**
46
- - **blockchain**, **bounty** (HackerOne), **defect_dojo**
17
+ ## By category
47
18
 
48
- ### Utility
49
- - **file_fu**, **json_pathify**, **log**, **pwn_logger**, **thread_pool**
50
- - **monkey_patch**, **xxd**, **char**, **vin**, **ssn**, **credit_card**
19
+ ### Web / Proxy / Browser
20
+ | Module | Purpose | Doc |
21
+ |---|---|---|
22
+ | **`BurpSuite`** ⭐ | Headless + REST control of Burp Pro; active/passive scan | [BurpSuite](BurpSuite.md) |
23
+ | `Zaproxy` | OWASP ZAP (fallback) | — |
24
+ | **`TransparentBrowser`** | Watir/Chrome headless or visible; devtools; proxy-aware | [Transparent-Browser](Transparent-Browser.md) |
25
+ | `Spider` | Recursive crawler | — |
26
+ | `OpenAPI` | Swagger/OpenAPI parse + fuzz targets | — |
27
+ | `URIScheme` | URI helpers | — |
28
+
29
+ ### Network
30
+ | Module | Purpose | Doc |
31
+ |---|---|---|
32
+ | **`NmapIt`** | Nmap wrapper + XML parse | [NmapIt](NmapIt.md) |
33
+ | `Sock` | Raw TCP/UDP client; banner grab | — |
34
+ | `Packet` | Craft/sniff L2/L3 (PacketFu) | — |
35
+ | `Tor` | Start/rotate Tor for egress | — |
36
+ | `IPInfo` | Geo/ASN lookup | — |
37
+
38
+ ### Exploitation
39
+ | Module | Purpose | Doc |
40
+ |---|---|---|
41
+ | **`Metasploit`** | msfrpcd client; run modules; sessions | [Metasploit](Metasploit.md) |
42
+ | **`Fuzz`** | Mutation/generation fuzzer | [Fuzzing](Fuzzing.md) |
43
+ | `BeEF` | Browser Exploitation Framework hooks | — |
44
+ | `Assembly` | asm ↔ opcodes (multi-arch, keystone/capstone) | — |
45
+
46
+ ### OSINT / Recon
47
+ | Module | Purpose |
48
+ |---|---|
49
+ | `Shodan` | host/search/GraphQL introspection |
50
+ | `Hunter` | email discovery |
51
+ | `Github` | code/secret search |
52
+ | `HackerOne` | program/report API |
53
+
54
+ ### Data Access / Parsing
55
+ | Module | Purpose |
56
+ |---|---|
57
+ | `DAOLdap` · `DAOMongo` · `DAOPostgres` · `DAOSqlite3` | DB clients |
58
+ | `JSONPathify` | JSONPath query |
59
+ | `PDFParse` · `OCR` | document extraction |
60
+ | `ScannableCodes` | QR/barcode gen/read |
51
61
 
52
- Full list (current as of build):
53
- `android assembly authentication_helper baresip basic_auth beef black_duck_binary_analysis burp_suite bus_pirate char credit_card dao_ldap dao_mongo dao_postgres dao_sqlite3 defect_dojo detect_os ein file_fu fuzz git github hacker_one hunter ip_info irc jenkins jira_data_center json_pathify log mail_agent metasploit monkey_patch msr206 nessus_cloud nexpose_vuln_scan nmap_it oauth2 ocr open_api openvas packet pdf_parse pony ps pwn_logger rabbit_mq repl scannable_codes serial shodan slack_client sock spider ssn thread_pool tor transparent_browser twitter_api uri_scheme vault vin voice vsphere xxd zaproxy`
62
+ ### Auth / Secrets
63
+ | Module | Purpose |
64
+ |---|---|
65
+ | `OAuth2` · `BasicAuth` · `AuthenticationHelper` | credential flows |
66
+ | `Vault` | HashiCorp Vault |
67
+
68
+ ### Hardware / Physical
69
+ | Module | Purpose | Doc |
70
+ |---|---|---|
71
+ | `Serial` · `BusPirate` | UART/SPI/I²C | [Hardware](Hardware.md) |
72
+ | `MSR206` | magstripe reader/writer | [Hardware](Hardware.md) |
73
+ | `Android` | adb push/pull/shell/screencap | [Hardware](Hardware.md) |
74
+ | `BareSIP` · `Voice` | VoIP war-dialing / TTS | [Hardware](Hardware.md) |
75
+
76
+ ### CI / DevOps / Vuln-Mgmt
77
+ | Module | Purpose |
78
+ |---|---|
79
+ | `Jenkins` | jobs/views/plugins/users |
80
+ | `Git` | repo helpers |
81
+ | `vSphere` | VMware inventory |
82
+ | `DefectDojo` | import/reimport findings |
83
+ | `BlackDuckBinaryAnalysis` | SBOM + CVE match |
84
+ | `NessusCloud` · `NexposeVulnScan` · `OpenVAS` | commercial/OSS scanners |
85
+ | `JiraDataCenter` | ticket findings |
86
+
87
+ ### Comms
88
+ | Module | Purpose |
89
+ |---|---|
90
+ | `MailAgent` · `Pony` | SMTP send |
91
+ | `SlackClient` · `IRC` · `TwitterAPI` | chat/notify |
92
+ | `RabbitMQ` | AMQP |
93
+
94
+ ### Utility
95
+ `FileFu` · `ThreadPool` · `Log` · `PwnLogger` · `Char` · `XXD` · `DetectOS` ·
96
+ `CreditCard` · `SSN` · `EIN` · `VIN` · `PS` · `MonkeyPatch` · `REPL`
54
97
 
55
- Each plugin has self-documenting method signatures viewable via the REPL or source in `lib/pwn/plugins/`.
98
+ ## Full alphabetical list
56
99
 
57
- See individual plugin pages or source for details. Many plugins accept common options and return rich Ruby objects.
100
+ `Android Assembly AuthenticationHelper BareSIP BasicAuth BeEF
101
+ BlackDuckBinaryAnalysis BurpSuite BusPirate Char CreditCard DAOLdap DAOMongo
102
+ DAOPostgres DAOSqlite3 DefectDojo DetectOS EIN FileFu Fuzz Git Github
103
+ HackerOne Hunter IPInfo IRC Jenkins JiraDataCenter JSONPathify Log MailAgent
104
+ Metasploit MonkeyPatch MSR206 NessusCloud NexposeVulnScan NmapIt OAuth2 OCR
105
+ OpenAPI OpenVAS Packet PDFParse Pony PS PwnLogger RabbitMQ REPL ScannableCodes
106
+ Serial Shodan SlackClient Sock Spider SSN ThreadPool Tor TransparentBrowser
107
+ TwitterAPI URIScheme Vault VIN Voice Vsphere XXD Zaproxy`
58
108
 
59
- [[Diagrams]]
109
+ [← Home](Home.md) · [Diagrams](Diagrams.md)
@@ -1,28 +1,35 @@
1
- # Reporting
1
+ # `PWN::Reports` — Findings Pipeline
2
2
 
3
- `PWN::Reports` generates structured output from scans, agent runs, SAST results, and manual findings.
3
+ ![Reporting pipeline](diagrams/reporting-pipeline.svg)
4
4
 
5
- ## Capabilities
5
+ ## Generators (`lib/pwn/reports/*.rb`)
6
6
 
7
- - Vulnerability report templating (Markdown + other formats)
8
- - Integration with defect trackers (`PWN::Plugins::DefectDojo`, Jira, etc.)
9
- - Automated report generation after agent tasks or plugin runs
10
- - Custom report drivers
7
+ | Module | Consumes | Emits |
8
+ |---|---|---|
9
+ | `Reports::SAST` | `PWN::SAST::Factory` output | HTML (with `HTMLHeader`/`HTMLFooter`) + JSON |
10
+ | `Reports::Fuzz` | `PWN::Plugins::Fuzz` crash log | HTML + JSON |
11
+ | `Reports::URIBuster` | `pwn_www_uri_buster` output | HTML |
12
+ | `Reports::Phone` | `PWN::Plugins::BareSIP` recon | HTML |
13
+ | `Reports::HTMLHeader` / `HTMLFooter` | — | shared chrome for all HTML reports |
11
14
 
12
- ## Template
15
+ ## Delivery integrations
13
16
 
14
- See example report templates in the PWN repo (or generate with `PWN::Reports`). Full pipeline in [Diagrams](Diagrams.md).
17
+ | Plugin | Purpose |
18
+ |---|---|
19
+ | `PWN::Plugins::DefectDojo` | `importscan` / `reimportscan` / `engagement_create` (also `bin/pwn_defectdojo_*`) |
20
+ | `PWN::Plugins::JiraDataCenter` | Create issues from findings |
21
+ | `PWN::Plugins::SlackClient` / `MailAgent` | Notify |
15
22
 
16
- ## Usage Patterns
17
-
18
- Typically invoked at the end of reconnaissance → scanning → exploitation → analysis workflows:
23
+ ## Example
19
24
 
20
25
  ```ruby
21
- PWN::Reports.generate(...)
26
+ findings = PWN::SAST::Factory.start(dir_path: './src')
27
+ PWN::Reports::SAST.generate(
28
+ dir_path: './src', results_hash: findings, output_dir: './out'
29
+ )
30
+ PWN::Plugins::DefectDojo.importscan(
31
+ engagement_id: 42, file: './out/report.json', scan_type: 'PWN SAST'
32
+ )
22
33
  ```
23
34
 
24
- The `pwn-ai` agent is frequently instructed to "analyze findings and produce a report."
25
-
26
- Combined with `PWN::Plugins::HackerOne` / bounty modules for streamlined disclosure workflows.
27
-
28
- [[Diagrams]]
35
+ [← Home](Home.md) · [SAST](SAST.md) · [Fuzzing](Fuzzing.md)
@@ -1,32 +1,49 @@
1
- # SAST (Static Application Security Testing)
1
+ # `PWN::SAST` Static Application Security Testing
2
2
 
3
- `PWN::SAST` provides a growing collection of static analysis signatures and test case generators.
3
+ 48 language-aware rule modules + a `TestCaseEngine` + a `Factory` loader.
4
+ Source: `lib/pwn/sast/*.rb`. CLI: `bin/pwn_sast`.
4
5
 
5
- ## Location
6
+ ![SAST pipeline](diagrams/code-scanning-sast.svg)
6
7
 
7
- `lib/pwn/sast/` one file per vulnerability class or mechanism.
8
+ ## Run it
8
9
 
9
- ## Current Coverage (examples)
10
-
11
- - Command execution (multiple languages)
12
- - Deserialization (Java, etc.)
13
- - Eval / dangerous functions
14
- - CSRF, redirect, inner HTML, postMessage issues
15
- - Log4j, ReDoS, path traversal patterns
16
- - Credential / secret patterns (keystore, passwords, AWS keys)
17
- - Modern issues: prototype pollution, etc.
18
- - Custom signature engine + factory
19
-
20
- ## Usage
10
+ ```bash
11
+ # CLI driver
12
+ pwn_sast -d /path/to/src -o /tmp/sast_out
13
+ ```
21
14
 
22
15
  ```ruby
23
- PWN::SAST.constants
24
- PWN::SAST::TestCaseEngine.generate(...)
25
- # Or call specific check modules
16
+ # REPL / pwn_eval
17
+ findings = PWN::SAST::Factory.start(dir_path: '/path/to/src')
18
+ PWN::Reports::SAST.generate(dir_path: '/path/to/src',
19
+ results_hash: findings,
20
+ output_dir: '/tmp/sast_out')
26
21
  ```
27
22
 
28
- SAST results feed directly into reporting and can be orchestrated by the `pwn-ai` agent or custom drivers.
23
+ ## Rule families (48 modules)
24
+
25
+ | Family | Modules |
26
+ |---|---|
27
+ | **Command execution** | `CmdExecutionJava` · `CmdExecutionPython` · `CmdExecutionRuby` · `CmdExecutionGoLang` · `CmdExecutionScala` · `Shell` · `Sudo` |
28
+ | **Web / DOM** | `CSRF` · `Redirect` · `ReDOS` · `InnerHTML` · `OuterHTML` · `LocationHash` · `WindowLocationHash` · `PostMessage` · `LocalStorage` · `BeefHook` |
29
+ | **Injection / eval** | `SQL` · `Eval` · `DeserialJava` · `Log4J` · `PHPInputMechanisms` · `PHPTypeJuggling` · `TypeScriptTypeJuggling` |
30
+ | **Crypto / secrets** | `MD5` · `SSL` · `Keystore` · `PaddingOracle` · `PrivateKey` · `Signature` · `Token` · `Password` · `Base64` · `HTTPAuthorizationHeader` |
31
+ | **Memory / native** | `BannedFunctionCallsC` · `UseAfterFree` |
32
+ | **Infra / meta** | `AWS` · `AMQPConnectAsGuest` · `ApacheFileSystemUtilAPI` · `PomVersion` · `Version` · `Port` · `Logger` · `ThrowErrors` · `TaskTag` · `Emoticon` |
33
+ | **Engine** | `Factory` (loader) · `TestCaseEngine` (probe generator) |
34
+
35
+ ## Write a rule
36
+
37
+ Each rule implements `self.scan(opts = {})` taking `dir_path:` and returning an
38
+ array of `{file:, line:, match:, cwe:, severity:}` hashes. Copy any existing
39
+ rule in `lib/pwn/sast/`, add your regex/AST logic, and it's auto-loaded by
40
+ `Factory`.
41
+
42
+ ## Downstream
43
+
44
+ `PWN::Reports::SAST` → HTML + JSON → `PWN::Plugins::DefectDojo.importscan` →
45
+ `PWN::Plugins::JiraDataCenter` tickets.
29
46
 
30
- See `lib/pwn/sast/` source for the full and growing list of modules.
47
+ **See also:** [Reporting](Reporting.md) · [CLI Drivers](CLI-Drivers.md)
31
48
 
32
- [[Diagrams]]
49
+ [← Home](Home.md)
@@ -0,0 +1,40 @@
1
+ # `PWN::SDR` — Software-Defined Radio & RF
2
+
3
+ ![SDR flow](diagrams/sdr-radio-flow.svg)
4
+
5
+ ## Modules (`lib/pwn/sdr/*.rb`)
6
+
7
+ | Module | Purpose |
8
+ |---|---|
9
+ | **`GQRX`** | Remote-control a running GQRX instance over TCP: tune, set demod, squelch, record, `get_spectrum_snapshot` (pure-Ruby FFT), scan ranges |
10
+ | `FlipperZero` | Serial control of Flipper (sub-GHz, NFC, IR, iButton) |
11
+ | `RFIDler` | 125 kHz RFID reader/emulator |
12
+ | `SonMicroRFID` | SM130 13.56 MHz reader |
13
+ | `FrequencyAllocation` | ITU/FCC band-plan lookup — "what lives at 433.92 MHz?" |
14
+ | `Decoder::*` | Demodulator/protocol helpers |
15
+
16
+ ## CLI
17
+
18
+ ```bash
19
+ pwn_gqrx_scanner --start 430e6 --stop 440e6 --step 12.5e3 --mode fast
20
+ pwn_gqrx_scanner --start 118e6 --stop 137e6 --mode iterative --squelch -60
21
+ ```
22
+
23
+ See skill `pwn_gqrx_scanner_fast_vs_iterative_scanning` for the trade-off.
24
+
25
+ ## REPL example
26
+
27
+ ```ruby
28
+ g = PWN::SDR::GQRX.connect(host: '127.0.0.1', port: 7356)
29
+ PWN::SDR::GQRX.set_freq(gqrx_sock: g, freq: 433_920_000)
30
+ PWN::SDR::GQRX.set_demod(gqrx_sock: g, demod: 'AM')
31
+ snap = PWN::SDR::GQRX.get_spectrum_snapshot(gqrx_sock: g)
32
+ PWN::SDR::FrequencyAllocation.lookup(freq: 433_920_000)
33
+ # => { band: 'ISM 433', typical: ['garage doors', 'weather stations', …] }
34
+ ```
35
+
36
+ Record signal intel with `extro_observe(source: 'gqrx', category: 'recon', …)`.
37
+
38
+ **See also:** [Hardware](Hardware.md) · [Extrospection](Extrospection.md)
39
+
40
+ [← Home](Home.md)