Nessus6 0.3.0 → 0.3.1

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
  SHA1:
3
- metadata.gz: dcbf03fa0718601cfb9d3780f862eead39111c50
4
- data.tar.gz: 3fd45dd455a363b77bfde3095048f123221c8686
3
+ metadata.gz: 124565e9d918310372e96f46ecc233111eab7d20
4
+ data.tar.gz: 25d9dd43bece92dd2637ec503e92749a996fd4b3
5
5
  SHA512:
6
- metadata.gz: bfac592a8a198defceb5eaa15aaa1dfcbb18ec18390f81b2b9a55a9ac60f08e5185df79ed0b0900800ea872708f7bdc3eb3d635715972ccb602d2f79dd29b103
7
- data.tar.gz: 16c0e2df32c239416b89ccd48676eb6a88757d619e495f7405b8dd9b1d8b875f22595b093c97125e5300b586534e973151b00457e809d2351eda04ac68600776
6
+ metadata.gz: 3802310a4764b6ea9b95f38604be99a7ee328ad03914f8dd76b91f09cb49eaaa9633a65e69112801cb68361b13de42d4c7ab8ff38cab27fb1d29a45c5c1e4ab8
7
+ data.tar.gz: dc72bfe6665b1bdce87686255203fdf42f3478e3ad2a3ddded5e70df801fff84739bf8edc97ef6ca3ce3e1168ee311e90e40d986303a7dedfd412f9296f887fe
@@ -40,16 +40,14 @@ nessus_location = {
40
40
  scan_id: row[3]
41
41
  }
42
42
  opts = { format: :csv }
43
- mapped_row[:file_id] = @client.scan.export mapped_row[:scan_id], opts
43
+ mapped_row[:file_id] = @client.scan.export(mapped_row[:scan_id], opts)['file']
44
44
 
45
45
  # Lock it in a closure so we don't have to have a huge one liner
46
46
  export_status = Proc.new { @client.scan.export_status mapped_row[:scan_id], mapped_row[:file_id] }
47
47
  ready_status = { 'status' => 'ready' }
48
48
  @logger.debug 'Waiting...' while export_status.call != ready_status
49
49
 
50
- file = @client.scan.download mapped_row[:scan_id],
51
- mapped_row[:file_id],
52
- "#{@results_directory}/#{mapped_row[:request_id].csv}"
53
-
54
- puts file
50
+ @client.scan.download mapped_row[:scan_id],
51
+ mapped_row[:file_id],
52
+ "#{@results_directory}/#{mapped_row[:request_id]}.csv"
55
53
  end
@@ -35,8 +35,8 @@ end
35
35
  @send_mail = '/usr/lib/sendmail -t'
36
36
 
37
37
  credentials = {
38
- access_key: 'eeb88394142b4b328332c2448e0f04846161493a50feaa454cbb2fa5083919f9',
39
- secret_key: 'b0d69c23612754367a84d168f2e7d6769aff1342cb25aa345481cb537164e092'
38
+ access_key: 'NA',
39
+ secret_key: 'NA'
40
40
  }
41
41
 
42
42
  nessus_location = {
@@ -104,10 +104,13 @@ module Nessus6
104
104
  # @param file_id [String, Fixnum] The id of the file to download (included in response from /scans/{scan_id}/export)
105
105
  def download(scan_id, file_id, write_path = nil)
106
106
  response = @client.get "scans/#{scan_id}/export/#{file_id}/download"
107
- hash_response = verify response,
108
- not_found: 'The scan or file does not exist.'
109
-
110
107
  File.open(write_path, 'w+') { |file| file.write response } unless write_path.nil?
108
+ begin
109
+ hash_response = verify response,
110
+ not_found: 'The scan or file does not exist.'
111
+ rescue
112
+ hash_response = nil
113
+ end
111
114
  hash_response
112
115
  end
113
116
 
@@ -1,5 +1,5 @@
1
1
  # The Nessus6 module is used to interact with Nessus version 6 servers.
2
2
  module Nessus6
3
3
  # VERSION is the current version of the Nessus6 gem
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Nessus6
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Kirsche