pwn 0.5.774 → 0.5.777

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fcf08f4e689259063fd8b459d824890336bda15e3756416871cff38a21135730
4
- data.tar.gz: cf3c78ae724f5fbf5702510ef6d7cd13800bbdba292a8613cf25d5216200da5d
3
+ metadata.gz: 77cd821e27ebf793d043b1b73139ff68b17badf106a91f42832769ac7760785e
4
+ data.tar.gz: '0708df0d0f8258f249e0b57556898e3a1e675ef90a8caa162eac0fc4366b652e'
5
5
  SHA512:
6
- metadata.gz: 7bbf2b429a197fc2a5157764d50bc7e3c890351035f306fe46426362b5dd9925890135168ff6b6a49af0fa75f18943b6929dfa2b83c21f017d3560dc294cbb4b
7
- data.tar.gz: '08eb6976dc48727a1baab7625500b214b30f1f1ffe3185c561b7bd9b8ceed18a827017b797280f67c986f29ad70d28c2c46c0c77168193b0aaeae7d054f84ac2'
6
+ metadata.gz: 338c0443dd72e44e29b50c8b3afd11251ab84643f1b105304c698789cda148f69e4f68468b9c2cdc4824dc1570591f2d9d51c17d5a678c4cea4eace72c27be4e
7
+ data.tar.gz: d60694fcbbe66c4b48eb2e35f5235e508d5bcc66f5d2172b7a5ebd604b755a778b83c428ea47578c61985078231382a5182dfca213e46400c61af5bdf8f9fd9a
data/Gemfile CHANGED
@@ -49,7 +49,7 @@ gem 'jwt', '3.3.0'
49
49
  gem 'libusb', '0.8.0'
50
50
  gem 'luhn', '3.0.0'
51
51
  gem 'mail', '2.9.1'
52
- gem 'mcp', '1.7.0'
52
+ gem 'mcp', '1.8.0'
53
53
  gem 'meshtastic', '0.0.188'
54
54
  gem 'metasm', '1.0.6'
55
55
  gem 'mongo', '2.26.0'
@@ -59,10 +59,11 @@ MQTT receiver when the primary is Serial, Bluetooth, or TCP. Missing/empty
59
59
  MQTT configuration makes no additional connection attempt; primary MQTT uses
60
60
  only one subscription. MQTT connection failures leave the primary usable and
61
61
  are reported in the UI. `/transport` reconnects both subscriptions; `/back`
62
- closes them. Ctrl+T switches the active pane between COMPOSE and
63
- CONVERSATION. COMPOSE keeps Up/Down history. CONVERSATION scrolls with
64
- Up/Down one row, PgUp/PgDn a page, Home to the top, and End to the live
65
- bottom. The live bottom is not row 0, so PgDn there stays put. Typing or
62
+ closes them. Ctrl+T cycles COMPOSE, CONVERSATION, SENDER, and RECEIVER.
63
+ COMPOSE keeps Up/Down history. CONVERSATION selects messages
64
+ with Up/Down, a page with PgUp/PgDn, Home for the first, and End for the
65
+ latest, including when every message already fits. The latest selection is
66
+ not row 0, so End stays on the last message. Typing or
66
67
  Enter returns to COMPOSE; Enter does not send while CONVERSATION is active.
67
68
  The active title is reversed and marked active.
68
69
 
@@ -79,14 +80,18 @@ uses sender, packet ID, network/channel path, destination and payload (not
79
80
  text alone), retaining at most 1000 packets for five minutes. No-ID packets
80
81
  cannot be safely merged.
81
82
 
82
- Each header ends with the sender's last known position. A valid fix is
83
- `lat,lon >> https://maps.google.com/?q=lat,lon` on that same header. The pane
84
- wraps on ` · `, and only at ` >> ` if the GPS field itself does not fit, so
85
- the coordinate is not split. This is the compact Maps URL; a maps.app.goo.gl
86
- code cannot be minted without a Google share request. Unknown, unset, or
87
- out-of-range positions display `GPS N/A` and omit the URL. `0,0` is kept when
83
+ Each header ends with its direction and transport. Sender and receiver positions
84
+ are not painted there. `SENDER` and `RECEIVER` sit to the right of
85
+ CONVERSATION. A broadcast destination shows the channel name, not the word
86
+ broadcast. Ctrl+T cycles COMPOSE, CONVERSATION, SENDER, and RECEIVER.
87
+ A valid fix is the underlined coordinate.
88
+ Click it, or press `g` while CONVERSATION, SENDER, or RECEIVER is active, to open
89
+ `https://maps.google.com/?q=lat,lon`. The URL is not painted. Curses cannot
90
+ hide a link inside the coordinate text. Unknown, unset, or
91
+ out-of-range positions display `GPS: N/A` and omit the URL. A broadcast
92
+ receiver has no single position, so that field is `GPS: N/A`. `0,0` is kept when
88
93
  a real location source is present and omitted when the source is unset. The
89
- value is the last position recorded for that sender, not a freshness guarantee.
94
+ value is the last position recorded for that node, not a freshness guarantee.
90
95
 
91
96
  MQTT TX uses `channel.<name>.from` when set, otherwise the connected radio's
92
97
  node number, otherwise a node-shaped `mqtt.client_id`. It does not publish the
@@ -102,14 +102,16 @@ session only; it is not written to disk.
102
102
 
103
103
  ### Message transport labels
104
104
 
105
- Each CONVERSATION header ends with its direction and the transport used for
106
- that individual message: `· RX via MQTT`, `· TX via Serial`, `· RX via Bluetooth`,
107
- or `· TX via TCP`. In `auto` mode this is the resolved connection, not the
108
- configured `auto` value. Received messages retain the subscribing transport's
105
+ Each CONVERSATION header ends with `RX via <TRANSPORT>` or `TX via <TRANSPORT>`.
106
+ SENDER and RECEIVER do not show that label. Ctrl+T cycles COMPOSE,
107
+ CONVERSATION, SENDER, and RECEIVER. In `auto` mode this is the
108
+ resolved connection, not the configured `auto` value. Received messages retain the subscribing transport's
109
109
  origin through queued rendering, even if the current transport changes.
110
110
  Missing origin metadata is shown as `Unknown`, not guessed from the current pin.
111
+ GPS is not part of the header. SENDER and RECEIVER sit to the right of
112
+ CONVERSATION. A broadcast receiver shows the channel name.
111
113
 
112
- Headers use `timestamp encryption · SHORT NAME · source path · destination path · direction via transport`,
114
+ Headers use `timestamp encryption · SHORT NAME · source path · destination path · RX via <TRANSPORT>`,
113
115
  with exactly one space on either side of each `·`. RX uses the sender's
114
116
  `User.short_name` (`shortName` in JSON); TX uses the sending local node's User,
115
117
  never the destination's name. Device connections use their NodeInfo/NODEINFO
@@ -125,8 +127,8 @@ Unicode text and internal spaces are retained. Names are labels, not authenticat
125
127
  For example (placeholder node IDs):
126
128
 
127
129
  ```text
128
- 2026-01-02 03:04:05+0000 🔍 · PEER · US/CA/2/e/LongFast/!aabbccdd · US/CA/2/e/LongFast/# · RX via MQTT
129
- 2026-01-02 03:04:06+0000 🔍 · SELF · US/CA/2/e/LongFast/!bbccddee (ME) · US/CA/2/e/LongFast/# · TX via Serial
130
+ 2026-01-02 03:04:05+0000 🔍 · PEER · US/CA/2/e/LongFast/!aabbccdd · US/CA/2/e/LongFast/#
131
+ 2026-01-02 03:04:06+0000 🔍 · SELF · US/CA/2/e/LongFast/!bbccddee (ME) · US/CA/2/e/LongFast/#
130
132
  ```
131
133
 
132
134
  The timestamp, encryption indicator, source/destination paths, channel and
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: pwn-jsontext
3
+ description: Drive PWN::JSONText from pwn_eval.
4
+ license: MIT
5
+ allowed-tools: [pwn, pwn_eval]
6
+ metadata:
7
+ bundled: true
8
+ generated: true
9
+ module: PWN::JSONText
10
+ source: pwn/json_text.rb
11
+ ---
12
+
13
+ # PWN::JSONText
14
+
15
+ Retag or scrub strings before the JSON generator sees them.
16
+
17
+ ## When to use
18
+
19
+ Call `PWN::JSONText` from `pwn_eval` when the task needs this module.
20
+ Do not reimplement it in shell.
21
+
22
+ ## Methodologies
23
+
24
+ Generated from `pwn/json_text.rb`. Prefer the public class methods below.
25
+ Class methods take `(opts = {})` and read `opts`.
26
+
27
+ ## How to call
28
+
29
+ ```ruby
30
+ PWN::JSONText.help
31
+ PWN::JSONText.prepare(opts)
32
+ ```
33
+
34
+ ## Public methods
35
+
36
+ - `prepare`
37
+ - `authors`
38
+ - `help`
39
+
40
+ ## Source
41
+
42
+ `pwn/json_text.rb`
43
+
44
+ ## Verification
45
+
46
+ `PWN::JSONText.respond_to?(:prepare)` after the
47
+ module is loaded. Read the source for parameter names.
@@ -1,3 +1,4 @@
1
1
  # PWN::Plugins::REPL::Mesh source links
2
2
 
3
3
  - https://maps.google.com/?q=[redacted]
4
+ - https://maps\.google\.com/\?q=-?\d+\.\d+,-?\d+\.\d+\z}
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Retag or scrub strings before the JSON generator sees them.
4
+ module PWN
5
+ # json 2.21 warns when valid UTF-8 is still tagged BINARY, and raises
6
+ # JSON::GeneratorError on a malformed sequence. Both show up in the session pane.
7
+ module JSONText
8
+ # Supported Method Parameters::
9
+ # safe = PWN::JSONText.prepare(
10
+ # value: 'required - string, hash, or array that may contain binary-tagged text',
11
+ # depth: 'optional - nesting already walked; containers stop at 100'
12
+ # )
13
+
14
+ public_class_method def self.prepare(opts = {})
15
+ value = opts[:value]
16
+ depth = opts[:depth].to_i
17
+ case value
18
+ when String
19
+ utf = value.dup.force_encoding(Encoding::UTF_8)
20
+ utf.valid_encoding? ? utf : utf.scrub
21
+ when Hash
22
+ return value if depth >= 100
23
+
24
+ value.each_with_object({}) do |(key, item), out|
25
+ out[key.is_a?(String) ? prepare(value: key, depth: depth + 1) : key] = prepare(value: item, depth: depth + 1)
26
+ end
27
+ when Array
28
+ return value if depth >= 100
29
+
30
+ value.map { |item| prepare(value: item, depth: depth + 1) }
31
+ else
32
+ value
33
+ end
34
+ end
35
+
36
+ # Author(s):: 0day Inc. <support@0dayinc.com>
37
+
38
+ public_class_method def self.authors
39
+ "AUTHOR(S):\n 0day Inc. <support@0dayinc.com>\n"
40
+ end
41
+
42
+ # Display Usage for this Module.
43
+
44
+ public_class_method def self.help
45
+ puts "USAGE:
46
+ # Retag valid UTF-8 that is still tagged binary, or scrub an illegal sequence.
47
+ #{self}.prepare(
48
+ value: 'required - string, hash, or array that may contain binary-tagged text',
49
+ depth: 'optional - nesting already walked; containers stop at 100'
50
+ )
51
+
52
+ # Print the AUTHOR(S) string for this module.
53
+ #{self}.authors
54
+ "
55
+ constants.sort
56
+ end
57
+ end
58
+ end
59
+
60
+ # json 2.21 warns inside JSON.generate before State.generate. json 2.18 warns
61
+ # inside the C to_json methods. Retag at both doors.
62
+ class << JSON
63
+ %i[generate fast_generate pretty_generate dump].each do |name|
64
+ alias_method :"#{name}_without_json_text", name
65
+ define_method(name) do |obj, *rest|
66
+ public_send(:"#{name}_without_json_text", PWN::JSONText.prepare(value: obj), *rest)
67
+ end
68
+ end
69
+ end
70
+
71
+ if defined?(JSON::Ext::Generator::GeneratorMethods)
72
+ JSON::Ext::Generator::GeneratorMethods.constants.each do |kind|
73
+ mod = JSON::Ext::Generator::GeneratorMethods.const_get(kind)
74
+ next unless mod.is_a?(Module) && mod.method_defined?(:to_json)
75
+
76
+ mod.class_eval do
77
+ alias_method :to_json_without_json_text, :to_json unless method_defined?(:to_json_without_json_text)
78
+ define_method(:to_json) do |*rest|
79
+ prepared = PWN::JSONText.prepare(value: self)
80
+ mod.instance_method(:to_json_without_json_text).bind_call(prepared, *rest)
81
+ end
82
+ end
83
+ end
84
+ end