pwn 0.5.63 → 0.5.65
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/bin/pwn +40 -2
- data/etc/pwn.decryptor.yaml.EXAMPLE +4 -0
- data/etc/pwn.yaml.EXAMPLE +1 -0
- data/lib/pwn/plugins/vault.rb +49 -9
- data/lib/pwn/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19fba8018db8e90a1c82fda10a5c0af6c560e367ae45a105c0daa495df25647b
|
4
|
+
data.tar.gz: 6c6fb1cc72ccb0438a655151925fb45ad5c9978fbe21607b26bc0c21cddf5575
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 765212cd579f768bea360c0d0e39ba71b16997e19124915ed1941915c26bec2e10253141d4e70f2cd5741aa7599f3169a5343f6351a50194dc7dd03cdd70065f
|
7
|
+
data.tar.gz: 5d76ffbbebd93ec75e2d16bf798c809b2f2be1a039fb459f917683ba2b960cb487da9ea8c750720fa8ca8a885e586b326f07e7f85fb340762919ad3ab4730e2f
|
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.65]: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.0@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.65]: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.0@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.65]: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:
|
data/bin/pwn
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
+
require 'base64'
|
4
5
|
require 'optparse'
|
5
6
|
require 'pwn'
|
6
7
|
require 'pry'
|
@@ -13,12 +14,31 @@ OptionParser.new do |options|
|
|
13
14
|
#{$PROGRAM_NAME} [opts]
|
14
15
|
"
|
15
16
|
|
16
|
-
options.on('-cPATH', '--yaml-config=PATH', '<Optional -
|
17
|
+
options.on('-cPATH', '--yaml-config=PATH', '<Optional - PWN YAML File>') do |p|
|
17
18
|
opts[:yaml_config_path] = p
|
18
19
|
end
|
20
|
+
|
21
|
+
options.on('-dPATH', '--decryptor=PATH', '<Optional - File Containing Decryption Key && IV>') do |d|
|
22
|
+
opts[:decryption_file] = d
|
23
|
+
end
|
24
|
+
|
25
|
+
options.on('-kKEY', '--decryption-key=KEY', '<Optional - Decryption Key>') do |k|
|
26
|
+
opts[:key] = k
|
27
|
+
end
|
28
|
+
|
29
|
+
options.on('-iIV', '--decryption-iv=PATH', '<Optional - Decryption IV>') do |i|
|
30
|
+
opts[:iv] = i
|
31
|
+
end
|
19
32
|
end.parse!
|
20
33
|
|
21
34
|
begin
|
35
|
+
def yaml_config_encrypted?(opts = {})
|
36
|
+
config = opts[:config]
|
37
|
+
|
38
|
+
config_contents = File.read(config)
|
39
|
+
config_contents.is_a?(String) && Base64.strict_encode64(Base64.decode64(config_contents)) == config_contents
|
40
|
+
end
|
41
|
+
|
22
42
|
def cleanup_pids(opts = {})
|
23
43
|
pids_arr = opts[:pids_arr]
|
24
44
|
|
@@ -288,7 +308,25 @@ begin
|
|
288
308
|
Pry.config.hooks.add_hook(:before_session, :init_opts) do |_output, _binding, pi|
|
289
309
|
if opts[:yaml_config_path] && File.exist?(opts[:yaml_config_path])
|
290
310
|
yaml_config_path = opts[:yaml_config_path]
|
291
|
-
|
311
|
+
is_encrypted = yaml_config_encrypted?(config: yaml_config_path)
|
312
|
+
|
313
|
+
if is_encrypted
|
314
|
+
# TODO: Implement "something you know, something you have, && something you are?"
|
315
|
+
decryption_file = opts[:decryption_file] ||= "#{Dir.home}/pwn.decryptor.yaml"
|
316
|
+
yaml_decryptor = YAML.load_file(decryption_file, symbolize_names: true) if File.exist?(decryption_file)
|
317
|
+
key = opts[:key] ||= yaml_decryptor[:key] ||= ENV.fetch('PWN_DECRYPTOR_KEY')
|
318
|
+
iv = opts[:iv] ||= yaml_decryptor[:iv] ||= ENV.fetch('PWN_DECRYPTOR_IV')
|
319
|
+
|
320
|
+
encrypted_config_dump = PWN::Plugins::Vault.dump(
|
321
|
+
file: yaml_config_path,
|
322
|
+
key: key,
|
323
|
+
iv: iv
|
324
|
+
)
|
325
|
+
yaml_config = YAML.load(encrypted_config_dump, symbolize_names: true)
|
326
|
+
else
|
327
|
+
yaml_config = YAML.load_file(yaml_config_path, symbolize_names: true)
|
328
|
+
end
|
329
|
+
|
292
330
|
pi.config.pwn_ai_key = yaml_config[:ai_key]
|
293
331
|
Pry.config.pwn_ai_key = pi.config.pwn_ai_key
|
294
332
|
end
|
@@ -0,0 +1,4 @@
|
|
1
|
+
# If you rely upon this file, it should be out-of-band
|
2
|
+
# (e.g. not available in code repos, permission protected, limited access, etc.)
|
3
|
+
key: 'KEY PROVIDED WHEN USING PWN::Plugins::Vault.create(file: "pwn.yaml") TO ENCRYPT pwn.yaml'
|
4
|
+
iv: 'KEY PROVIDED WHEN USING PWN::Plugins::Vault.create(file: "pwn.yaml") TO ENCRYPT pwn.yaml'
|
data/etc/pwn.yaml.EXAMPLE
CHANGED
data/lib/pwn/plugins/vault.rb
CHANGED
@@ -8,6 +8,31 @@ module PWN
|
|
8
8
|
module Plugins
|
9
9
|
# Used to encrypt/decrypt configuration files leveraging AES256
|
10
10
|
module Vault
|
11
|
+
# Supported Method Parameters::
|
12
|
+
# PWN::Plugins::Vault.change_encryption_secrets(
|
13
|
+
# file: 'required - file to encrypt with new key and iv',
|
14
|
+
# key: 'required - key to decrypt',
|
15
|
+
# iv: 'required - iv to decrypt'
|
16
|
+
# )
|
17
|
+
|
18
|
+
def self.change_encryption_secrets(opts = {})
|
19
|
+
file = opts[:file].to_s.scrub if File.exist?(opts[:file].to_s.scrub)
|
20
|
+
key = opts[:key]
|
21
|
+
iv = opts[:iv]
|
22
|
+
|
23
|
+
decrypt(
|
24
|
+
file: file,
|
25
|
+
key: key,
|
26
|
+
iv: iv
|
27
|
+
)
|
28
|
+
|
29
|
+
create(
|
30
|
+
file: file
|
31
|
+
)
|
32
|
+
rescue StandardError => e
|
33
|
+
raise e
|
34
|
+
end
|
35
|
+
|
11
36
|
# Supported Method Parameters::
|
12
37
|
# PWN::Plugins::Vault.create(
|
13
38
|
# file: 'required - encrypted file to create'
|
@@ -35,7 +60,7 @@ module PWN
|
|
35
60
|
|
36
61
|
# Supported Method Parameters::
|
37
62
|
# PWN::Plugins::Vault.decrypt(
|
38
|
-
# file: 'required - file to
|
63
|
+
# file: 'required - file to decrypt',
|
39
64
|
# key: 'required - key to decrypt',
|
40
65
|
# iv: 'required - iv to decrypt'
|
41
66
|
# )
|
@@ -62,15 +87,17 @@ module PWN
|
|
62
87
|
|
63
88
|
# Supported Method Parameters::
|
64
89
|
# PWN::Plugins::Vault.dump(
|
65
|
-
# file: 'required - file to
|
90
|
+
# file: 'required - file to dump',
|
66
91
|
# key: 'required - key to decrypt',
|
67
|
-
# iv: 'required - iv to decrypt'
|
92
|
+
# iv: 'required - iv to decrypt',
|
93
|
+
# search: 'optional - search for a specific string'
|
68
94
|
# )
|
69
95
|
|
70
96
|
def self.dump(opts = {})
|
71
97
|
file = opts[:file].to_s.scrub if File.exist?(opts[:file].to_s.scrub)
|
72
98
|
key = opts[:key]
|
73
99
|
iv = opts[:iv]
|
100
|
+
search = opts[:search]
|
74
101
|
|
75
102
|
decrypt(
|
76
103
|
file: file,
|
@@ -78,20 +105,26 @@ module PWN
|
|
78
105
|
iv: iv
|
79
106
|
)
|
80
107
|
|
81
|
-
|
108
|
+
if search
|
109
|
+
file_dump = File.readlines(file).grep(/#{search}/)
|
110
|
+
else
|
111
|
+
file_dump = File.read(file)
|
112
|
+
end
|
82
113
|
|
83
114
|
encrypt(
|
84
115
|
file: file,
|
85
116
|
key: key,
|
86
117
|
iv: iv
|
87
118
|
)
|
119
|
+
|
120
|
+
file_dump
|
88
121
|
rescue StandardError => e
|
89
122
|
raise e
|
90
123
|
end
|
91
124
|
|
92
125
|
# Supported Method Parameters::
|
93
126
|
# PWN::Plugins::Vault.edit(
|
94
|
-
# file: 'required - file to
|
127
|
+
# file: 'required - file to edit',
|
95
128
|
# key: 'required - key to decrypt',
|
96
129
|
# iv: 'required - iv to decrypt'
|
97
130
|
# )
|
@@ -163,24 +196,31 @@ module PWN
|
|
163
196
|
|
164
197
|
public_class_method def self.help
|
165
198
|
puts "USAGE:
|
199
|
+
#{self}.change_encryption_secrets(
|
200
|
+
file: 'required - file to encrypt with new key and iv',
|
201
|
+
key: 'required - key to decrypt',
|
202
|
+
iv: 'required - iv to decrypt'
|
203
|
+
)
|
204
|
+
|
166
205
|
#{self}.create(
|
167
206
|
file: 'required - file to encrypt'
|
168
207
|
)
|
169
208
|
|
170
209
|
#{self}.decrypt(
|
171
|
-
file: 'required - file to
|
210
|
+
file: 'required - file to decrypt',
|
172
211
|
key: 'required - key to decrypt',
|
173
212
|
iv: 'required - iv to decrypt'
|
174
213
|
)
|
175
214
|
|
176
215
|
#{self}.dump(
|
177
|
-
file: 'required - file to
|
216
|
+
file: 'required - file to dump',
|
178
217
|
key: 'required - key to decrypt',
|
179
|
-
iv: 'required - iv to decrypt'
|
218
|
+
iv: 'required - iv to decrypt',
|
219
|
+
# search: 'optional - search for a specific string'
|
180
220
|
)
|
181
221
|
|
182
222
|
#{self}.edit(
|
183
|
-
file: 'required - file to
|
223
|
+
file: 'required - file to edit',
|
184
224
|
key: 'required - key to decrypt',
|
185
225
|
iv: 'required - iv to decrypt'
|
186
226
|
)
|
data/lib/pwn/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.65
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
@@ -1317,6 +1317,7 @@ files:
|
|
1317
1317
|
- documentation/pwn_wallpaper.jpg
|
1318
1318
|
- documentation/ringing-spectrogram.png
|
1319
1319
|
- documentation/ringing-waveform.png
|
1320
|
+
- etc/pwn.decryptor.yaml.EXAMPLE
|
1320
1321
|
- etc/pwn.yaml.EXAMPLE
|
1321
1322
|
- etc/systemd/msfrpcd.service
|
1322
1323
|
- etc/systemd/openvas.service
|