pwn 0.5.316 → 0.5.317

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: 987e7f6f41786a977a0e1dbd0977fe614dbaf90be3cc901d2d00e20f282085b3
4
- data.tar.gz: 252b0917e5f09d430db0f4603a12cd7a49fdd13348e30d6dca9b9861bc3bb161
3
+ metadata.gz: 867fb28f8e587319ad4cdaa05757178c1cb4c89dcb6d02904b795f1afc5bf6bd
4
+ data.tar.gz: c3c9c9bd85f6654a3ac22ce2771165d696914cbaf3b55936bedafda60fa61742
5
5
  SHA512:
6
- metadata.gz: 970119688679e2e6fb8a3eb0e4ec80d7d995fd1e2bbb7b6aa55fc8c182a76efdfa9a9514dc9ff61dffa3849d8c3c78ca936fa3ab2c0b3ad67691e3d949a83f2e
7
- data.tar.gz: c6c18e9ddf30be351947e11f7a04a082adeb0ac5c7ed951311a4f35ae8ec9d60f051e4b8133bfd4ac0ab2c635794dac642873942956c151f56b76a6701cfde1b
6
+ metadata.gz: 9bbf94f9caf372277d1637967f8ad5d0d9f83ddd306b05f1e631c8d3276054abbcfda50d2637e6fb89676bc9215a9fe37e40fe415333ee9d46ed14adc293131e
7
+ data.tar.gz: 056e03f80f7a641093f10dc405a18dfbd44f4dc4fce653d9097885f5802122fa74dda3c3477a1bfdeee47051844c296445dcd1d33d564f2afab0e61ee1eebea6
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.316]:001 >>> PWN.help
40
+ pwn[v0.5.317]: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.316]:001 >>> PWN.help
55
+ pwn[v0.5.317]: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.316]:001 >>> PWN.help
65
+ pwn[v0.5.317]: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:
@@ -724,30 +724,30 @@ module PWN
724
724
  browser_obj = opts[:browser_obj]
725
725
  verify_devtools_browser(browser_obj: browser_obj)
726
726
 
727
- browser = browser_obj[:browser]
728
- current_window_handle = browser.driver.current_window_handle
727
+ current_window_handle = browser_obj[:browser].driver.window_handle
729
728
 
730
729
  tabs_arr_hash = []
731
- browser.driver.window_handles.each_with_index do |window_handle, idx|
730
+ browser_obj[:browser].driver.window_handles.each do |window_handle|
732
731
  # Skip DevTools tabs
733
- next if browser.driver.switch_to.window(window_handle).url.include?('devtools://')
732
+ browser_obj[:browser].driver.switch_to.window(window_handle)
733
+ title = browser_obj[:browser].execute_script('return document.title')
734
+ url = browser_obj[:browser].execute_script('return document.location.href')
735
+ next if url.include?('devtools://')
734
736
 
735
737
  # Get title and URL without switching tabs
736
- title = browser.execute_script('return document.title')
737
- url = browser.url
738
738
 
739
739
  state = window_handle == current_window_handle ? :active : :inactive
740
740
 
741
741
  tabs_arr_hash << { index: window_handle, title: title, url: url, state: state }
742
742
  ensure
743
743
  # Ensure we return to the original active tab
744
- browser.driver.switch_to.window(current_window_handle)
744
+ browser_obj[:browser].driver.switch_to.window(current_window_handle)
745
745
  end
746
746
 
747
747
  # Ensure we have a visible tab that's active
748
748
  active_tab = tabs_arr_hash.find { |tab| tab[:state] == :active } || tabs_arr_hash.first
749
749
  # Switch to the active tab if it exists
750
- browser.driver.switch_to.window(active_tab[:index]) if active_tab
750
+ browser_obj[:browser].driver.switch_to.window(active_tab[:index]) if active_tab
751
751
 
752
752
  tabs_arr_hash
753
753
  rescue Selenium::WebDriver::Error::NoSuchWindowError => e
@@ -757,40 +757,6 @@ module PWN
757
757
  raise "Failed to list tabs: #{e.message}"
758
758
  end
759
759
 
760
- # Supported Method Parameters::
761
- # tabs = PWN::Plugins::TransparentBrowser.list_tabs_legacy(
762
- # browser_obj: 'required - browser_obj returned from #open method)'
763
- # )
764
-
765
- public_class_method def self.list_tabs_legacy(opts = {})
766
- browser_obj = opts[:browser_obj]
767
- verify_devtools_browser(browser_obj: browser_obj)
768
-
769
- idx = 0
770
- current_window_handle = browser_obj[:browser].driver.window_handle
771
-
772
- tabs_arr_hash = browser_obj[:browser].windows.map do |tab|
773
- next if tab.url.include?('devtools://')
774
-
775
- state = :inactive
776
- window_handle = browser_obj[:browser].driver.window_handles[idx]
777
- state = :active if window_handle == current_window_handle
778
-
779
- idx += 1
780
-
781
- { index: window_handle, title: tab.title, url: tab.url, state: state }
782
- end.compact
783
-
784
- # Ensure we have a visible tab that's active
785
- active_tab = tabs_arr_hash.find { |tab| tab[:state] == :active } || tabs_arr_hash.first
786
- # Ensure we're back to the active tab
787
- browser_obj[:browser].driver.switch_to.window(active_tab[:index])
788
-
789
- tabs_arr_hash
790
- rescue StandardError => e
791
- raise e
792
- end
793
-
794
760
  # Supported Method Parameters::
795
761
  # tab = PWN::Plugins::TransparentBrowser.jmp_tab(
796
762
  # browser_obj: 'required - browser_obj returned from #open method)',
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.316'
4
+ VERSION = '0.5.317'
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.316
4
+ version: 0.5.317
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.