pwn 0.4.430 → 0.4.431

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c31b2ac11c6feecd92b4cd5fb270270c7cf91794dec67257bd18b1ba5ce330f4
4
- data.tar.gz: b774b6329c49e18d65720fad8e4ae0976cbce0507489e039b2b5745baf85055e
3
+ metadata.gz: 48072b8179bfac8c54e8c436a40414dc482092f73ef06fb3f6f318fde1f27ca7
4
+ data.tar.gz: 1760f70d5a5e81fb0c5e82606a3019b4de3e374a2a596a1ffd344dba62d2d865
5
5
  SHA512:
6
- metadata.gz: '08fc344ede5c67f38ef52aba9ed5d6fa9a9fcc7d1ec6b0f0f8486520a118ca94bf8de5219a93d00286813d1174270793805b3866ea99841571c0ddceedaff00f'
7
- data.tar.gz: 9061c5bd187b2c0c99229cd35dbe31aec1d1935c6465a07b5bfaa55691888d280f68eade1217e5a518d2ecfda5b2509a81dfe35b26d60f6dca8cffb7b302c6b6
6
+ metadata.gz: 48b319c619e24c40ec69a45c4ab2470972480400157443470752d0915e93761f3ad0e0a74b33f6d5389034e091d054efa4455ea8943957620d4e98130cb0c598
7
+ data.tar.gz: d93a09ed3585490878ca297da4be21bcce0a28f80732838eb2ddb436bab7383293aead3628a851bd7fc78f03b4af0a231f01145434132292f6d3ed6e69f088f1
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.430]:001 >>> PWN.help
40
+ pwn[v0.4.431]: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.430]:001 >>> PWN.help
55
+ pwn[v0.4.431]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -35,8 +35,8 @@ OptionParser.new do |options|
35
35
  opts[:scanner_name] = s
36
36
  end
37
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
38
+ options.on('-TTARGET', '--target-network-name=TARGET', '<Optional if --scanner other than AUTO-ROUTED, Otherwise Required - Network to Scan (Defaults to "Default")>') do |t|
39
+ opts[:target_network_name] = t
40
40
  end
41
41
 
42
42
  options.on('-lWHEN', '--launch=WHEN', '<Optional When to Launch Scan - ON_DEMAND || DAILY || WEEKLY || MONTHLY || YEARLY (Defaults to "ON_DEMAND")>') do |l|
@@ -80,9 +80,8 @@ begin
80
80
  scanner_name = opts[:scanner_name]
81
81
  scanner_name ||= 'AUTO-ROUTED'
82
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'
83
+ target_network_name = opts[:target_network_name]
84
+ target_network_name ||= 'Default'
86
85
 
87
86
  launch = opts[:launch]
88
87
  launch ||= 'ON_DEMAND'
@@ -122,10 +121,11 @@ begin
122
121
  scanner_id = scanner[:id]
123
122
  puts scanner_id
124
123
 
125
- target_network_list = PWN::Plugins::NessusCloud.get_target_networks(
126
- nessus_obj: nessus_obj
124
+ target_network = PWN::Plugins::NessusCloud.get_target_networks(
125
+ nessus_obj: nessus_obj,
126
+ name: target_network_name
127
127
  )
128
- puts target_network_list.inspect
128
+ target_network_id = target_network[:uuid]
129
129
  rescue Interrupt
130
130
  puts 'CTRL+C detected...goodbye.'
131
131
  rescue StandardError => e
@@ -215,13 +215,24 @@ module PWN
215
215
 
216
216
  public_class_method def self.get_target_networks(opts = {})
217
217
  nessus_obj = opts[:nessus_obj]
218
+ name = opts[:name]
218
219
 
219
220
  scan_templates_resp = nessus_cloud_rest_call(
220
221
  nessus_obj: nessus_obj,
221
222
  rest_call: 'networks'
222
223
  ).body
223
224
 
224
- JSON.parse(scan_templates_resp, symbolize_names: true)
225
+ target_networks = JSON.parse(scan_templates_resp, symbolize_names: true)
226
+
227
+ if name
228
+ selected_network = target_networks[:networks].select do |tn|
229
+ tn[:name] == name
230
+ end
231
+ target_networks = selected_network.first if selected_network.any?
232
+ target_networks ||= {}
233
+ end
234
+
235
+ target_networks
225
236
  rescue StandardError, SystemExit, Interrupt => e
226
237
  raise e
227
238
  end
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.430'
4
+ VERSION = '0.4.431'
5
5
  end
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.4.430
4
+ version: 0.4.431
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.