pwn 0.5.190 → 0.5.191

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: 8f5fb6d75564102eb7ed819f4c3833eefb9c8874fd78a0d0f588e07c74d00b62
4
- data.tar.gz: 3fd6332778c90183ea364e2ee899a72beb79a3c8863c855ba669349fedbf2a65
3
+ metadata.gz: 0a505a20bdb9c9adcd1e006d35bc8b09002c4c98e4dfd43d6e592f381fc39ae0
4
+ data.tar.gz: '05856cfa4c5c3e0d3fb9a807a616f063f4606b09c913b6502e4c354613da321e'
5
5
  SHA512:
6
- metadata.gz: 76cfc601b26f1aa5b095f7b0d12bd32186bcc7ed606738ee2b9aa5890820b254d8496c7814a6228771cd1112dc7628c2bca773438964a6ad5e7a8fe0c0efa2e1
7
- data.tar.gz: 823c40899d1f2d899f21f490737138f7870348ef6d7f03e121056024a97c2059b68bb27985b01c40eb4ad89db96a8126ab3b371af34a095b855f0c60800ef28e
6
+ metadata.gz: a4386feadcc8c56c4de2c8fe323fba7c4b794397cdf4c4a0e3ca661e8126ce8cb07b71aa191d1cc5cf6233bbdc5a0cc5bcf8e4c7b7dfe2bfb824b8fd68db5651
7
+ data.tar.gz: c61ac9fcf9e474fe4b01eaa0fdf0deb03beebd91e4f7cdc340b9b960f9dbcec3b8ffa5fe3562007f0af313ff9ae805e3881bac25bdfbc37db9f94ba9a358e517
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.190]:001 >>> PWN.help
40
+ pwn[v0.5.191]: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.190]:001 >>> PWN.help
55
+ pwn[v0.5.191]: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.190]:001 >>> PWN.help
65
+ pwn[v0.5.191]: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:
@@ -198,9 +198,6 @@ module PWN
198
198
  this_profile['devtools.cache.disabled'] = true
199
199
  this_profile['dom.caches.enabled'] = false
200
200
 
201
- # caps = Selenium::WebDriver::Remote::Capabilities.firefox
202
- # caps[:acceptInsecureCerts] = true
203
-
204
201
  if proxy
205
202
  this_profile['network.proxy.type'] = 1
206
203
  this_profile['network.proxy.allow_hijacking_localhost'] = true
@@ -513,7 +510,7 @@ module PWN
513
510
 
514
511
  # Supported Method Parameters::
515
512
  # tab = PWN::Plugins::TransparentBrowser.close_tab(
516
- # browser_obj: 'required - browser_obj returned from #open method)'
513
+ # browser_obj: 'required - browser_obj returned from #open method)',
517
514
  # keyword: 'required - keyword in title or url used to close tabs'
518
515
  # )
519
516
 
@@ -526,17 +523,26 @@ module PWN
526
523
 
527
524
  browser = browser_obj[:browser]
528
525
  # Switch to an inactive tab before closing the active tab if it's currently active
529
- active_tab = list_tabs(browser_obj: browser_obj).find { |tab| tab[:state] == :active }
530
- if active_tab[:url] == browser.url
531
- inactive_tabs = list_tabs(browser_obj: browser_obj).reject { |tab| tab[:state] == :active }
526
+ tab_list = list_tabs(browser_obj: browser_obj)
527
+ active_tab = tab_list.find { |tab| tab[:state] == :active }
528
+ if active_tab[:url].include?(keyword)
529
+ inactive_tabs = tab_list.reject { |tab| tab[:url] == browser.url }
532
530
  if inactive_tabs.any?
533
- keyword = inactive_tabs.last[:url]
534
- jmp_tab(browser_obj: browser_obj, keyword: keyword)
531
+ tab_to_activate = inactive_tabs.last[:url]
532
+ jmp_tab(browser_obj: browser_obj, keyword: tab_to_activate)
535
533
  end
536
534
  end
537
535
  all_tabs = browser.windows
538
- tab_sel = all_tabs.select { |tab| tab.close if tab.title.include?(keyword) || tab.url.include?(keyword) }
539
- { title: tab_sel.last.title, url: tab_sel.last.url, state: :closed } if tab_sel.any?
536
+
537
+ tabs_to_close = all_tabs.select { |tab| tab.title.include?(keyword) || tab.url.include?(keyword) }
538
+
539
+ tabs_closed = tabs_to_close.map do |tab|
540
+ { title: tab.title, url: tab.url, state: :closed }
541
+ end
542
+
543
+ tabs_to_close.each(&:close)
544
+
545
+ tabs_closed
540
546
  rescue StandardError => e
541
547
  raise e
542
548
  end
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.190'
4
+ VERSION = '0.5.191'
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.190
4
+ version: 0.5.191
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.