pwn 0.5.778 → 0.5.779
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 +4 -4
- data/Gemfile +2 -2
- data/lib/pwn/plugins/repl/mesh.rb +15 -8
- data/lib/pwn/version.rb +1 -1
- data/spec/lib/pwn/plugins/repl_mesh_origin_gps_spec.rb +16 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7dd747b247b7c7039df9bba24c9542ecd37b65df6c650b09730ce6b9803d599b
|
|
4
|
+
data.tar.gz: b355d2d146e6b26c833319ac265b76e8fa3fe85892ff53e7c78e1f0238daf067
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6f594c419c8095b788c397b64dcaa417a8efbc3992007b40079f121d93a8dc6ee67b3b41bb5bf48526e55720d99f2fe7cad5ae1fb5a563d71421a866240c4f04
|
|
7
|
+
data.tar.gz: 87e8e462103a8954fd94e9859fbde5e528d1f6803e3dda5abdadbe0e58524a56125fc084747edf0171289b99f84bfcc75d65d5ff4ac10d95d2d44cfe9d002205
|
data/Gemfile
CHANGED
|
@@ -69,7 +69,7 @@ gem 'packetfu', '2.0.0'
|
|
|
69
69
|
gem 'packetgen', '4.1.1'
|
|
70
70
|
gem 'pdf-reader', '2.16.0'
|
|
71
71
|
gem 'pg', '1.7.0'
|
|
72
|
-
gem 'pry', '0.16.
|
|
72
|
+
gem 'pry', '0.16.1'
|
|
73
73
|
gem 'pry-doc', '1.7.0'
|
|
74
74
|
gem 'rake', '13.4.2'
|
|
75
75
|
gem 'rb-readline', '0.5.5'
|
|
@@ -94,7 +94,7 @@ gem 'selenium-webdriver', '4.51.0'
|
|
|
94
94
|
gem 'slack-ruby-client', '3.3.0'
|
|
95
95
|
gem 'socksify', '1.8.1'
|
|
96
96
|
gem 'spreadsheet', '1.3.5'
|
|
97
|
-
gem 'sqlite3', '2.10.
|
|
97
|
+
gem 'sqlite3', '2.10.1'
|
|
98
98
|
gem 'thin', '2.0.1'
|
|
99
99
|
gem 'tty-prompt', '0.23.1'
|
|
100
100
|
gem 'tty-spinner', '0.9.3'
|
|
@@ -2624,9 +2624,9 @@ class << PWN::Plugins::REPL # rubocop:disable Metrics/ClassLength
|
|
|
2624
2624
|
value = opts[:value].to_s
|
|
2625
2625
|
value = '—' if value.empty?
|
|
2626
2626
|
prefix = "#{opts[:label]}: "
|
|
2627
|
-
return [{ text: "#{prefix}#{value}" }] if Unicode::DisplayWidth.of("#{prefix}#{value}") <= width
|
|
2627
|
+
return [{ text: "#{prefix}#{value}", label: prefix.rstrip }] if Unicode::DisplayWidth.of("#{prefix}#{value}") <= width
|
|
2628
2628
|
|
|
2629
|
-
[{ text: prefix.rstrip }].concat(mesh_wrap_text(text: value, width: width).map { |line| { text: line } })
|
|
2629
|
+
[{ text: prefix.rstrip, label: prefix.rstrip }].concat(mesh_wrap_text(text: value, width: width).map { |line| { text: line } })
|
|
2630
2630
|
end
|
|
2631
2631
|
|
|
2632
2632
|
def mesh_gps_labeled_rows(opts = {})
|
|
@@ -2637,9 +2637,9 @@ class << PWN::Plugins::REPL # rubocop:disable Metrics/ClassLength
|
|
|
2637
2637
|
coord, url = label.split(' >> ', 2)
|
|
2638
2638
|
prefix = 'GPS: '
|
|
2639
2639
|
if Unicode::DisplayWidth.of("#{prefix}#{coord}") <= width
|
|
2640
|
-
[{ text: "#{prefix}#{coord}", link: true, link_at: prefix.length, url: url }]
|
|
2640
|
+
[{ text: "#{prefix}#{coord}", label: 'GPS:', link: true, link_at: prefix.length, url: url }]
|
|
2641
2641
|
else
|
|
2642
|
-
[{ text: 'GPS:' }, { text: coord, link: true, url: url }]
|
|
2642
|
+
[{ text: 'GPS:', label: 'GPS:' }, { text: coord, link: true, url: url }]
|
|
2643
2643
|
end
|
|
2644
2644
|
end
|
|
2645
2645
|
|
|
@@ -2964,7 +2964,12 @@ class << PWN::Plugins::REPL # rubocop:disable Metrics/ClassLength
|
|
|
2964
2964
|
at = line[:link_at].to_i
|
|
2965
2965
|
prefix = text[0, at].to_s
|
|
2966
2966
|
coord = text[at..] || ''
|
|
2967
|
-
|
|
2967
|
+
unless prefix.empty?
|
|
2968
|
+
win.attron(Curses.color_pair(24) | Curses::A_BOLD)
|
|
2969
|
+
win.addstr(prefix.rstrip)
|
|
2970
|
+
win.attroff(Curses.color_pair(24) | Curses::A_BOLD)
|
|
2971
|
+
win.addstr(prefix[prefix.rstrip.length..])
|
|
2972
|
+
end
|
|
2968
2973
|
win.attron(Curses::A_UNDERLINE)
|
|
2969
2974
|
win.addstr(coord)
|
|
2970
2975
|
win.attroff(Curses::A_UNDERLINE)
|
|
@@ -2973,9 +2978,11 @@ class << PWN::Plugins::REPL # rubocop:disable Metrics/ClassLength
|
|
|
2973
2978
|
hit[:pane] = opts[:pane]
|
|
2974
2979
|
opts[:hits] << hit
|
|
2975
2980
|
elsif line[:label] && win.respond_to?(:attron)
|
|
2976
|
-
|
|
2977
|
-
win.
|
|
2978
|
-
win.
|
|
2981
|
+
label = text[0, line[:label].to_s.length]
|
|
2982
|
+
win.attron(Curses.color_pair(24) | Curses::A_BOLD)
|
|
2983
|
+
win.addstr(label)
|
|
2984
|
+
win.attroff(Curses.color_pair(24) | Curses::A_BOLD)
|
|
2985
|
+
win.addstr(text[label.length..].to_s)
|
|
2979
2986
|
else
|
|
2980
2987
|
win.addstr(text)
|
|
2981
2988
|
end
|
data/lib/pwn/version.rb
CHANGED
|
@@ -4,6 +4,21 @@ require 'spec_helper'
|
|
|
4
4
|
require 'meshtastic'
|
|
5
5
|
|
|
6
6
|
describe PWN::Plugins::REPL, 'mesh primary display, MQTT sender, and GPS link' do
|
|
7
|
+
it 'paints field labels bold white without changing value attributes' do
|
|
8
|
+
attrs = 0
|
|
9
|
+
painted = []
|
|
10
|
+
allow(Curses).to receive(:color_pair).with(20).and_return(0)
|
|
11
|
+
allow(Curses).to receive(:color_pair).with(24).and_return(256)
|
|
12
|
+
allow(details).to receive(:attron) { |value| attrs |= value }
|
|
13
|
+
allow(details).to receive(:attroff) { |value| attrs &= ~value }
|
|
14
|
+
allow(details).to receive(:addstr) { |text| painted << [text, attrs] }
|
|
15
|
+
rows = described_class.send(:mesh_value_rows, label: 'Node ID', value: '!00001337', width: 28)
|
|
16
|
+
rows += described_class.send(:mesh_value_rows, label: 'GPS', value: 'N/A', width: 28)
|
|
17
|
+
described_class.send(:mesh_paint_side, win: details, title: 'SENDER', focus: :sndr, rows: rows, hits: [])
|
|
18
|
+
expect(painted).to include(['Node ID:', 256 | Curses::A_BOLD], ['GPS:', 256 | Curses::A_BOLD])
|
|
19
|
+
expect(painted).to include([' !00001337', 0], [' N/A', 0])
|
|
20
|
+
end
|
|
21
|
+
|
|
7
22
|
let(:env) do
|
|
8
23
|
{ transport: 'serial', mqtt: { host: 'offline.invalid', region: 'US' },
|
|
9
24
|
channel: { active: 'LongFast', LongFast: { psk: 'AQ==', region: 'US', topic: '2/e/LongFast/#', from: '!00001337' } } }
|
|
@@ -224,7 +239,7 @@ describe PWN::Plugins::REPL, 'mesh primary display, MQTT sender, and GPS link' d
|
|
|
224
239
|
colors = []
|
|
225
240
|
allow(details).to receive(:attron) { |attr| colors << attr }
|
|
226
241
|
described_class.send(:mesh_handle_rx, env: env, obj: radio, msg: { packet: packet, mesh_transport: :serial })
|
|
227
|
-
painted = details.lines.join
|
|
242
|
+
painted = details.lines.join
|
|
228
243
|
expect(painted).to include('SENDER', 'Node ID: !421f6f22', 'GPS:')
|
|
229
244
|
expect(painted).not_to include('VIA')
|
|
230
245
|
node_num = 0x421f6f22
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pwn
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.779
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- 0day Inc.
|
|
@@ -785,14 +785,14 @@ dependencies:
|
|
|
785
785
|
requirements:
|
|
786
786
|
- - '='
|
|
787
787
|
- !ruby/object:Gem::Version
|
|
788
|
-
version: 0.16.
|
|
788
|
+
version: 0.16.1
|
|
789
789
|
type: :runtime
|
|
790
790
|
prerelease: false
|
|
791
791
|
version_requirements: !ruby/object:Gem::Requirement
|
|
792
792
|
requirements:
|
|
793
793
|
- - '='
|
|
794
794
|
- !ruby/object:Gem::Version
|
|
795
|
-
version: 0.16.
|
|
795
|
+
version: 0.16.1
|
|
796
796
|
- !ruby/object:Gem::Dependency
|
|
797
797
|
name: pry-doc
|
|
798
798
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -1121,14 +1121,14 @@ dependencies:
|
|
|
1121
1121
|
requirements:
|
|
1122
1122
|
- - '='
|
|
1123
1123
|
- !ruby/object:Gem::Version
|
|
1124
|
-
version: 2.10.
|
|
1124
|
+
version: 2.10.1
|
|
1125
1125
|
type: :development
|
|
1126
1126
|
prerelease: false
|
|
1127
1127
|
version_requirements: !ruby/object:Gem::Requirement
|
|
1128
1128
|
requirements:
|
|
1129
1129
|
- - '='
|
|
1130
1130
|
- !ruby/object:Gem::Version
|
|
1131
|
-
version: 2.10.
|
|
1131
|
+
version: 2.10.1
|
|
1132
1132
|
- !ruby/object:Gem::Dependency
|
|
1133
1133
|
name: thin
|
|
1134
1134
|
requirement: !ruby/object:Gem::Requirement
|