pwn 0.5.158 → 0.5.160
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/thread_pool.rb +41 -40
- data/lib/pwn/plugins/transparent_browser.rb +28 -20
- data/lib/pwn/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c60ad1dae3937c81207eba9b1656bd8d03bb253cf59d1c72b6ad581d6f8c5c8
|
4
|
+
data.tar.gz: 78a8f2a9ca4c2ae038ec8a697c6113c4629faad4695b39c0f1ec339635657b29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74219980c6db4d8a0e2fa0bbdf745422ee6de00f0401ed2ffcbc261a212b1915244f0ccf91944b4be99aac330c2505555f150ac7bcf284c9365bfd3c19079888
|
7
|
+
data.tar.gz: a646cf451e919e7d409b0fad3fefe8012a2f17b0fbd029675d26ab3479a8d9cbba93e01ad6da684948167dff8a5d17f571def735b044ea36473d7ac266ffa0e8
|
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.160]:001 >>> PWN.help
|
41
41
|
```
|
42
42
|
|
43
43
|
[](https://youtu.be/G7iLUY4FzsI)
|
@@ -52,7 +52,7 @@ $ rvm use ruby-3.3.1@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.160]: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.1@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.160]: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:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'concurrent-ruby'
|
3
|
+
# require 'concurrent-ruby'
|
4
4
|
|
5
5
|
module PWN
|
6
6
|
module Plugins
|
@@ -22,30 +22,6 @@ module PWN
|
|
22
22
|
# end
|
23
23
|
# end
|
24
24
|
|
25
|
-
public_class_method def self.fill(opts = {})
|
26
|
-
enumerable_array = opts[:enumerable_array]
|
27
|
-
max_threads = opts[:max_threads].to_i
|
28
|
-
max_threads = 9 if max_threads.zero?
|
29
|
-
detach = opts[:detach] ||= false
|
30
|
-
|
31
|
-
puts "Initiating Thread Pool of #{max_threads} Worker Threads...."
|
32
|
-
pool = Concurrent::FixedThreadPool.new(max_threads)
|
33
|
-
|
34
|
-
enumerable_array.each do |this_thread|
|
35
|
-
pool.post do
|
36
|
-
yield this_thread
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
pool.shutdown
|
41
|
-
pool.wait_for_termination unless detach
|
42
|
-
rescue Interrupt
|
43
|
-
puts "\nGoodbye."
|
44
|
-
rescue StandardError => e
|
45
|
-
puts e.backtrace
|
46
|
-
raise e
|
47
|
-
end
|
48
|
-
|
49
25
|
# public_class_method def self.fill(opts = {})
|
50
26
|
# enumerable_array = opts[:enumerable_array]
|
51
27
|
# max_threads = opts[:max_threads].to_i
|
@@ -53,29 +29,54 @@ module PWN
|
|
53
29
|
# detach = opts[:detach] ||= false
|
54
30
|
|
55
31
|
# puts "Initiating Thread Pool of #{max_threads} Worker Threads...."
|
56
|
-
#
|
57
|
-
# threads = Array.new(max_threads) do
|
58
|
-
# Thread.new do
|
59
|
-
# until (this_thread = queue.pop) == :POOL_EXHAUSTED
|
60
|
-
# yield this_thread
|
61
|
-
# end
|
62
|
-
# end
|
63
|
-
# end
|
64
|
-
|
65
|
-
# enumerable_array.uniq.each do |this_thread|
|
66
|
-
# queue << this_thread
|
67
|
-
# end
|
32
|
+
# pool = Concurrent::FixedThreadPool.new(max_threads)
|
68
33
|
|
69
|
-
#
|
70
|
-
#
|
34
|
+
# enumerable_array.each do |this_thread|
|
35
|
+
# pool.post do
|
36
|
+
# yield this_thread
|
37
|
+
# end
|
71
38
|
# end
|
72
39
|
|
73
|
-
#
|
40
|
+
# pool.shutdown
|
41
|
+
# pool.wait_for_termination unless detach
|
74
42
|
# rescue Interrupt
|
75
43
|
# puts "\nGoodbye."
|
76
44
|
# rescue StandardError => e
|
45
|
+
# puts e.backtrace
|
77
46
|
# raise e
|
78
47
|
# end
|
48
|
+
# METHOD ABOVE IS SLOWER THAN THE ONE BELOW
|
49
|
+
|
50
|
+
public_class_method def self.fill(opts = {})
|
51
|
+
enumerable_array = opts[:enumerable_array]
|
52
|
+
max_threads = opts[:max_threads].to_i
|
53
|
+
max_threads = 9 if max_threads.zero?
|
54
|
+
detach = opts[:detach] ||= false
|
55
|
+
|
56
|
+
puts "Initiating Thread Pool of #{max_threads} Worker Threads...."
|
57
|
+
queue = SizedQueue.new(max_threads)
|
58
|
+
threads = Array.new(max_threads) do
|
59
|
+
Thread.new do
|
60
|
+
until (this_thread = queue.pop) == :POOL_EXHAUSTED
|
61
|
+
yield this_thread
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
enumerable_array.uniq.each do |this_thread|
|
67
|
+
queue << this_thread
|
68
|
+
end
|
69
|
+
|
70
|
+
max_threads.times do
|
71
|
+
queue << :POOL_EXHAUSTED
|
72
|
+
end
|
73
|
+
|
74
|
+
threads.each(&:join) unless detach
|
75
|
+
rescue Interrupt
|
76
|
+
puts "\nGoodbye."
|
77
|
+
rescue StandardError => e
|
78
|
+
raise e
|
79
|
+
end
|
79
80
|
|
80
81
|
# Author(s):: 0day Inc. <support@0dayinc.com>
|
81
82
|
|
@@ -45,6 +45,15 @@ module PWN
|
|
45
45
|
# Let's crank up the default timeout from 30 seconds to 15 min for slow sites
|
46
46
|
Watir.default_timeout = 900
|
47
47
|
|
48
|
+
args = []
|
49
|
+
args.push('--start-maximized')
|
50
|
+
args.push('--disable-notifications')
|
51
|
+
|
52
|
+
unless browser_type == :rest
|
53
|
+
logger = Selenium::WebDriver.logger
|
54
|
+
logger.level = :error
|
55
|
+
end
|
56
|
+
|
48
57
|
case browser_type
|
49
58
|
when :firefox
|
50
59
|
this_profile = Selenium::WebDriver::Firefox::Profile.new
|
@@ -98,10 +107,11 @@ module PWN
|
|
98
107
|
end
|
99
108
|
end
|
100
109
|
|
101
|
-
args = []
|
102
|
-
|
103
110
|
args.push('--devtools') if with_devtools
|
104
|
-
options = Selenium::WebDriver::Firefox::Options.new(
|
111
|
+
options = Selenium::WebDriver::Firefox::Options.new(
|
112
|
+
args: args,
|
113
|
+
accept_insecure_certs: true
|
114
|
+
)
|
105
115
|
options.profile = this_profile
|
106
116
|
# driver = Selenium::WebDriver.for(:firefox, capabilities: options)
|
107
117
|
driver = Selenium::WebDriver.for(:firefox, options: options)
|
@@ -112,22 +122,18 @@ module PWN
|
|
112
122
|
this_profile['download.prompt_for_download'] = false
|
113
123
|
this_profile['download.default_directory'] = '~/Downloads'
|
114
124
|
|
115
|
-
switches = []
|
116
|
-
switches.push('--start-maximized')
|
117
|
-
switches.push('--disable-notifications')
|
118
|
-
|
119
125
|
if proxy
|
120
|
-
|
121
|
-
|
126
|
+
args.push("--host-resolver-rules='MAP * 0.0.0.0 , EXCLUDE #{tor_obj[:ip]}'") if tor_obj
|
127
|
+
args.push("--proxy-server=#{proxy}")
|
122
128
|
end
|
123
129
|
|
124
130
|
if with_devtools
|
125
|
-
|
126
|
-
|
131
|
+
args.push('--auto-open-devtools-for-tabs')
|
132
|
+
args.push('--disable-hang-monitor')
|
127
133
|
end
|
128
134
|
|
129
135
|
options = Selenium::WebDriver::Chrome::Options.new(
|
130
|
-
args:
|
136
|
+
args: args,
|
131
137
|
accept_insecure_certs: true
|
132
138
|
)
|
133
139
|
|
@@ -188,7 +194,12 @@ module PWN
|
|
188
194
|
end
|
189
195
|
end
|
190
196
|
|
191
|
-
|
197
|
+
args.push('--headless')
|
198
|
+
options = Selenium::WebDriver::Firefox::Options.new(
|
199
|
+
args: args,
|
200
|
+
accept_insecure_certs: true
|
201
|
+
)
|
202
|
+
|
192
203
|
options.profile = this_profile
|
193
204
|
driver = Selenium::WebDriver.for(:firefox, options: options)
|
194
205
|
browser_obj[:browser] = Watir::Browser.new(driver)
|
@@ -198,18 +209,15 @@ module PWN
|
|
198
209
|
this_profile['download.prompt_for_download'] = false
|
199
210
|
this_profile['download.default_directory'] = '~/Downloads'
|
200
211
|
|
201
|
-
|
202
|
-
switches.push('--headless')
|
203
|
-
switches.push('--start-maximized')
|
204
|
-
switches.push('--disable-notifications')
|
212
|
+
args.push('--headless')
|
205
213
|
|
206
214
|
if proxy
|
207
|
-
|
208
|
-
|
215
|
+
args.push("--host-resolver-rules='MAP * 0.0.0.0 , EXCLUDE #{tor_obj[:ip]}'") if tor_obj
|
216
|
+
args.push("--proxy-server=#{proxy}")
|
209
217
|
end
|
210
218
|
|
211
219
|
options = Selenium::WebDriver::Chrome::Options.new(
|
212
|
-
args:
|
220
|
+
args: args,
|
213
221
|
accept_insecure_certs: true
|
214
222
|
)
|
215
223
|
|
data/lib/pwn/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pwn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.160
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|