pwn 0.5.158 → 0.5.159
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/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: 7f15b5602a73c8726bfd66d6ed8ec663f5b0d4f9fb6d1b13a5a5ce02563b6e5a
|
4
|
+
data.tar.gz: 19614b0dce31aa5eb46bc81c35ec76940a992f8664510aca1fb2b25788090b79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43a7da7a7938a383d7b9af1f00ebc2e796aed590bf21e5771e1a8b7bb504168a0b62ba50926f0e33f52fd012f34b2e61e959a1b30d0e243cd0c1057099bffcbe
|
7
|
+
data.tar.gz: 272d5f97b39eeee26ac2fe05d58c0dcaa8455eb80c12b457775a727fc5e536995831f23a127289c04afeef250f880ff2b2c4ae281ba76e38ae180c5649b17724
|
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.159]: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.159]: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.159]: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
|
|
data/lib/pwn/version.rb
CHANGED