pwn 0.5.184 → 0.5.185

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: 9503d9d61acf12e65e98a43f39a436e7b8ee536b366e8e41a30ab549a4b3cf68
4
- data.tar.gz: 348b098b00fc505b4ad1e02ab90c29b1e30ecfcd6f45ee36ccf8a3907933b774
3
+ metadata.gz: dbfe23aedfd50bf00cce67e7eff4b1d29d8dc3cf6e4bcfcad8c83c71ee4e5362
4
+ data.tar.gz: 397c808f4509652f528c9ca350efe0ae62339556eec55cb2790351b041ceaec6
5
5
  SHA512:
6
- metadata.gz: 7488056e30f9e6ca9b14501cad819da3e429ae9b403c663182350e662717822bb2f00e3480b571acac5fcacf5438b5e72b1dc0e6054b455c0b49c3fa68f3c647
7
- data.tar.gz: 2b35e01ca7cd9839a6e49aae4addcc1073027d93d0ded6ad73eaaa80a221c1d25f6b0cbad393b81fcdddaf9cf35153a7db73cf13b9ff1f2d5f1ac7008034cb2b
6
+ metadata.gz: f45f0ece9a3b81bf0866d1d9edd544a079bfb9dc823be5b6d9e9b5f57de8a1a4c70166a550bd808bfe17ac4c6bb27e0369641f0f162f5f74a9cb450a38dddc70
7
+ data.tar.gz: b55dad06ecdbd6a8c2ae7cd911dc81a61b6f92f2f36c8f6d4f583d9da7ea7c768bdb497d6368c7a6bf18faae3bf745c7632a137f7f94fe435f05978dbbfd2282
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.184]:001 >>> PWN.help
40
+ pwn[v0.5.185]: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.184]:001 >>> PWN.help
55
+ pwn[v0.5.185]: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.184]:001 >>> PWN.help
65
+ pwn[v0.5.185]: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:
@@ -452,12 +452,12 @@ module PWN
452
452
  end
453
453
 
454
454
  # Supported Method Parameters::
455
- # browser_obj1 = PWN::Plugins::TransparentBrowser.switch_tab(
455
+ # tab = PWN::Plugins::TransparentBrowser.jmp_tab(
456
456
  # browser_obj: 'required - browser_obj returned from #open method)',
457
457
  # keyword: 'required - keyword in title or url used to switch tabs'
458
458
  # )
459
459
 
460
- public_class_method def self.switch_tab(opts = {})
460
+ public_class_method def self.jmp_tab(opts = {})
461
461
  browser_obj = opts[:browser_obj]
462
462
  verify_devtools_browser(browser_obj: browser_obj)
463
463
 
@@ -473,7 +473,7 @@ module PWN
473
473
  end
474
474
 
475
475
  # Supported Method Parameters::
476
- # browser_obj1 = PWN::Plugins::TransparentBrowser.new_tab(
476
+ # tab = PWN::Plugins::TransparentBrowser.new_tab(
477
477
  # browser_obj: 'required - browser_obj returned from #open method)',
478
478
  # url: 'optional - URL to navigate to after opening new tab (Defaults to nil)'
479
479
  # )
@@ -484,12 +484,16 @@ module PWN
484
484
 
485
485
  url = opts[:url]
486
486
 
487
+ firefox_types = %i[firefox headless_firefox]
487
488
  browser = browser_obj[:browser]
489
+ browser_type = browser_obj[:type]
488
490
  browser.execute_script('window.open()')
489
- switch_tab(browser_obj: browser_obj, keyword: 'about:blank')
491
+ jmp_tab(browser_obj: browser_obj, keyword: 'about:blank')
490
492
  browser.goto('about:about') if url.nil?
491
493
  rand_tab = SecureRandom.hex(8)
492
494
  browser.execute_script("document.title = '#{rand_tab}'")
495
+ # Open the DevTools for Firefox, Chrome opens them automatically
496
+ browser.body.send_keys(:f12) if firefox_types.include?(browser_type)
493
497
  browser.goto(url) unless url.nil?
494
498
 
495
499
  { title: browser.title, url: browser.url, state: :active }
@@ -498,7 +502,7 @@ module PWN
498
502
  end
499
503
 
500
504
  # Supported Method Parameters::
501
- # browser_obj1 = PWN::Plugins::TransparentBrowser.close_tab(
505
+ # tab = PWN::Plugins::TransparentBrowser.close_tab(
502
506
  # browser_obj: 'required - browser_obj returned from #open method)'
503
507
  # keyword: 'required - keyword in title or url used to close tabs'
504
508
  # )
@@ -519,7 +523,7 @@ module PWN
519
523
  end
520
524
 
521
525
  # Supported Method Parameters::
522
- # browser_obj1 = PWN::Plugins::TransparentBrowser.debugger(
526
+ # PWN::Plugins::TransparentBrowser.debugger(
523
527
  # browser_obj: 'required - browser_obj returned from #open method)',
524
528
  # action: 'optional - action to take :pause|:resume (Defaults to :pause)',
525
529
  # url: 'optional - URL to navigate to after pausing debugger (Defaults to nil)'
@@ -573,7 +577,7 @@ module PWN
573
577
  end
574
578
 
575
579
  # Supported Method Parameters::
576
- # browser_obj1 = PWN::Plugins::TransparentBrowser.step_into(
580
+ # PWN::Plugins::TransparentBrowser.step_into(
577
581
  # browser_obj: 'required - browser_obj returned from #open method)'
578
582
  # )
579
583
 
@@ -589,7 +593,7 @@ module PWN
589
593
  end
590
594
 
591
595
  # Supported Method Parameters::
592
- # browser_obj1 = PWN::Plugins::TransparentBrowser.step_out(
596
+ # PWN::Plugins::TransparentBrowser.step_out(
593
597
  # browser_obj: 'required - browser_obj returned from #open method)'
594
598
  # )
595
599
 
@@ -605,7 +609,7 @@ module PWN
605
609
  end
606
610
 
607
611
  # Supported Method Parameters::
608
- # browser_obj1 = PWN::Plugins::TransparentBrowser.step_over(
612
+ # PWN::Plugins::TransparentBrowser.step_over(
609
613
  # browser_obj: 'required - browser_obj returned from #open method)'
610
614
  # )
611
615
 
@@ -620,6 +624,65 @@ module PWN
620
624
  raise e
621
625
  end
622
626
 
627
+ # Supported Method Parameters::
628
+ # PWN::Plugins::TransparentBrowser.toggle_devtools(
629
+ # browser_obj: 'required - browser_obj returned from #open method)'
630
+ # )
631
+
632
+ public_class_method def self.toggle_devtools(opts = {})
633
+ browser_obj = opts[:browser_obj]
634
+ verify_devtools_browser(browser_obj: browser_obj)
635
+
636
+ browser = browser_obj[:browser]
637
+ browser.body.send_keys(:f12)
638
+ rescue StandardError => e
639
+ raise e
640
+ end
641
+
642
+ # Supported Method Parameters::
643
+ # PWN::Plugins::TransparentBrowser.jmp_devtools_panel(
644
+ # browser_obj: 'required - browser_obj returned from #open method)',
645
+ # panel: 'optional - panel to switch to :elements|:inspector|:console|:debugger|:sources|:network
646
+ # )
647
+
648
+ public_class_method def self.jmp_devtools_panel(opts = {})
649
+ browser_obj = opts[:browser_obj]
650
+ verify_devtools_browser(browser_obj: browser_obj)
651
+
652
+ panel = opts[:panel] ||= :elements
653
+ browser = browser_obj[:browser]
654
+ browser_type = browser_obj[:type]
655
+ firefox_types = %i[firefox headless_firefox]
656
+ chrome_types = %i[chrome headless_chrome]
657
+
658
+ case PWN::Plugins::DetectOS.type
659
+ when :linux, :openbsd, :windows
660
+ hotkey = %i[control shift]
661
+ when :macos
662
+ hotkey = %i[command option]
663
+ end
664
+
665
+ case panel
666
+ when :elements, :inspector
667
+ hotkey.push('c') if firefox_types.include?(browser_type)
668
+ when :console
669
+ hotkey.push('j') if chrome_types.include?(browser_type)
670
+ hotkey.push('k') if firefox_types.include?(browser_type)
671
+ when :debugger, :sources
672
+ hotkey.push('z') if firefox_types.include?(browser_type)
673
+ when :network
674
+ hotkey.push('e') if firefox_types.include?(browser_type)
675
+ else
676
+ raise 'ERROR: panel parameter must be :elements|:inspector|:console|:debugger|:sources|:network'
677
+ end
678
+
679
+ # Have to call twice for Chrome, otherwise devtools stays closed
680
+ browser.body.send_keys(hotkey)
681
+ browser.body.send_keys(hotkey) if chrome_types.include?(browser_type)
682
+ rescue StandardError => e
683
+ raise e
684
+ end
685
+
623
686
  # Supported Method Parameters::
624
687
  # browser_obj1 = PWN::Plugins::TransparentBrowser.close(
625
688
  # browser_obj: 'required - browser_obj returned from #open method)'
@@ -768,38 +831,47 @@ module PWN
768
831
  browser_obj: 'required - browser_obj returned from #open method)'
769
832
  )
770
833
 
771
- browser_obj1 = #{self}.switch_tab(
834
+ tab = #{self}.jmp_tab(
772
835
  browser_obj: 'required - browser_obj returned from #open method)',
773
836
  keyword: 'required - keyword in title or url used to switch tabs'
774
837
  )
775
838
 
776
- browser_obj1 = #{self}.new_tab(
839
+ tab = #{self}.new_tab(
777
840
  browser_obj: 'required - browser_obj returned from #open method)'
778
841
  )
779
842
 
780
- browser_obj1 = #{self}.close_tab(
843
+ tab = #{self}.close_tab(
781
844
  browser_obj: 'required - browser_obj returned from #open method)',
782
845
  keyword: 'required - keyword in title or url used to close tabs'
783
846
  )
784
847
 
785
- browser_obj1 = #{self}.debugger(
848
+ #{self}.debugger(
786
849
  browser_obj: 'required - browser_obj returned from #open method)',
787
850
  action: 'optional - action to take :pause|:resume (Defaults to :pause)',
788
851
  url: 'optional - URL to navigate to after pausing debugger (Defaults to nil)'
789
852
  )
790
853
 
791
- browser_obj1 = #{self}.step_into(
854
+ #{self}.step_into(
792
855
  browser_obj: 'required - browser_obj returned from #open method)'
793
856
  )
794
857
 
795
- browser_obj1 = #{self}.step_out(
858
+ #{self}.step_out(
796
859
  browser_obj: 'required - browser_obj returned from #open method)'
797
860
  )
798
861
 
799
- browser_obj1 = #{self}.step_over(
862
+ #{self}.step_over(
800
863
  browser_obj: 'required - browser_obj returned from #open method)'
801
864
  )
802
865
 
866
+ #{self}.toggle_devtools(
867
+ browser_obj: 'required - browser_obj returned from #open method)'
868
+ )
869
+
870
+ #{self}.jmp_devtools_panel(
871
+ browser_obj: 'required - browser_obj returned from #open method)',
872
+ panel: 'optional - panel to switch to :elements|:inspector|:console|:debugger|:sources|:network'
873
+ )
874
+
803
875
  browser_obj1 = #{self}.close(
804
876
  browser_obj: 'required - browser_obj returned from #open method)'
805
877
  )
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.184'
4
+ VERSION = '0.5.185'
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.184
4
+ version: 0.5.185
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.