pwn 0.5.487 → 0.5.488

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: 39f11158eacd6a873c2699f6f642591ed8b4de2ba64ce73f96b84f56f35a81e8
4
- data.tar.gz: '08b0fb7f0b619bfb20e1fb97b083a180c215a662f90383a43b22785e2e57e5fd'
3
+ metadata.gz: 1c6b217ab3c5fdf16b2cacd41cfdbc77fdcc4fe4f2095490e831a172022bd8e4
4
+ data.tar.gz: 8855d5d95676a6779ec7f81a5c968ca82bbb09e0ffab2ae7bc35d146bce159d8
5
5
  SHA512:
6
- metadata.gz: fc7d789f23c35d20ab41229e87903c8a618da4fef1518b51291fe534b888a3d0cfcb36af7f824bef116f224034ba8e9d071a7e88fa1a7ad2cdb6b418fe2498db
7
- data.tar.gz: b36f00d2e5a3118c561415be867d14eae5b2ec54b6dac67c32840bc434585fac9a1f1633b2f81178b495f3900ee5f567b7c63c5b4402779826b1cd952fa63b64
6
+ metadata.gz: 17c944994ed32f740d1e2048598229deea593b1a657fe1a7e9e0928cc23052c31a07ccdff30f90242c395b28073ce5c584d8ab9f45a448b5bd0b3f152ab3a972
7
+ data.tar.gz: f1ad3887c815aaf1ebff5b7113c55ef0e255891f68fcb39a9b8348dc60db1c10f6e03c87802a6c36d5d51781ad0ae8990978232c6cf63fb08eed608455a6db81
data/.rubocop.yml CHANGED
@@ -6,7 +6,7 @@ Layout/LineLength:
6
6
  Lint/UselessRescue:
7
7
  Enabled: false
8
8
  Metrics/AbcSize:
9
- Max: 552.3
9
+ Max: 562
10
10
  Metrics/BlockLength:
11
11
  Max: 292
12
12
  Metrics/BlockNesting:
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.487]:001 >>> PWN.help
40
+ pwn[v0.5.488]:001 >>> PWN.help
41
41
  ```
42
42
 
43
43
  [![Installing the pwn Security Automation Framework](https://raw.githubusercontent.com/0dayInc/pwn/master/documentation/pwn_install.png)](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.487]:001 >>> PWN.help
55
+ pwn[v0.5.488]: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.487]:001 >>> PWN.help
65
+ pwn[v0.5.488]: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:
@@ -432,7 +432,8 @@ module PWN
432
432
 
433
433
  PWN.send(:remove_const, :MeshTxEchoThread) if PWN.const_defined?(:MeshTxEchoThread)
434
434
  PWN.send(:remove_const, :MqttObj) if PWN.const_defined?(:MqttObj)
435
- PWN.send(:remove_const, :MeshRxWin) if PWN.const_defined?(:MeshRxWin)
435
+ PWN.send(:remove_const, :MeshRxHeaderWin) if PWN.const_defined?(:MeshRxHeaderWin)
436
+ PWN.send(:remove_const, :MeshRxBodyWin) if PWN.const_defined?(:MeshRxBodyWin)
436
437
  PWN.send(:remove_const, :MeshTxWin) if PWN.const_defined?(:MeshTxWin)
437
438
  PWN.send(:remove_const, :MeshMutex) if PWN.const_defined?(:MeshMutex)
438
439
  PWN.send(:remove_const, :MqttSubThread) if PWN.const_defined?(:MqttSubThread)
@@ -508,29 +509,37 @@ module PWN
508
509
  white = mesh_ui_colors[6][:color_id]
509
510
 
510
511
  rx_height = Curses.lines - 4
511
- rx_win = Curses::Window.new(rx_height, Curses.cols, 0, 0)
512
+ rx_header_win = Curses::Window.new(rx_height, Curses.cols, 0, 0)
512
513
  # TODO: Scrollable but should stay below header_line
513
- rx_win.scrollok(true)
514
- rx_win.nodelay = true
515
- rx_win.attron(Curses.color_pair(cyan) | Curses::A_BOLD)
514
+ rx_header_win.scrollok(false)
515
+ rx_header_win.nodelay = true
516
+ rx_header_win.attron(Curses.color_pair(cyan) | Curses::A_BOLD)
516
517
 
517
518
  # Make rx_header bold and green
518
- rx_win.attron(Curses.color_pair(green) | Curses::A_BOLD)
519
+ rx_header_win.attron(Curses.color_pair(green) | Curses::A_BOLD)
519
520
  rx_header = "<<< #{host}:#{port} | #{region}/#{topic} | ch:#{channel_num} >>>"
520
521
  rx_header_len = rx_header.length
521
522
  rx_header_pos = (Curses.cols / 2) - (rx_header_len / 2)
522
- rx_win.setpos(1, rx_header_pos)
523
- rx_win.addstr(rx_header)
524
- rx_win.attroff(Curses.color_pair(green) | Curses::A_BOLD)
523
+ rx_header_win.setpos(1, rx_header_pos)
524
+ rx_header_win.addstr(rx_header)
525
+ rx_header_win.attroff(Curses.color_pair(green) | Curses::A_BOLD)
525
526
  # Jump two lines below header before messages begin
526
- rx_win.setpos(2, 0)
527
- rx_win.attron(Curses.color_pair(cyan) | Curses::A_BOLD)
527
+ rx_header_win.setpos(2, 0)
528
+ rx_header_win.attron(Curses.color_pair(cyan) | Curses::A_BOLD)
528
529
  header_line = "\u2014" * Curses.cols
529
530
  rx_header_bottom_line_pos = (Curses.cols / 2) - (header_line.length / 2)
530
- rx_win.addstr(header_line)
531
- rx_win.attroff(Curses.color_pair(cyan) | Curses::A_BOLD)
532
-
533
- rx_win.refresh
531
+ rx_header_win.addstr(header_line)
532
+ rx_header_win.attroff(Curses.color_pair(cyan) | Curses::A_BOLD)
533
+ rx_header_win.refresh
534
+ PWN.const_set(:MeshRxHeaderWin, rx_header_win)
535
+
536
+ body_start_row = 3
537
+ body_height = rx_height - body_start_row
538
+ rx_body_win = Curses::Window.new(body_height, Curses.cols, body_start_row, 0)
539
+ rx_body_win.scrollok(true)
540
+ rx_body_win.nodelay = true
541
+ rx_body_win.refresh
542
+ PWN.const_set(:MeshRxBodyWin, rx_body_win)
534
543
 
535
544
  tx_height = rx_height - 1
536
545
  tx_win = Curses::Window.new(4, Curses.cols, tx_height, 0)
@@ -538,7 +547,6 @@ module PWN
538
547
  tx_win.nodelay = true
539
548
  tx_win.refresh
540
549
 
541
- PWN.const_set(:MeshRxWin, rx_win)
542
550
  PWN.const_set(:MeshTxWin, tx_win)
543
551
  PWN.const_set(:MeshMutex, Mutex.new)
544
552
 
@@ -622,7 +630,7 @@ module PWN
622
630
  decoded = packet[:decoded]
623
631
  next unless decoded.key?(:portnum) && decoded[:portnum] == :TEXT_MESSAGE_APP
624
632
 
625
- rx_win = PWN.const_get(:MeshRxWin)
633
+ # rx_header_win = PWN.const_get(:MeshRxHeaderWin)
626
634
  mutex = PWN.const_get(:MeshMutex)
627
635
 
628
636
  from = "#{packet[:node_id_from]} ".ljust(9, ' ')
@@ -646,26 +654,24 @@ module PWN
646
654
  to_label = 'DM' unless to == '!ffffffff'
647
655
  current_line = "\nDate: #{ts}\nFrom: #{from}\n#{to_label}: #{to}\nTopic: #{absolute_topic}\n> #{rx_text}"
648
656
 
649
- rx_win.attron(Curses.color_pair(pair) | Curses::A_REVERSE)
657
+ rx_body_win = PWN.const_get(:MeshRxBodyWin)
658
+ rx_body_win.attron(Curses.color_pair(pair) | Curses::A_REVERSE)
650
659
  mutex.synchronize do
651
660
  inner_height = Curses.lines - 5
652
661
  inner_width = Curses.cols
653
662
  segments = current_line.scan(/.{1,#{inner_width}}/)
654
663
  segments.each do |seg|
655
- # TODO: Show new messages without scrolling above header line
656
- rx_win.scroll if rx_win.cury >= (inner_height - 1)
657
-
658
- rx_win.setpos(rx_win.cury, 0)
664
+ rx_body_win.setpos(rx_body_win.cury, 0)
659
665
  # Handle wide Unicode characters for proper alignment
660
666
  display_width = Unicode::DisplayWidth.of(seg)
661
667
  width_diff = seg.length - display_width
662
668
  inner_width = Curses.cols + width_diff
663
669
  line = seg.ljust(inner_width)
664
- rx_win.addstr(line)
670
+ rx_body_win.addstr(line)
665
671
  end
666
- rx_win.refresh
672
+ rx_body_win.refresh
667
673
  end
668
- rx_win.attroff(Curses.color_pair(pair) | Curses::A_REVERSE)
674
+ rx_body_win.attroff(Curses.color_pair(pair) | Curses::A_REVERSE)
669
675
 
670
676
  last_from = from
671
677
  end
@@ -749,10 +755,16 @@ module PWN
749
755
  PWN.send(:remove_const, :MqttObj)
750
756
  end
751
757
 
752
- if PWN.const_defined?(:MeshRxWin)
753
- PWN.const_get(:MeshRxWin).close
754
- PWN.send(:remove_const, :MeshRxWin)
758
+ if PWN.const_defined?(:MeshRxHeaderWin)
759
+ PWN.const_get(:MeshRxHeaderWin).close
760
+ PWN.send(:remove_const, :MeshRxHeaderWin)
755
761
  end
762
+
763
+ if PWN.const_defined?(:MeshRxBodyWin)
764
+ PWN.const_get(:MeshRxBodyWin).close
765
+ PWN.send(:remove_const, :MeshRxBodyWin)
766
+ end
767
+
756
768
  if PWN.const_defined?(:MeshTxWin)
757
769
  PWN.const_get(:MeshTxWin).close
758
770
  PWN.send(:remove_const, :MeshTxWin)
data/lib/pwn/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PWN
4
- VERSION = '0.5.487'
4
+ VERSION = '0.5.488'
5
5
  end
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.487
4
+ version: 0.5.488
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.