pwn 0.5.190 → 0.5.192
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 +28 -19
- 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: 943acf516461b6defab89c118dce50021fbe4a54149e383cb94be08570cb4735
|
4
|
+
data.tar.gz: 88ed9ddeec7d76c97a0b4665b26d14db609b9a820786905ab81a2d1f9115f65b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15fea999df3f0b8f05358f285980cf34851d3dde2992e325f8b1cc3d550be9e24a18fe78a7147531d811992f8b15b9ef2e89300cade9d9873534addc513ecd65
|
7
|
+
data.tar.gz: 13f05cebbee3ddd043f8f397a733a78daa7e8aa1efae393659d2e8f9bd493cc940bcea1d953fd2bcebeaece47eb29f9abad9184f41ce5a3b587e6285a981beb0
|
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.192]: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.192]: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.192]: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,7 @@ 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
|
-
#
|
44
|
+
# devtools: 'optional - boolean (defaults to true)',
|
45
45
|
# url: 'optional - URL to navigate to after opening browser (Defaults to about:about#RANDID)'
|
46
46
|
# )
|
47
47
|
|
@@ -60,8 +60,8 @@ module PWN
|
|
60
60
|
end
|
61
61
|
|
62
62
|
devtools_supported = %i[chrome headless_chrome firefox headless_firefox headless]
|
63
|
-
|
64
|
-
|
63
|
+
devtools = opts[:devtools] ||= false
|
64
|
+
devtools = true if devtools_supported.include?(browser_type) && devtools
|
65
65
|
|
66
66
|
url = opts[:url] ||= "about:about##{SecureRandom.hex(8)}"
|
67
67
|
|
@@ -130,7 +130,7 @@ module PWN
|
|
130
130
|
end
|
131
131
|
end
|
132
132
|
|
133
|
-
args.push('--devtools') if
|
133
|
+
args.push('--devtools') if devtools
|
134
134
|
options = Selenium::WebDriver::Firefox::Options.new(
|
135
135
|
args: args,
|
136
136
|
accept_insecure_certs: true
|
@@ -151,7 +151,7 @@ module PWN
|
|
151
151
|
args.push("--proxy-server=#{proxy}")
|
152
152
|
end
|
153
153
|
|
154
|
-
if
|
154
|
+
if devtools
|
155
155
|
args.push('--auto-open-devtools-for-tabs')
|
156
156
|
args.push('--disable-hang-monitor')
|
157
157
|
end
|
@@ -198,9 +198,6 @@ module PWN
|
|
198
198
|
this_profile['devtools.cache.disabled'] = true
|
199
199
|
this_profile['dom.caches.enabled'] = false
|
200
200
|
|
201
|
-
# caps = Selenium::WebDriver::Remote::Capabilities.firefox
|
202
|
-
# caps[:acceptInsecureCerts] = true
|
203
|
-
|
204
201
|
if proxy
|
205
202
|
this_profile['network.proxy.type'] = 1
|
206
203
|
this_profile['network.proxy.allow_hijacking_localhost'] = true
|
@@ -261,6 +258,7 @@ module PWN
|
|
261
258
|
browser_obj[:browser].proxy = proxy
|
262
259
|
end
|
263
260
|
end
|
261
|
+
puts browser_obj[:browser].get(url).body if url
|
264
262
|
|
265
263
|
when :websocket
|
266
264
|
if proxy
|
@@ -288,10 +286,10 @@ module PWN
|
|
288
286
|
|
289
287
|
if devtools_supported.include?(browser_type)
|
290
288
|
rand_tab = SecureRandom.hex(8)
|
291
|
-
browser_obj[:browser].goto(
|
289
|
+
browser_obj[:browser].goto(url)
|
292
290
|
browser_obj[:browser].execute_script("document.title = '#{rand_tab}'")
|
293
291
|
|
294
|
-
if
|
292
|
+
if devtools
|
295
293
|
driver = browser_obj[:browser].driver
|
296
294
|
browser_obj[:devtools] = driver.devtools
|
297
295
|
|
@@ -311,6 +309,7 @@ module PWN
|
|
311
309
|
|
312
310
|
browser_obj[:bidi] = driver.bidi
|
313
311
|
|
312
|
+
jmp_devtools_panel(browser_obj: browser_obj, panel: :elements)
|
314
313
|
browser_obj[:browser].send_keys(:escape)
|
315
314
|
end
|
316
315
|
end
|
@@ -513,7 +512,7 @@ module PWN
|
|
513
512
|
|
514
513
|
# Supported Method Parameters::
|
515
514
|
# tab = PWN::Plugins::TransparentBrowser.close_tab(
|
516
|
-
# browser_obj: 'required - browser_obj returned from #open method)'
|
515
|
+
# browser_obj: 'required - browser_obj returned from #open method)',
|
517
516
|
# keyword: 'required - keyword in title or url used to close tabs'
|
518
517
|
# )
|
519
518
|
|
@@ -526,17 +525,26 @@ module PWN
|
|
526
525
|
|
527
526
|
browser = browser_obj[:browser]
|
528
527
|
# Switch to an inactive tab before closing the active tab if it's currently active
|
529
|
-
|
530
|
-
|
531
|
-
|
528
|
+
tab_list = list_tabs(browser_obj: browser_obj)
|
529
|
+
active_tab = tab_list.find { |tab| tab[:state] == :active }
|
530
|
+
if active_tab[:url].include?(keyword)
|
531
|
+
inactive_tabs = tab_list.reject { |tab| tab[:url] == browser.url }
|
532
532
|
if inactive_tabs.any?
|
533
|
-
|
534
|
-
jmp_tab(browser_obj: browser_obj, keyword:
|
533
|
+
tab_to_activate = inactive_tabs.last[:url]
|
534
|
+
jmp_tab(browser_obj: browser_obj, keyword: tab_to_activate)
|
535
535
|
end
|
536
536
|
end
|
537
537
|
all_tabs = browser.windows
|
538
|
-
|
539
|
-
{
|
538
|
+
|
539
|
+
tabs_to_close = all_tabs.select { |tab| tab.title.include?(keyword) || tab.url.include?(keyword) }
|
540
|
+
|
541
|
+
tabs_closed = tabs_to_close.map do |tab|
|
542
|
+
{ title: tab.title, url: tab.url, state: :closed }
|
543
|
+
end
|
544
|
+
|
545
|
+
tabs_to_close.each(&:close)
|
546
|
+
|
547
|
+
tabs_closed
|
540
548
|
rescue StandardError => e
|
541
549
|
raise e
|
542
550
|
end
|
@@ -697,6 +705,7 @@ module PWN
|
|
697
705
|
end
|
698
706
|
|
699
707
|
# Have to call twice for Chrome, otherwise devtools stays closed
|
708
|
+
browser.body.click
|
700
709
|
browser.send_keys(hotkey)
|
701
710
|
browser.send_keys(hotkey) if chrome_types.include?(browser_type)
|
702
711
|
rescue StandardError => e
|
@@ -741,7 +750,7 @@ module PWN
|
|
741
750
|
browser_obj1 = #{self}.open(
|
742
751
|
browser_type: 'optional - :firefox|:chrome|:headless|:rest|:websocket (defaults to :chrome)',
|
743
752
|
proxy: 'optional scheme://proxy_host:port || tor (defaults to nil)',
|
744
|
-
|
753
|
+
devtools: 'optional - boolean (defaults to true)'
|
745
754
|
)
|
746
755
|
browser = browser_obj1[:browser]
|
747
756
|
puts browser.public_methods
|
data/lib/pwn/version.rb
CHANGED