pwn 0.4.435 → 0.4.438

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 209ccf03fc65f77a45d9e9f03d3966688a0591f617f07155b40de41dfe5b0063
4
- data.tar.gz: 763afb4b83c8d881d3427a1f875c07972f0589c14e3dd5a213cbec9e3d708ca8
3
+ metadata.gz: 33588cb757610a97b50a963139394cd378b6dfed85a0379a22b694d567956814
4
+ data.tar.gz: 28bf4ed7c3e2c043873d93c6fc1e35f213a02c2a862f7fd83d7747bacedf2dd0
5
5
  SHA512:
6
- metadata.gz: 883e63a3b58c95c3beb9600f2c22406e20329f8c9ea314a2eb54d7e64af502a90e3da9dc0ddffcb7998a945e8b8d21536aa28af75d502bd0064d40c24fdbbb17
7
- data.tar.gz: 308d5c412f29b76b33911c605a3e01fa66fdf199ddf5d0cc5eb037b3d2bbabe7dff27ad748dc1f8fa268cdb7b75676195af82fc7bfcf27bff63e35fa796e9969
6
+ metadata.gz: 9dbed712b1a371adeb258d11ac40609391ed398efd9e3a0fef2a7f211b478fe51b88cf2fc7fa18d474c07a39f96fc924a7a39bac31443491c40683251b96f1d9
7
+ data.tar.gz: 3c96781e09e1d72cd9c539c8b0a1adb20c495fcb290d4f9aa580e12ad780f873090722bd93d5c35197e851287d5fb86b2a304f4ce4aba4c9987e884bfb16e319
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.435]:001 >>> PWN.help
40
+ pwn[v0.4.438]: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.435]:001 >>> PWN.help
55
+ pwn[v0.4.438]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -70,6 +70,10 @@ OptionParser.new do |options|
70
70
  options.on('-zTIMEZONE', '--timezone=TIMEZONE', '<Optional - Timezone of the scheduled start time for the scan - (Defaults to "UTC")>') do |t|
71
71
  opts[:timezone] = t
72
72
  end
73
+
74
+ options.on('-gGROUPS', '--target-groups=GROUPS', '<Optional - Comma-delimited list of target group IDs to scan>') do |t|
75
+ opts[:timezone] = t
76
+ end
73
77
  end.parse!
74
78
 
75
79
  if opts.empty?
@@ -79,6 +83,7 @@ end
79
83
 
80
84
  begin
81
85
  # Get Options Passed to pwn_nessus_cloud_create_scan
86
+ # Required Arguments
82
87
  yaml_config = opts[:yaml_config]
83
88
 
84
89
  raise "YAML Config Not Found: #{yaml_config}" unless File.exist?(yaml_config)
@@ -92,6 +97,11 @@ begin
92
97
  secret_key = yaml[:secret_key]
93
98
 
94
99
  scan_name = opts[:scan_name]
100
+
101
+ text_targets = opts[:text_targets]
102
+ raise 'ERROR: --text-targets (i.e. List of targets to scan) is required.' unless text_targets
103
+
104
+ # Optional Arguments
95
105
  scan_desc = opts[:scan_desc]
96
106
 
97
107
  scan_template = opts[:scan_template]
@@ -130,9 +140,6 @@ begin
130
140
  timezone = opts[:timezone]
131
141
  timezone ||= 'UTC'
132
142
 
133
- text_targets = opts[:text_targets]
134
- raise 'ERROR: --text-targets (i.e. List of targets to scan) is required.' unless text_targets
135
-
136
143
  target_groups = opts[:target_groups]
137
144
 
138
145
  file_targets = opts[:file_targets]
@@ -200,7 +207,7 @@ begin
200
207
  # Part 2: Populate settings object from options passed to driver
201
208
  settings = {}
202
209
  settings[:name] = scan_name
203
- settings[:description] = scan_desc
210
+ settings[:description] = scan_desc if scan_desc
204
211
 
205
212
  policy = PWN::Plugins::NessusCloud.get_policies(
206
213
  nessus_obj: nessus_obj,
@@ -240,27 +247,28 @@ begin
240
247
 
241
248
  settings[:text_targets] = text_targets
242
249
 
243
- settings[:target_groups] = target_groups
250
+ # Example array on https://developer.tenable.com/reference/scans-create is really just a string.
251
+ settings[:target_groups] = "[#{target_groups}]" if target_groups
244
252
 
245
- settings[:file_targets] = file_targets
253
+ settings[:file_targets] = file_targets if file_targets
246
254
 
247
- settings[:tag_targets] = tag_targets_arr
255
+ settings[:tag_targets] = tag_targets_arr if tag_targets_arr.any?
248
256
 
249
- settings[:agent_group_id] = agent_group_id_arr
257
+ settings[:agent_group_id] = agent_group_id_arr if agent_group_id_arr.any?
250
258
 
251
- settings[:agent_scan_launch_type] = agent_scan_launch_type
259
+ settings[:agent_scan_launch_type] = agent_scan_launch_type if agent_scan_launch_type
252
260
 
253
- settings[:triggers] = triggers_arr
261
+ settings[:triggers] = triggers_arr if triggers_arr.any?
254
262
 
255
- settings[:emails] = emails
263
+ settings[:emails] = emails if emails
256
264
 
257
- settings[:acls] = acls
265
+ # settings[:acls] = acls if acls
258
266
 
259
267
  # Part 3: Populate credentials object from YAML config (optional)
260
- credentials = yaml[:credentials]
268
+ credentials = yaml[:credentials] if yaml[:credentials]
261
269
 
262
270
  # Part 4: Populate plugins object from YAML config (optional)
263
- plugins = yaml[:plugins]
271
+ plugins = yaml[:plugins] if yaml[:plugins]
264
272
 
265
273
  create_scan_resp = PWN::Plugins::NessusCloud.create_scan(
266
274
  nessus_obj: nessus_obj,
@@ -358,12 +358,17 @@ module PWN
358
358
 
359
359
  public_class_method def self.create_scan(opts = {})
360
360
  nessus_obj = opts[:nessus_obj]
361
+ uuid = opts[:scan_template_uuid]
362
+ settings = opts[:settings]
363
+ credentials = opts[:credentials]
364
+ plugins = opts[:plugins]
361
365
 
362
- http_body = {}
363
- http_body[:uuid] = opts[:scan_template_uuid]
364
- http_body[:settings] = opts[:settings]
365
- http_body[:credentials] = opts[:credentials]
366
- http_body[:plugins] = opts[:plugins]
366
+ http_body = {
367
+ uuid: uuid,
368
+ settings: settings,
369
+ credentials: credentials,
370
+ plugins: plugins
371
+ }.to_json
367
372
 
368
373
  create_scan_resp = nessus_cloud_rest_call(
369
374
  http_method: :post,
data/lib/pwn/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PWN
4
- VERSION = '0.4.435'
4
+ VERSION = '0.4.438'
5
5
  end
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.4.435
4
+ version: 0.4.438
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-20 00:00:00.000000000 Z
11
+ date: 2022-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport