pwn 0.5.311 → 0.5.313

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: cf124a838b0f13e7e6e2ac3d13d354fd885c07f7c71c24e05134cf33dd66ba10
4
- data.tar.gz: 0e4413b5365adadf3d7fc688ccf372d6caf8145ba8876bb0c6d65b6145048279
3
+ metadata.gz: 637c524ecea5f16a96ee38e5fb449e6df52289ba726aac5447d7509511745ea5
4
+ data.tar.gz: f25475d8329111f5c71a79ebb0f75f677e8a2d2ebdc3f160fdb8623bdd845015
5
5
  SHA512:
6
- metadata.gz: caf9d4f9fd676258b3405562f9ece2e85cfedcce57e83360e4b536ab2222c25487ccf19c82d19d3a26f07311d8f635222c9ffd765404cbda42d357593ddbbd18
7
- data.tar.gz: 5ff6987e379badb54018ea566e5f288188a7e99e3c40d6fc27b13189cdde1eb9e5d45a42d4b2b510cacb270ee79c0465a21f014903671b317164fb650bb3c3df
6
+ metadata.gz: 4ab9ee157c8f6edfd2cfe30f77e0cdea7bd91926bcc1e44959241655e6a7a2665b872f8830cade196e6ba27cc4dec99741999fa22c60cbbc2c4e2e63d87c222d
7
+ data.tar.gz: eca463f21dc9ae0ac5c793154a91db82aaea6757212ab004873fade7077369e27401ba167576e2c0d91a8c2e284fb221425f7c64702f9e2121172904321b1a39
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.311]:001 >>> PWN.help
40
+ pwn[v0.5.313]: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.4.4@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.5.311]:001 >>> PWN.help
55
+ pwn[v0.5.313]: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.4.4@pwn
62
62
  $ rvmsudo gem uninstall --all --executables pwn
63
63
  $ rvmsudo gem install --verbose pwn
64
64
  $ pwn
65
- pwn[v0.5.311]:001 >>> PWN.help
65
+ pwn[v0.5.313]: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:
@@ -504,6 +504,7 @@ module PWN
504
504
  # Supported Method Parameters::
505
505
  # console_resp = PWN::Plugins::TransparentBrowser.view_dom_mutations(
506
506
  # browser_obj: browser_obj1,
507
+ # tab_keyword: 'optional - keyword in title or url to switch to tab (defaults to active tab per list_tabs method)',
507
508
  # target: 'optional - target JavaScript node to observe (defaults to document.body)'
508
509
  # )
509
510
 
@@ -511,6 +512,9 @@ module PWN
511
512
  browser_obj = opts[:browser_obj]
512
513
  verify_devtools_browser(browser_obj: browser_obj)
513
514
 
515
+ tab_keyword = opts[:tab_keyword]
516
+ jmp_tab(browser_obj: browser_obj, keyword: tab_keyword) if tab_keyword
517
+
514
518
  target = opts[:target] ||= 'undefined'
515
519
 
516
520
  jmp_devtools_panel(
@@ -662,13 +666,17 @@ module PWN
662
666
 
663
667
  # Supported Method Parameters::
664
668
  # console_resp = PWN::Plugins::TransparentBrowser.hide_dom_mutations(
665
- # browser_obj: browser_obj1
669
+ # browser_obj: browser_obj1,
670
+ # tab_keyword: 'optional - keyword in title or url to switch to tab (defaults to active tab per list_tabs method)'
666
671
  # )
667
672
 
668
673
  public_class_method def self.hide_dom_mutations(opts = {})
669
674
  browser_obj = opts[:browser_obj]
670
675
  verify_devtools_browser(browser_obj: browser_obj)
671
676
 
677
+ tab_keyword = opts[:tab_keyword]
678
+ jmp_tab(browser_obj: browser_obj, keyword: tab_keyword) if tab_keyword
679
+
672
680
  jmp_devtools_panel(
673
681
  browser_obj: browser_obj,
674
682
  panel: :console
@@ -745,7 +753,7 @@ module PWN
745
753
  # Supported Method Parameters::
746
754
  # tab = PWN::Plugins::TransparentBrowser.jmp_tab(
747
755
  # browser_obj: 'required - browser_obj returned from #open method)',
748
- # keyword: 'required - keyword in title or url used to switch tabs',
756
+ # keyword: 'optional - keyword in title or url used to switch tabs (defaults to switching to next tab)',
749
757
  # explicit: 'optional - boolean to indicate if the keyword is an exact match (Defaults to false)'
750
758
  # )
751
759
 
@@ -754,7 +762,20 @@ module PWN
754
762
  verify_devtools_browser(browser_obj: browser_obj)
755
763
 
756
764
  keyword = opts[:keyword]
757
- raise 'ERROR: keyword parameter is required' if keyword.nil?
765
+ if keyword.nil?
766
+ # If no keyword is provided, switch to the next tab in the list
767
+ tab_list = list_tabs(browser_obj: browser_obj)
768
+ active_tab = tab_list.find { |tab| tab[:state] == :active }
769
+ # Next tab in the tab_list. If active tab is the last tab, switch to the first tab
770
+ next_tab_index = (tab_list.index(active_tab) + 1) % tab_list.size
771
+ next_tab = tab_list[next_tab_index]
772
+
773
+ if next_tab[:url] == active_tab[:url]
774
+ keyword = next_tab[:title]
775
+ else
776
+ keyword = next_tab[:url]
777
+ end
778
+ end
758
779
 
759
780
  explicit = opts[:explicit] ||= false
760
781
 
@@ -1279,12 +1300,13 @@ module PWN
1279
1300
 
1280
1301
  console_resp = #{self}.view_dom_mutations(
1281
1302
  browser_obj: 'required - browser_obj returned from #open method)',
1303
+ tab_keyword: 'optional - keyword in title or url to switch to tab (defaults to active tab per list_tabs method)',
1282
1304
  target: 'optional - target JavaScript node to observe (defaults to document.body)'
1283
1305
  )
1284
1306
 
1285
1307
  console_resp = #{self}.hide_dom_mutations(
1286
1308
  browser_obj: 'required - browser_obj returned from #open method)',
1287
- target: 'optional - target JavaScript node to observe (defaults to document.body)'
1309
+ tab_keyword: 'optional - keyword in title or url to switch to tab (defaults to active tab per list_tabs method)'
1288
1310
  )
1289
1311
 
1290
1312
  #{self}.update_about_config(
@@ -1299,7 +1321,7 @@ module PWN
1299
1321
 
1300
1322
  tab = #{self}.jmp_tab(
1301
1323
  browser_obj: 'required - browser_obj returned from #open method)',
1302
- keyword: 'required - keyword in title or url used to switch tabs'
1324
+ keyword: 'optional - keyword in title or url used to switch tabs (defaults to switching to next tab)',
1303
1325
  )
1304
1326
 
1305
1327
  tab = #{self}.new_tab(
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.311'
4
+ VERSION = '0.5.313'
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.311
4
+ version: 0.5.313
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.