pwn 0.5.450 → 0.5.451

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: '0947425cd2f0b0fe1fa78c2e0b2bfaec1b600238d60807781a88cb6855f203ff'
4
- data.tar.gz: e4ab15bb551069926e34ed1f58c07ead54faa810cdd73f93f3702fc4f29a20a3
3
+ metadata.gz: 83807b57b3001c59c409d5d38968615691afda19769a3d4e862b4a3b3262dabf
4
+ data.tar.gz: 0fc622109134323b10483427cbfe6a25d55f809a01bb4a57e69280ecfed559c5
5
5
  SHA512:
6
- metadata.gz: c1612e1d9547e7dd8e8e673947b85771cfcb8a996732f593154c5f0df4f93bd52112ba7c79bf52232749e88ff5fe622718755ebe5786000f6f9273d84c778653
7
- data.tar.gz: 5a43a0b8fec2b9099fcd563aec848c0a3b46e22c413a3b4161e502a40ed4610eab900eabaf2f74eaf0096174817409f6931144fe3c3c4976f7edd48d402592e7
6
+ metadata.gz: 6db3dfa4103b3f1b19a4c77b967c37f77e1186dac9c1fb6f7a7d4478e576999e7698a25d95c18a7c2be9a9e34166055d3f415604a504f3f06ba32778e5665852
7
+ data.tar.gz: 97b8f02a6e85f088f9c04bfc766f4290740145f33bbcfed1d714e69a02483f0e6fab1cfe6e2ea849cba88983016935bd33cffbd8124eb725127e73de3be127ed
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.450]:001 >>> PWN.help
40
+ pwn[v0.5.451]: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.450]:001 >>> PWN.help
55
+ pwn[v0.5.451]: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.450]:001 >>> PWN.help
65
+ pwn[v0.5.451]: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:
@@ -336,14 +336,21 @@ module PWN
336
336
  chrome_types = %i[chrome headless_chrome]
337
337
  firefox_types = %i[firefox headless_firefox]
338
338
 
339
- # Future BiDi API that's more universally supported across browsers
340
- sleep 0.01 until browser_obj[:browser].driver.window_handles.any?
339
+ # Switch to the last opened window which should be the active tab
340
+ # if it doesn't work, try the first window handle. In chrome they
341
+ # get reversed sometimes ¯\_(ツ)_/¯
341
342
  target_window_handle = browser_obj[:browser].driver.window_handles.last
342
- browser_obj[:browser].driver.switch_to.window(target_window_handle)
343
+ begin
344
+ browser_obj[:browser].driver.switch_to.window(target_window_handle)
345
+
346
+ url = 'about:about'
347
+ url = 'chrome://chrome-urls' if chrome_types.include?(browser_type)
348
+ browser_obj[:browser].goto(url)
349
+ rescue Selenium::WebDriver::Error::WebDriverError
350
+ target_window_handle = browser_obj[:browser].driver.window_handles.first
351
+ retry
352
+ end
343
353
 
344
- url = 'about:about'
345
- url = 'chrome://chrome-urls/' if chrome_types.include?(browser_type)
346
- browser_obj[:browser].goto(url)
347
354
  rand_tab = SecureRandom.hex(8)
348
355
  browser_obj[:browser].execute_script("document.title = 'about:about-#{rand_tab}'")
349
356
 
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.450'
4
+ VERSION = '0.5.451'
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.450
4
+ version: 0.5.451
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.