pwn 0.5.186 → 0.5.188

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ff25e4be2c1f9ef0475858c8d712b2fed42595a90c64f607172d6c53ef2d3ca
4
- data.tar.gz: 320d9f7ababc3d72a10568f8ccf88dcc53408202fedd859e1d633f9f552d16d9
3
+ metadata.gz: 7d177d8ba3adcb7aca7b75e94b2bb1693a207578ad900afa123c55d4ffff71ec
4
+ data.tar.gz: 602fdf082a592e42a7b59f371682d60e2243b8e98e811f3ca8422b1c13247258
5
5
  SHA512:
6
- metadata.gz: 3e09bf1806d28938bfd208a1188db648e2b2501d00d23292e4471351576d3538f63b576b16bea919d14dfddc6cb73f4a1d25192b196caf191656db13e78af832
7
- data.tar.gz: be94d3161a65b1c9b5c04885a95971384c32d341c38feec4f414c18e96af1146ddd473c2301dfd9f51e671881f09c9695f4e81c8455f2ea0066ee44be6357a9a
6
+ metadata.gz: 7616d1af83026a31ba41f23b69cf65b85721e6a7770f1611a49ed417ac16c584019b8515d4e6b92f45c0c00c87f655877676a506ce9b2278ae439a243cdbcb7d
7
+ data.tar.gz: 36b19d1c5480a03bdf2e344cbdde7796815c316f41c2754912a2c8c8fd9ef7294f5f157b495290978aeeaeb3da6e2b5348dd84ac986d3dff70695b92f999323f
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.188]: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.188]: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.188]: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,13 +491,15 @@ 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
+ if url.nil?
496
+ browser.goto("about:about##{rand_tab}")
497
+ browser.execute_script("document.title = '#{rand_tab}'")
498
+ end
498
499
  # Open the DevTools for Firefox, Chrome opens them automatically
499
500
  browser.body.send_keys(:f12) if firefox_types.include?(browser_type)
500
501
  # Open Console drawer if DevTools are open
501
- browser.body.send_keys(:escape) if devtools
502
+ browser.body.send_keys(:escape) unless devtools.nil?
502
503
  browser.goto(url) unless url.nil?
503
504
 
504
505
  { title: browser.title, url: browser.url, state: :active }
@@ -520,6 +521,13 @@ module PWN
520
521
  raise 'ERROR: keyword parameter is required' if keyword.nil?
521
522
 
522
523
  browser = browser_obj[:browser]
524
+ # Switch to an inactive tab before closing the active tab if it's currently active
525
+ active_tab = list_tabs(browser_obj: browser_obj).select { |tab| tab[:state] == :active }
526
+ if active_tab.last[:url] == browser.url
527
+ invalid_tab = list_tabs(browser_obj: browser_obj).select { |tab| tab[:url] != browser.url }
528
+ keyword = invalid_tab.last[:url]
529
+ jmp_tab(browser_obj: browser_obj, keyword: keyword)
530
+ end
523
531
  all_tabs = browser.windows
524
532
  tab_sel = all_tabs.select { |tab| tab.close if tab.title.include?(keyword) || tab.url.include?(keyword) }
525
533
  { title: tab_sel.last.title, url: tab_sel.last.url, state: :closed } if tab_sel.any?
@@ -660,6 +668,7 @@ module PWN
660
668
  firefox_types = %i[firefox headless_firefox]
661
669
  chrome_types = %i[chrome headless_chrome]
662
670
 
671
+ hotkey = []
663
672
  case PWN::Plugins::DetectOS.type
664
673
  when :linux, :openbsd, :windows
665
674
  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.188'
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.188
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.