pwn 0.5.186 → 0.5.187

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: 2ff25e4be2c1f9ef0475858c8d712b2fed42595a90c64f607172d6c53ef2d3ca
4
- data.tar.gz: 320d9f7ababc3d72a10568f8ccf88dcc53408202fedd859e1d633f9f552d16d9
3
+ metadata.gz: 50a533cec3772f1ba3206b4c9ad3c781c69ffd578fb5f2b517f65080d6601837
4
+ data.tar.gz: c382a547d23fdc83f615605a88c8cfd6fb25875ca8b838d62b3deb84cbfe3e82
5
5
  SHA512:
6
- metadata.gz: 3e09bf1806d28938bfd208a1188db648e2b2501d00d23292e4471351576d3538f63b576b16bea919d14dfddc6cb73f4a1d25192b196caf191656db13e78af832
7
- data.tar.gz: be94d3161a65b1c9b5c04885a95971384c32d341c38feec4f414c18e96af1146ddd473c2301dfd9f51e671881f09c9695f4e81c8455f2ea0066ee44be6357a9a
6
+ metadata.gz: bd7f4abe077384ec01028d5886785e36360f9e02e0e2c54c9642649578d4336c8d1257efaff62c93fe1dc7bc6fc53ac86dfedea70aedf053c7f65f151e5d6fba
7
+ data.tar.gz: 1e93386db70d9d43d19c1b2fc14b9eb05760ca2192cc43cc9454dfc830f865233fef574a9c537415314fc1ab5832c57cdf6d9c5cd25932ddc23456c898935d0e
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.186]:001 >>> PWN.help
40
+ pwn[v0.5.187]: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.3.3@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.5.186]:001 >>> PWN.help
55
+ pwn[v0.5.187]: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.3.3@pwn
62
62
  $ rvmsudo gem uninstall --all --executables pwn
63
63
  $ rvmsudo gem install --verbose pwn
64
64
  $ pwn
65
- pwn[v0.5.186]:001 >>> PWN.help
65
+ pwn[v0.5.187]: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:
@@ -285,8 +285,7 @@ module PWN
285
285
 
286
286
  if devtools_supported.include?(browser_type)
287
287
  rand_tab = SecureRandom.hex(8)
288
- browser_obj[:browser].goto('about:about')
289
- browser_obj[:browser].execute_script("document.title = '#{rand_tab}'")
288
+ browser_obj[:browser].goto("about:about##{rand_tab}")
290
289
 
291
290
  if with_devtools
292
291
  driver = browser_obj[:browser].driver
@@ -492,9 +491,8 @@ module PWN
492
491
  devtools = browser_obj[:devtools]
493
492
  browser.execute_script('window.open()')
494
493
  jmp_tab(browser_obj: browser_obj, keyword: 'about:blank')
495
- browser.goto('about:about') if url.nil?
496
494
  rand_tab = SecureRandom.hex(8)
497
- browser.execute_script("document.title = '#{rand_tab}'")
495
+ browser.goto("about:about##{rand_tab}") if url.nil?
498
496
  # Open the DevTools for Firefox, Chrome opens them automatically
499
497
  browser.body.send_keys(:f12) if firefox_types.include?(browser_type)
500
498
  # Open Console drawer if DevTools are open
@@ -520,6 +518,13 @@ module PWN
520
518
  raise 'ERROR: keyword parameter is required' if keyword.nil?
521
519
 
522
520
  browser = browser_obj[:browser]
521
+ # Switch to an inactive tab before closing the active tab if it's currently active
522
+ active_tab = list_tabs(browser_obj: browser_obj).find { |tab| tab[:state] == :active }
523
+ if active_tab[:url] == browser.url
524
+ invalid_tab = list_tabs(browser_obj: browser_obj).find { |tab| tab[:url] != browser.url }
525
+ keyword = invalid_tab[:url]
526
+ jmp_tab(browser_obj: browser_obj, keyword: keyword)
527
+ end
523
528
  all_tabs = browser.windows
524
529
  tab_sel = all_tabs.select { |tab| tab.close if tab.title.include?(keyword) || tab.url.include?(keyword) }
525
530
  { title: tab_sel.last.title, url: tab_sel.last.url, state: :closed } if tab_sel.any?
@@ -660,6 +665,8 @@ module PWN
660
665
  firefox_types = %i[firefox headless_firefox]
661
666
  chrome_types = %i[chrome headless_chrome]
662
667
 
668
+ hotkey = []
669
+
663
670
  case PWN::Plugins::DetectOS.type
664
671
  when :linux, :openbsd, :windows
665
672
  hotkey = %i[control shift]
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.186'
4
+ VERSION = '0.5.187'
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.186
4
+ version: 0.5.187
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.