pwn 0.4.428 → 0.4.429
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/bin/pwn_nessus_cloud_create_scan +58 -9
- data/lib/pwn/plugins/nessus_cloud.rb +45 -1
- 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: 101c2b7768232bb1ffc67b7304cd58d8d1968fd2549958dadd8d1fbfc79b9ac1
|
4
|
+
data.tar.gz: 3a56e33451f7bf6868a2dbe124ae1c6cb9a03389a5af7dea8e1c567d46081fb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54c49f48521be56ba68642530ed280253a6835acbab991ee6bf9560e9912e103f34d17127be3dc4a27dcbddc03c426118705d2e4428d6753760a58d449f9f3ac
|
7
|
+
data.tar.gz: 5f05900cb509d463f888852ea36a3c40a36d360912009c4c476a1deae04049e35e825aa5d75fc6c2afa22f9887a54a320f5108df5e424e3de84267c8acd6cb17
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ $ rvm use ruby-3.1.2@pwn
|
|
37
37
|
$ rvm list gemsets
|
38
38
|
$ gem install --verbose pwn
|
39
39
|
$ pwn
|
40
|
-
pwn[v0.4.
|
40
|
+
pwn[v0.4.429]: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.1.2@pwn
|
|
52
52
|
$ gem uninstall --all --executables pwn
|
53
53
|
$ gem install --verbose pwn
|
54
54
|
$ pwn
|
55
|
-
pwn[v0.4.
|
55
|
+
pwn[v0.4.429]:001 >>> PWN.help
|
56
56
|
```
|
57
57
|
|
58
58
|
|
@@ -19,12 +19,32 @@ OptionParser.new do |options|
|
|
19
19
|
opts[:scan_name] = n
|
20
20
|
end
|
21
21
|
|
22
|
+
options.on('-tVALUE', '--scan-template=VALUE', '<Optional - Canned Scan Template to Use for Scan Creation (Defaults to "Basic Network Scan">') do |t|
|
23
|
+
opts[:scan_template] = t
|
24
|
+
end
|
25
|
+
|
22
26
|
options.on('-pPOLICY', '--policy-name=POLICY', '<Optional - Policy to Use to Create the Scan (Defaults to "")>') do |p|
|
23
27
|
opts[:policy_name] = p
|
24
28
|
end
|
25
29
|
|
26
|
-
options.on('-
|
27
|
-
opts[:
|
30
|
+
options.on('-fFOLDER', '--folder-name=FOLDER', '<Optional - Where to Store the Scan (Defaults to "main")>') do |f|
|
31
|
+
opts[:folder_name] = f
|
32
|
+
end
|
33
|
+
|
34
|
+
options.on('-sSCANNER', '--scanner=SCANNER', '<Optional - Scanner to Use (Defaults to "AUTO-ROUTED")>') do |s|
|
35
|
+
opts[:scanner] = s
|
36
|
+
end
|
37
|
+
|
38
|
+
options.on('-nTARGET', '--target-network=TARGET', '<Optional if --scanner other than AUTO-ROUTED, Otherwise Required - Network to Scan (Defaults to "default-network")>') do |n|
|
39
|
+
opts[:target_network] = n
|
40
|
+
end
|
41
|
+
|
42
|
+
options.on('-lWHEN', '--launch=WHEN', '<Optional When to Launch Scan - ON_DEMAND || DAILY || WEEKLY || MONTHLY || YEARLY (Defaults to "ON_DEMAND")>') do |l|
|
43
|
+
opts[:launch] = l
|
44
|
+
end
|
45
|
+
|
46
|
+
options.on('-wTIME', '--scan-time-window=TIME', '<Optional Scan Time Window in Minutes - (Defaults to 0 if nessus scanner scan || 180 if nessus agent scan)>') do |l|
|
47
|
+
opts[:launch] = l
|
28
48
|
end
|
29
49
|
end.parse!
|
30
50
|
|
@@ -48,22 +68,32 @@ begin
|
|
48
68
|
|
49
69
|
scan_name = opts[:scan_name]
|
50
70
|
|
71
|
+
scan_template = opts[:scan_template]
|
72
|
+
scan_template ||= 'Basic Network Scan'
|
73
|
+
|
51
74
|
policy_name = opts[:policy_name]
|
52
75
|
policy_name ||= ''
|
53
76
|
|
54
|
-
|
55
|
-
|
77
|
+
folder_name = opts[:folder_name]
|
78
|
+
folder_name ||= 'main'
|
79
|
+
|
80
|
+
scanner = opts[:scanner]
|
81
|
+
scanner ||= 'AUTO-ROUTED'
|
82
|
+
|
83
|
+
target_network = opts[:target_network]
|
84
|
+
target_network ||= '00000000-0000-0000-0000-000000000000'
|
85
|
+
target_network = '00000000-0000-0000-0000-000000000000' if target_network == 'default-network'
|
86
|
+
|
87
|
+
launch = opts[:launch]
|
88
|
+
launch ||= 'ON_DEMAND'
|
89
|
+
|
90
|
+
scan_time_window = opts[:scan_time_window]
|
56
91
|
|
57
92
|
nessus_obj = PWN::Plugins::NessusCloud.login(
|
58
93
|
access_key: access_key,
|
59
94
|
secret_key: secret_key
|
60
95
|
)
|
61
96
|
|
62
|
-
policy_list = PWN::Plugins::NessusCloud.get_policies(
|
63
|
-
nessus_obj: nessus_obj
|
64
|
-
)
|
65
|
-
puts policy_list.inspect
|
66
|
-
|
67
97
|
scan_template_list = PWN::Plugins::NessusCloud.get_canned_scan_templates(
|
68
98
|
nessus_obj: nessus_obj
|
69
99
|
)
|
@@ -74,6 +104,25 @@ begin
|
|
74
104
|
|
75
105
|
scan_template_id = selected_scan_template.first[:uuid]
|
76
106
|
|
107
|
+
policy_list = PWN::Plugins::NessusCloud.get_policies(
|
108
|
+
nessus_obj: nessus_obj
|
109
|
+
)
|
110
|
+
puts policy_list.inspect
|
111
|
+
|
112
|
+
folder_list = PWN::Plugins::NessusCloud.get_folders(
|
113
|
+
nessus_obj: nessus_obj
|
114
|
+
)
|
115
|
+
puts folder_list.inspect
|
116
|
+
|
117
|
+
scanner_list = PWN::Plugins::NessusCloud.get_scanners(
|
118
|
+
nessus_obj: nessus_obj
|
119
|
+
)
|
120
|
+
puts scanner_list.inspect
|
121
|
+
|
122
|
+
target_network_list = PWN::Plugins::NessusCloud.get_target_networks(
|
123
|
+
nessus_obj: nessus_obj
|
124
|
+
)
|
125
|
+
puts target_network_list.inspect
|
77
126
|
rescue Interrupt
|
78
127
|
puts 'CTRL+C detected...goodbye.'
|
79
128
|
rescue StandardError => e
|
@@ -129,7 +129,7 @@ module PWN
|
|
129
129
|
end
|
130
130
|
|
131
131
|
# Supported Method Parameters::
|
132
|
-
# PWN::Plugins::NessusCloud.
|
132
|
+
# PWN::Plugins::NessusCloud.get_folders(
|
133
133
|
# nessus_obj: 'required - nessus_obj returned from #login method'
|
134
134
|
# )
|
135
135
|
|
@@ -146,6 +146,42 @@ module PWN
|
|
146
146
|
raise e
|
147
147
|
end
|
148
148
|
|
149
|
+
# Supported Method Parameters::
|
150
|
+
# PWN::Plugins::NessusCloud.get_scanners(
|
151
|
+
# nessus_obj: 'required - nessus_obj returned from #login method'
|
152
|
+
# )
|
153
|
+
|
154
|
+
public_class_method def self.get_scanners(opts = {})
|
155
|
+
nessus_obj = opts[:nessus_obj]
|
156
|
+
|
157
|
+
scan_templates_resp = nessus_cloud_rest_call(
|
158
|
+
nessus_obj: nessus_obj,
|
159
|
+
rest_call: 'scanners'
|
160
|
+
).body
|
161
|
+
|
162
|
+
JSON.parse(scan_templates_resp, symbolize_names: true)
|
163
|
+
rescue StandardError, SystemExit, Interrupt => e
|
164
|
+
raise e
|
165
|
+
end
|
166
|
+
|
167
|
+
# Supported Method Parameters::
|
168
|
+
# PWN::Plugins::NessusCloud.get_target_networks(
|
169
|
+
# nessus_obj: 'required - nessus_obj returned from #login method'
|
170
|
+
# )
|
171
|
+
|
172
|
+
public_class_method def self.get_target_networks(opts = {})
|
173
|
+
nessus_obj = opts[:nessus_obj]
|
174
|
+
|
175
|
+
scan_templates_resp = nessus_cloud_rest_call(
|
176
|
+
nessus_obj: nessus_obj,
|
177
|
+
rest_call: 'networks'
|
178
|
+
).body
|
179
|
+
|
180
|
+
JSON.parse(scan_templates_resp, symbolize_names: true)
|
181
|
+
rescue StandardError, SystemExit, Interrupt => e
|
182
|
+
raise e
|
183
|
+
end
|
184
|
+
|
149
185
|
# Supported Method Parameters::
|
150
186
|
# PWN::Plugins::NessusCloud.get_scans(
|
151
187
|
# nessus_obj: 'required - nessus_obj returned from #login method'
|
@@ -349,6 +385,14 @@ module PWN
|
|
349
385
|
nessus_obj: 'required - nessus_obj returned from #login method'
|
350
386
|
)
|
351
387
|
|
388
|
+
#{self}.get_scanners(
|
389
|
+
nessus_obj: 'required - nessus_obj returned from #login method'
|
390
|
+
)
|
391
|
+
|
392
|
+
#{self}.get_target_networks(
|
393
|
+
nessus_obj: 'required - nessus_obj returned from #login method'
|
394
|
+
)
|
395
|
+
|
352
396
|
#{self}.get_scans(
|
353
397
|
nessus_obj: 'required - nessus_obj returned from #login method'
|
354
398
|
)
|
data/lib/pwn/version.rb
CHANGED