pwn 0.5.617 → 0.5.620

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 (120) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -2
  3. data/README.md +101 -83
  4. data/bin/pwn_gqrx_scanner +25 -5
  5. data/documentation/AI-Integration.md +42 -26
  6. data/documentation/AWS.md +57 -0
  7. data/documentation/Agent-Tool-Registry.md +56 -0
  8. data/documentation/Banner.md +17 -0
  9. data/documentation/Blockchain.md +18 -0
  10. data/documentation/Bounty.md +21 -0
  11. data/documentation/BurpSuite.md +41 -16
  12. data/documentation/CLI-Drivers.md +58 -0
  13. data/documentation/Configuration.md +66 -0
  14. data/documentation/Contributing.md +33 -19
  15. data/documentation/Cron.md +47 -0
  16. data/documentation/Diagrams.md +6 -2
  17. data/documentation/Drivers.md +43 -16
  18. data/documentation/Extrospection.md +73 -0
  19. data/documentation/FFI.md +14 -0
  20. data/documentation/Fuzzing.md +36 -0
  21. data/documentation/Hardware.md +40 -0
  22. data/documentation/Home.md +5 -4
  23. data/documentation/How-PWN-Works.md +7 -4
  24. data/documentation/Metasploit.md +34 -0
  25. data/documentation/Mistakes.md +96 -0
  26. data/documentation/NmapIt.md +18 -12
  27. data/documentation/PWN.png +0 -0
  28. data/documentation/PWN_Contributors_and_Users.png +0 -0
  29. data/documentation/Persistence.md +40 -0
  30. data/documentation/Plugins.md +97 -47
  31. data/documentation/Reporting.md +25 -18
  32. data/documentation/SAST.md +39 -22
  33. data/documentation/SDR.md +58 -0
  34. data/documentation/Sessions.md +39 -0
  35. data/documentation/Skills-Memory-Learning.md +59 -29
  36. data/documentation/Swarm.md +71 -0
  37. data/documentation/Transparent-Browser.md +26 -22
  38. data/documentation/Troubleshooting.md +44 -25
  39. data/documentation/WWW.md +32 -0
  40. data/documentation/diagrams/agent-tool-registry.svg +286 -0
  41. data/documentation/diagrams/aws-cloud-security.svg +166 -0
  42. data/documentation/diagrams/cron-scheduling.svg +148 -0
  43. data/documentation/diagrams/dot/agent-tool-registry.dot +2 -2
  44. data/documentation/diagrams/dot/extrospection-world-awareness.dot +9 -7
  45. data/documentation/diagrams/dot/hardware-hacking.dot +48 -0
  46. data/documentation/diagrams/dot/memory-skills-detailed.dot +12 -5
  47. data/documentation/diagrams/dot/mistakes-negative-feedback.dot +93 -0
  48. data/documentation/diagrams/dot/overall-pwn-architecture.dot +7 -5
  49. data/documentation/diagrams/dot/persistence-filesystem.dot +30 -0
  50. data/documentation/diagrams/dot/pwn-ai-feedback-learning-loop.dot +19 -7
  51. data/documentation/diagrams/dot/sdr-radio-flow.dot +13 -11
  52. data/documentation/diagrams/extrospection-world-awareness.svg +203 -0
  53. data/documentation/diagrams/hardware-hacking.svg +163 -0
  54. data/documentation/diagrams/memory-skills-detailed.svg +146 -97
  55. data/documentation/diagrams/mistakes-negative-feedback.svg +266 -0
  56. data/documentation/diagrams/overall-pwn-architecture.svg +184 -173
  57. data/documentation/diagrams/persistence-filesystem.svg +189 -0
  58. data/documentation/diagrams/pwn-ai-feedback-learning-loop.svg +217 -149
  59. data/documentation/diagrams/sdr-radio-flow.svg +166 -0
  60. data/documentation/diagrams/swarm-multi-agent.svg +225 -0
  61. data/documentation/fax-spectrogram.png +0 -0
  62. data/documentation/fax-waveform.png +0 -0
  63. data/documentation/pwn-REPL.md +40 -24
  64. data/documentation/pwn-ai-Agent.md +72 -30
  65. data/documentation/pwn_android_war_dialer_session.png +0 -0
  66. data/documentation/pwn_install.png +0 -0
  67. data/documentation/pwn_wallpaper.jpg +0 -0
  68. data/documentation/ringing-spectrogram.png +0 -0
  69. data/documentation/ringing-waveform.png +0 -0
  70. data/lib/pwn/ai/agent/extrospection.rb +65 -6
  71. data/lib/pwn/ai/agent/learning.rb +67 -7
  72. data/lib/pwn/ai/agent/loop.rb +72 -6
  73. data/lib/pwn/ai/agent/mistakes.rb +369 -0
  74. data/lib/pwn/ai/agent/prompt_builder.rb +10 -1
  75. data/lib/pwn/ai/agent/tools/extrospection.rb +2 -2
  76. data/lib/pwn/ai/agent/tools/mistakes.rb +132 -0
  77. data/lib/pwn/ai/agent.rb +1 -0
  78. data/lib/pwn/plugins/jira_data_center.rb +2 -2
  79. data/lib/pwn/sdr/decoder/adsb.rb +101 -0
  80. data/lib/pwn/sdr/decoder/apt.rb +75 -0
  81. data/lib/pwn/sdr/decoder/bluetooth.rb +78 -0
  82. data/lib/pwn/sdr/decoder/dect.rb +84 -0
  83. data/lib/pwn/sdr/decoder/gps.rb +83 -0
  84. data/lib/pwn/sdr/decoder/gsm.rb +50 -29
  85. data/lib/pwn/sdr/decoder/iridium.rb +81 -0
  86. data/lib/pwn/sdr/decoder/lora.rb +87 -0
  87. data/lib/pwn/sdr/decoder/lte.rb +88 -0
  88. data/lib/pwn/sdr/decoder/morse.rb +64 -0
  89. data/lib/pwn/sdr/decoder/p25.rb +71 -0
  90. data/lib/pwn/sdr/decoder/pager.rb +77 -0
  91. data/lib/pwn/sdr/decoder/pocsag.rb +26 -11
  92. data/lib/pwn/sdr/decoder/rfid.rb +88 -0
  93. data/lib/pwn/sdr/decoder/rtl433.rb +95 -0
  94. data/lib/pwn/sdr/decoder/rtty.rb +66 -0
  95. data/lib/pwn/sdr/decoder/wifi.rb +98 -0
  96. data/lib/pwn/sdr/decoder/zigbee.rb +96 -0
  97. data/lib/pwn/sdr/decoder.rb +67 -7
  98. data/lib/pwn/sdr/frequency_allocation.rb +82 -41
  99. data/lib/pwn/sdr/gqrx.rb +186 -95
  100. data/lib/pwn/version.rb +1 -1
  101. data/spec/lib/pwn/ai/agent/mistakes_spec.rb +36 -0
  102. data/spec/lib/pwn/ai/agent/tools/mistakes_spec.rb +12 -0
  103. data/spec/lib/pwn/sdr/decoder/adsb_spec.rb +15 -0
  104. data/spec/lib/pwn/sdr/decoder/apt_spec.rb +15 -0
  105. data/spec/lib/pwn/sdr/decoder/bluetooth_spec.rb +15 -0
  106. data/spec/lib/pwn/sdr/decoder/dect_spec.rb +15 -0
  107. data/spec/lib/pwn/sdr/decoder/gps_spec.rb +15 -0
  108. data/spec/lib/pwn/sdr/decoder/iridium_spec.rb +15 -0
  109. data/spec/lib/pwn/sdr/decoder/lora_spec.rb +15 -0
  110. data/spec/lib/pwn/sdr/decoder/lte_spec.rb +15 -0
  111. data/spec/lib/pwn/sdr/decoder/morse_spec.rb +15 -0
  112. data/spec/lib/pwn/sdr/decoder/p25_spec.rb +15 -0
  113. data/spec/lib/pwn/sdr/decoder/pager_spec.rb +15 -0
  114. data/spec/lib/pwn/sdr/decoder/rfid_spec.rb +15 -0
  115. data/spec/lib/pwn/sdr/decoder/rtl433_spec.rb +15 -0
  116. data/spec/lib/pwn/sdr/decoder/rtty_spec.rb +15 -0
  117. data/spec/lib/pwn/sdr/decoder/wifi_spec.rb +15 -0
  118. data/spec/lib/pwn/sdr/decoder/zigbee_spec.rb +15 -0
  119. data/third_party/pwn_rdoc.jsonl +114 -8
  120. metadata +81 -5
@@ -0,0 +1,96 @@
1
+ # Mistakes — The Negative-Feedback Loop
2
+
3
+ `PWN::AI::Agent::Mistakes` is the **negative** half of the pwn-ai learning
4
+ loop. Where [Learning](Skills-Memory-Learning.md) records *what worked* and
5
+ [Metrics](Skills-Memory-Learning.md) records *how often* a tool worked,
6
+ Mistakes records **specific failure patterns** with a stable fingerprint so
7
+ the agent can (a) recognise it is repeating itself, (b) be told exactly what
8
+ **not** to do again in every future system prompt, and (c) capture the **fix**
9
+ once one is found so the avoidance lesson becomes an actionable correction.
10
+
11
+ ![Mistakes negative-feedback loop](diagrams/mistakes-negative-feedback.svg)
12
+
13
+ ## The failure fingerprint
14
+
15
+ A "mistake" is keyed by `sha12(tool + normalised_error)`. Normalisation strips
16
+ volatile bits — paths, hex addresses, `:LINE`, `port N`, timestamps, UUIDs,
17
+ PIDs — so `NoMethodError … at foo.rb:42` and `… at foo.rb:99` collapse to
18
+ **one** signature and its `:count` climbs. **That count *is* the repeat
19
+ detector**, and it survives across sessions.
20
+
21
+ | Field | Meaning |
22
+ |---|---|
23
+ | `signature` | 12-hex-char sha of `(tool, normalised_error)` — stable across runs |
24
+ | `tool` | component the failure was in (`shell`, `pwn_eval`, `assumption`, `assistant_answer`, a module name…) |
25
+ | `error` | normalised error text (paths/lines/addrs/ts stripped) |
26
+ | `count` | **cross-session** recurrence count — drives `[REPEATING]` at ≥ 3 |
27
+ | `resolved` / `fix` | set by `mistakes_resolve` — promoted to a `PWN::Memory` `:lesson` |
28
+ | `regressed` | auto-set when a *resolved* signature recurs — reopened as `[REGRESSED]` |
29
+ | `sessions` | last 10 session_ids that hit it |
30
+
31
+ ## How the loop closes (why it does **not** repeat mistakes)
32
+
33
+ ```text
34
+ Loop.run --(tool failure)---------> Mistakes.record (persist + count++)
35
+ Loop.run --(same sig, count≥3)----> guard_repeated_failure (uses PERSISTENT count →
36
+ fires on the 1st recurrence
37
+ in a NEW session, not the 3rd)
38
+ Loop.run --(failure w/ known fix)-> inline correction_hint ("seen 5×, sig=…, KNOWN FIX: …"
39
+ → self-corrects NEXT iteration)
40
+ Loop.run --(user says "wrong")----> check_user_correction (flip last outcome + record)
41
+ PromptBuilder <-------------------- Mistakes.to_context (KNOWN MISTAKES + KNOWN FIXES)
42
+ model --(tool call)---------------> mistakes_record / mistakes_resolve
43
+ ```
44
+
45
+ ## Four ingest paths — nothing slips through
46
+
47
+ | Source | Trigger | What is recorded |
48
+ |---|---|---|
49
+ | `:tool` | any tool dispatch returns `success:false` / raises | *automatic* — `Loop.record_metrics` |
50
+ | `:loop` | iteration budget exhausted with no final answer | *automatic* — `Loop.run` epilogue |
51
+ | `:user_correction` | next user message matches `CORRECTION_RX` (*"no that's wrong"*, *"still broken"*, *"try again"*, …) | `check_user_correction` — also flips the previous `Learning` outcome to `success:false` |
52
+ | `:model` | the model itself calls `mistakes_record` | wrong assumption, wrong file, hallucinated API — failures that are **not** dispatch errors |
53
+
54
+ ## Tools
55
+
56
+ | Tool | Does |
57
+ |---|---|
58
+ | `mistakes_list` | count-sorted fingerprints (signature · tool · error · count · resolved · fix) |
59
+ | `mistakes_record` | proactively fingerprint a semantic mistake YOU just made |
60
+ | `mistakes_resolve` | attach the **fix** → promoted to `PWN::Memory` `:lesson` **and** handed straight back inline via `correction_hint` on the next recurrence. If the same sig recurs it auto-reopens as `[REGRESSED]`. |
61
+ | `mistakes_reset` | wipe `~/.pwn/mistakes.json` (new engagement) |
62
+
63
+ ## What the model sees every turn
64
+
65
+ `PromptBuilder` injects `Mistakes.to_context` between the `LEARNING` and
66
+ `TOOL EFFECTIVENESS` blocks:
67
+
68
+ ```text
69
+ KNOWN MISTAKES (do NOT repeat — call mistakes_resolve once fixed)
70
+ ✗ [a1b2c3d4e5f6] shell ×4 [REPEATING]: nmpa: command not found
71
+ ✗ [7f8e9d0c1b2a] pwn_eval ×2 [REGRESSED]: nomethoderror: undefined method `scan_range' — last fix (insufficient): use fast_scan_range
72
+ KNOWN FIXES (apply these instead of repeating the mistake)
73
+ ✓ [c0ffee123456] shell: connection refused port N — FIX: start ZAP first via PWN::Plugins::Zaproxy.start
74
+ ```
75
+
76
+ …and every failed dispatch gets an **inline** postscript:
77
+
78
+ ```text
79
+ [pwn-ai/mistakes] seen 4× across 3 session(s), sig=a1b2c3d4e5f6 | KNOWN FIX: binary is spelled `nmap`
80
+ ```
81
+
82
+ so the very next iteration self-corrects without re-discovering the fix.
83
+
84
+ ## Regression detection
85
+
86
+ Resolving a mistake does **not** delete it. If the same signature fires again
87
+ after `mistakes_resolve`, `record()` clears `:resolved`, sets `:regressed`,
88
+ and the entry re-enters the `KNOWN MISTAKES` block tagged `[REGRESSED]` with
89
+ its (now-insufficient) previous fix shown inline — the strongest possible
90
+ "your last fix didn't hold" signal.
91
+
92
+ **See also:** [Skills, Memory & Learning](Skills-Memory-Learning.md) ·
93
+ [Extrospection](Extrospection.md) · [Persistence](Persistence.md) ·
94
+ [pwn-ai Agent](pwn-ai-Agent.md)
95
+
96
+ [← Home](Home.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,40 @@
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
+ | **`mistakes.json`** | **`PWN::AI::Agent::Mistakes`** | **JSON `{sig → entry}`** | **`mistakes_reset`** | **failure fingerprints · cross-session count · fix · `[REPEATING]` · `[REGRESSED]`** |
14
+ | `metrics.json` | `PWN::AI::Agent::Metrics` | JSON | `metrics_reset` | per-tool calls · success · avg_duration · last_error |
15
+ | `extrospection.json` | `PWN::AI::Agent::Extrospection` | JSON | `extro_reset` | host/net/toolchain/repo/env/**rf** snapshot + previous baseline + observations[] |
16
+ | `sessions/*.jsonl` | `PWN::Sessions` | JSON-per-line | `sessions_delete` | full transcript per pwn-ai run |
17
+ | `cron/jobs.yml` | `PWN::Cron` | YAML | `cron_remove` | scheduled prompt/ruby/script jobs |
18
+ | `cron/log/*.log` | `PWN::Cron` | text | rm | last_run output |
19
+ | `agents.yml` | `PWN::AI::Agent::Swarm` | YAML | edit / `agent_spawn` | persona registry |
20
+ | `swarm/<id>/bus.jsonl` | `Swarm` | JSON-per-line | rm -rf | append-only multi-agent chat |
21
+ | `swarm/<id>/personas.json` | `Swarm` | JSON | rm | persona → session_id map |
22
+ | `~/.pwn_history` | Pry | text | rm | REPL input history |
23
+
24
+ ## Back it up
25
+
26
+ ```bash
27
+ tar czf pwn-state-$(date +%F).tgz -C "$HOME" .pwn
28
+ ```
29
+
30
+ ## Start fresh for a new engagement
31
+
32
+ ```ruby
33
+ # inside pwn-ai — keeps config & skills, wipes engagement-specific state
34
+ extro_reset(confirm: true) # host snapshot + observations
35
+ mistakes_reset(confirm: true) # failure fingerprints (host-specific errors)
36
+ learning_reset(confirm: true) # task outcomes (optional)
37
+ metrics_reset(confirm: true) # tool telemetry (optional)
38
+ ```
39
+
40
+ [← 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,58 @@
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 — median noise floor, DC/LO-leakage null, band-edge guard), `fast_scan_range` |
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::*`** | 20 protocol demodulators/decoders — `ADSB APT Bluetooth DECT FLEX GPS GSM Iridium LoRa LTE Morse P25 Pager POCSAG RDS RFID RTL433 RTTY WiFi ZigBee` |
15
+
16
+ ## CLI
17
+
18
+ ```bash
19
+ # FFT sweep — SNR-gated peak detection (no false-positive flood)
20
+ pwn_gqrx_scanner --start 430e6 --stop 440e6 --fft-scan \
21
+ --avg 8 --min-snr-db 10 --capture-secs 0.10
22
+
23
+ # Classic iterative S-meter scan
24
+ pwn_gqrx_scanner --start 118e6 --stop 137e6 --step 12.5e3 \
25
+ --strength-lock -60 --audio-gain-db 6
26
+ ```
27
+
28
+ See skill `pwn_gqrx_scanner_fast_vs_iterative_scanning` for the trade-off.
29
+
30
+ ## REPL example
31
+
32
+ ```ruby
33
+ g = PWN::SDR::GQRX.connect(host: '127.0.0.1', port: 7356)
34
+ PWN::SDR::GQRX.set_freq(gqrx_sock: g, freq: 433_920_000)
35
+ PWN::SDR::GQRX.set_demod(gqrx_sock: g, demod: 'AM')
36
+ snap = PWN::SDR::GQRX.get_spectrum_snapshot(gqrx_sock: g)
37
+ PWN::SDR::FrequencyAllocation.lookup(freq: 433_920_000)
38
+ # => { band: 'ISM 433', typical: ['garage doors', 'weather stations', …] }
39
+ ```
40
+
41
+ ## RF ↔ Extrospection
42
+
43
+ The AI agent is RF-aware. `extro_snapshot(sections: [:rf])` runs `probe_rf`
44
+ (RTL-SDR / HackRF / SoapySDR / Flipper / GQRX-socket inventory) and RF signal
45
+ intel is recorded with a first-class `:rf` observation category:
46
+
47
+ ```ruby
48
+ extro_observe(source: 'gqrx', category: :rf, target: '433.920MHz',
49
+ data: 'peak -34.2 dBFS bw=200k FSK — likely garage remote')
50
+ ```
51
+
52
+ `extro_correlate` then cross-references `:rf` observations against missing
53
+ `RF_BINS` / unplugged hardware so the agent can tell "no signal" from "no
54
+ dongle".
55
+
56
+ **See also:** [Hardware](Hardware.md) · [Extrospection](Extrospection.md)
57
+
58
+ [← Home](Home.md)
@@ -0,0 +1,39 @@
1
+ # Sessions — Transcript Persistence
2
+
3
+ Every `pwn-ai` conversation (top-level *and* per-persona in a Swarm) is
4
+ appended as JSON-per-line to `~/.pwn/sessions/<id>.jsonl`.
5
+
6
+ ![Sessions ↔ Cron ↔ Swarm](diagrams/sessions-cron-automation.svg)
7
+
8
+ ## Why keep transcripts?
9
+
10
+ - `learning_reflect(session_id:)` mines them for durable lessons → Memory.
11
+ - `learning_distill_skill(name:, session_id:)` turns a winning run into a
12
+ reusable Skill.
13
+ - `sessions_view` lets you (or a later agent) re-read exactly what happened.
14
+ - Swarm maps each persona to its own session so its private context survives
15
+ across `agent_ask` calls.
16
+
17
+ ## Tools
18
+
19
+ | Tool | Purpose |
20
+ |---|---|
21
+ | `sessions_current` | The id *this* conversation is being written to |
22
+ | `sessions_list(limit:)` | Newest-first index (id · size · mtime · lines) |
23
+ | `sessions_view(session_id:, truncate:)` | Read entries |
24
+ | `sessions_delete(session_id:)` | Prune noisy/dev transcripts so `reflect` corpus stays clean |
25
+ | `sessions_stats` | totals across the whole directory |
26
+
27
+ ## File format
28
+
29
+ ```json
30
+ {"role":"system","ts":"2026-07-07T22:08:02Z","content":"…"}
31
+ {"role":"user","ts":"…","content":"…"}
32
+ {"role":"assistant","ts":"…","content":"…","tool_calls":[…]}
33
+ {"role":"tool","ts":"…","name":"shell","content":"…"}
34
+ ```
35
+
36
+ **See also:** [Skills, Memory & Learning](Skills-Memory-Learning.md) ·
37
+ [Swarm](Swarm.md) · [Persistence](Persistence.md)
38
+
39
+ [← Home](Home.md)