pwn 0.5.306 → 0.5.308
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 +106 -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: 8cf8d3e6c50a8caa34200e9dee3323ac1c689ff2381db4a8b39a8cc51eb7f245
|
4
|
+
data.tar.gz: 82fd38322306d70277792942ed664bef3a03e0704a30fddbf54fcfc3a82c5a24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4e48ca74897cd2cbfe03f961b2922ad1c9d66cadb8c2ce831945e1a935cc227b81c6898991c9bea8b38a3218f14a892699f1766ed566949a99a4de8a8dfe167
|
7
|
+
data.tar.gz: d7a13a43336ed4bb3301f1c52faa60d771552078521036c8e1090843b3ec70b88c8b16b802ec2eca63fd06f56d4a5dae000d8df19bafed5040cdead98a48b851
|
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.308]: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.308]: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.308]: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,100 @@ 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] ||= 'undefined'
|
507
|
+
|
508
|
+
jmp_devtools_panel(
|
509
|
+
browser_obj: browser_obj,
|
510
|
+
panel: :console
|
511
|
+
)
|
512
|
+
|
513
|
+
js = <<~JAVASCRIPT
|
514
|
+
// Select the target node to observe
|
515
|
+
const targetNode = document.getElementById(#{target}) || document.body;
|
516
|
+
|
517
|
+
// Configuration for observer
|
518
|
+
const config = { attributes: true, childList: true, subtree: true };
|
519
|
+
|
520
|
+
// Callback for mutations
|
521
|
+
const callback = (mutationList, observer) => {
|
522
|
+
for (const mutation of mutationList) {
|
523
|
+
if (mutation.type === 'childList') {
|
524
|
+
console.log('Child node added/removed:', mutation);
|
525
|
+
} else if (mutation.type === 'attributes') {
|
526
|
+
console.log(`Attribute ${mutation.attributeName} modified:`, mutation);
|
527
|
+
}
|
528
|
+
}
|
529
|
+
};
|
530
|
+
|
531
|
+
// Create and start observer
|
532
|
+
const observer = new MutationObserver(callback);
|
533
|
+
observer.observe(targetNode, config);
|
534
|
+
JAVASCRIPT
|
535
|
+
|
536
|
+
console(browser_obj: browser_obj, js: 'console.clear();')
|
537
|
+
browser = browser_obj[:browser]
|
538
|
+
browser.execute_script(js)
|
539
|
+
rescue StandardError => e
|
540
|
+
raise e
|
541
|
+
end
|
542
|
+
|
543
|
+
# Supported Method Parameters::
|
544
|
+
# console_resp = PWN::Plugins::TransparentBrowser.disable_dom_mutations(
|
545
|
+
# browser_obj: browser_obj1
|
546
|
+
# )
|
547
|
+
|
548
|
+
public_class_method def self.disable_dom_mutations(opts = {})
|
549
|
+
browser_obj = opts[:browser_obj]
|
550
|
+
verify_devtools_browser(browser_obj: browser_obj)
|
551
|
+
|
552
|
+
jmp_devtools_panel(
|
553
|
+
browser_obj: browser_obj,
|
554
|
+
panel: :console
|
555
|
+
)
|
556
|
+
|
557
|
+
js = <<~JAVASCRIPT
|
558
|
+
// Select the target node to observe
|
559
|
+
const targetNode = document.getElementById(#{target}) || document.body;
|
560
|
+
|
561
|
+
// Configuration for observer
|
562
|
+
const config = { attributes: true, childList: true, subtree: true };
|
563
|
+
|
564
|
+
// Callback for mutations
|
565
|
+
const callback = (mutationList, observer) => {
|
566
|
+
for (const mutation of mutationList) {
|
567
|
+
if (mutation.type === 'childList') {
|
568
|
+
console.log('Child node added/removed:', mutation);
|
569
|
+
} else if (mutation.type === 'attributes') {
|
570
|
+
console.log(`Attribute ${mutation.attributeName} modified:`, mutation);
|
571
|
+
}
|
572
|
+
}
|
573
|
+
};
|
574
|
+
|
575
|
+
// Create and start observer
|
576
|
+
const observer = new MutationObserver(callback);
|
577
|
+
observer.observe(targetNode, config);
|
578
|
+
|
579
|
+
// Later, stop observing if needed
|
580
|
+
observer.disconnect();
|
581
|
+
JAVASCRIPT
|
582
|
+
|
583
|
+
console(browser_obj: browser_obj, js: 'console.clear();')
|
584
|
+
browser = browser_obj[:browser]
|
585
|
+
browser.execute_script(js)
|
586
|
+
rescue StandardError => e
|
587
|
+
raise e
|
588
|
+
end
|
589
|
+
|
492
590
|
# Supported Method Parameters::
|
493
591
|
# PWN::Plugins::TransparentBrowser.update_about_config(
|
494
592
|
# browser_obj: browser_obj1,
|
@@ -1077,6 +1175,14 @@ module PWN
|
|
1077
1175
|
js: 'required - JavaScript expression to evaluate'
|
1078
1176
|
)
|
1079
1177
|
|
1178
|
+
console_resp = #{self}.enable_dom_mutations(
|
1179
|
+
browser_obj: 'required - browser_obj returned from #open method)'
|
1180
|
+
)
|
1181
|
+
|
1182
|
+
console_resp = #{self}.disable_dom_mutations(
|
1183
|
+
browser_obj: 'required - browser_obj returned from #open method)'
|
1184
|
+
)
|
1185
|
+
|
1080
1186
|
#{self}.update_about_config(
|
1081
1187
|
browser_obj: 'required - browser_obj returned from #open method)',
|
1082
1188
|
key: 'required - key to update in about:config',
|
data/lib/pwn/version.rb
CHANGED