pwn 0.5.177 → 0.5.179

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: 04bc92c4ffca1af44436a1957189c0fe42ee982f85c25fd1238d1cd98b52239a
4
- data.tar.gz: 498dd344a71c735a629e95089a95eaf2883eed36bbe1dcc327fec2c16a337407
3
+ metadata.gz: 3c731dd165a8e1944b7fab3438d92d3ce475bbeda7e198589413cc141beac5d3
4
+ data.tar.gz: 4d69eb7d8a1c966b71e5d6d6e8f111f36f700c5549b7c0a8fb2e0f0822114b79
5
5
  SHA512:
6
- metadata.gz: bc0b4ce8d5f4965065f2f03835f271ad2272a3105e88fe134e503b55d7af294e72d25121374744fe84c717da029dd8d1a8498eef8c62914b8a1a8342d4ad86f8
7
- data.tar.gz: bfcd3f6b1065006c2644ea1a891f8e9a6023b3304c7d4540baabc1df5624a65468488f19a755b97c8d1989e991aca72adc1770848bbc60003d2f0ac2140e78a0
6
+ metadata.gz: b49202e6895e994720a12ab5995ce3b5e0c1147c1461dbd1e0437f1ddad0b255a5510f8d60aa2138b28648a151f45519c9743539e5d434a90e8e680dd84755ec
7
+ data.tar.gz: 65d5f85e931196f99a6d13a3360c5f0e9c2628566a7369aa7c43b6ebe3521dd712e9cb84e27e2f48bea909c9919ecd1f2b248021d27daeb624a9154d9bc7c418
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.177]:001 >>> PWN.help
40
+ pwn[v0.5.179]: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.177]:001 >>> PWN.help
55
+ pwn[v0.5.179]: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.177]:001 >>> PWN.help
65
+ pwn[v0.5.179]: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:
@@ -58,7 +58,9 @@ module PWN
58
58
  browser_obj[:tor_obj] = tor_obj
59
59
  end
60
60
 
61
+ devtools_supported = %i[chrome headless_chrome firefox headless_firefox headless]
61
62
  with_devtools = opts[:with_devtools] ||= true
63
+ with_devtools = false unless devtools_supported.include?(browser_type)
62
64
 
63
65
  # Let's crank up the default timeout from 30 seconds to 15 min for slow sites
64
66
  Watir.default_timeout = 900
@@ -277,32 +279,34 @@ module PWN
277
279
  browser_obj[:browser] = Faye::WebSocket::Client.new('')
278
280
  end
279
281
  else
280
- puts 'Error: browser_type only supports :firefox, :chrome, :headless, :rest, or :websocket'
282
+ puts 'Error: browser_type only supports :firefox, :chrome, :headless, :headless_chrome, :headless_firefox, :rest, :websocket'
281
283
  return nil
282
284
  end
283
285
 
284
- browser_type = browser_obj[:type]
285
- supported = %i[chrome headless_chrome firefox headless_firefox headless]
286
- if with_devtools && supported.include?(browser_type)
287
- browser_obj[:browser].goto('about:blank')
286
+ if devtools_supported.include?(browser_type)
288
287
  rand_tab = SecureRandom.hex(8)
288
+ browser_obj[:browser].goto('about:about')
289
289
  browser_obj[:browser].execute_script("document.title = '#{rand_tab}'")
290
290
 
291
- browser_obj[:devtools] = browser_obj[:browser].driver.devtools
292
- browser_obj[:bidi] = browser_obj[:browser].driver.bidi
293
-
294
- # browser_obj[:devtools].send_cmd('DOM.enable')
295
- # browser_obj[:devtools].send_cmd('Log.enable')
296
- # browser_obj[:devtools].send_cmd('Network.enable')
297
- # browser_obj[:devtools].send_cmd('Page.enable')
298
- # browser_obj[:devtools].send_cmd('Runtime.enable')
299
- # browser_obj[:devtools].send_cmd('Security.enable')
300
-
301
- # if browser_type == :chrome || browser_type == :headless_chrome
302
- # browser_obj[:devtools].send_cmd('Debugger.enable')
303
- # browser_obj[:devtools].send_cmd('DOMStorage.enable')
304
- # browser_obj[:devtools].send_cmd('DOMSnapshot.enable')
305
- # end
291
+ if with_devtools
292
+ browser_obj[:devtools] = browser_obj[:browser].driver.devtools
293
+
294
+ browser_obj[:devtools].send_cmd('DOM.enable')
295
+ browser_obj[:devtools].send_cmd('Log.enable')
296
+ browser_obj[:devtools].send_cmd('Network.enable')
297
+ browser_obj[:devtools].send_cmd('Page.enable')
298
+ browser_obj[:devtools].send_cmd('Runtime.enable')
299
+ browser_obj[:devtools].send_cmd('Security.enable')
300
+
301
+ chrome_browser_types = %i[chrome headless_chrome]
302
+ if chrome_browser_types.include?(browser_type)
303
+ browser_obj[:devtools].send_cmd('Debugger.enable')
304
+ browser_obj[:devtools].send_cmd('DOMStorage.enable')
305
+ browser_obj[:devtools].send_cmd('DOMSnapshot.enable')
306
+ end
307
+
308
+ # browser_obj[:bidi] = browser_obj[:browser].driver.bidi
309
+ end
306
310
  end
307
311
 
308
312
  browser_obj
@@ -438,9 +442,9 @@ module PWN
438
442
 
439
443
  browser = browser_obj[:browser]
440
444
  browser.windows.map do |tab|
441
- active = false
442
- active = true if browser.title == tab.title && browser.url == tab.url
443
- { title: tab.title, url: tab.url, active: active }
445
+ state = :inactive
446
+ state = :active if browser.title == tab.title && browser.url == tab.url
447
+ { title: tab.title, url: tab.url, state: state }
444
448
  end
445
449
  rescue StandardError => e
446
450
  raise e
@@ -462,7 +466,7 @@ module PWN
462
466
  browser = browser_obj[:browser]
463
467
  all_tabs = browser.windows
464
468
  tab_sel = all_tabs.select { |tab| tab.use if tab.title.include?(keyword) || tab.url.include?(keyword) }
465
- { title: tab_sel.last.title, url: tab_sel.last.url, active: true } if tab_sel.any?
469
+ { title: tab_sel.last.title, url: tab_sel.last.url, state: :active } if tab_sel.any?
466
470
  rescue StandardError => e
467
471
  raise e
468
472
  end
@@ -486,7 +490,7 @@ module PWN
486
490
  browser.execute_script("document.title = '#{rand_tab}'")
487
491
  browser.goto(url) unless url.nil?
488
492
 
489
- { title: browser.title, url: browser.url, active: true }
493
+ { title: browser.title, url: browser.url, state: :active }
490
494
  rescue StandardError => e
491
495
  raise e
492
496
  end
@@ -506,7 +510,8 @@ module PWN
506
510
 
507
511
  browser = browser_obj[:browser]
508
512
  all_tabs = browser.windows
509
- all_tabs.select { |tab| tab.close if tab.title.include?(keyword) || tab.url.include?(keyword) }
513
+ tab_sel = all_tabs.select { |tab| tab.close if tab.title.include?(keyword) || tab.url.include?(keyword) }
514
+ { title: tab_sel.last.title, url: tab_sel.last.url, state: :closed } if tab_sel.any?
510
515
  rescue StandardError => e
511
516
  raise e
512
517
  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.177'
4
+ VERSION = '0.5.179'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.177
4
+ version: 0.5.179
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-22 00:00:00.000000000 Z
11
+ date: 2024-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport