pwn 0.5.186 → 0.5.188
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 +14 -5
- 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: 7d177d8ba3adcb7aca7b75e94b2bb1693a207578ad900afa123c55d4ffff71ec
|
|
4
|
+
data.tar.gz: 602fdf082a592e42a7b59f371682d60e2243b8e98e811f3ca8422b1c13247258
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7616d1af83026a31ba41f23b69cf65b85721e6a7770f1611a49ed417ac16c584019b8515d4e6b92f45c0c00c87f655877676a506ce9b2278ae439a243cdbcb7d
|
|
7
|
+
data.tar.gz: 36b19d1c5480a03bdf2e344cbdde7796815c316f41c2754912a2c8c8fd9ef7294f5f157b495290978aeeaeb3da6e2b5348dd84ac986d3dff70695b92f999323f
|
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.188]:001 >>> PWN.help
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
[](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.
|
|
55
|
+
pwn[v0.5.188]: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.
|
|
65
|
+
pwn[v0.5.188]: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:
|
|
@@ -285,8 +285,7 @@ module PWN
|
|
|
285
285
|
|
|
286
286
|
if devtools_supported.include?(browser_type)
|
|
287
287
|
rand_tab = SecureRandom.hex(8)
|
|
288
|
-
browser_obj[:browser].goto(
|
|
289
|
-
browser_obj[:browser].execute_script("document.title = '#{rand_tab}'")
|
|
288
|
+
browser_obj[:browser].goto("about:about##{rand_tab}")
|
|
290
289
|
|
|
291
290
|
if with_devtools
|
|
292
291
|
driver = browser_obj[:browser].driver
|
|
@@ -492,13 +491,15 @@ module PWN
|
|
|
492
491
|
devtools = browser_obj[:devtools]
|
|
493
492
|
browser.execute_script('window.open()')
|
|
494
493
|
jmp_tab(browser_obj: browser_obj, keyword: 'about:blank')
|
|
495
|
-
browser.goto('about:about') if url.nil?
|
|
496
494
|
rand_tab = SecureRandom.hex(8)
|
|
497
|
-
|
|
495
|
+
if url.nil?
|
|
496
|
+
browser.goto("about:about##{rand_tab}")
|
|
497
|
+
browser.execute_script("document.title = '#{rand_tab}'")
|
|
498
|
+
end
|
|
498
499
|
# Open the DevTools for Firefox, Chrome opens them automatically
|
|
499
500
|
browser.body.send_keys(:f12) if firefox_types.include?(browser_type)
|
|
500
501
|
# Open Console drawer if DevTools are open
|
|
501
|
-
browser.body.send_keys(:escape)
|
|
502
|
+
browser.body.send_keys(:escape) unless devtools.nil?
|
|
502
503
|
browser.goto(url) unless url.nil?
|
|
503
504
|
|
|
504
505
|
{ title: browser.title, url: browser.url, state: :active }
|
|
@@ -520,6 +521,13 @@ module PWN
|
|
|
520
521
|
raise 'ERROR: keyword parameter is required' if keyword.nil?
|
|
521
522
|
|
|
522
523
|
browser = browser_obj[:browser]
|
|
524
|
+
# Switch to an inactive tab before closing the active tab if it's currently active
|
|
525
|
+
active_tab = list_tabs(browser_obj: browser_obj).select { |tab| tab[:state] == :active }
|
|
526
|
+
if active_tab.last[:url] == browser.url
|
|
527
|
+
invalid_tab = list_tabs(browser_obj: browser_obj).select { |tab| tab[:url] != browser.url }
|
|
528
|
+
keyword = invalid_tab.last[:url]
|
|
529
|
+
jmp_tab(browser_obj: browser_obj, keyword: keyword)
|
|
530
|
+
end
|
|
523
531
|
all_tabs = browser.windows
|
|
524
532
|
tab_sel = all_tabs.select { |tab| tab.close if tab.title.include?(keyword) || tab.url.include?(keyword) }
|
|
525
533
|
{ title: tab_sel.last.title, url: tab_sel.last.url, state: :closed } if tab_sel.any?
|
|
@@ -660,6 +668,7 @@ module PWN
|
|
|
660
668
|
firefox_types = %i[firefox headless_firefox]
|
|
661
669
|
chrome_types = %i[chrome headless_chrome]
|
|
662
670
|
|
|
671
|
+
hotkey = []
|
|
663
672
|
case PWN::Plugins::DetectOS.type
|
|
664
673
|
when :linux, :openbsd, :windows
|
|
665
674
|
hotkey = %i[control shift]
|
data/lib/pwn/version.rb
CHANGED