pwn 0.5.189 → 0.5.190
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/pwn/plugins/transparent_browser.rb +18 -12
- 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: 8f5fb6d75564102eb7ed819f4c3833eefb9c8874fd78a0d0f588e07c74d00b62
|
4
|
+
data.tar.gz: 3fd6332778c90183ea364e2ee899a72beb79a3c8863c855ba669349fedbf2a65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76cfc601b26f1aa5b095f7b0d12bd32186bcc7ed606738ee2b9aa5890820b254d8496c7814a6228771cd1112dc7628c2bca773438964a6ad5e7a8fe0c0efa2e1
|
7
|
+
data.tar.gz: 823c40899d1f2d899f21f490737138f7870348ef6d7f03e121056024a97c2059b68bb27985b01c40eb4ad89db96a8126ab3b371af34a095b855f0c60800ef28e
|
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.190]: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.
|
55
|
+
pwn[v0.5.190]: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.190]: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:
|
@@ -41,7 +41,8 @@ module PWN
|
|
41
41
|
# browser_obj1 = PWN::Plugins::TransparentBrowser.open(
|
42
42
|
# browser_type: 'optional - :firefox|:chrome|:headless|:rest|:websocket (defaults to :chrome)',
|
43
43
|
# proxy: 'optional - scheme://proxy_host:port || tor (defaults to nil)',
|
44
|
-
# with_devtools: 'optional - boolean (defaults to true)'
|
44
|
+
# with_devtools: 'optional - boolean (defaults to true)',
|
45
|
+
# url: 'optional - URL to navigate to after opening browser (Defaults to about:about#RANDID)'
|
45
46
|
# )
|
46
47
|
|
47
48
|
public_class_method def self.open(opts = {})
|
@@ -62,6 +63,8 @@ module PWN
|
|
62
63
|
with_devtools = opts[:with_devtools] ||= false
|
63
64
|
with_devtools = true if devtools_supported.include?(browser_type) && with_devtools
|
64
65
|
|
66
|
+
url = opts[:url] ||= "about:about##{SecureRandom.hex(8)}"
|
67
|
+
|
65
68
|
# Let's crank up the default timeout from 30 seconds to 15 min for slow sites
|
66
69
|
Watir.default_timeout = 900
|
67
70
|
|
@@ -286,6 +289,7 @@ module PWN
|
|
286
289
|
if devtools_supported.include?(browser_type)
|
287
290
|
rand_tab = SecureRandom.hex(8)
|
288
291
|
browser_obj[:browser].goto("about:about##{rand_tab}")
|
292
|
+
browser_obj[:browser].execute_script("document.title = '#{rand_tab}'")
|
289
293
|
|
290
294
|
if with_devtools
|
291
295
|
driver = browser_obj[:browser].driver
|
@@ -307,7 +311,7 @@ module PWN
|
|
307
311
|
|
308
312
|
browser_obj[:bidi] = driver.bidi
|
309
313
|
|
310
|
-
browser_obj[:browser].
|
314
|
+
browser_obj[:browser].send_keys(:escape)
|
311
315
|
end
|
312
316
|
end
|
313
317
|
|
@@ -497,9 +501,9 @@ module PWN
|
|
497
501
|
browser.execute_script("document.title = '#{rand_tab}'")
|
498
502
|
end
|
499
503
|
# Open the DevTools for Firefox, Chrome opens them automatically
|
500
|
-
browser.
|
504
|
+
browser.send_keys(:f12) if firefox_types.include?(browser_type)
|
501
505
|
# Open Console drawer if DevTools are open
|
502
|
-
browser.
|
506
|
+
browser.send_keys(:escape) unless devtools.nil?
|
503
507
|
browser.goto(url) unless url.nil?
|
504
508
|
|
505
509
|
{ title: browser.title, url: browser.url, state: :active }
|
@@ -522,11 +526,13 @@ module PWN
|
|
522
526
|
|
523
527
|
browser = browser_obj[:browser]
|
524
528
|
# Switch to an inactive tab before closing the active tab if it's currently active
|
525
|
-
active_tab = list_tabs(browser_obj: browser_obj).
|
526
|
-
if active_tab
|
527
|
-
inactive_tabs = list_tabs(browser_obj: browser_obj).reject { |tab| tab[:
|
528
|
-
|
529
|
-
|
529
|
+
active_tab = list_tabs(browser_obj: browser_obj).find { |tab| tab[:state] == :active }
|
530
|
+
if active_tab[:url] == browser.url
|
531
|
+
inactive_tabs = list_tabs(browser_obj: browser_obj).reject { |tab| tab[:state] == :active }
|
532
|
+
if inactive_tabs.any?
|
533
|
+
keyword = inactive_tabs.last[:url]
|
534
|
+
jmp_tab(browser_obj: browser_obj, keyword: keyword)
|
535
|
+
end
|
530
536
|
end
|
531
537
|
all_tabs = browser.windows
|
532
538
|
tab_sel = all_tabs.select { |tab| tab.close if tab.title.include?(keyword) || tab.url.include?(keyword) }
|
@@ -647,7 +653,7 @@ module PWN
|
|
647
653
|
verify_devtools_browser(browser_obj: browser_obj)
|
648
654
|
|
649
655
|
browser = browser_obj[:browser]
|
650
|
-
browser.
|
656
|
+
browser.send_keys(:f12)
|
651
657
|
rescue StandardError => e
|
652
658
|
raise e
|
653
659
|
end
|
@@ -691,8 +697,8 @@ module PWN
|
|
691
697
|
end
|
692
698
|
|
693
699
|
# Have to call twice for Chrome, otherwise devtools stays closed
|
694
|
-
browser.
|
695
|
-
browser.
|
700
|
+
browser.send_keys(hotkey)
|
701
|
+
browser.send_keys(hotkey) if chrome_types.include?(browser_type)
|
696
702
|
rescue StandardError => e
|
697
703
|
raise e
|
698
704
|
end
|
data/lib/pwn/version.rb
CHANGED