pwn 0.5.306 → 0.5.307
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 +4 -4
- data/README.md +3 -3
- data/lib/pwn/plugins/transparent_browser.rb +73 -0
- data/lib/pwn/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84d7508456ef5d3e90206c2c24e4c5cd5b9e00f2d0b73b1e173c9e728d5c73e0
|
4
|
+
data.tar.gz: ba77cd727eda78d699d225ed35e42440d33a46163413a98eee8351ba47d0036b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5503a807ca026473e5adead9b6e75224eb174851cc7ffda6e449fc6dd924448a9395f11ad4aa4709c58c23a78c9ae2323946d3ef241455ce5e9e2f4b85982ca
|
7
|
+
data.tar.gz: 758bc5954f798c8602738c0081aca0e072d670d9e54d95ec3e78ea9c3ea641de0cb2eb6fd261f5462e81814a2b4024daca875e4635fad31f4beee2f53fe24e94
|
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.
|
40
|
+
pwn[v0.5.307]:001 >>> PWN.help
|
41
41
|
```
|
42
42
|
|
43
43
|
[](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.
|
55
|
+
pwn[v0.5.307]: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.
|
65
|
+
pwn[v0.5.307]: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:
|
@@ -171,6 +171,7 @@ module PWN
|
|
171
171
|
|
172
172
|
# This is required for BiDi support
|
173
173
|
options.web_socket_url = true
|
174
|
+
options.add_preference('remote.active-protocols', 3)
|
174
175
|
options.profile = this_profile
|
175
176
|
driver = Selenium::WebDriver.for(:firefox, options: options)
|
176
177
|
browser_obj[:browser] = Watir::Browser.new(driver)
|
@@ -199,6 +200,7 @@ module PWN
|
|
199
200
|
|
200
201
|
# This is required for BiDi support
|
201
202
|
options.web_socket_url = true
|
203
|
+
options.add_preference('remote.active-protocols', 3)
|
202
204
|
options.profile = this_profile
|
203
205
|
driver = Selenium::WebDriver.for(:chrome, options: options)
|
204
206
|
browser_obj[:browser] = Watir::Browser.new(driver)
|
@@ -262,6 +264,7 @@ module PWN
|
|
262
264
|
|
263
265
|
# This is required for BiDi support
|
264
266
|
options.web_socket_url = true
|
267
|
+
options.add_preference('remote.active-protocols', 3)
|
265
268
|
options.profile = this_profile
|
266
269
|
driver = Selenium::WebDriver.for(:firefox, options: options)
|
267
270
|
browser_obj[:browser] = Watir::Browser.new(driver)
|
@@ -286,6 +289,7 @@ module PWN
|
|
286
289
|
|
287
290
|
# This is required for BiDi support
|
288
291
|
options.web_socket_url = true
|
292
|
+
options.add_preference('remote.active-protocols', 3)
|
289
293
|
options.profile = this_profile
|
290
294
|
driver = Selenium::WebDriver.for(:chrome, options: options)
|
291
295
|
browser_obj[:browser] = Watir::Browser.new(driver)
|
@@ -489,6 +493,67 @@ module PWN
|
|
489
493
|
raise e
|
490
494
|
end
|
491
495
|
|
496
|
+
# Supported Method Parameters::
|
497
|
+
# console_resp = PWN::Plugins::TransparentBrowser.enable_dom_mutations(
|
498
|
+
# browser_obj: browser_obj1,
|
499
|
+
# target: 'optional - target JavaScript node to observe (defaults to document.body)'
|
500
|
+
# )
|
501
|
+
|
502
|
+
public_class_method def self.enable_dom_mutations(opts = {})
|
503
|
+
browser_obj = opts[:browser_obj]
|
504
|
+
verify_devtools_browser(browser_obj: browser_obj)
|
505
|
+
|
506
|
+
target = opts[:target] ||= 'document.body'
|
507
|
+
|
508
|
+
js = "
|
509
|
+
// 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
|
+
|
516
|
+
// Configuration for observer
|
517
|
+
const config = { attributes: true, childList: true, subtree: true };
|
518
|
+
|
519
|
+
// Callback for mutations
|
520
|
+
const callback = (mutationList, observer) => {
|
521
|
+
for (const mutation of mutationList) {
|
522
|
+
if (mutation.type === 'childList') {
|
523
|
+
console.log('Child node added/removed:', mutation);
|
524
|
+
} else if (mutation.type === 'attributes') {
|
525
|
+
console.log(`Attribute ${mutation.attributeName} modified:`, mutation);
|
526
|
+
}
|
527
|
+
}
|
528
|
+
};
|
529
|
+
|
530
|
+
// Create and start observer
|
531
|
+
const observer = new MutationObserver(callback);
|
532
|
+
observer.observe(targetNode, config);
|
533
|
+
|
534
|
+
// Later, stop observing if needed
|
535
|
+
// observer.disconnect();
|
536
|
+
"
|
537
|
+
console(browser_obj: browser_obj, js: js)
|
538
|
+
rescue StandardError => e
|
539
|
+
raise e
|
540
|
+
end
|
541
|
+
|
542
|
+
# Supported Method Parameters::
|
543
|
+
# console_resp = PWN::Plugins::TransparentBrowser.disable_dom_mutations(
|
544
|
+
# browser_obj: browser_obj1
|
545
|
+
# )
|
546
|
+
|
547
|
+
public_class_method def self.disable_dom_mutations(opts = {})
|
548
|
+
browser_obj = opts[:browser_obj]
|
549
|
+
verify_devtools_browser(browser_obj: browser_obj)
|
550
|
+
|
551
|
+
js = 'observer.disconnect();'
|
552
|
+
console(browser_obj: browser_obj, js: js)
|
553
|
+
rescue StandardError => e
|
554
|
+
raise e
|
555
|
+
end
|
556
|
+
|
492
557
|
# Supported Method Parameters::
|
493
558
|
# PWN::Plugins::TransparentBrowser.update_about_config(
|
494
559
|
# browser_obj: browser_obj1,
|
@@ -1077,6 +1142,14 @@ module PWN
|
|
1077
1142
|
js: 'required - JavaScript expression to evaluate'
|
1078
1143
|
)
|
1079
1144
|
|
1145
|
+
console_resp = #{self}.enable_dom_mutations(
|
1146
|
+
browser_obj: 'required - browser_obj returned from #open method)'
|
1147
|
+
)
|
1148
|
+
|
1149
|
+
console_resp = #{self}.disable_dom_mutations(
|
1150
|
+
browser_obj: 'required - browser_obj returned from #open method)'
|
1151
|
+
)
|
1152
|
+
|
1080
1153
|
#{self}.update_about_config(
|
1081
1154
|
browser_obj: 'required - browser_obj returned from #open method)',
|
1082
1155
|
key: 'required - key to update in about:config',
|
data/lib/pwn/version.rb
CHANGED