Nessus6 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/lib/Nessus6.rb +1 -0
- data/lib/Nessus6/file.rb +1 -1
- data/lib/Nessus6/scan.rb +27 -0
- data/lib/Nessus6/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3aba5750c8d57f4ebc153f048b939b66c133a79
|
4
|
+
data.tar.gz: 6d3eedfd62b45e77531f081c56da11990a13d01f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 928cc8afbaa5b4d6600980101c9cf376160b025891df37dca292a1222cb84738243b86d03633e5ea6ee5d64960d8fd208ca5fe120120aa59f9b619b97b3c2ddf
|
7
|
+
data.tar.gz: c7eb4bfad5059da1892f34076cb8cc1c1f40bb62c7f7e6a0a5bacc4e179b3028bfe81b9b049983e23d765209f7ab9fab37fc2da53fc8573aac8056855ec52036
|
data/.travis.yml
CHANGED
data/lib/Nessus6.rb
CHANGED
@@ -48,6 +48,7 @@ module Nessus6
|
|
48
48
|
@token = @session.create(credentials[:username], credentials[:password])
|
49
49
|
@client.header['X-Cookie'] = "token = #{@token}"
|
50
50
|
elsif credentials[:access_key] && credentials[:secret_key]
|
51
|
+
@client.header['X-ApiKeys'] = "accessKey=#{credentials[:access_key]}; secretKey=#{credentials[:secret_key]}"
|
51
52
|
else
|
52
53
|
fail Nessus6::Error::AuthenticationError, 'Authentication credentials' \
|
53
54
|
' not provided. Must provided either username and password or ' \
|
data/lib/Nessus6/file.rb
CHANGED
@@ -16,7 +16,7 @@ module Nessus6
|
|
16
16
|
# @param file_path [String] Path to the file to upload
|
17
17
|
# @param file_type [String] MIME type. E.g. 'text/plain'
|
18
18
|
# @return [Hash] Returns a :fileuploaded string.
|
19
|
-
def upload(file_path, file_type, encrypted = 0)
|
19
|
+
def upload(file_path, file_type = 'text/plain', encrypted = 0)
|
20
20
|
response = @client.post('file/upload',
|
21
21
|
file: Hurley::UploadIO.new(file_path, file_type),
|
22
22
|
no_enc: encrypted)
|
data/lib/Nessus6/scan.rb
CHANGED
@@ -115,6 +115,33 @@ module Nessus6
|
|
115
115
|
conflict: 'Scan is not active.'
|
116
116
|
end
|
117
117
|
|
118
|
+
# Returns the output for a given plugin
|
119
|
+
#
|
120
|
+
# @param scan_id [String, Integer] The id of the scan to retrieve
|
121
|
+
# @param host_id [String, Integer] The id of the host to retrieve
|
122
|
+
# @param plugin_id [String, Integer] The id of the plugin to retrieve
|
123
|
+
# @param history_id [String, Integer] The history_id of the historical data
|
124
|
+
# that should be returned
|
125
|
+
# @return [Hash] Plugin information object
|
126
|
+
def plugin_output(scan_id, host_id, plugin_id, history_id = nil)
|
127
|
+
response = @client.get "scans/#{scan_id}/hosts/#{host_id}/plugins/"\
|
128
|
+
"#{plugin_id}", history_id: history_id
|
129
|
+
verify response,
|
130
|
+
internal_server_error: 'Internal server error'
|
131
|
+
end
|
132
|
+
|
133
|
+
# Changes the status of a scan
|
134
|
+
#
|
135
|
+
# @param scan_id [String, Fixnum] The id of the scan to change
|
136
|
+
# @param read [String, Trueclass, Falseclass] If true, the scan has been
|
137
|
+
# read
|
138
|
+
# @return [Hash]
|
139
|
+
def read_status(scan_id, read)
|
140
|
+
response = @client.put "scans/#{scan_id}/status", read: read
|
141
|
+
verify response,
|
142
|
+
not_found: 'A scan with that ID could not be located.'
|
143
|
+
end
|
144
|
+
|
118
145
|
# Resumes a scan
|
119
146
|
#
|
120
147
|
# @param scan_id [String, Fixnum] The id of the scan to resume
|
data/lib/Nessus6/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Nessus6
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Kirsche
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -161,3 +161,4 @@ signing_key:
|
|
161
161
|
specification_version: 4
|
162
162
|
summary: "[Under Construction] Nessus 6 API Gem"
|
163
163
|
test_files: []
|
164
|
+
has_rdoc:
|