pwn 0.5.307 → 0.5.309

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: 84d7508456ef5d3e90206c2c24e4c5cd5b9e00f2d0b73b1e173c9e728d5c73e0
4
- data.tar.gz: ba77cd727eda78d699d225ed35e42440d33a46163413a98eee8351ba47d0036b
3
+ metadata.gz: 04b9816658aabc56840644ad45c4ad7a7acb67f2115027eaabdb2745c6305571
4
+ data.tar.gz: 2dfcea55bc83eefbb84e1bad2ee900d760acf8271a2ddac00badebe421411985
5
5
  SHA512:
6
- metadata.gz: d5503a807ca026473e5adead9b6e75224eb174851cc7ffda6e449fc6dd924448a9395f11ad4aa4709c58c23a78c9ae2323946d3ef241455ce5e9e2f4b85982ca
7
- data.tar.gz: 758bc5954f798c8602738c0081aca0e072d670d9e54d95ec3e78ea9c3ea641de0cb2eb6fd261f5462e81814a2b4024daca875e4635fad31f4beee2f53fe24e94
6
+ metadata.gz: dd2ef466bcb48f2110f569f25645213c9d3ab6e6d71dedbed6b465b46e3f85995d067f87708326009d14f23d8f84fbf28669d9114df3034afbd04a2495dc5fef
7
+ data.tar.gz: e3111e88a91cc06a6ee9a950feda54527918ab27b5c2cfaa174128dfcd79185acc6d8eef9c0592fe1a30a5c4d5c83a273359be5246ff9be89b8dc761e5231ec3
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.307]:001 >>> PWN.help
40
+ pwn[v0.5.309]: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.307]:001 >>> PWN.help
55
+ pwn[v0.5.309]: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.307]:001 >>> PWN.help
65
+ pwn[v0.5.309]: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:
@@ -494,24 +494,25 @@ module PWN
494
494
  end
495
495
 
496
496
  # Supported Method Parameters::
497
- # console_resp = PWN::Plugins::TransparentBrowser.enable_dom_mutations(
497
+ # console_resp = PWN::Plugins::TransparentBrowser.view_dom_mutations(
498
498
  # browser_obj: browser_obj1,
499
499
  # target: 'optional - target JavaScript node to observe (defaults to document.body)'
500
500
  # )
501
501
 
502
- public_class_method def self.enable_dom_mutations(opts = {})
502
+ public_class_method def self.view_dom_mutations(opts = {})
503
503
  browser_obj = opts[:browser_obj]
504
504
  verify_devtools_browser(browser_obj: browser_obj)
505
505
 
506
- target = opts[:target] ||= 'document.body'
506
+ target = opts[:target] ||= 'undefined'
507
507
 
508
- js = "
508
+ jmp_devtools_panel(
509
+ browser_obj: browser_obj,
510
+ panel: :console
511
+ )
512
+
513
+ js = <<~JAVASCRIPT
509
514
  // Select the target node to observe
510
- const targetNode;
511
- targetNode = document.getElementById('#{target}');
512
- if (!targetNode) {
513
- targetNode = document.body; // Fallback to body if target not found
514
- }
515
+ const targetNode = document.getElementById(#{target}) || document.body;
515
516
 
516
517
  // Configuration for observer
517
518
  const config = { attributes: true, childList: true, subtree: true };
@@ -530,26 +531,61 @@ module PWN
530
531
  // Create and start observer
531
532
  const observer = new MutationObserver(callback);
532
533
  observer.observe(targetNode, config);
534
+ JAVASCRIPT
533
535
 
534
- // Later, stop observing if needed
535
- // observer.disconnect();
536
- "
537
- console(browser_obj: browser_obj, js: js)
536
+ console(browser_obj: browser_obj, js: 'console.clear();')
537
+ browser = browser_obj[:browser]
538
+ browser.execute_script(js)
538
539
  rescue StandardError => e
539
540
  raise e
540
541
  end
541
542
 
542
543
  # Supported Method Parameters::
543
- # console_resp = PWN::Plugins::TransparentBrowser.disable_dom_mutations(
544
- # browser_obj: browser_obj1
544
+ # console_resp = PWN::Plugins::TransparentBrowser.hide_dom_mutations(
545
+ # browser_obj: browser_obj1,
546
+ # target: 'optional - target JavaScript node to observe (defaults to document.body)'
545
547
  # )
546
548
 
547
- public_class_method def self.disable_dom_mutations(opts = {})
549
+ public_class_method def self.hide_dom_mutations(opts = {})
548
550
  browser_obj = opts[:browser_obj]
549
551
  verify_devtools_browser(browser_obj: browser_obj)
550
552
 
551
- js = 'observer.disconnect();'
552
- console(browser_obj: browser_obj, js: js)
553
+ target = opts[:target] ||= 'undefined'
554
+
555
+ jmp_devtools_panel(
556
+ browser_obj: browser_obj,
557
+ panel: :console
558
+ )
559
+
560
+ js = <<~JAVASCRIPT
561
+ // Select the target node to observe
562
+ const targetNode = document.getElementById(#{target}) || document.body;
563
+
564
+ // Configuration for observer
565
+ const config = { attributes: true, childList: true, subtree: true };
566
+
567
+ // Callback for mutations
568
+ const callback = (mutationList, observer) => {
569
+ for (const mutation of mutationList) {
570
+ if (mutation.type === 'childList') {
571
+ console.log('Child node added/removed:', mutation);
572
+ } else if (mutation.type === 'attributes') {
573
+ console.log(`Attribute ${mutation.attributeName} modified:`, mutation);
574
+ }
575
+ }
576
+ };
577
+
578
+ // Create and start observer
579
+ const observer = new MutationObserver(callback);
580
+ observer.observe(targetNode, config);
581
+
582
+ // Later, stop observing if needed
583
+ observer.disconnect();
584
+ JAVASCRIPT
585
+
586
+ console(browser_obj: browser_obj, js: 'console.clear();')
587
+ browser = browser_obj[:browser]
588
+ browser.execute_script(js)
553
589
  rescue StandardError => e
554
590
  raise e
555
591
  end
@@ -1142,12 +1178,14 @@ module PWN
1142
1178
  js: 'required - JavaScript expression to evaluate'
1143
1179
  )
1144
1180
 
1145
- console_resp = #{self}.enable_dom_mutations(
1146
- browser_obj: 'required - browser_obj returned from #open method)'
1181
+ console_resp = #{self}.view_dom_mutations(
1182
+ browser_obj: 'required - browser_obj returned from #open method)',
1183
+ target: 'optional - target JavaScript node to observe (defaults to document.body)'
1147
1184
  )
1148
1185
 
1149
- console_resp = #{self}.disable_dom_mutations(
1150
- browser_obj: 'required - browser_obj returned from #open method)'
1186
+ console_resp = #{self}.hide_dom_mutations(
1187
+ browser_obj: 'required - browser_obj returned from #open method)',
1188
+ target: 'optional - target JavaScript node to observe (defaults to document.body)'
1151
1189
  )
1152
1190
 
1153
1191
  #{self}.update_about_config(
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.307'
4
+ VERSION = '0.5.309'
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.307
4
+ version: 0.5.309
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.