pwn 0.5.484 → 0.5.486
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 +1 -1
- data/README.md +3 -3
- data/lib/pwn/plugins/repl.rb +15 -12
- data/lib/pwn/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6a00e0d95c9e0be5169eab1f252c92cc8df842179dee67a42e344d6d5180ca15
|
|
4
|
+
data.tar.gz: 6790637bca216986e41e89958f596b583bc9a36dea307e5723cbfb6a4b538153
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c5a75d88b69df64071efbf705a117e49d18b03a46aa895696133b6dac2bf7cb7572bbe8149f08e7440cdcf5a37324b2c167defa24239eff2009ec15007b73017
|
|
7
|
+
data.tar.gz: 0a9df8092b26b299908e04789474a45eef61a792edd1cd4ee76b9efb977e14a049135186ec232f5a801e89a9e3fb3c511a1faed29fcaa92a8744013cace766c7
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -37,7 +37,7 @@ $ cd /opt/pwn
|
|
|
37
37
|
$ ./install.sh
|
|
38
38
|
$ ./install.sh ruby-gem
|
|
39
39
|
$ pwn
|
|
40
|
-
pwn[v0.5.
|
|
40
|
+
pwn[v0.5.486]:001 >>> PWN.help
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
[](https://youtu.be/G7iLUY4FzsI)
|
|
@@ -52,7 +52,7 @@ $ rvm use ruby-3.4.4@pwn
|
|
|
52
52
|
$ gem uninstall --all --executables pwn
|
|
53
53
|
$ gem install --verbose pwn
|
|
54
54
|
$ pwn
|
|
55
|
-
pwn[v0.5.
|
|
55
|
+
pwn[v0.5.486]:001 >>> PWN.help
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
If you're using a multi-user install of RVM do:
|
|
@@ -62,7 +62,7 @@ $ rvm use ruby-3.4.4@pwn
|
|
|
62
62
|
$ rvmsudo gem uninstall --all --executables pwn
|
|
63
63
|
$ rvmsudo gem install --verbose pwn
|
|
64
64
|
$ pwn
|
|
65
|
-
pwn[v0.5.
|
|
65
|
+
pwn[v0.5.486]:001 >>> PWN.help
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
PWN periodically upgrades to the latest version of Ruby which is reflected in `/opt/pwn/.ruby-version`. The easiest way to upgrade to the latest version of Ruby from a previous PWN installation is to run the following script:
|
data/lib/pwn/plugins/repl.rb
CHANGED
|
@@ -5,6 +5,7 @@ require 'fileutils'
|
|
|
5
5
|
require 'meshtastic'
|
|
6
6
|
require 'pry'
|
|
7
7
|
require 'tty-prompt'
|
|
8
|
+
require 'unicode/display_width'
|
|
8
9
|
require 'yaml'
|
|
9
10
|
|
|
10
11
|
module PWN
|
|
@@ -433,7 +434,6 @@ module PWN
|
|
|
433
434
|
PWN.send(:remove_const, :MqttObj) if PWN.const_defined?(:MqttObj)
|
|
434
435
|
PWN.send(:remove_const, :MeshRxWin) if PWN.const_defined?(:MeshRxWin)
|
|
435
436
|
PWN.send(:remove_const, :MeshTxWin) if PWN.const_defined?(:MeshTxWin)
|
|
436
|
-
PWN.send(:remove_const, :MeshPi) if PWN.const_defined?(:MeshPi)
|
|
437
437
|
PWN.send(:remove_const, :MeshMutex) if PWN.const_defined?(:MeshMutex)
|
|
438
438
|
PWN.send(:remove_const, :MqttSubThread) if PWN.const_defined?(:MqttSubThread)
|
|
439
439
|
|
|
@@ -509,7 +509,8 @@ module PWN
|
|
|
509
509
|
|
|
510
510
|
rx_height = Curses.lines - 4
|
|
511
511
|
rx_win = Curses::Window.new(rx_height, Curses.cols, 0, 0)
|
|
512
|
-
|
|
512
|
+
# TODO: Scrollable but should stay below header_line
|
|
513
|
+
rx_win.scrollok(true)
|
|
513
514
|
rx_win.nodelay = true
|
|
514
515
|
rx_win.attron(Curses.color_pair(cyan) | Curses::A_BOLD)
|
|
515
516
|
|
|
@@ -540,7 +541,6 @@ module PWN
|
|
|
540
541
|
PWN.const_set(:MeshRxWin, rx_win)
|
|
541
542
|
PWN.const_set(:MeshTxWin, tx_win)
|
|
542
543
|
PWN.const_set(:MeshMutex, Mutex.new)
|
|
543
|
-
PWN.const_set(:MeshPi, pi)
|
|
544
544
|
|
|
545
545
|
# Live typing echo thread (idempotent)
|
|
546
546
|
tx_prompt = "#{region}/#{topic} >>>"
|
|
@@ -625,11 +625,11 @@ module PWN
|
|
|
625
625
|
rx_win = PWN.const_get(:MeshRxWin)
|
|
626
626
|
mutex = PWN.const_get(:MeshMutex)
|
|
627
627
|
|
|
628
|
-
from = "#{packet[:node_id_from]} ".ljust(
|
|
628
|
+
from = "#{packet[:node_id_from]} ".ljust(9, ' ')
|
|
629
629
|
absolute_topic = "#{region}/#{topic.gsub('#', from)}"
|
|
630
630
|
to = packet[:node_id_to]
|
|
631
631
|
rx_text = decoded[:payload]
|
|
632
|
-
ts = Time.now.strftime('%H:%M:%S%z')
|
|
632
|
+
ts = Time.now.strftime('%Y-%m-%d %H:%M:%S%z')
|
|
633
633
|
|
|
634
634
|
# Select a random color pair different from the last used one
|
|
635
635
|
colors_arr = PWN.const_get(:MeshColors)
|
|
@@ -641,20 +641,24 @@ module PWN
|
|
|
641
641
|
pair = pair_choices.sample
|
|
642
642
|
PWN.const_set(:MeshLastPair, pair)
|
|
643
643
|
end
|
|
644
|
-
rx_win.attron(Curses.color_pair(pair) | Curses::A_REVERSE)
|
|
645
644
|
|
|
646
|
-
|
|
647
|
-
|
|
645
|
+
to_label = 'To'
|
|
646
|
+
to_label = 'DM' unless to == '!ffffffff'
|
|
647
|
+
current_line = "\nDate: #{ts}\nFrom: #{from}\n#{to_label}: #{to}\nTopic: #{absolute_topic}\n> #{rx_text}"
|
|
648
648
|
|
|
649
|
+
rx_win.attron(Curses.color_pair(pair) | Curses::A_REVERSE)
|
|
649
650
|
mutex.synchronize do
|
|
650
651
|
inner_width = Curses.cols
|
|
651
|
-
|
|
652
|
-
segments = content.scan(/.{1,#{inner_width}}/)
|
|
652
|
+
segments = current_line.scan(/.{1,#{inner_width}}/)
|
|
653
653
|
segments.each do |seg|
|
|
654
|
-
# rx_win.addstr("\n")
|
|
655
654
|
rx_win.setpos(rx_win.cury, 0)
|
|
655
|
+
# Handle wide Unicode characters for proper alignment
|
|
656
|
+
display_width = Unicode::DisplayWidth.of(seg)
|
|
657
|
+
width_diff = seg.length - display_width
|
|
658
|
+
inner_width = Curses.cols + width_diff
|
|
656
659
|
line = seg.ljust(inner_width)
|
|
657
660
|
rx_win.addstr(line)
|
|
661
|
+
# rx_win.addstr("Inner Width: #{inner_width} width_diff: #{width_diff} display_width: #{display_width} seg.length: #{seg.length}\n")
|
|
658
662
|
end
|
|
659
663
|
rx_win.refresh
|
|
660
664
|
end
|
|
@@ -752,7 +756,6 @@ module PWN
|
|
|
752
756
|
end
|
|
753
757
|
PWN.send(:remove_const, :MeshColors) if PWN.const_defined?(:MeshColors)
|
|
754
758
|
PWN.send(:remove_const, :MeshLastPair) if PWN.const_defined?(:MeshLastPair)
|
|
755
|
-
PWN.send(:remove_const, :MeshPi) if PWN.const_defined?(:MeshPi)
|
|
756
759
|
PWN.send(:remove_const, :MeshMutex) if PWN.const_defined?(:MeshMutex)
|
|
757
760
|
PWN.send(:remove_const, :MqttSubThread) if PWN.const_defined?(:MqttSubThread)
|
|
758
761
|
Curses.close_screen
|
data/lib/pwn/version.rb
CHANGED
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.486
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- 0day Inc.
|
|
@@ -533,14 +533,14 @@ dependencies:
|
|
|
533
533
|
requirements:
|
|
534
534
|
- - '='
|
|
535
535
|
- !ruby/object:Gem::Version
|
|
536
|
-
version: 0.0.
|
|
536
|
+
version: 0.0.137
|
|
537
537
|
type: :runtime
|
|
538
538
|
prerelease: false
|
|
539
539
|
version_requirements: !ruby/object:Gem::Requirement
|
|
540
540
|
requirements:
|
|
541
541
|
- - '='
|
|
542
542
|
- !ruby/object:Gem::Version
|
|
543
|
-
version: 0.0.
|
|
543
|
+
version: 0.0.137
|
|
544
544
|
- !ruby/object:Gem::Dependency
|
|
545
545
|
name: metasm
|
|
546
546
|
requirement: !ruby/object:Gem::Requirement
|