pwn 0.5.488 → 0.5.490

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: 1c6b217ab3c5fdf16b2cacd41cfdbc77fdcc4fe4f2095490e831a172022bd8e4
4
- data.tar.gz: 8855d5d95676a6779ec7f81a5c968ca82bbb09e0ffab2ae7bc35d146bce159d8
3
+ metadata.gz: d4c871405c39f70977bc12f378019f8b57d41c7bcb196a0d98ec2ec9c27786f3
4
+ data.tar.gz: a7d7666635a7eb493d673eab21e16185fe13e67f653bbc66aa738bcb375abff1
5
5
  SHA512:
6
- metadata.gz: 17c944994ed32f740d1e2048598229deea593b1a657fe1a7e9e0928cc23052c31a07ccdff30f90242c395b28073ce5c584d8ab9f45a448b5bd0b3f152ab3a972
7
- data.tar.gz: f1ad3887c815aaf1ebff5b7113c55ef0e255891f68fcb39a9b8348dc60db1c10f6e03c87802a6c36d5d51781ad0ae8990978232c6cf63fb08eed608455a6db81
6
+ metadata.gz: 4046713b68f5614414cce21d2367c37609e481043e6279b7816b846b78500dfdc509aa96050763e9882f5c8dcf5f1cdb58e8f5687f3be76476b75a6518b2df98
7
+ data.tar.gz: 384df4144dac12d48b1b1a428b02dfba08d5254687aedca300db6d831cfc4aae11ac079bbf0f339f5aa24b837dcd4f5a3aab862c421b202f6f60323e110d09d4
data/.rubocop.yml CHANGED
@@ -6,7 +6,7 @@ Layout/LineLength:
6
6
  Lint/UselessRescue:
7
7
  Enabled: false
8
8
  Metrics/AbcSize:
9
- Max: 562
9
+ Max: 562.2
10
10
  Metrics/BlockLength:
11
11
  Max: 292
12
12
  Metrics/BlockNesting:
data/Gemfile CHANGED
@@ -49,7 +49,7 @@ gem 'jwt', '3.1.2'
49
49
  gem 'libusb', '0.7.2'
50
50
  gem 'luhn', '3.0.0'
51
51
  gem 'mail', '2.9.0'
52
- gem 'meshtastic', '0.0.139'
52
+ gem 'meshtastic', '0.0.140'
53
53
  gem 'metasm', '1.0.5'
54
54
  gem 'mongo', '2.21.3'
55
55
  gem 'msfrpc-client', '1.1.2'
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.488]:001 >>> PWN.help
40
+ pwn[v0.5.490]: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.488]:001 >>> PWN.help
55
+ pwn[v0.5.490]: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.488]:001 >>> PWN.help
65
+ pwn[v0.5.490]: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:
@@ -487,7 +487,7 @@ module PWN
487
487
  Curses.init_pair(color_id, color_fg, color_bg)
488
488
  end
489
489
  PWN.const_set(:MeshColors, (1..mesh_highlight_colors.length).to_a)
490
- PWN.const_set(:MeshLastPair, PWN::MeshColors.sample)
490
+ PWN.const_set(:MeshLastColor, PWN::MeshColors.sample)
491
491
 
492
492
  mesh_ui_colors = []
493
493
  mesh_highlight_colors.each_with_index do |hl_hash, idx|
@@ -553,7 +553,7 @@ module PWN
553
553
  # Live typing echo thread (idempotent)
554
554
  tx_prompt = "#{region}/#{topic} >>>"
555
555
  echo_thread = Thread.new do
556
- last_drawn = nil
556
+ last_line = nil
557
557
  loop do
558
558
  break unless pi.config.pwn_mesh
559
559
 
@@ -566,7 +566,7 @@ module PWN
566
566
  base_line = "#{prefix}#{msg_input}"
567
567
  cursor_abs_index = prefix.length + cursor_pos
568
568
  current_line = base_line
569
- if current_line != last_drawn
569
+ if last_line != current_line
570
570
  mutex.synchronize do
571
571
  tx_win.clear
572
572
  tx_win.attron(Curses.color_pair(red) | Curses::A_BOLD)
@@ -601,9 +601,9 @@ module PWN
601
601
  tx_win.attroff(Curses.color_pair(yellow) | Curses::A_BOLD)
602
602
  tx_win.refresh
603
603
  end
604
- last_drawn = current_line
604
+ last_line = current_line
605
605
  end
606
- sleep 0.0001
606
+ sleep 0.00001
607
607
  end
608
608
  end
609
609
  echo_thread.abort_on_exception = false
@@ -617,6 +617,7 @@ module PWN
617
617
  detach: true
618
618
  ) do |_|
619
619
  last_from = nil
620
+ last_line = nil
620
621
  Meshtastic::MQTT.subscribe(
621
622
  mqtt_obj: mqtt_obj,
622
623
  region: region,
@@ -639,41 +640,43 @@ module PWN
639
640
  rx_text = decoded[:payload]
640
641
  ts = Time.now.strftime('%Y-%m-%d %H:%M:%S%z')
641
642
 
642
- # Select a random color pair different from the last used one
643
+ # Select a random color different from the last used one
643
644
  colors_arr = PWN.const_get(:MeshColors)
644
- last_pair = PWN.const_get(:MeshLastPair)
645
- pair = last_pair
645
+ last_color = PWN.const_get(:MeshLastColor)
646
+ color = last_color
646
647
  unless last_from == from
647
- PWN.send(:remove_const, :MeshLastPair)
648
- pair_choices = colors_arr.reject { |c| c == last_pair }
649
- pair = pair_choices.sample
650
- PWN.const_set(:MeshLastPair, pair)
648
+ PWN.send(:remove_const, :MeshLastColor)
649
+ color_choices = colors_arr.reject { |c| c == last_color }
650
+ color = color_choices.sample
651
+ PWN.const_set(:MeshLastColor, color)
651
652
  end
652
653
 
653
654
  to_label = 'To'
654
655
  to_label = 'DM' unless to == '!ffffffff'
655
656
  current_line = "\nDate: #{ts}\nFrom: #{from}\n#{to_label}: #{to}\nTopic: #{absolute_topic}\n> #{rx_text}"
656
657
 
657
- rx_body_win = PWN.const_get(:MeshRxBodyWin)
658
- rx_body_win.attron(Curses.color_pair(pair) | Curses::A_REVERSE)
659
- mutex.synchronize do
660
- inner_height = Curses.lines - 5
661
- inner_width = Curses.cols
662
- segments = current_line.scan(/.{1,#{inner_width}}/)
663
- segments.each do |seg|
664
- rx_body_win.setpos(rx_body_win.cury, 0)
665
- # Handle wide Unicode characters for proper alignment
666
- display_width = Unicode::DisplayWidth.of(seg)
667
- width_diff = seg.length - display_width
668
- inner_width = Curses.cols + width_diff
669
- line = seg.ljust(inner_width)
670
- rx_body_win.addstr(line)
658
+ if last_line != current_line
659
+ rx_body_win = PWN.const_get(:MeshRxBodyWin)
660
+ mutex.synchronize do
661
+ inner_height = rx_body_win.maxy - 5
662
+ inner_width = rx_body_win.maxx
663
+ segments = current_line.scan(/.{1,#{inner_width}}/)
664
+ rx_body_win.attron(Curses.color_pair(color) | Curses::A_REVERSE)
665
+ segments.each do |seg|
666
+ rx_body_win.setpos(rx_body_win.cury, 0)
667
+ # Handle wide Unicode characters for proper alignment
668
+ display_width = Unicode::DisplayWidth.of(seg)
669
+ width_diff = seg.length - display_width
670
+ shift_width = inner_width + width_diff
671
+ line = seg.ljust(shift_width)
672
+ rx_body_win.addstr(line)
673
+ end
674
+ rx_body_win.attroff(Curses.color_pair(color) | Curses::A_REVERSE)
675
+ rx_body_win.refresh
671
676
  end
672
- rx_body_win.refresh
677
+ last_line = current_line
678
+ last_from = from
673
679
  end
674
- rx_body_win.attroff(Curses.color_pair(pair) | Curses::A_REVERSE)
675
-
676
- last_from = from
677
680
  end
678
681
  end
679
682
  rescue StandardError => e
@@ -770,7 +773,7 @@ module PWN
770
773
  PWN.send(:remove_const, :MeshTxWin)
771
774
  end
772
775
  PWN.send(:remove_const, :MeshColors) if PWN.const_defined?(:MeshColors)
773
- PWN.send(:remove_const, :MeshLastPair) if PWN.const_defined?(:MeshLastPair)
776
+ PWN.send(:remove_const, :MeshLastColor) if PWN.const_defined?(:MeshLastColor)
774
777
  PWN.send(:remove_const, :MeshMutex) if PWN.const_defined?(:MeshMutex)
775
778
  PWN.send(:remove_const, :MqttSubThread) if PWN.const_defined?(:MqttSubThread)
776
779
  Curses.close_screen
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.488'
4
+ VERSION = '0.5.490'
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.488
4
+ version: 0.5.490
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.139
536
+ version: 0.0.140
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.139
543
+ version: 0.0.140
544
544
  - !ruby/object:Gem::Dependency
545
545
  name: metasm
546
546
  requirement: !ruby/object:Gem::Requirement