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
@@ -3,147 +3,151 @@
3
3
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
4
  <!-- Generated by graphviz version 14.1.2 (0)
5
5
  -->
6
- <!-- Title: PWN Zero&#45;Day Research Workflow Pages: 1 -->
7
- <svg width="272pt" height="529pt"
8
- viewBox="0.00 0.00 272.00 529.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
9
- <g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 524.69)">
10
- <title>PWN Zero&#45;Day Research Workflow</title>
11
- <polygon fill="white" stroke="none" points="-4,4 -4,-524.69 267.62,-524.69 267.62,4 -4,4"/>
12
- <!-- Target -->
6
+ <!-- Title: PWN_ZeroDay Pages: 1 -->
7
+ <svg width="1064pt" height="309pt"
8
+ viewBox="0.00 0.00 1064.00 309.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
9
+ <g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(43.2 265.39)">
10
+ <title>PWN_ZeroDay</title>
11
+ <polygon fill="#0f172a" stroke="none" points="-43.2,43.2 -43.2,-265.39 1021.2,-265.39 1021.2,43.2 -43.2,43.2"/>
12
+ <text xml:space="preserve" text-anchor="start" x="304.5" y="-200.19" font-family="sans-Serif" font-weight="bold" font-size="20.00" fill="#e2e8f0">Zero&#45;Day Research Lifecycle with PWN</text>
13
+ <text xml:space="preserve" text-anchor="start" x="337.12" y="-188.74" font-family="sans-Serif" font-size="11.00" fill="#94a3b8">attack surface → hypothesis → prove → weaponise → disclose</text>
14
+ <g id="clust1" class="cluster">
15
+ <title>cluster_hyp</title>
16
+ <path fill="#022c22" stroke="#047857" d="M210.5,-24.19C210.5,-24.19 312,-24.19 312,-24.19 318,-24.19 324,-30.19 324,-36.19 324,-36.19 324,-163.19 324,-163.19 324,-169.19 318,-175.19 312,-175.19 312,-175.19 210.5,-175.19 210.5,-175.19 204.5,-175.19 198.5,-169.19 198.5,-163.19 198.5,-163.19 198.5,-36.19 198.5,-36.19 198.5,-30.19 204.5,-24.19 210.5,-24.19"/>
17
+ <text xml:space="preserve" text-anchor="middle" x="261.25" y="-152.19" font-family="sans-Serif" font-size="20.00" fill="#a7f3d0">Hypothesise</text>
18
+ </g>
19
+ <g id="clust2" class="cluster">
20
+ <title>cluster_prove</title>
21
+ <path fill="#422006" stroke="#a16207" d="M407,-24.19C407,-24.19 502.75,-24.19 502.75,-24.19 508.75,-24.19 514.75,-30.19 514.75,-36.19 514.75,-36.19 514.75,-163.19 514.75,-163.19 514.75,-169.19 508.75,-175.19 502.75,-175.19 502.75,-175.19 407,-175.19 407,-175.19 401,-175.19 395,-169.19 395,-163.19 395,-163.19 395,-36.19 395,-36.19 395,-30.19 401,-24.19 407,-24.19"/>
22
+ <text xml:space="preserve" text-anchor="middle" x="454.88" y="-152.19" font-family="sans-Serif" font-size="20.00" fill="#fde68a">Prove</text>
23
+ </g>
24
+ <g id="clust3" class="cluster">
25
+ <title>cluster_weapon</title>
26
+ <path fill="#450a0a" stroke="#b91c1c" d="M674.75,-24.19C674.75,-24.19 767.25,-24.19 767.25,-24.19 773.25,-24.19 779.25,-30.19 779.25,-36.19 779.25,-36.19 779.25,-163.19 779.25,-163.19 779.25,-169.19 773.25,-175.19 767.25,-175.19 767.25,-175.19 674.75,-175.19 674.75,-175.19 668.75,-175.19 662.75,-169.19 662.75,-163.19 662.75,-163.19 662.75,-36.19 662.75,-36.19 662.75,-30.19 668.75,-24.19 674.75,-24.19"/>
27
+ <text xml:space="preserve" text-anchor="middle" x="721" y="-152.19" font-family="sans-Serif" font-size="20.00" fill="#fecaca">Weaponise</text>
28
+ </g>
29
+ <g id="clust4" class="cluster">
30
+ <title>cluster_disc</title>
31
+ <path fill="#2e1065" stroke="#6d28d9" d="M862.25,-24.19C862.25,-24.19 958,-24.19 958,-24.19 964,-24.19 970,-30.19 970,-36.19 970,-36.19 970,-163.19 970,-163.19 970,-169.19 964,-175.19 958,-175.19 958,-175.19 862.25,-175.19 862.25,-175.19 856.25,-175.19 850.25,-169.19 850.25,-163.19 850.25,-163.19 850.25,-36.19 850.25,-36.19 850.25,-30.19 856.25,-24.19 862.25,-24.19"/>
32
+ <text xml:space="preserve" text-anchor="middle" x="910.12" y="-152.19" font-family="sans-Serif" font-size="20.00" fill="#ddd6fe">Disclose</text>
33
+ </g>
34
+ <!-- Surface -->
13
35
  <g id="node1" class="node">
14
- <title>Target</title>
15
- <path fill="none" stroke="black" d="M147.88,-520.69C147.88,-520.69 77.12,-520.69 77.12,-520.69 71.12,-520.69 65.12,-514.69 65.12,-508.69 65.12,-508.69 65.12,-493.19 65.12,-493.19 65.12,-487.19 71.12,-481.19 77.12,-481.19 77.12,-481.19 147.88,-481.19 147.88,-481.19 153.88,-481.19 159.88,-487.19 159.88,-493.19 159.88,-493.19 159.88,-508.69 159.88,-508.69 159.88,-514.69 153.88,-520.69 147.88,-520.69"/>
16
- <text xml:space="preserve" text-anchor="middle" x="112.5" y="-508.14" font-family="Arial" font-size="9.00">Target Research</text>
17
- <text xml:space="preserve" text-anchor="middle" x="112.5" y="-497.64" font-family="Arial" font-size="9.00">(Binary, Firmware,</text>
18
- <text xml:space="preserve" text-anchor="middle" x="112.5" y="-487.14" font-family="Arial" font-size="9.00">Protocol, Web App)</text>
36
+ <title>Surface</title>
37
+ <path fill="#7dd3fc" stroke="#334155" stroke-width="1.3" d="M107.5,-101.19C107.5,-101.19 12,-101.19 12,-101.19 6,-101.19 0,-95.19 0,-89.19 0,-89.19 0,-77.19 0,-77.19 0,-71.19 6,-65.19 12,-65.19 12,-65.19 107.5,-65.19 107.5,-65.19 113.5,-65.19 119.5,-71.19 119.5,-77.19 119.5,-77.19 119.5,-89.19 119.5,-89.19 119.5,-95.19 113.5,-101.19 107.5,-101.19"/>
38
+ <text xml:space="preserve" text-anchor="middle" x="59.75" y="-85.69" font-family="sans-Serif" font-size="10.00" fill="#0f172a">Attack Surface</text>
39
+ <text xml:space="preserve" text-anchor="middle" x="59.75" y="-73.69" font-family="sans-Serif" font-size="10.00" fill="#0f172a">OpenAPI · Shodan · Git</text>
19
40
  </g>
20
- <!-- RE -->
41
+ <!-- SAST -->
21
42
  <g id="node2" class="node">
22
- <title>RE</title>
23
- <path fill="none" stroke="black" d="M91,-444.19C91,-444.19 12,-444.19 12,-444.19 6,-444.19 0,-438.19 0,-432.19 0,-432.19 0,-420.19 0,-420.19 0,-414.19 6,-408.19 12,-408.19 12,-408.19 91,-408.19 91,-408.19 97,-408.19 103,-414.19 103,-420.19 103,-420.19 103,-432.19 103,-432.19 103,-438.19 97,-444.19 91,-444.19"/>
24
- <text xml:space="preserve" text-anchor="middle" x="51.5" y="-428.14" font-family="Arial" font-size="9.00">Reverse Engineering</text>
25
- <text xml:space="preserve" text-anchor="middle" x="51.5" y="-417.64" font-family="Arial" font-size="9.00">+ Static Analysis</text>
43
+ <title>SAST</title>
44
+ <path fill="#6ee7b7" stroke="#334155" stroke-width="1.3" d="M285.25,-136.19C285.25,-136.19 236.25,-136.19 236.25,-136.19 230.25,-136.19 224.25,-130.19 224.25,-124.19 224.25,-124.19 224.25,-112.19 224.25,-112.19 224.25,-106.19 230.25,-100.19 236.25,-100.19 236.25,-100.19 285.25,-100.19 285.25,-100.19 291.25,-100.19 297.25,-106.19 297.25,-112.19 297.25,-112.19 297.25,-124.19 297.25,-124.19 297.25,-130.19 291.25,-136.19 285.25,-136.19"/>
45
+ <text xml:space="preserve" text-anchor="middle" x="260.75" y="-120.69" font-family="sans-Serif" font-size="10.00" fill="#0f172a">PWN::SAST</text>
46
+ <text xml:space="preserve" text-anchor="middle" x="260.75" y="-108.69" font-family="sans-Serif" font-size="10.00" fill="#0f172a">taint patterns</text>
26
47
  </g>
27
- <!-- Target&#45;&gt;RE -->
48
+ <!-- Surface&#45;&gt;SAST -->
28
49
  <g id="edge1" class="edge">
29
- <title>Target&#45;&gt;RE</title>
30
- <path fill="none" stroke="black" d="M96.47,-480.82C89.38,-472.36 80.92,-462.28 73.27,-453.15"/>
31
- <polygon fill="black" stroke="black" points="76.04,-451.01 66.93,-445.59 70.68,-455.51 76.04,-451.01"/>
50
+ <title>Surface&#45;&gt;SAST</title>
51
+ <path fill="none" stroke="#38bdf8" stroke-width="1.3" d="M119.92,-93.59C150.05,-98.89 186.12,-105.24 214.08,-110.16"/>
52
+ <polygon fill="#38bdf8" stroke="#38bdf8" stroke-width="1.3" points="213.3,-112.86 221.67,-111.49 214.27,-107.35 213.3,-112.86"/>
32
53
  </g>
33
- <!-- SAST -->
54
+ <!-- AI -->
34
55
  <g id="node3" class="node">
35
- <title>SAST</title>
36
- <path fill="none" stroke="black" d="M215.5,-444.19C215.5,-444.19 133.5,-444.19 133.5,-444.19 127.5,-444.19 121.5,-438.19 121.5,-432.19 121.5,-432.19 121.5,-420.19 121.5,-420.19 121.5,-414.19 127.5,-408.19 133.5,-408.19 133.5,-408.19 215.5,-408.19 215.5,-408.19 221.5,-408.19 227.5,-414.19 227.5,-420.19 227.5,-420.19 227.5,-432.19 227.5,-432.19 227.5,-438.19 221.5,-444.19 215.5,-444.19"/>
37
- <text xml:space="preserve" text-anchor="middle" x="174.5" y="-422.89" font-family="Arial" font-size="9.00">PWN::SAST + Custom</text>
56
+ <title>AI</title>
57
+ <path fill="#6ee7b7" stroke="#334155" stroke-width="1.3" d="M291.25,-68.19C291.25,-68.19 230.25,-68.19 230.25,-68.19 224.25,-68.19 218.25,-62.19 218.25,-56.19 218.25,-56.19 218.25,-44.19 218.25,-44.19 218.25,-38.19 224.25,-32.19 230.25,-32.19 230.25,-32.19 291.25,-32.19 291.25,-32.19 297.25,-32.19 303.25,-38.19 303.25,-44.19 303.25,-44.19 303.25,-56.19 303.25,-56.19 303.25,-62.19 297.25,-68.19 291.25,-68.19"/>
58
+ <text xml:space="preserve" text-anchor="middle" x="260.75" y="-52.69" font-family="sans-Serif" font-size="10.00" fill="#0f172a">pwn&#45;ai</text>
59
+ <text xml:space="preserve" text-anchor="middle" x="260.75" y="-40.69" font-family="sans-Serif" font-size="10.00" fill="#0f172a">Agent::VulnGen</text>
38
60
  </g>
39
- <!-- Target&#45;&gt;SAST -->
61
+ <!-- Surface&#45;&gt;AI -->
40
62
  <g id="edge2" class="edge">
41
- <title>Target&#45;&gt;SAST</title>
42
- <path fill="none" stroke="black" d="M128.79,-480.82C136,-472.36 144.6,-462.28 152.38,-453.15"/>
43
- <polygon fill="black" stroke="black" points="155,-455.47 158.82,-445.59 149.67,-450.93 155,-455.47"/>
63
+ <title>Surface&#45;&gt;AI</title>
64
+ <path fill="none" stroke="#38bdf8" stroke-width="1.3" d="M119.92,-73.38C147.98,-68.72 181.19,-63.22 208.2,-58.74"/>
65
+ <polygon fill="#38bdf8" stroke="#38bdf8" stroke-width="1.3" points="208.48,-61.53 215.91,-57.46 207.56,-56 208.48,-61.53"/>
44
66
  </g>
45
67
  <!-- Fuzz -->
46
68
  <g id="node4" class="node">
47
69
  <title>Fuzz</title>
48
- <path fill="none" stroke="black" d="M178.38,-371.19C178.38,-371.19 110.62,-371.19 110.62,-371.19 104.62,-371.19 98.62,-365.19 98.62,-359.19 98.62,-359.19 98.62,-347.19 98.62,-347.19 98.62,-341.19 104.62,-335.19 110.62,-335.19 110.62,-335.19 178.38,-335.19 178.38,-335.19 184.38,-335.19 190.38,-341.19 190.38,-347.19 190.38,-347.19 190.38,-359.19 190.38,-359.19 190.38,-365.19 184.38,-371.19 178.38,-371.19"/>
49
- <text xml:space="preserve" text-anchor="middle" x="144.5" y="-355.14" font-family="Arial" font-size="9.00">Fuzzing + Protocol</text>
50
- <text xml:space="preserve" text-anchor="middle" x="144.5" y="-344.64" font-family="Arial" font-size="9.00">Analysis</text>
70
+ <path fill="#fcd34d" stroke="#334155" stroke-width="1.3" d="M477.5,-136.19C477.5,-136.19 432.25,-136.19 432.25,-136.19 426.25,-136.19 420.25,-130.19 420.25,-124.19 420.25,-124.19 420.25,-112.19 420.25,-112.19 420.25,-106.19 426.25,-100.19 432.25,-100.19 432.25,-100.19 477.5,-100.19 477.5,-100.19 483.5,-100.19 489.5,-106.19 489.5,-112.19 489.5,-112.19 489.5,-124.19 489.5,-124.19 489.5,-130.19 483.5,-136.19 477.5,-136.19"/>
71
+ <text xml:space="preserve" text-anchor="middle" x="454.88" y="-120.69" font-family="sans-Serif" font-size="10.00" fill="#0f172a">Fuzz · Sock</text>
72
+ <text xml:space="preserve" text-anchor="middle" x="454.88" y="-108.69" font-family="sans-Serif" font-size="10.00" fill="#0f172a">Packet</text>
51
73
  </g>
52
- <!-- RE&#45;&gt;Fuzz -->
74
+ <!-- SAST&#45;&gt;Fuzz -->
53
75
  <g id="edge3" class="edge">
54
- <title>RE&#45;&gt;Fuzz</title>
55
- <path fill="none" stroke="black" d="M74.01,-408C85.69,-399.08 100.15,-388.04 112.93,-378.29"/>
56
- <polygon fill="black" stroke="black" points="114.84,-381.23 120.67,-372.38 110.6,-375.67 114.84,-381.23"/>
76
+ <title>SAST&#45;&gt;Fuzz</title>
77
+ <path fill="none" stroke="#f59e0b" stroke-width="1.3" d="M297.89,-118.19C329.74,-118.19 376.24,-118.19 410.18,-118.19"/>
78
+ <polygon fill="#f59e0b" stroke="#f59e0b" stroke-width="1.3" points="409.87,-120.99 417.87,-118.19 409.87,-115.39 409.87,-120.99"/>
57
79
  </g>
58
- <!-- Dyn -->
80
+ <!-- TB -->
59
81
  <g id="node5" class="node">
60
- <title>Dyn</title>
61
- <path fill="none" stroke="black" d="M142.88,-296.25C142.88,-296.25 78.12,-296.25 78.12,-296.25 72.12,-296.25 66.12,-290.25 66.12,-284.25 66.12,-284.25 66.12,-272.25 66.12,-272.25 66.12,-266.25 72.12,-260.25 78.12,-260.25 78.12,-260.25 142.88,-260.25 142.88,-260.25 148.88,-260.25 154.88,-266.25 154.88,-272.25 154.88,-272.25 154.88,-284.25 154.88,-284.25 154.88,-290.25 148.88,-296.25 142.88,-296.25"/>
62
- <text xml:space="preserve" text-anchor="middle" x="110.5" y="-280.2" font-family="Arial" font-size="9.00">Dynamic Analysis</text>
63
- <text xml:space="preserve" text-anchor="middle" x="110.5" y="-269.7" font-family="Arial" font-size="9.00">(REPL + Debug)</text>
82
+ <title>TB</title>
83
+ <path fill="#fcd34d" stroke="#334155" stroke-width="1.3" d="M494.75,-68.19C494.75,-68.19 415,-68.19 415,-68.19 409,-68.19 403,-62.19 403,-56.19 403,-56.19 403,-44.19 403,-44.19 403,-38.19 409,-32.19 415,-32.19 415,-32.19 494.75,-32.19 494.75,-32.19 500.75,-32.19 506.75,-38.19 506.75,-44.19 506.75,-44.19 506.75,-56.19 506.75,-56.19 506.75,-62.19 500.75,-68.19 494.75,-68.19"/>
84
+ <text xml:space="preserve" text-anchor="middle" x="454.88" y="-52.69" font-family="sans-Serif" font-size="10.00" fill="#0f172a">TransparentBrowser</text>
85
+ <text xml:space="preserve" text-anchor="middle" x="454.88" y="-40.69" font-family="sans-Serif" font-size="10.00" fill="#0f172a">Burp replay</text>
64
86
  </g>
65
- <!-- RE&#45;&gt;Dyn -->
66
- <g id="edge6" class="edge">
67
- <title>RE&#45;&gt;Dyn</title>
68
- <path fill="none" stroke="black" d="M58.5,-407.87C68.57,-382.97 87.25,-336.77 99.26,-307.05"/>
69
- <polygon fill="black" stroke="black" points="102.44,-308.53 102.94,-297.94 95.95,-305.9 102.44,-308.53"/>
70
- </g>
71
- <!-- SAST&#45;&gt;Fuzz -->
87
+ <!-- AI&#45;&gt;TB -->
72
88
  <g id="edge4" class="edge">
73
- <title>SAST&#45;&gt;Fuzz</title>
74
- <path fill="none" stroke="black" d="M167.24,-408C163.88,-400.06 159.82,-390.45 156.06,-381.55"/>
75
- <polygon fill="black" stroke="black" points="159.4,-380.46 152.28,-372.61 152.95,-383.18 159.4,-380.46"/>
89
+ <title>AI&#45;&gt;TB</title>
90
+ <path fill="none" stroke="#f59e0b" stroke-width="1.3" d="M303.44,-50.19C329.61,-50.19 363.82,-50.19 393,-50.19"/>
91
+ <polygon fill="#f59e0b" stroke="#f59e0b" stroke-width="1.3" points="392.72,-52.99 400.72,-50.19 392.72,-47.39 392.72,-52.99"/>
92
+ </g>
93
+ <!-- Asm -->
94
+ <g id="node6" class="node">
95
+ <title>Asm</title>
96
+ <path fill="#fda4af" stroke="#334155" stroke-width="1.3" d="M758.5,-136.19C758.5,-136.19 682.5,-136.19 682.5,-136.19 676.5,-136.19 670.5,-130.19 670.5,-124.19 670.5,-124.19 670.5,-112.19 670.5,-112.19 670.5,-106.19 676.5,-100.19 682.5,-100.19 682.5,-100.19 758.5,-100.19 758.5,-100.19 764.5,-100.19 770.5,-106.19 770.5,-112.19 770.5,-112.19 770.5,-124.19 770.5,-124.19 770.5,-130.19 764.5,-136.19 758.5,-136.19"/>
97
+ <text xml:space="preserve" text-anchor="middle" x="720.5" y="-120.69" font-family="sans-Serif" font-size="10.00" fill="#0f172a">Assembly</text>
98
+ <text xml:space="preserve" text-anchor="middle" x="720.5" y="-108.69" font-family="sans-Serif" font-size="10.00" fill="#0f172a">pwn&#45;asm shellcode</text>
76
99
  </g>
77
- <!-- Fuzz&#45;&gt;Dyn -->
100
+ <!-- Fuzz&#45;&gt;Asm -->
78
101
  <g id="edge5" class="edge">
79
- <title>Fuzz&#45;&gt;Dyn</title>
80
- <path fill="none" stroke="black" d="M136.44,-334.9C132.53,-326.52 127.74,-316.24 123.35,-306.81"/>
81
- <polygon fill="black" stroke="black" points="126.65,-305.62 119.26,-298.04 120.31,-308.58 126.65,-305.62"/>
102
+ <title>Fuzz&#45;&gt;Asm</title>
103
+ <path fill="none" stroke="#fb7185" stroke-width="1.3" d="M490.07,-118.19C533.13,-118.19 607.81,-118.19 660.24,-118.19"/>
104
+ <polygon fill="#fb7185" stroke="#fb7185" stroke-width="1.3" points="660.12,-120.99 668.12,-118.19 660.12,-115.39 660.12,-120.99"/>
82
105
  </g>
83
- <!-- Exploit -->
84
- <g id="node8" class="node">
85
- <title>Exploit</title>
86
- <path fill="none" stroke="black" d="M137.88,-212.56C137.88,-212.56 97.12,-212.56 97.12,-212.56 91.12,-212.56 85.12,-206.56 85.12,-200.56 85.12,-200.56 85.12,-188.56 85.12,-188.56 85.12,-182.56 91.12,-176.56 97.12,-176.56 97.12,-176.56 137.88,-176.56 137.88,-176.56 143.88,-176.56 149.88,-182.56 149.88,-188.56 149.88,-188.56 149.88,-200.56 149.88,-200.56 149.88,-206.56 143.88,-212.56 137.88,-212.56"/>
87
- <text xml:space="preserve" text-anchor="middle" x="117.5" y="-196.51" font-family="Arial" font-size="9.00">Exploit Dev</text>
88
- <text xml:space="preserve" text-anchor="middle" x="117.5" y="-186.01" font-family="Arial" font-size="9.00">&amp; Validation</text>
106
+ <!-- MSF -->
107
+ <g id="node7" class="node">
108
+ <title>MSF</title>
109
+ <path fill="#fda4af" stroke="#334155" stroke-width="1.3" d="M739,-68.19C739,-68.19 702,-68.19 702,-68.19 696,-68.19 690,-62.19 690,-56.19 690,-56.19 690,-44.19 690,-44.19 690,-38.19 696,-32.19 702,-32.19 702,-32.19 739,-32.19 739,-32.19 745,-32.19 751,-38.19 751,-44.19 751,-44.19 751,-56.19 751,-56.19 751,-62.19 745,-68.19 739,-68.19"/>
110
+ <text xml:space="preserve" text-anchor="middle" x="720.5" y="-52.69" font-family="sans-Serif" font-size="10.00" fill="#0f172a">Metasploit</text>
111
+ <text xml:space="preserve" text-anchor="middle" x="720.5" y="-40.69" font-family="sans-Serif" font-size="10.00" fill="#0f172a">module</text>
89
112
  </g>
90
- <!-- Dyn&#45;&gt;Exploit -->
91
- <g id="edge9" class="edge">
92
- <title>Dyn&#45;&gt;Exploit</title>
93
- <path fill="none" stroke="black" d="M111.98,-259.93C112.88,-249.53 114.03,-236.05 115.05,-224.11"/>
94
- <polygon fill="black" stroke="black" points="118.52,-224.63 115.89,-214.37 111.55,-224.03 118.52,-224.63"/>
113
+ <!-- TB&#45;&gt;MSF -->
114
+ <g id="edge6" class="edge">
115
+ <title>TB&#45;&gt;MSF</title>
116
+ <path fill="none" stroke="#fb7185" stroke-width="1.3" d="M507.33,-50.19C557.76,-50.19 633.56,-50.19 679.6,-50.19"/>
117
+ <polygon fill="#fb7185" stroke="#fb7185" stroke-width="1.3" points="679.54,-52.99 687.54,-50.19 679.54,-47.39 679.54,-52.99"/>
95
118
  </g>
96
- <!-- Memory -->
97
- <g id="node6" class="node">
98
- <title>Memory</title>
99
- <path fill="none" stroke="black" d="M89.5,-49.38C89.5,-52.1 71.12,-54.31 48.5,-54.31 25.88,-54.31 7.5,-52.1 7.5,-49.38 7.5,-49.38 7.5,-4.94 7.5,-4.94 7.5,-2.21 25.88,0 48.5,0 71.12,0 89.5,-2.21 89.5,-4.94 89.5,-4.94 89.5,-49.38 89.5,-49.38"/>
100
- <path fill="none" stroke="black" d="M89.5,-49.38C89.5,-46.65 71.12,-44.44 48.5,-44.44 25.88,-44.44 7.5,-46.65 7.5,-49.38"/>
101
- <text xml:space="preserve" text-anchor="middle" x="48.5" y="-34.36" font-family="Arial" font-size="9.00">PWN Memory</text>
102
- <text xml:space="preserve" text-anchor="middle" x="48.5" y="-23.86" font-family="Arial" font-size="9.00">(historical vulns,</text>
103
- <text xml:space="preserve" text-anchor="middle" x="48.5" y="-13.36" font-family="Arial" font-size="9.00">references)</text>
104
- </g>
105
- <!-- Memory&#45;&gt;RE -->
119
+ <!-- H1 -->
120
+ <g id="node8" class="node">
121
+ <title>H1</title>
122
+ <path fill="#c4b5fd" stroke="#334155" stroke-width="1.3" d="M950,-136.19C950,-136.19 870.25,-136.19 870.25,-136.19 864.25,-136.19 858.25,-130.19 858.25,-124.19 858.25,-124.19 858.25,-112.19 858.25,-112.19 858.25,-106.19 864.25,-100.19 870.25,-100.19 870.25,-100.19 950,-100.19 950,-100.19 956,-100.19 962,-106.19 962,-112.19 962,-112.19 962,-124.19 962,-124.19 962,-130.19 956,-136.19 950,-136.19"/>
123
+ <text xml:space="preserve" text-anchor="middle" x="910.12" y="-120.69" font-family="sans-Serif" font-size="10.00" fill="#0f172a">HackerOne</text>
124
+ <text xml:space="preserve" text-anchor="middle" x="910.12" y="-108.69" font-family="sans-Serif" font-size="10.00" fill="#0f172a">BugCrowd · Synack</text>
125
+ </g>
126
+ <!-- Asm&#45;&gt;H1 -->
106
127
  <g id="edge7" class="edge">
107
- <title>Memory&#45;&gt;RE</title>
108
- <path fill="none" stroke="black" d="M41.34,-54.52C37.08,-72.49 32.5,-96.92 32.5,-118.81 32.5,-354.19 32.5,-354.19 32.5,-354.19 32.5,-368.7 36.25,-384.32 40.41,-397.21"/>
109
- <polygon fill="black" stroke="black" points="36.99,-398.03 43.6,-406.31 43.6,-395.71 36.99,-398.03"/>
110
- <text xml:space="preserve" text-anchor="middle" x="63.25" y="-232.71" font-family="Times,serif" font-size="8.00">recall past findings</text>
128
+ <title>Asm&#45;&gt;H1</title>
129
+ <path fill="none" stroke="#a78bfa" stroke-width="1.3" d="M770.8,-118.19C794.47,-118.19 823.07,-118.19 848.11,-118.19"/>
130
+ <polygon fill="#a78bfa" stroke="#a78bfa" stroke-width="1.3" points="847.9,-120.99 855.9,-118.19 847.9,-115.39 847.9,-120.99"/>
111
131
  </g>
112
- <!-- Skill -->
113
- <g id="node7" class="node">
114
- <title>Skill</title>
115
- <path fill="none" stroke="black" d="M263.62,-294.56C263.62,-296.56 243.4,-298.19 218.5,-298.19 193.6,-298.19 173.38,-296.56 173.38,-294.56 173.38,-294.56 173.38,-261.94 173.38,-261.94 173.38,-259.94 193.6,-258.31 218.5,-258.31 243.4,-258.31 263.62,-259.94 263.62,-261.94 263.62,-261.94 263.62,-294.56 263.62,-294.56"/>
116
- <path fill="none" stroke="black" d="M263.62,-294.56C263.62,-292.56 243.4,-290.94 218.5,-290.94 193.6,-290.94 173.38,-292.56 173.38,-294.56"/>
117
- <text xml:space="preserve" text-anchor="middle" x="218.5" y="-280.2" font-family="Arial" font-size="9.00">Skills (prior</text>
118
- <text xml:space="preserve" text-anchor="middle" x="218.5" y="-269.7" font-family="Arial" font-size="9.00">zero&#45;day patterns)</text>
132
+ <!-- Rep -->
133
+ <g id="node9" class="node">
134
+ <title>Rep</title>
135
+ <path fill="#c4b5fd" stroke="#334155" stroke-width="1.3" d="M939.88,-68.19C939.88,-68.19 880.38,-68.19 880.38,-68.19 874.38,-68.19 868.38,-62.19 868.38,-56.19 868.38,-56.19 868.38,-44.19 868.38,-44.19 868.38,-38.19 874.38,-32.19 880.38,-32.19 880.38,-32.19 939.88,-32.19 939.88,-32.19 945.88,-32.19 951.88,-38.19 951.88,-44.19 951.88,-44.19 951.88,-56.19 951.88,-56.19 951.88,-62.19 945.88,-68.19 939.88,-68.19"/>
136
+ <text xml:space="preserve" text-anchor="middle" x="910.12" y="-52.69" font-family="sans-Serif" font-size="10.00" fill="#0f172a">Reports · Skills</text>
137
+ <text xml:space="preserve" text-anchor="middle" x="910.12" y="-40.69" font-family="sans-Serif" font-size="10.00" fill="#0f172a">distill_skill</text>
119
138
  </g>
120
- <!-- Skill&#45;&gt;Exploit -->
139
+ <!-- MSF&#45;&gt;Rep -->
121
140
  <g id="edge8" class="edge">
122
- <title>Skill&#45;&gt;Exploit</title>
123
- <path fill="none" stroke="black" d="M194.56,-257.89C180.56,-246.56 162.73,-232.15 147.76,-220.03"/>
124
- <polygon fill="black" stroke="black" points="150.01,-217.36 140.04,-213.79 145.61,-222.8 150.01,-217.36"/>
125
- <text xml:space="preserve" text-anchor="middle" x="193.53" y="-232.71" font-family="Times,serif" font-size="8.00">apply patterns</text>
141
+ <title>MSF&#45;&gt;Rep</title>
142
+ <path fill="none" stroke="#a78bfa" stroke-width="1.3" d="M751.65,-50.19C780.31,-50.19 823.98,-50.19 858.07,-50.19"/>
143
+ <polygon fill="#a78bfa" stroke="#a78bfa" stroke-width="1.3" points="857.9,-52.99 865.9,-50.19 857.9,-47.39 857.9,-52.99"/>
126
144
  </g>
127
- <!-- Disclose -->
128
- <g id="node9" class="node">
129
- <title>Disclose</title>
130
- <path fill="none" stroke="black" d="M162.25,-139.56C162.25,-139.56 72.75,-139.56 72.75,-139.56 66.75,-139.56 60.75,-133.56 60.75,-127.56 60.75,-127.56 60.75,-112.06 60.75,-112.06 60.75,-106.06 66.75,-100.06 72.75,-100.06 72.75,-100.06 162.25,-100.06 162.25,-100.06 168.25,-100.06 174.25,-106.06 174.25,-112.06 174.25,-112.06 174.25,-127.56 174.25,-127.56 174.25,-133.56 168.25,-139.56 162.25,-139.56"/>
131
- <text xml:space="preserve" text-anchor="middle" x="117.5" y="-127.01" font-family="Arial" font-size="9.00">Responsible Disclosure</text>
132
- <text xml:space="preserve" text-anchor="middle" x="117.5" y="-116.51" font-family="Arial" font-size="9.00">&amp; Fix (Reports,</text>
133
- <text xml:space="preserve" text-anchor="middle" x="117.5" y="-106.01" font-family="Arial" font-size="9.00">HackerOne, etc.)</text>
134
- </g>
135
- <!-- Exploit&#45;&gt;Disclose -->
136
- <g id="edge10" class="edge">
137
- <title>Exploit&#45;&gt;Disclose</title>
138
- <path fill="none" stroke="black" d="M117.5,-176.32C117.5,-168.81 117.5,-159.78 117.5,-151.2"/>
139
- <polygon fill="black" stroke="black" points="121,-151.49 117.5,-141.49 114,-151.49 121,-151.49"/>
140
- </g>
141
- <!-- Disclose&#45;&gt;Memory -->
142
- <g id="edge11" class="edge">
143
- <title>Disclose&#45;&gt;Memory</title>
144
- <path fill="none" stroke="black" d="M102.87,-99.59C94.92,-89.15 84.85,-75.91 75.53,-63.67"/>
145
- <polygon fill="black" stroke="black" points="78.37,-61.62 69.53,-55.78 72.8,-65.86 78.37,-61.62"/>
146
- <text xml:space="preserve" text-anchor="middle" x="122.93" y="-74.46" font-family="Times,serif" font-size="8.00">remember disclosure</text>
145
+ <!-- Rep&#45;&gt;AI -->
146
+ <g id="edge9" class="edge">
147
+ <title>Rep&#45;&gt;AI</title>
148
+ <path fill="none" stroke="#fbbf24" stroke-width="1.3" stroke-dasharray="5,2" d="M867.84,-36.49C842.58,-28.83 809.42,-20.07 779.25,-16.19 609.87,5.62 564.45,5.09 395,-16.19 367.6,-19.63 337.77,-26.9 313.29,-33.84"/>
149
+ <polygon fill="#fbbf24" stroke="#fbbf24" stroke-width="1.3" points="312.63,-31.11 305.73,-36.03 314.19,-36.49 312.63,-31.11"/>
150
+ <text xml:space="preserve" text-anchor="middle" x="588.75" y="-2.92" font-family="sans-Serif" font-size="9.00" fill="#cbd5e1">lesson → next hunt</text>
147
151
  </g>
148
152
  </g>
149
153
  </svg>
Binary file
Binary file
@@ -1,33 +1,49 @@
1
- # The pwn REPL
1
+ # The `pwn` REPL
2
2
 
3
- The `pwn` command launches a Pry-based interactive Ruby shell with the entire `PWN` namespace pre-loaded.
3
+ `pwn` launches a **Pry** session with the entire `PWN::` namespace already
4
+ `require`d, a themed prompt, a persistent history file, and a set of custom
5
+ commands.
4
6
 
5
- ## Starting
7
+ ![REPL prototyping](diagrams/pwn-repl-prototyping.svg)
6
8
 
7
- ```bash
8
- pwn
9
- pwn[v0.5.613]:001 >>>
10
- ```
9
+ ## Why Pry (not IRB)?
11
10
 
12
- ## Key Features
11
+ - `ls PWN::Plugins::BurpSuite` — instant method listing
12
+ - `show-source` / `show-doc` — read any plugin without leaving the shell
13
+ - `edit -m` — patch a method live and retry
14
+ - `wtf?` — full backtrace of the last exception
15
+ - `history --replay 5..12` — re-run a range of lines
13
16
 
14
- - Direct access to every `PWN::` constant and plugin.
15
- - Tab completion for classes and methods.
16
- - Multi-line support.
17
- - Easy prototyping of security workflows.
18
- - `PWN.help` and inspection of any object.
17
+ ## Custom commands
19
18
 
20
- ## Useful REPL Commands
19
+ | Command | Implemented in | Purpose |
20
+ |---|---|---|
21
+ | `pwn-ai` | `Agent::Loop` | Enter the AI agent TUI |
22
+ | `pwn-asm` | `Plugins::Assembly` | Multiline asm ↔ opcodes workbench |
23
+ | `pwn-ai-memory` | `PWN::Memory` | View/edit persistent memory |
24
+ | `pwn-ai-sessions` | `PWN::Sessions` | List/view/delete transcripts |
25
+ | `pwn-ai-cron` | `PWN::Cron` | List/run/toggle scheduled jobs |
26
+ | `pwn-ai-delegate` | `Agent::Swarm` | Send one request to a persona |
27
+ | `welcome-banner` | `PWN::Banner` | Redraw a random banner |
28
+ | `toggle-pager` | Pry | Page long output on/off |
21
29
 
22
- ```
23
- pwn[v0.5.613]:001 >>> PWN::Plugins.constants.sort
24
- pwn[v0.5.613]:001 >>> PWN::Plugins::BurpSuite.methods(false).sort
25
- pwn[v0.5.613]:001 >>> PWN::SAST.constants
26
- pwn[v0.5.613]:001 >>> pwn-ai
27
- ```
30
+ ## Multi-line input
28
31
 
29
- See:
30
- - [pwn-ai Agent](pwn-ai-Agent.md) — the killer feature inside the REPL
31
- - [General Usage](General-PWN-Usage.md)
32
+ `pwn-ai` and `pwn-asm` use a custom `PWNMultiLineInput` reader:
32
33
 
33
- [[Diagrams]]
34
+ - **SHIFT + ENTER** → insert newline
35
+ - **ENTER** → submit
36
+
37
+ > **tmux users:** requires `set -s extended-keys on` **and**
38
+ > `set -as terminal-features '<outerTERM>*:extkeys'` — see
39
+ > [Troubleshooting](Troubleshooting.md#shiftenter-submits-instead-of-newline).
40
+
41
+ ## History → Driver
42
+
43
+ `~/.pwn_history` captures every line you type. When a sequence works, turn it
44
+ into a shipped `bin/pwn_*` driver — see
45
+ [From REPL History to Driver](Drivers.md).
46
+
47
+ **Next:** [pwn-ai Agent](pwn-ai-Agent.md) · [CLI Drivers](CLI-Drivers.md)
48
+
49
+ [← Home](Home.md)
@@ -1,43 +1,72 @@
1
- # pwn-ai Autonomous Agent
1
+ # `pwn-ai` — The Autonomous Agent
2
2
 
3
- The most powerful way to use PWN is via the `pwn-ai` command inside the REPL.
3
+ `pwn-ai` is a natural-language front end to everything in `PWN::`. You describe
4
+ the goal; the agent plans a sequence of tool calls (`pwn_eval`, `shell`,
5
+ `memory_*`, `skill_*`, `extro_*`, `agent_*`, …), executes them against the live
6
+ process, observes the results, and loops until it can give you a final answer.
4
7
 
5
- ## Activation
8
+ ## Two ways to run it
9
+
10
+ ```text
11
+ # 1. Interactive TUI (inside the pwn REPL)
12
+ pwn[v0.5.616]:001 >>> pwn-ai
13
+ ✨ pwn-ai · anthropic · session 20260707_220802_3f39791f
14
+ > Use NmapIt to sweep 10.0.0.0/24, then TransparentBrowser via Burp on any
15
+ host with 443 open, active-scan, and give me a Reports::SAST summary.
16
+ ```
6
17
 
7
18
  ```bash
8
- pwn[v0.5.613]:001 >>> pwn-ai
9
- [*] pwn-ai agent TUI activated...
10
- >
19
+ # 2. Headless one-shot (CI-friendly)
20
+ $ pwn --ai "run bin/pwn_sast against ./src and push findings to DefectDojo"
11
21
  ```
12
22
 
13
- ## Capabilities
23
+ ## Anatomy of a turn
14
24
 
15
- - Natural language instruction of complex multi-step security tasks.
16
- - Full tool calling access to:
17
- - All `PWN::Plugins` (BurpSuite preferred, TransparentBrowser, NmapIt, Shodan, Metasploit, etc.)
18
- - `PWN::SAST`
19
- - `PWN::Reports`
20
- - Shell execution
21
- - Memory recall / remember
22
- - Skill usage and distillation
23
- - Learning / introspection loop
24
- - Persistent context across interactions via memory and skills.
25
+ 1. **PromptBuilder** assembles the system prompt: your request + MEMORY block +
26
+ SKILLS list + LEARNING stats + EXTROSPECTION block.
27
+ 2. **Loop** sends it to the active `PWN::AI::<Engine>` client.
28
+ 3. Provider replies with `tool_calls` → **Dispatch** executes each one via the
29
+ [Registry](Agent-Tool-Registry.md), **Metrics** records duration/success.
30
+ 4. Results are appended to the message list; go to 2.
31
+ 5. When the reply has *no* tool_calls it's the **final answer** →
32
+ `Learning.auto_reflect` and `Extrospection.auto_extrospect` fire (if
33
+ enabled), transcript is flushed to `~/.pwn/sessions/`.
25
34
 
26
- ## Tips
35
+ ![Self-improvement loop](diagrams/pwn-ai-feedback-learning-loop.svg)
36
+
37
+ ## What the agent can call
38
+
39
+ 10 toolsets · 45+ tools — full table at
40
+ [Agent Tool Registry](Agent-Tool-Registry.md).
27
41
 
28
- - Use `SHIFT+ENTER` to insert newlines.
29
- - `ENTER` submits the prompt.
30
- - Type `back` or `exit` to return to normal REPL.
31
- - Example prompt:
32
- ```
33
- Scan https://target with NmapIt + TransparentBrowser (via BurpSuite),
34
- run relevant SAST if source present, exploit any findings, generate report.
35
- ```
42
+ The two that matter most:
36
43
 
37
- ## Self-Improvement
44
+ | Tool | Reach |
45
+ |---|---|
46
+ | `pwn_eval` | **Any** Ruby in-process — the whole `PWN::` namespace, `require`, monkey-patch, everything |
47
+ | `shell` | **Any** OS command on the host |
48
+
49
+ Everything else (memory, skills, learning, extrospection, cron, swarm,
50
+ sessions, metrics) is a convenience wrapper the model can discover from the
51
+ schema alone.
52
+
53
+ ## Delegating to other agents
54
+
55
+ `agent_ask`, `agent_debate`, `agent_broadcast` spin up **sub-agents** (each a
56
+ full `Loop.run` under a persona overlay) that share a JSONL bus. See
57
+ [Swarm](Swarm.md).
58
+
59
+ ## Tips
38
60
 
39
- Successful workflows can be distilled into reusable **Skills** (see [Skills-Memory-Learning](Skills-Memory-Learning.md)).
61
+ - SHIFT+ENTER = newline, ENTER = submit.
62
+ - `back` / `exit` returns to the plain REPL.
63
+ - Set `ai.agent.max_iters` in `~/.pwn/config.yml` if long tasks get truncated.
64
+ - Disable `auto_reflect` during noisy fuzz loops
65
+ (`learning_auto_reflect_toggle(enabled: false)`), re-enable for the summary
66
+ turn.
40
67
 
41
- See also [AI Integration](AI-Integration.md).
68
+ **See also:** [AI Integration](AI-Integration.md) ·
69
+ [Skills, Memory & Learning](Skills-Memory-Learning.md) ·
70
+ [Extrospection](Extrospection.md) · [Swarm](Swarm.md) · [Cron](Cron.md)
42
71
 
43
- [[Diagrams]]
72
+ [← Home](Home.md)
Binary file
Binary file
Binary file
data/git_commit.sh CHANGED
@@ -37,7 +37,7 @@ if (( $# == 3 )); then
37
37
  fi
38
38
 
39
39
  # Generate RDoc JSONL for fine-tunning LLMs
40
- echo "[TEMP] skipping rdoc for commit completion"
40
+ pwn_rdoc_to_jsonl --rdoc-root-dir '/opt/pwn/rdoc/PWN' --jsonl-results '/opt/pwn/third_party/pwn_rdoc.jsonl'
41
41
 
42
42
  # Tag for every 100 commits (i.e. 0.1.100, 0.1.200, etc)
43
43
  tag_this_version_bool=`ruby -r 'pwn' -e 'if (PWN::VERSION.split(".")[-1].to_i + 1) % 100 == 0; then print true; else print false; end'`
@@ -35,7 +35,7 @@ module PWN
35
35
  raise "ERROR: Unsupported type parameter value '#{type}'. Supported values are :opcodes_to_asm and :asm_to_opcodes."
36
36
  end
37
37
 
38
- PWN::AI::Introspection.reflect_on(
38
+ PWN::AI::Agent::Introspection.reflect_on(
39
39
  system_role_content: system_role_content,
40
40
  request: request,
41
41
  suppress_pii_warning: true
@@ -16,7 +16,7 @@ module PWN
16
16
 
17
17
  system_role_content = 'Provide a useful summary of this latest bitcoin block returned from a bitcoin node via getblockchaininfo.'
18
18
 
19
- PWN::AI::Introspection.reflect_on(
19
+ PWN::AI::Agent::Introspection.reflect_on(
20
20
  system_role_content: system_role_content,
21
21
  request: request,
22
22
  suppress_pii_warning: true
@@ -50,7 +50,7 @@ module PWN
50
50
  Analyze provided HTTP request/response pairs methodically: Start with a high-level overview, then dive into specifics, flag potential issues with evidence from the traffic, and end with PoC if applicable. Be verbose in reasoning but concise in output. Prioritize high-severity findings. If data is incomplete, request clarifications. If analyzing a JavaScript source map file (i.e. .js.map), focus on deobfuscating and identifying any potentially vulnerable code patterns, especially those that could lead to client-side vulnerabilities like DOM XSS, prototype pollution, or insecure deserialization. Look for patterns such as eval, document.write, innerHTML assignments, and event handlers that could be influenced by user input. Provide detailed analysis and PoCs if vulnerabilities are identified.
51
51
  '
52
52
 
53
- PWN::AI::Introspection.reflect_on(
53
+ PWN::AI::Agent::Introspection.reflect_on(
54
54
  system_role_content: system_role_content,
55
55
  request: request,
56
56
  suppress_pii_warning: true