pwn 0.5.190 → 0.5.192

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: 8f5fb6d75564102eb7ed819f4c3833eefb9c8874fd78a0d0f588e07c74d00b62
4
- data.tar.gz: 3fd6332778c90183ea364e2ee899a72beb79a3c8863c855ba669349fedbf2a65
3
+ metadata.gz: 943acf516461b6defab89c118dce50021fbe4a54149e383cb94be08570cb4735
4
+ data.tar.gz: 88ed9ddeec7d76c97a0b4665b26d14db609b9a820786905ab81a2d1f9115f65b
5
5
  SHA512:
6
- metadata.gz: 76cfc601b26f1aa5b095f7b0d12bd32186bcc7ed606738ee2b9aa5890820b254d8496c7814a6228771cd1112dc7628c2bca773438964a6ad5e7a8fe0c0efa2e1
7
- data.tar.gz: 823c40899d1f2d899f21f490737138f7870348ef6d7f03e121056024a97c2059b68bb27985b01c40eb4ad89db96a8126ab3b371af34a095b855f0c60800ef28e
6
+ metadata.gz: 15fea999df3f0b8f05358f285980cf34851d3dde2992e325f8b1cc3d550be9e24a18fe78a7147531d811992f8b15b9ef2e89300cade9d9873534addc513ecd65
7
+ data.tar.gz: 13f05cebbee3ddd043f8f397a733a78daa7e8aa1efae393659d2e8f9bd493cc940bcea1d953fd2bcebeaece47eb29f9abad9184f41ce5a3b587e6285a981beb0
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.192]: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.192]: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.192]: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:
@@ -41,7 +41,7 @@ module PWN
41
41
  # browser_obj1 = PWN::Plugins::TransparentBrowser.open(
42
42
  # browser_type: 'optional - :firefox|:chrome|:headless|:rest|:websocket (defaults to :chrome)',
43
43
  # proxy: 'optional - scheme://proxy_host:port || tor (defaults to nil)',
44
- # with_devtools: 'optional - boolean (defaults to true)',
44
+ # devtools: 'optional - boolean (defaults to true)',
45
45
  # url: 'optional - URL to navigate to after opening browser (Defaults to about:about#RANDID)'
46
46
  # )
47
47
 
@@ -60,8 +60,8 @@ module PWN
60
60
  end
61
61
 
62
62
  devtools_supported = %i[chrome headless_chrome firefox headless_firefox headless]
63
- with_devtools = opts[:with_devtools] ||= false
64
- with_devtools = true if devtools_supported.include?(browser_type) && with_devtools
63
+ devtools = opts[:devtools] ||= false
64
+ devtools = true if devtools_supported.include?(browser_type) && devtools
65
65
 
66
66
  url = opts[:url] ||= "about:about##{SecureRandom.hex(8)}"
67
67
 
@@ -130,7 +130,7 @@ module PWN
130
130
  end
131
131
  end
132
132
 
133
- args.push('--devtools') if with_devtools
133
+ args.push('--devtools') if devtools
134
134
  options = Selenium::WebDriver::Firefox::Options.new(
135
135
  args: args,
136
136
  accept_insecure_certs: true
@@ -151,7 +151,7 @@ module PWN
151
151
  args.push("--proxy-server=#{proxy}")
152
152
  end
153
153
 
154
- if with_devtools
154
+ if devtools
155
155
  args.push('--auto-open-devtools-for-tabs')
156
156
  args.push('--disable-hang-monitor')
157
157
  end
@@ -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
@@ -261,6 +258,7 @@ module PWN
261
258
  browser_obj[:browser].proxy = proxy
262
259
  end
263
260
  end
261
+ puts browser_obj[:browser].get(url).body if url
264
262
 
265
263
  when :websocket
266
264
  if proxy
@@ -288,10 +286,10 @@ module PWN
288
286
 
289
287
  if devtools_supported.include?(browser_type)
290
288
  rand_tab = SecureRandom.hex(8)
291
- browser_obj[:browser].goto("about:about##{rand_tab}")
289
+ browser_obj[:browser].goto(url)
292
290
  browser_obj[:browser].execute_script("document.title = '#{rand_tab}'")
293
291
 
294
- if with_devtools
292
+ if devtools
295
293
  driver = browser_obj[:browser].driver
296
294
  browser_obj[:devtools] = driver.devtools
297
295
 
@@ -311,6 +309,7 @@ module PWN
311
309
 
312
310
  browser_obj[:bidi] = driver.bidi
313
311
 
312
+ jmp_devtools_panel(browser_obj: browser_obj, panel: :elements)
314
313
  browser_obj[:browser].send_keys(:escape)
315
314
  end
316
315
  end
@@ -513,7 +512,7 @@ module PWN
513
512
 
514
513
  # Supported Method Parameters::
515
514
  # tab = PWN::Plugins::TransparentBrowser.close_tab(
516
- # browser_obj: 'required - browser_obj returned from #open method)'
515
+ # browser_obj: 'required - browser_obj returned from #open method)',
517
516
  # keyword: 'required - keyword in title or url used to close tabs'
518
517
  # )
519
518
 
@@ -526,17 +525,26 @@ module PWN
526
525
 
527
526
  browser = browser_obj[:browser]
528
527
  # 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 }
528
+ tab_list = list_tabs(browser_obj: browser_obj)
529
+ active_tab = tab_list.find { |tab| tab[:state] == :active }
530
+ if active_tab[:url].include?(keyword)
531
+ inactive_tabs = tab_list.reject { |tab| tab[:url] == browser.url }
532
532
  if inactive_tabs.any?
533
- keyword = inactive_tabs.last[:url]
534
- jmp_tab(browser_obj: browser_obj, keyword: keyword)
533
+ tab_to_activate = inactive_tabs.last[:url]
534
+ jmp_tab(browser_obj: browser_obj, keyword: tab_to_activate)
535
535
  end
536
536
  end
537
537
  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?
538
+
539
+ tabs_to_close = all_tabs.select { |tab| tab.title.include?(keyword) || tab.url.include?(keyword) }
540
+
541
+ tabs_closed = tabs_to_close.map do |tab|
542
+ { title: tab.title, url: tab.url, state: :closed }
543
+ end
544
+
545
+ tabs_to_close.each(&:close)
546
+
547
+ tabs_closed
540
548
  rescue StandardError => e
541
549
  raise e
542
550
  end
@@ -697,6 +705,7 @@ module PWN
697
705
  end
698
706
 
699
707
  # Have to call twice for Chrome, otherwise devtools stays closed
708
+ browser.body.click
700
709
  browser.send_keys(hotkey)
701
710
  browser.send_keys(hotkey) if chrome_types.include?(browser_type)
702
711
  rescue StandardError => e
@@ -741,7 +750,7 @@ module PWN
741
750
  browser_obj1 = #{self}.open(
742
751
  browser_type: 'optional - :firefox|:chrome|:headless|:rest|:websocket (defaults to :chrome)',
743
752
  proxy: 'optional scheme://proxy_host:port || tor (defaults to nil)',
744
- with_devtools: 'optional - boolean (defaults to true)'
753
+ devtools: 'optional - boolean (defaults to true)'
745
754
  )
746
755
  browser = browser_obj1[:browser]
747
756
  puts browser.public_methods
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.192'
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.192
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.