pwn 0.5.481 → 0.5.482

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: f8f0ace17ae36a1a8e60fd015ad3c0a37dcaa22fd3490806b4fc033bd974ae70
4
- data.tar.gz: 4a3b5eb17658a0a7c63e6e49bd87cad5740112ed1c2d77207fd0cde9949a50d6
3
+ metadata.gz: f08d37f0ef017a76ac0b7bfea02093a55aebd68954ac13761b6969d4937e44f6
4
+ data.tar.gz: e187138d17aac3845fb86a3166bd7b31013110cd93113227bde83ede9cf4041d
5
5
  SHA512:
6
- metadata.gz: d97493c22667ef54489045fd1bdd5ff8940701fa266e923849f8784feacc546be605154bc215a15823b9c424a4ba025e6bd95d3a1b3e86eba3d70987bc55c6c0
7
- data.tar.gz: 0636daf478dff9780efe1b14478d40d06e109927c955d8d8c50f8c1c8e5c1bd7faaad9cfc8f98254084f4f384cdaa90c4698d563e57d386be38449193600c2e4
6
+ metadata.gz: cd0f3d1caa5a0cc98d79daeb267a7577a1ef2fa1ec40eff5a707743206c9c2cbf4fa6c5fcba124be4bddef90331e91466bbddb94de776df605a72f5f3510e52a
7
+ data.tar.gz: 1dac1bc3dac0ab48b2572d43c1dee10e6c9f89c4389c43acfae4ffff4f8d546e7c29c8f77e95a9cf6d2b23df39fd3303ef85065d7f892037a636051d432378c1
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.481]:001 >>> PWN.help
40
+ pwn[v0.5.482]: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.481]:001 >>> PWN.help
55
+ pwn[v0.5.482]: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.481]:001 >>> PWN.help
65
+ pwn[v0.5.482]: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:
@@ -522,11 +522,11 @@ module PWN
522
522
  rx_win.addstr(rx_header)
523
523
  rx_win.attroff(Curses.color_pair(green) | Curses::A_BOLD)
524
524
  # Jump two lines below header before messages begin
525
- rx_win.setpos(2, 1)
525
+ rx_win.setpos(2, 0)
526
526
  rx_win.attron(Curses.color_pair(cyan) | Curses::A_BOLD)
527
- rx_header_bottom_line = "\u2014" * (Curses.cols - 2)
528
- rx_header_bottom_line_pos = (Curses.cols / 2) - (rx_header_bottom_line.length / 2)
529
- rx_win.addstr(rx_header_bottom_line)
527
+ header_line = "\u2014" * Curses.cols
528
+ rx_header_bottom_line_pos = (Curses.cols / 2) - (header_line.length / 2)
529
+ rx_win.addstr(header_line)
530
530
  rx_win.attroff(Curses.color_pair(cyan) | Curses::A_BOLD)
531
531
 
532
532
  rx_win.refresh
@@ -552,29 +552,27 @@ module PWN
552
552
  mutex = PWN.const_get(:MeshMutex)
553
553
  msg_input = pi.input.line_buffer.to_s
554
554
  ts = Time.now.strftime('%H:%M:%S%z')
555
- cursor_pos = (Readline.respond_to?(:point) ? Readline.point : msg_input.length)
555
+ cursor_pos = Readline.point
556
556
  prefix = "[#{ts}] [TX] #{tx_prompt} "
557
557
  base_line = "#{prefix}#{msg_input}"
558
558
  cursor_abs_index = prefix.length + cursor_pos
559
559
  current_line = base_line
560
560
  if current_line != last_drawn
561
561
  mutex.synchronize do
562
- # Only show draft if after_read hook hasn't just written final TX (heuristic)
563
562
  tx_win.clear
564
563
  tx_win.attron(Curses.color_pair(red) | Curses::A_BOLD)
565
- tx_header_bottom_line = "\u2014" * (Curses.cols - 2)
566
- tx_header_bottom_line_pos = (Curses.cols / 2) - (rx_header_bottom_line.length / 2)
567
- tx_win.addstr(rx_header_bottom_line)
564
+ tx_header_line_pos = (Curses.cols / 2) - (header_line.length / 2)
565
+ tx_win.addstr(header_line)
568
566
  tx_win.attroff(Curses.color_pair(red) | Curses::A_BOLD)
569
- tx_win.attron(Curses.color_pair(yellow) | Curses::A_BOLD)
570
567
 
571
- inner_width = Curses.cols - 2
568
+ tx_win.attron(Curses.color_pair(yellow) | Curses::A_BOLD)
569
+ inner_width = Curses.cols
572
570
  segments = current_line.chars.each_slice(inner_width).map(&:join)
573
- available_rows = tx_win.maxy - 2
571
+ available_rows = tx_win.maxy - 1
574
572
  segments.first(available_rows).each_with_index do |seg, idx|
575
- tx_win.setpos(1 + idx, 1)
573
+ tx_win.setpos(1 + idx, 0)
576
574
  start_index = idx * inner_width
577
- end_index = start_index + inner_width - 1
575
+ end_index = start_index + inner_width
578
576
  if cursor_abs_index.between?(start_index, end_index)
579
577
  cursor_col = cursor_abs_index - start_index
580
578
  (0..inner_width).each do |col|
@@ -596,7 +594,7 @@ module PWN
596
594
  end
597
595
  last_drawn = current_line
598
596
  end
599
- sleep 0.005
597
+ sleep 0.001
600
598
  end
601
599
  end
602
600
  echo_thread.abort_on_exception = false
@@ -609,6 +607,7 @@ module PWN
609
607
  max_threads: 1,
610
608
  detach: true
611
609
  ) do |_|
610
+ last_from = nil
612
611
  Meshtastic::MQTT.subscribe(
613
612
  mqtt_obj: mqtt_obj,
614
613
  region: region,
@@ -635,8 +634,12 @@ module PWN
635
634
  colors_arr = PWN.const_get(:MeshColors)
636
635
  last_pair = PWN.const_get(:MeshLastPair)
637
636
  PWN.send(:remove_const, :MeshLastPair)
638
- pair_choices = colors_arr.reject { |c| c == last_pair }
639
- pair = pair_choices.sample
637
+ if last_from != from
638
+ pair_choices = colors_arr.reject { |c| c == last_pair }
639
+ pair = pair_choices.sample
640
+ else
641
+ pair = last_pair
642
+ end
640
643
  PWN.const_set(:MeshLastPair, pair)
641
644
  rx_win.attron(Curses.color_pair(pair) | Curses::A_REVERSE)
642
645
 
@@ -656,6 +659,8 @@ module PWN
656
659
  rx_win.refresh
657
660
  end
658
661
  rx_win.attroff(Curses.color_pair(pair) | Curses::A_REVERSE)
662
+
663
+ last_from = from
659
664
  end
660
665
  end
661
666
  rescue StandardError => e
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.481'
4
+ VERSION = '0.5.482'
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.481
4
+ version: 0.5.482
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.