pwn 0.5.613 → 0.5.615

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 (87) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +10 -10
  3. data/README.md +110 -24
  4. data/documentation/AI-Integration.md +36 -0
  5. data/documentation/BurpSuite.md +26 -0
  6. data/documentation/Contributing.md +31 -0
  7. data/documentation/Diagrams.md +57 -0
  8. data/documentation/Drivers.md +25 -0
  9. data/documentation/General-PWN-Usage.md +40 -0
  10. data/documentation/Home.md +51 -0
  11. data/documentation/How-PWN-Works.md +60 -0
  12. data/documentation/Installation.md +50 -0
  13. data/documentation/NmapIt.md +18 -0
  14. data/documentation/Plugins.md +59 -0
  15. data/documentation/Reporting.md +28 -0
  16. data/documentation/SAST.md +32 -0
  17. data/documentation/Skills-Memory-Learning.md +44 -0
  18. data/documentation/Transparent-Browser.md +32 -0
  19. data/documentation/Troubleshooting.md +38 -0
  20. data/documentation/What-is-PWN.md +34 -0
  21. data/documentation/Why-PWN.md +18 -0
  22. data/documentation/diagrams/ai-integration-tool-calling.svg +134 -0
  23. data/documentation/diagrams/burp-vs-zap-preference.svg +84 -0
  24. data/documentation/diagrams/code-scanning-sast.svg +112 -0
  25. data/documentation/diagrams/dot/ai-integration-tool-calling.dot +23 -0
  26. data/documentation/diagrams/dot/burp-vs-zap-preference.dot +15 -0
  27. data/documentation/diagrams/dot/code-scanning-sast.dot +21 -0
  28. data/documentation/diagrams/dot/driver-framework.dot +17 -0
  29. data/documentation/diagrams/dot/fuzzing-workflow.dot +27 -0
  30. data/documentation/diagrams/dot/history-to-drivers.dot +20 -0
  31. data/documentation/diagrams/dot/memory-skills-detailed.dot +28 -0
  32. data/documentation/diagrams/dot/network-infra-testing.dot +22 -0
  33. data/documentation/diagrams/dot/overall-pwn-architecture.dot +49 -0
  34. data/documentation/diagrams/dot/penetration-testing-workflow.dot +29 -0
  35. data/documentation/diagrams/dot/plugin-ecosystem.dot +31 -0
  36. data/documentation/diagrams/dot/pwn-ai-feedback-learning-loop.dot +57 -0
  37. data/documentation/diagrams/dot/pwn-repl-prototyping.dot +37 -0
  38. data/documentation/diagrams/dot/reporting-pipeline.dot +17 -0
  39. data/documentation/diagrams/dot/reverse-engineering-flow.dot +21 -0
  40. data/documentation/diagrams/dot/sessions-cron-automation.dot +17 -0
  41. data/documentation/diagrams/dot/web-application-testing.dot +27 -0
  42. data/documentation/diagrams/dot/zero-day-research-flow.dot +27 -0
  43. data/documentation/diagrams/driver-framework.svg +90 -0
  44. data/documentation/diagrams/fuzzing-workflow.svg +147 -0
  45. data/documentation/diagrams/history-to-drivers.svg +117 -0
  46. data/documentation/diagrams/memory-skills-detailed.svg +154 -0
  47. data/documentation/diagrams/network-infra-testing.svg +121 -0
  48. data/documentation/diagrams/overall-pwn-architecture.svg +234 -0
  49. data/documentation/diagrams/penetration-testing-workflow.svg +148 -0
  50. data/documentation/diagrams/plugin-ecosystem.svg +172 -0
  51. data/documentation/diagrams/pwn-ai-feedback-learning-loop.svg +234 -0
  52. data/documentation/diagrams/pwn-repl-prototyping.svg +179 -0
  53. data/documentation/diagrams/reporting-pipeline.svg +91 -0
  54. data/documentation/diagrams/reverse-engineering-flow.svg +114 -0
  55. data/documentation/diagrams/sessions-cron-automation.svg +92 -0
  56. data/documentation/diagrams/web-application-testing.svg +137 -0
  57. data/documentation/diagrams/zero-day-research-flow.svg +149 -0
  58. data/documentation/pwn-REPL.md +33 -0
  59. data/documentation/pwn-ai-Agent.md +43 -0
  60. data/lib/pwn/ai/agent/learning.rb +377 -0
  61. data/lib/pwn/ai/agent/loop.rb +18 -3
  62. data/lib/pwn/ai/agent/metrics.rb +155 -0
  63. data/lib/pwn/ai/agent/prompt_builder.rb +23 -3
  64. data/lib/pwn/ai/agent/tools/learning.rb +113 -0
  65. data/lib/pwn/ai/agent/tools/skills.rb +94 -8
  66. data/lib/pwn/ai/agent.rb +2 -0
  67. data/lib/pwn/ai/grok.rb +249 -106
  68. data/lib/pwn/config.rb +86 -13
  69. data/lib/pwn/plugins/monkey_patch.rb +2 -2
  70. data/lib/pwn/plugins/repl.rb +68 -3
  71. data/lib/pwn/version.rb +1 -1
  72. data/spec/lib/pwn/ai/agent/learning_spec.rb +68 -0
  73. data/spec/lib/pwn/ai/agent/metrics_spec.rb +27 -0
  74. data/spec/lib/pwn/ai/agent/tools/learning_spec.rb +30 -0
  75. metadata +84 -34
  76. data/documentation/PWN.png +0 -0
  77. data/documentation/PWN_Contributors_and_Users.png +0 -0
  78. data/documentation/fax-spectrogram.png +0 -0
  79. data/documentation/fax-waveform.png +0 -0
  80. data/documentation/frozen_string_literal_files_changed_from_false_to_true.txt +0 -54
  81. data/documentation/lifecycle_authz_replay.example.yaml +0 -27
  82. data/documentation/pwn_android_war_dialer_session.png +0 -0
  83. data/documentation/pwn_install.png +0 -0
  84. data/documentation/pwn_wallpaper.jpg +0 -0
  85. data/documentation/ringing-spectrogram.png +0 -0
  86. data/documentation/ringing-waveform.png +0 -0
  87. data/documentation/vulnerability_report_template.md +0 -37
@@ -0,0 +1,112 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
3
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <!-- Generated by graphviz version 14.1.2 (0)
5
+ -->
6
+ <!-- Title: PWN Code Scanning &amp; SAST Pages: 1 -->
7
+ <svg width="930pt" height="137pt"
8
+ viewBox="0.00 0.00 930.00 137.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 132.75)">
10
+ <title>PWN Code Scanning &amp; SAST</title>
11
+ <polygon fill="white" stroke="none" points="-4,4 -4,-132.75 926.19,-132.75 926.19,4 -4,4"/>
12
+ <!-- Source -->
13
+ <g id="node1" class="node">
14
+ <title>Source</title>
15
+ <path fill="none" stroke="black" d="M62.5,-36C62.5,-36 12,-36 12,-36 6,-36 0,-30 0,-24 0,-24 0,-12 0,-12 0,-6 6,0 12,0 12,0 62.5,0 62.5,0 68.5,0 74.5,-6 74.5,-12 74.5,-12 74.5,-24 74.5,-24 74.5,-30 68.5,-36 62.5,-36"/>
16
+ <text xml:space="preserve" text-anchor="middle" x="37.25" y="-19.95" font-family="Arial" font-size="9.00">Source Code</text>
17
+ <text xml:space="preserve" text-anchor="middle" x="37.25" y="-9.45" font-family="Arial" font-size="9.00">(Git, Local Dir)</text>
18
+ </g>
19
+ <!-- SAST -->
20
+ <g id="node2" class="node">
21
+ <title>SAST</title>
22
+ <ellipse fill="none" stroke="black" cx="174.26" cy="-55" rx="62.76" ry="20.51"/>
23
+ <text xml:space="preserve" text-anchor="middle" x="174.26" y="-56.95" font-family="Arial" font-size="9.00">PWN::SAST</text>
24
+ <text xml:space="preserve" text-anchor="middle" x="174.26" y="-46.45" font-family="Arial" font-size="9.00">(analyze, testgen)</text>
25
+ </g>
26
+ <!-- Source&#45;&gt;SAST -->
27
+ <g id="edge1" class="edge">
28
+ <title>Source&#45;&gt;SAST</title>
29
+ <path fill="none" stroke="black" d="M74.78,-28.01C86.93,-31.34 100.77,-35.13 114.17,-38.81"/>
30
+ <polygon fill="black" stroke="black" points="113.24,-42.18 123.81,-41.45 115.09,-35.43 113.24,-42.18"/>
31
+ </g>
32
+ <!-- Static -->
33
+ <g id="node3" class="node">
34
+ <title>Static</title>
35
+ <path fill="none" stroke="black" d="M374.76,-128.75C374.76,-128.75 286.01,-128.75 286.01,-128.75 280.01,-128.75 274.01,-122.75 274.01,-116.75 274.01,-116.75 274.01,-101.25 274.01,-101.25 274.01,-95.25 280.01,-89.25 286.01,-89.25 286.01,-89.25 374.76,-89.25 374.76,-89.25 380.76,-89.25 386.76,-95.25 386.76,-101.25 386.76,-101.25 386.76,-116.75 386.76,-116.75 386.76,-122.75 380.76,-128.75 374.76,-128.75"/>
36
+ <text xml:space="preserve" text-anchor="middle" x="330.39" y="-116.2" font-family="Arial" font-size="9.00">Static Analysis</text>
37
+ <text xml:space="preserve" text-anchor="middle" x="330.39" y="-105.7" font-family="Arial" font-size="9.00">(RuboCop, Brakeman,</text>
38
+ <text xml:space="preserve" text-anchor="middle" x="330.39" y="-95.2" font-family="Arial" font-size="9.00">Semgrep, custom rules)</text>
39
+ </g>
40
+ <!-- SAST&#45;&gt;Static -->
41
+ <g id="edge2" class="edge">
42
+ <title>SAST&#45;&gt;Static</title>
43
+ <path fill="none" stroke="black" d="M218.19,-70.04C232.16,-74.94 248,-80.49 263.26,-85.83"/>
44
+ <polygon fill="black" stroke="black" points="261.68,-88.99 272.27,-88.99 263.99,-82.38 261.68,-88.99"/>
45
+ </g>
46
+ <!-- TestGen -->
47
+ <g id="node4" class="node">
48
+ <title>TestGen</title>
49
+ <path fill="none" stroke="black" d="M369.14,-71C369.14,-71 291.64,-71 291.64,-71 285.64,-71 279.64,-65 279.64,-59 279.64,-59 279.64,-47 279.64,-47 279.64,-41 285.64,-35 291.64,-35 291.64,-35 369.14,-35 369.14,-35 375.14,-35 381.14,-41 381.14,-47 381.14,-47 381.14,-59 381.14,-59 381.14,-65 375.14,-71 369.14,-71"/>
50
+ <text xml:space="preserve" text-anchor="middle" x="330.39" y="-54.95" font-family="Arial" font-size="9.00">Test Case Gen</text>
51
+ <text xml:space="preserve" text-anchor="middle" x="330.39" y="-44.45" font-family="Arial" font-size="9.00">(unit/integration fuzz)</text>
52
+ </g>
53
+ <!-- SAST&#45;&gt;TestGen -->
54
+ <g id="edge3" class="edge">
55
+ <title>SAST&#45;&gt;TestGen</title>
56
+ <path fill="none" stroke="black" d="M237.06,-54.2C247.28,-54.07 257.88,-53.93 268.09,-53.8"/>
57
+ <polygon fill="black" stroke="black" points="267.94,-57.3 277.9,-53.67 267.85,-50.3 267.94,-57.3"/>
58
+ </g>
59
+ <!-- Findings -->
60
+ <g id="node5" class="node">
61
+ <title>Findings</title>
62
+ <path fill="none" stroke="black" d="M578.26,-73C578.26,-73 521.76,-73 521.76,-73 515.76,-73 509.76,-67 509.76,-61 509.76,-61 509.76,-49 509.76,-49 509.76,-43 515.76,-37 521.76,-37 521.76,-37 578.26,-37 578.26,-37 584.26,-37 590.26,-43 590.26,-49 590.26,-49 590.26,-61 590.26,-61 590.26,-67 584.26,-73 578.26,-73"/>
63
+ <text xml:space="preserve" text-anchor="middle" x="550.01" y="-56.95" font-family="Arial" font-size="9.00">Vulns / Findings</text>
64
+ <text xml:space="preserve" text-anchor="middle" x="550.01" y="-46.45" font-family="Arial" font-size="9.00">(CWE mapped)</text>
65
+ </g>
66
+ <!-- Static&#45;&gt;Findings -->
67
+ <g id="edge4" class="edge">
68
+ <title>Static&#45;&gt;Findings</title>
69
+ <path fill="none" stroke="black" d="M387.15,-95.16C421.54,-86.63 465.3,-75.77 498.65,-67.5"/>
70
+ <polygon fill="black" stroke="black" points="499.2,-70.97 508.06,-65.16 497.51,-64.17 499.2,-70.97"/>
71
+ </g>
72
+ <!-- TestGen&#45;&gt;Findings -->
73
+ <g id="edge5" class="edge">
74
+ <title>TestGen&#45;&gt;Findings</title>
75
+ <path fill="none" stroke="black" d="M381.59,-53.46C416.55,-53.78 463.02,-54.21 498.13,-54.53"/>
76
+ <polygon fill="black" stroke="black" points="498.02,-58.03 508.05,-54.62 498.08,-51.03 498.02,-58.03"/>
77
+ </g>
78
+ <!-- Reports -->
79
+ <g id="node6" class="node">
80
+ <title>Reports</title>
81
+ <ellipse fill="none" stroke="black" cx="713.35" cy="-55" rx="86.09" ry="20.51"/>
82
+ <text xml:space="preserve" text-anchor="middle" x="713.35" y="-56.95" font-family="Arial" font-size="9.00">PWN::Reports</text>
83
+ <text xml:space="preserve" text-anchor="middle" x="713.35" y="-46.45" font-family="Arial" font-size="9.00">(generate PDF/MD/JSON)</text>
84
+ </g>
85
+ <!-- Findings&#45;&gt;Reports -->
86
+ <g id="edge6" class="edge">
87
+ <title>Findings&#45;&gt;Reports</title>
88
+ <path fill="none" stroke="black" d="M590.48,-55C598.29,-55 606.79,-55 615.57,-55"/>
89
+ <polygon fill="black" stroke="black" points="615.28,-58.5 625.28,-55 615.28,-51.5 615.28,-58.5"/>
90
+ </g>
91
+ <!-- REPL -->
92
+ <g id="node7" class="node">
93
+ <title>REPL</title>
94
+ <path fill="none" stroke="black" d="M910.19,-36C910.19,-36 848.44,-36 848.44,-36 842.44,-36 836.44,-30 836.44,-24 836.44,-24 836.44,-12 836.44,-12 836.44,-6 842.44,0 848.44,0 848.44,0 910.19,0 910.19,0 916.19,0 922.19,-6 922.19,-12 922.19,-12 922.19,-24 922.19,-24 922.19,-30 916.19,-36 910.19,-36"/>
95
+ <text xml:space="preserve" text-anchor="middle" x="879.32" y="-19.95" font-family="Arial" font-size="9.00">REPL / Agent</text>
96
+ <text xml:space="preserve" text-anchor="middle" x="879.32" y="-9.45" font-family="Arial" font-size="9.00">(inspect findings)</text>
97
+ </g>
98
+ <!-- Reports&#45;&gt;REPL -->
99
+ <g id="edge7" class="edge">
100
+ <title>Reports&#45;&gt;REPL</title>
101
+ <path fill="none" stroke="black" d="M776.81,-40.91C792.83,-37.29 809.91,-33.44 825.4,-29.94"/>
102
+ <polygon fill="black" stroke="black" points="825.89,-33.42 834.88,-27.8 824.35,-26.59 825.89,-33.42"/>
103
+ </g>
104
+ <!-- REPL&#45;&gt;Source -->
105
+ <g id="edge8" class="edge">
106
+ <title>REPL&#45;&gt;Source</title>
107
+ <path fill="none" stroke="black" d="M836.25,-13.22C803.17,-9.88 755.88,-6 714.35,-6 173.26,-6 173.26,-6 173.26,-6 144.28,-6 111.94,-8.78 86.18,-11.66"/>
108
+ <polygon fill="black" stroke="black" points="85.87,-8.17 76.35,-12.81 86.69,-15.12 85.87,-8.17"/>
109
+ <text xml:space="preserve" text-anchor="middle" x="448.26" y="-9.2" font-family="Times,serif" font-size="14.00">patch &amp; re&#45;scan</text>
110
+ </g>
111
+ </g>
112
+ </svg>
@@ -0,0 +1,23 @@
1
+ digraph "PWN AI Integration & Tool Calling" {
2
+ rankdir=LR;
3
+ node [shape=box, style=rounded, fontname="Arial", fontsize=9];
4
+
5
+ User [label="User Prompt"];
6
+ Agent [label="PWN::AI::Agent", shape=ellipse, fillcolor=lightblue];
7
+ LLM [label="LLM (Grok OAuth,\nOpenAI, etc.)", shape=box];
8
+ Tools [label="Tool Registry\n(pwn_eval, shell,\nmemory_*, skill_*, \nlearning_*)", shape=box];
9
+ PWNNS [label="PWN Namespace\n(Plugins, SAST,\nReports, etc.)", shape=box];
10
+ External [label="External Tools\n(curl, nmap, msf, burp)", shape=box];
11
+
12
+ User -> Agent;
13
+ Agent -> LLM [label="build prompt +\ntools schema"];
14
+ LLM -> Agent [label="tool_calls[]"];
15
+ Agent -> Tools [label="dispatch"];
16
+ Tools -> PWNNS [label="PWN::Plugins::XXX.method"];
17
+ Tools -> External [label="shell commands"];
18
+ PWNNS -> Tools [label="return value\nor exception"];
19
+ External -> Tools [label="stdout/stderr"];
20
+ Tools -> Agent [label="results"];
21
+ Agent -> LLM [label="continue conversation"];
22
+ Agent -> User [label="final answer + artifacts"];
23
+ }
@@ -0,0 +1,15 @@
1
+ digraph "PWN BurpSuite vs Zaproxy Preference" {
2
+ rankdir=LR;
3
+ node [shape=box, style=rounded, fontname="Arial", fontsize=9];
4
+
5
+ Decision [label="Web Proxy Choice\nin PWN", shape=diamond, fillcolor=lightyellow];
6
+ Burp [label="PWN::Plugins::BurpSuite\n(preferred for most cases)\n- Comprehensive scanning\n- Rich ecosystem\n- Active scan + extensions", shape=box, fillcolor=lightgreen];
7
+ Zap [label="PWN::Plugins::Zaproxy\n(fallback)\n- Open source\n- REST API scans", shape=box, fillcolor=lightblue];
8
+
9
+ UserTask [label="Web App Test Task"];
10
+ UserTask -> Decision;
11
+ Decision -> Burp [label="default / most features"];
12
+ Decision -> Zap [label="if Burp unavailable\nor specific REST need"];
13
+ Burp -> "Scan / Proxy / Exploit";
14
+ Zap -> "Scan / Proxy / Exploit";
15
+ }
@@ -0,0 +1,21 @@
1
+ digraph "PWN Code Scanning & SAST" {
2
+ rankdir=LR;
3
+ node [shape=box, style=rounded, fontname="Arial", fontsize=9];
4
+
5
+ Source [label="Source Code\n(Git, Local Dir)", shape=box];
6
+ SAST [label="PWN::SAST\n(analyze, testgen)", shape=ellipse, fillcolor=lightgreen];
7
+ Static [label="Static Analysis\n(RuboCop, Brakeman,\nSemgrep, custom rules)"];
8
+ TestGen [label="Test Case Gen\n(unit/integration fuzz)"];
9
+ Findings [label="Vulns / Findings\n(CWE mapped)", shape=box];
10
+ Reports [label="PWN::Reports\n(generate PDF/MD/JSON)", shape=ellipse, fillcolor=lightgreen];
11
+ REPL [label="REPL / Agent\n(inspect findings)"];
12
+
13
+ Source -> SAST;
14
+ SAST -> Static;
15
+ SAST -> TestGen;
16
+ Static -> Findings;
17
+ TestGen -> Findings;
18
+ Findings -> Reports;
19
+ Reports -> REPL;
20
+ REPL -> Source [label="patch & re-scan"];
21
+ }
@@ -0,0 +1,17 @@
1
+ digraph "PWN Driver Framework" {
2
+ rankdir=LR;
3
+ node [shape=box, style=rounded, fontname="Arial", fontsize=9];
4
+
5
+ Parser [label="PWN::Driver::Parser\n(OptionParser + auto_opts)"];
6
+ Script [label="Driver Script\n(bin/pwn_* or custom)"];
7
+ PWNLoad [label="require 'pwn'\nFull namespace"];
8
+ Orchestrate [label="Orchestration Logic\n(plugins + AI + loops)"];
9
+ Outputs [label="Reports, Logs,\nFindings"];
10
+
11
+ Script -> Parser;
12
+ Parser -> Script;
13
+ Script -> PWNLoad;
14
+ PWNLoad -> Orchestrate;
15
+ Orchestrate -> Outputs;
16
+ Script -> "standalone | cron | pwn-ai";
17
+ }
@@ -0,0 +1,27 @@
1
+ digraph "PWN Fuzzing Workflows" {
2
+ rankdir=LR;
3
+ node [shape=box, style=rounded, fontname="Arial", fontsize=9];
4
+
5
+ Input [label="Input Corpus\n(Seeds, Mutators)", shape=box];
6
+ FuzzProto [label="Protocol Fuzz\n(pwn_fuzz_net_app_proto)"];
7
+ FuzzFile [label="File / Format Fuzz"];
8
+ FuzzNet [label="Network Service Fuzz"];
9
+ FuzzWeb [label="Web App Fuzz\n(XSS vectors, etc.)"];
10
+ PWNfuzz [label="PWN::Plugins::Fuzz", shape=ellipse];
11
+ Monitor [label="Monitor Crashes\n(PS, logging, core dumps)"];
12
+ Corpus [label="Interesting Inputs\n(saved for replay)", shape=cylinder];
13
+ Crash [label="Crash Analysis\n(identify root cause)", shape=ellipse];
14
+
15
+ Input -> PWNfuzz;
16
+ PWNfuzz -> FuzzProto;
17
+ PWNfuzz -> FuzzFile;
18
+ PWNfuzz -> FuzzNet;
19
+ PWNfuzz -> FuzzWeb;
20
+ FuzzProto -> Monitor;
21
+ FuzzFile -> Monitor;
22
+ FuzzNet -> Monitor;
23
+ FuzzWeb -> Monitor;
24
+ Monitor -> Corpus;
25
+ Monitor -> Crash;
26
+ Crash -> Input [label="refine mutators"];
27
+ }
@@ -0,0 +1,20 @@
1
+ digraph "History Command to Driver Generation" {
2
+ rankdir=TB;
3
+ node [shape=box, style=rounded, fontname="Arial", fontsize=9];
4
+
5
+ User [label="User in REPL"];
6
+ Pry [label="PWN REPL\n(history, edit, save)"];
7
+ HistoryFile [label="~/.pry_history\n(raw commands)", shape=cylinder, fillcolor=lightyellow];
8
+ Script [label="Prototype Script\n(.rb or bin/)", shape=box];
9
+ Driver [label="PWN Driver\n(/opt/pwn/bin/ example\nor PWN::Driver::Parser)", shape=box];
10
+ Skill [label="Distilled Skill\n(~/.pwn/skills/)", shape=cylinder, fillcolor=lightyellow];
11
+ Agent [label="pwn-ai Agent\n(future automation)"];
12
+
13
+ User -> Pry [label="run exploration cmds"];
14
+ Pry -> HistoryFile [label="appends each line"];
15
+ Pry -> Script [label="history | grep > my_proto.rb\nor edit -n"];
16
+ Script -> Driver [label="wrap in PWN::Driver\nadd opts, orchestration"];
17
+ Script -> Skill [label="manually or via\ndistill_skill after success"];
18
+ Driver -> Agent [label="invoked by agent\nor cron"];
19
+ Skill -> Agent [label="loaded in prompt context"];
20
+ }
@@ -0,0 +1,28 @@
1
+ digraph "PWN Memory & Skills Detailed Data Flow" {
2
+ rankdir=TB;
3
+ node [shape=box, style=rounded, fontname="Arial", fontsize=9];
4
+
5
+ Input [label="Successful Task\nOutcome in Agent"];
6
+ Learn [label="PWN::AI::Agent::Learning\nnote_outcome"];
7
+ Metrics [label="Metrics (success/duration)"];
8
+ Introspect [label="learning_reflect\n+ LLM introspection"];
9
+ Distill [label="learning_distill_skill"];
10
+ SkillCreate [label="skill_create / edit"];
11
+ SkillStore [label="~/.pwn/skills/*.md\n(YAML frontmatter\n+ markdown + references)", shape=cylinder, fillcolor=lightyellow];
12
+ MemStore [label="~/.pwn/memory.json", shape=cylinder, fillcolor=lightyellow];
13
+ SkillList [label="skill_list / skill_view"];
14
+ AgentPrompt [label="Agent System Prompt\n(injects skills + memory)"];
15
+ Recall [label="memory_recall"];
16
+
17
+ Input -> Learn;
18
+ Learn -> Metrics;
19
+ Learn -> Introspect;
20
+ Introspect -> Distill;
21
+ Distill -> SkillCreate;
22
+ SkillCreate -> SkillStore;
23
+ SkillStore -> SkillList;
24
+ SkillList -> AgentPrompt;
25
+ Input -> MemStore [label="remember key facts"];
26
+ Recall -> AgentPrompt;
27
+ MemStore -> Recall;
28
+ }
@@ -0,0 +1,22 @@
1
+ digraph "Network & Infrastructure Testing with PWN" {
2
+ rankdir=TB;
3
+ node [shape=box, style=rounded, fontname="Arial", fontsize=9];
4
+
5
+ Targets [label="Targets\n(IPs, Domains, ASNs)", shape=box];
6
+ Discovery [label="Discovery\n(NmapIt, pwn_nmap_discover,\nShodan, IPInfo, crt.sh)"];
7
+ Enum [label="Service Enum\n(portscan, version, scripts)"];
8
+ Auth [label="Auth Testing\n(basic_auth, DAOs,\ncredential spray)"];
9
+ VulnScan [label="Vuln Scanning\n(NessusCloud, OpenVAS,\nNexpose, Zaproxy)"];
10
+ Packet [label="Packet Crafting\n(PWN::Plugins::Packet,\nSock, Tor)"];
11
+ Infra [label="Infra Specific\n(AWS, Jenkins, Jira,\nVsphere, RabbitMQ)"];
12
+ ExploitNet [label="Network Exploits"];
13
+
14
+ Targets -> Discovery;
15
+ Discovery -> Enum;
16
+ Enum -> Auth;
17
+ Auth -> VulnScan;
18
+ VulnScan -> Packet;
19
+ Packet -> ExploitNet;
20
+ VulnScan -> Infra;
21
+ Infra -> ExploitNet;
22
+ }
@@ -0,0 +1,49 @@
1
+ digraph "PWN Overall Architecture" {
2
+ rankdir=TB;
3
+ node [shape=box, style=rounded, fontname="Arial", fontsize=9];
4
+ edge [fontname="Arial", fontsize=8];
5
+
6
+ User [label="End User\n(Researcher, pwn-ai)", shape=box];
7
+ REPL [label="PWN REPL\n(pry + pwn)", shape=ellipse, fillcolor=lightgreen, style=filled];
8
+ AI [label="PWN::AI\n(Agent + Providers)", shape=ellipse, fillcolor=lightblue, style=filled];
9
+
10
+ subgraph cluster_core {
11
+ label="Core PWN";
12
+ color=darkblue;
13
+ Plugins [label="PWN::Plugins\n(67+ modules:\nBurp, NmapIt,\nMetasploit, Fuzz,\nTransparentBrowser...)" , shape=box];
14
+ SAST [label="PWN::SAST", shape=box];
15
+ Reports [label="PWN::Reports", shape=box];
16
+ Driver [label="PWN::Driver", shape=box];
17
+ Memory [label="PWN::Memory", shape=box];
18
+ }
19
+
20
+ subgraph cluster_persistent {
21
+ label="Persistent Layer";
22
+ color=darkgreen;
23
+ Skills [label="PWN::Skills\n(~/.pwn/skills)", shape=cylinder, fillcolor=lightyellow];
24
+ Sess [label="PWN::Sessions", shape=cylinder, fillcolor=lightyellow];
25
+ Cron [label="PWN::Cron", shape=cylinder, fillcolor=lightyellow];
26
+ Learn [label="Learning\n(Metrics + JSONL)", shape=cylinder, fillcolor=lightyellow];
27
+ }
28
+
29
+ BinDrivers [label="/opt/pwn/bin/\n(Drivers & CLIs)", shape=box];
30
+
31
+ User -> REPL [label="pwn / pwn-ai"];
32
+ REPL -> AI [label="launch pwn-ai"];
33
+ REPL -> Plugins [label="direct invocation"];
34
+ REPL -> SAST;
35
+ REPL -> Reports;
36
+ REPL -> Driver;
37
+ AI -> Plugins [label="tool calls\npwn_eval"];
38
+ AI -> Memory [label="remember/recall"];
39
+ REPL -> Memory;
40
+ REPL -> BinDrivers;
41
+ Driver -> BinDrivers;
42
+ Plugins -> Learn;
43
+ AI -> Learn [label="distill skills"];
44
+ Learn -> Skills [label="promote successful"];
45
+ Skills -> AI [label="context injection"];
46
+ Skills -> REPL;
47
+ Cron -> REPL [label="schedule drivers/agents"];
48
+ Sess -> REPL [label="replay / audit"];
49
+ }
@@ -0,0 +1,29 @@
1
+ digraph "PWN Penetration Testing Workflow" {
2
+ rankdir=TB;
3
+ node [shape=box, style=rounded, fontname="Arial", fontsize=9];
4
+ edge [fontname="Arial", fontsize=8];
5
+
6
+ Target [label="Target System\n(Host, Network, App)", shape=box];
7
+
8
+ Recon [label="Recon\n(NmapIt, Shodan,\nIPInfo, crt.sh)", shape=ellipse, fillcolor=lightblue];
9
+ Scanning [label="Vuln Scanning\n(OpenVAS, Nessus,\nNexpose, ZAP/Burp)", shape=ellipse, fillcolor=lightblue];
10
+ Web [label="Web App Testing\n(TransparentBrowser,\nBurpSuite, Zaproxy,\nURI Buster)", shape=ellipse, fillcolor=lightblue];
11
+ Fuzz [label="Fuzzing\n(PWN::Plugins::Fuzz,\npwn_fuzz_net_app_proto)", shape=ellipse, fillcolor=lightblue];
12
+ Exploit [label="Exploitation\n(Metasploit, custom\nBeEF, Serial, etc.)", shape=ellipse, fillcolor=lightcoral];
13
+ Post [label="Post-Exploitation\n(PS, FileFu, SSH,\ncredential extraction)", shape=ellipse, fillcolor=lightcoral];
14
+ Report [label="Reporting\n(PWN::Reports)", shape=ellipse, fillcolor=lightgreen];
15
+
16
+ MemorySkills [label="Memory + Skills\n(persistent context)", shape=cylinder];
17
+
18
+ Target -> Recon;
19
+ Recon -> Scanning;
20
+ Scanning -> Web;
21
+ Web -> Fuzz;
22
+ Fuzz -> Exploit;
23
+ Exploit -> Post;
24
+ Post -> Report;
25
+
26
+ Report -> MemorySkills [label="note outcomes"];
27
+ MemorySkills -> Recon [label="recall previous\nfindings"];
28
+ MemorySkills -> Exploit [label="reuse exploits"];
29
+ }
@@ -0,0 +1,31 @@
1
+ digraph "PWN Plugin Ecosystem" {
2
+ rankdir=TB;
3
+ node [shape=box, style=rounded, fontname="Arial", fontsize=8];
4
+ edge [fontsize=7];
5
+
6
+ Hub [label="PWN::Plugins", shape=ellipse, fillcolor=lightblue];
7
+ Recon [label="Recon & Discovery\n(NmapIt, Shodan, IPInfo,\nHunter, crt.sh, Git)"];
8
+ Web [label="Web & Proxy\n(TransparentBrowser,\nBurpSuite, Zaproxy,\nSpider, URI Buster)"];
9
+ Vuln [label="Vulnerability\n(Fuzz, Metasploit,\nNessus, OpenVAS,\nNexpose, DefectDojo)"];
10
+ Auth [label="Auth & Access\n(OAuth2, BasicAuth,\nDAOs, Vault)"];
11
+ Infra [label="Infrastructure\n(Jenkins, AWS, Jira,\nRabbitMQ, Vsphere)"];
12
+ LowLevel [label="Low Level &\nHardware\n(Serial, BusPirate,\nPacket, Sock, Tor,\nAndroid, Assembly)"];
13
+ Util [label="Utilities\n(FileFu, Char, XXD,\nPS, Reports helpers)"];
14
+ SDR [label="SDR & RF\n(SDR, gqrx)"];
15
+ Other [label="Misc\n(BeEF, OCR, PDFParse,\nScannableCodes, etc.)"];
16
+
17
+ Hub -> Recon;
18
+ Hub -> Web;
19
+ Hub -> Vuln;
20
+ Hub -> Auth;
21
+ Hub -> Infra;
22
+ Hub -> LowLevel;
23
+ Hub -> Util;
24
+ Hub -> SDR;
25
+ Hub -> Other;
26
+
27
+ Recon -> Vuln;
28
+ Web -> Vuln;
29
+ Auth -> Vuln;
30
+ Infra -> Vuln;
31
+ }
@@ -0,0 +1,57 @@
1
+ digraph "PWN-AI Feedback Learning Loop" {
2
+ rankdir=TB;
3
+ node [shape=box, style=rounded, fontname="Arial", fontsize=10];
4
+ edge [fontname="Arial", fontsize=9];
5
+
6
+ // External Entities
7
+ User [label="Security Researcher\n(User / pwn-ai)", shape=box];
8
+ LLM [label="LLM Providers\n(Grok/OAuth, OpenAI,\nAnthropic, Gemini, Ollama)", shape=box];
9
+
10
+ // Processes
11
+ subgraph cluster_agent {
12
+ label="PWN::AI::Agent";
13
+ style=rounded;
14
+ color=blue;
15
+
16
+ PwnAI [label="pwn-ai TUI\n(Natural Language Interface)", shape=ellipse, style=filled, fillcolor=lightblue];
17
+ ToolCall [label="Tool Calling Dispatcher\n(pwn_eval, shell, memory,\nskill_list, etc.)", shape=ellipse, style=filled, fillcolor=lightblue];
18
+ Introspection [label="Introspection &\nReflection", shape=ellipse, style=filled, fillcolor=lightblue];
19
+ }
20
+
21
+ // Data Stores
22
+ Memory [label="PWN::Memory\n(~/.pwn/memory.json)", shape=cylinder, fillcolor=lightyellow];
23
+ Metrics [label="PWN::AI::Agent::Metrics\n(~/.pwn/metrics.json)", shape=cylinder, fillcolor=lightyellow];
24
+ Learning [label="PWN::AI::Agent::Learning\n(~/.pwn/learning.jsonl)", shape=cylinder, fillcolor=lightyellow];
25
+ Skills [label="PWN::Skills\n(~/.pwn/skills/*.md)", shape=cylinder, fillcolor=lightyellow];
26
+ History [label="Pry History /\nSession Logs", shape=cylinder, fillcolor=lightyellow];
27
+
28
+ // External / Other
29
+ REPL [label="PWN REPL\n(Full PWN namespace)", shape=box];
30
+
31
+ // Flows
32
+ User -> PwnAI [label="Natural language task\n(e.g. scan + exploit + report)"];
33
+ PwnAI -> ToolCall [label="Parse intent, plan steps"];
34
+ ToolCall -> REPL [label="pwn_eval(code) or shell(cmd)"];
35
+ REPL -> ToolCall [label="Results / stdout / exceptions"];
36
+ ToolCall -> LLM [label="If needed for decisioning"];
37
+ LLM -> ToolCall [label="Responses"];
38
+
39
+ ToolCall -> Memory [label="remember(key, val)"];
40
+ Memory -> ToolCall [label="recall(query) injected\ninto prompts"];
41
+
42
+ ToolCall -> Metrics [label="record(success, duration,\ntool=...)"];
43
+ Metrics -> Introspection [label="per-tool stats"];
44
+
45
+ ToolCall -> Learning [label="note_outcome(task, success, details)"];
46
+ Learning -> Introspection [label="reflect on transcript"];
47
+
48
+ Introspection -> Skills [label="distill_skill(name, content,\nreferences)"];
49
+ Skills -> ToolCall [label="skill_list / skill_view\ninjected into future prompts"];
50
+
51
+ Introspection -> History [label="Update session"];
52
+
53
+ User -> History [label="history command to\ninspect previous"];
54
+ History -> PwnAI [label="context from prior sessions"];
55
+
56
+ PwnAI -> User [label="Results, reports, next steps"];
57
+ }
@@ -0,0 +1,37 @@
1
+ digraph "PWN REPL Prototyping & Development" {
2
+ rankdir=LR;
3
+ node [shape=box, style=rounded, fontname="Arial", fontsize=9];
4
+ edge [fontname="Arial", fontsize=8];
5
+
6
+ User [label="User\n(Researcher)", shape=box];
7
+ Shell [label="shell (pwn command)", shape=box];
8
+ Pry [label="Pry REPL\n(PWN preloaded)", shape=ellipse, fillcolor=lightgreen, style=filled];
9
+
10
+ subgraph cluster_pwn {
11
+ label="PWN Namespace";
12
+ color=navy;
13
+ Plugins [label="PWN::Plugins::\n(Burp, NmapIt,\nTransparentBrowser,\nMetasploit, etc.)", shape=box];
14
+ SAST [label="PWN::SAST\n(Static Analysis\n+ Testgen)", shape=box];
15
+ Reports [label="PWN::Reports", shape=box];
16
+ Driver [label="PWN::Driver\n(Parser, auto_opts)", shape=box];
17
+ AI [label="PWN::AI::\n(Agent, Grok, etc.)", shape=box];
18
+ }
19
+
20
+ History [label="Pry Command History\n(~/.pry_history)", shape=cylinder, fillcolor=yellow];
21
+ Scripts [label="Custom Scripts\n& Prototypes (.rb)", shape=box];
22
+
23
+ User -> Shell [label="pwn"];
24
+ Shell -> Pry [label="starts"];
25
+ Pry -> Plugins [label="direct method calls"];
26
+ Pry -> SAST [label="PWN::SAST.analyze..."];
27
+ Pry -> Reports [label="PWN::Reports.generate"];
28
+ Pry -> AI [label="pwn-ai or direct"];
29
+ Pry -> History [label="every cmd logged"];
30
+ Pry -> Scripts [label="save / edit\nprototype"];
31
+
32
+ History -> Pry [label="history\nup-arrow\nctrl-r search"];
33
+ Scripts -> Pry [label="load / require\ncopy-paste"];
34
+ Scripts -> Driver [label="wrap as driver"];
35
+
36
+ Pry -> User [label="interactive results\ninspect / pp / tab-complete"];
37
+ }
@@ -0,0 +1,17 @@
1
+ digraph "PWN Reporting Pipeline" {
2
+ rankdir=LR;
3
+ node [shape=box, style=rounded, fontname="Arial", fontsize=9];
4
+
5
+ Findings [label="Raw Findings\n(Scan results,\nagent outputs,\nexploits, SAST)", shape=box];
6
+ Reports [label="PWN::Reports", shape=ellipse, fillcolor=lightgreen];
7
+ Templates [label="Templates\n(Markdown, PDF,\nJSON, CSV, HTML)", shape=cylinder];
8
+ Outputs [label="Generated Reports\n(DefectDojo import,\nJira tickets, PDFs)", shape=box];
9
+ Memory [label="PWN::Memory", shape=cylinder, fillcolor=lightyellow];
10
+
11
+ Findings -> Reports;
12
+ Reports -> Templates;
13
+ Templates -> Reports;
14
+ Reports -> Outputs [label="generate"];
15
+ Reports -> Memory [label="store summary"];
16
+ Memory -> Reports [label="enrich with context"];
17
+ }
@@ -0,0 +1,21 @@
1
+ digraph "PWN Reverse Engineering Flow" {
2
+ rankdir=TB;
3
+ node [shape=box, style=rounded, fontname="Arial", fontsize=9];
4
+
5
+ Binary [label="Binary / Firmware\n(ELF, PE, APK,\nSerial devices)", shape=box];
6
+ RE [label="RE Tools\n(XXD, Assembly,\nStrings, objdump,\nRadare/Ghidra via shell)"];
7
+ PWNRE [label="PWN::Plugins::\nAssembly, XXD,\nSerial, BusPirate"];
8
+ Analysis [label="Analysis\n(Deobfuscate, patch,\nidentify vulns)", shape=ellipse];
9
+ FuzzRE [label="Targeted Fuzzing"];
10
+ ExploitRE [label="Craft Exploit\n(ROP, shellcode)"];
11
+ Test [label="Validate in REPL"];
12
+
13
+ Binary -> RE;
14
+ RE -> PWNRE;
15
+ PWNRE -> Analysis;
16
+ Analysis -> FuzzRE;
17
+ Analysis -> ExploitRE;
18
+ FuzzRE -> ExploitRE;
19
+ ExploitRE -> Test;
20
+ Test -> Binary [label="re-analyze"];
21
+ }
@@ -0,0 +1,17 @@
1
+ digraph "PWN Sessions, Cron & Scheduled Automation" {
2
+ rankdir=TB;
3
+ node [shape=box, style=rounded, fontname="Arial", fontsize=9];
4
+
5
+ Agent [label="pwn-ai Agent / REPL"];
6
+ Sessions [label="PWN::Sessions\n(record/replay,\ntranscripts)", shape=cylinder, fillcolor=lightyellow];
7
+ Cron [label="PWN::Cron\n(scheduled tasks)", shape=ellipse, fillcolor=lightcoral];
8
+ Drivers [label="Drivers &\nBin Scripts"];
9
+ Memory [label="PWN::Memory", shape=cylinder, fillcolor=lightyellow];
10
+
11
+ Agent -> Sessions [label="save / load"];
12
+ Cron -> Drivers [label="invoke on schedule"];
13
+ Cron -> Agent [label="run autonomous pwn-ai jobs"];
14
+ Drivers -> Agent [label="orchestrate"];
15
+ Sessions -> Memory [label="persist key facts"];
16
+ Memory -> Cron [label="use recalled context\nfor jobs"];
17
+ }
@@ -0,0 +1,27 @@
1
+ digraph "Web Application Testing with PWN" {
2
+ rankdir=TB;
3
+ node [shape=box, style=rounded, fontname="Arial", fontsize=9];
4
+ edge [fontsize=8];
5
+
6
+ App [label="Web App\n(URL, API, SPA)", shape=box];
7
+
8
+ Proxy [label="Proxy Interception\n(BurpSuite (preferred),\nZaproxy)", shape=ellipse, fillcolor=lightblue];
9
+ Spider [label="Spider / Crawl\n(TransparentBrowser,\nSpider plugin)"];
10
+ ActiveScan [label="Active Scans\n(Burp active, ZAP active,\npwn_*_active_scan)"];
11
+ Manual [label="Manual + Assisted\n(URI Buster, XSS vectors,\nchar encodings, web_cache)"];
12
+ API [label="API Testing\n(OpenAPI, JSONPathify,\nGraphQL introspection)"];
13
+ AuthWeb [label="Auth & Session\n(OAuth2, BasicAuth,\nJWT handling)"];
14
+ Findings [label="Web Vulns\n(XSS, SQLi, IDOR,\nCache deception, etc.)", shape=box];
15
+ ReportWeb [label="PWN Reports"];
16
+
17
+ App -> Proxy;
18
+ Proxy -> Spider;
19
+ Spider -> ActiveScan;
20
+ ActiveScan -> Manual;
21
+ Manual -> API;
22
+ API -> AuthWeb;
23
+ AuthWeb -> Findings;
24
+ Findings -> ReportWeb;
25
+
26
+ Proxy -> Findings [label="intercept & modify"];
27
+ }
@@ -0,0 +1,27 @@
1
+ digraph "PWN Zero-Day Research Workflow" {
2
+ rankdir=TB;
3
+ node [shape=box, style=rounded, fontname="Arial", fontsize=9];
4
+ edge [fontsize=8];
5
+
6
+ Target [label="Target Research\n(Binary, Firmware,\nProtocol, Web App)", shape=box];
7
+ RE [label="Reverse Engineering\n+ Static Analysis"];
8
+ SAST [label="PWN::SAST + Custom"];
9
+ Fuzz [label="Fuzzing + Protocol\nAnalysis"];
10
+ Dyn [label="Dynamic Analysis\n(REPL + Debug)"];
11
+ Memory [label="PWN Memory\n(historical vulns,\nreferences)", shape=cylinder];
12
+ Skill [label="Skills (prior\nzero-day patterns)", shape=cylinder];
13
+ Exploit [label="Exploit Dev\n& Validation"];
14
+ Disclose [label="Responsible Disclosure\n& Fix (Reports,\nHackerOne, etc.)"];
15
+
16
+ Target -> RE;
17
+ Target -> SAST;
18
+ RE -> Fuzz;
19
+ SAST -> Fuzz;
20
+ Fuzz -> Dyn;
21
+ RE -> Dyn;
22
+ Memory -> RE [label="recall past findings"];
23
+ Skill -> Exploit [label="apply patterns"];
24
+ Dyn -> Exploit;
25
+ Exploit -> Disclose;
26
+ Disclose -> Memory [label="remember disclosure"];
27
+ }