nexpose 5.3.0 → 5.3.1
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 +4 -4
- data/Gemfile.lock +23 -23
- data/lib/nexpose/shared_credential.rb +40 -0
- data/lib/nexpose/version.rb +1 -1
- data/nexpose.gemspec +29 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 292f60db00ed0ad10463659fe229f5adae941595
|
4
|
+
data.tar.gz: 6bab0a12147116121fe004da5fc13dba958b7093
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8573bde575041d179bc49c914c2a9050b3eede0009dbb9a24c0c2e75e017e2b3ea0feff543c0f5e87f871de3b425693da6a848fd8fce3a2ef1a6af92e1aa9555
|
7
|
+
data.tar.gz: 849c15d0c49813f9894e66ab9c71e17a0bacc8cbf3a5cd4cb0286dcbd8504a03e77f2393128aab2ff214f17ea4c202b898aba51c5523c928322133d06af0f086
|
data/Gemfile.lock
CHANGED
@@ -1,47 +1,47 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
nexpose (5.3.
|
4
|
+
nexpose (5.3.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
addressable (2.3.
|
10
|
-
ast (2.
|
11
|
-
astrolabe (1.3.
|
12
|
-
parser (
|
9
|
+
addressable (2.3.7)
|
10
|
+
ast (2.0.0)
|
11
|
+
astrolabe (1.3.0)
|
12
|
+
parser (>= 2.2.0.pre.3, < 3.0)
|
13
13
|
codeclimate-test-reporter (0.4.7)
|
14
14
|
simplecov (>= 0.7.1, < 1.0.0)
|
15
15
|
crack (0.4.2)
|
16
16
|
safe_yaml (~> 1.0.0)
|
17
17
|
diff-lcs (1.2.5)
|
18
18
|
docile (1.1.5)
|
19
|
-
multi_json (1.
|
20
|
-
parser (2.
|
21
|
-
ast (
|
22
|
-
powerpack (0.1.
|
19
|
+
multi_json (1.10.1)
|
20
|
+
parser (2.2.0.3)
|
21
|
+
ast (>= 1.1, < 3.0)
|
22
|
+
powerpack (0.1.0)
|
23
23
|
rainbow (2.0.0)
|
24
|
-
rake (
|
25
|
-
rspec (3.
|
26
|
-
rspec-core (~> 3.
|
27
|
-
rspec-expectations (~> 3.
|
28
|
-
rspec-mocks (~> 3.
|
29
|
-
rspec-core (3.
|
30
|
-
rspec-support (~> 3.
|
31
|
-
rspec-expectations (3.
|
24
|
+
rake (10.4.2)
|
25
|
+
rspec (3.2.0)
|
26
|
+
rspec-core (~> 3.2.0)
|
27
|
+
rspec-expectations (~> 3.2.0)
|
28
|
+
rspec-mocks (~> 3.2.0)
|
29
|
+
rspec-core (3.2.1)
|
30
|
+
rspec-support (~> 3.2.0)
|
31
|
+
rspec-expectations (3.2.0)
|
32
32
|
diff-lcs (>= 1.2.0, < 2.0)
|
33
|
-
rspec-support (~> 3.
|
34
|
-
rspec-mocks (3.
|
33
|
+
rspec-support (~> 3.2.0)
|
34
|
+
rspec-mocks (3.2.1)
|
35
35
|
diff-lcs (>= 1.2.0, < 2.0)
|
36
|
-
rspec-support (~> 3.
|
37
|
-
rspec-support (3.
|
36
|
+
rspec-support (~> 3.2.0)
|
37
|
+
rspec-support (3.2.2)
|
38
38
|
rubocop (0.29.1)
|
39
39
|
astrolabe (~> 1.3)
|
40
40
|
parser (>= 2.2.0.1, < 3.0)
|
41
41
|
powerpack (~> 0.1)
|
42
42
|
rainbow (>= 1.99.1, < 3.0)
|
43
43
|
ruby-progressbar (~> 1.4)
|
44
|
-
ruby-progressbar (1.7.
|
44
|
+
ruby-progressbar (1.7.1)
|
45
45
|
safe_yaml (1.0.4)
|
46
46
|
simplecov (0.9.2)
|
47
47
|
docile (~> 1.1.0)
|
@@ -68,4 +68,4 @@ DEPENDENCIES
|
|
68
68
|
webmock (~> 1.20.4)
|
69
69
|
|
70
70
|
BUNDLED WITH
|
71
|
-
1.
|
71
|
+
1.12.5
|
@@ -166,6 +166,46 @@ module Nexpose
|
|
166
166
|
xml
|
167
167
|
end
|
168
168
|
|
169
|
+
# Test this credential against a target where the credentials should apply.
|
170
|
+
# Only works for a newly created credential. Loading an existing credential
|
171
|
+
# will likely fail.
|
172
|
+
#
|
173
|
+
# @param [Connection] nsc An active connection to the security console.
|
174
|
+
# @param [String] target Target host to check credentials against.
|
175
|
+
# @param [Fixnum] engine_id ID of the engine to use for testing credentials.
|
176
|
+
# Will default to the local engine if none is provided.
|
177
|
+
#
|
178
|
+
def test(nsc, target, engine_id = nil, siteid = -1)
|
179
|
+
unless engine_id
|
180
|
+
engine_id = nsc.engines.find { |e| e.name == 'Local scan engine' }.id
|
181
|
+
end
|
182
|
+
@port = Credential::DEFAULT_PORTS[@service] if @port.nil?
|
183
|
+
parameters = _to_param(target, engine_id, @port, siteid)
|
184
|
+
xml = AJAX.form_post(nsc, '/data/credential/shared/test', parameters)
|
185
|
+
result = REXML::XPath.first(REXML::Document.new(xml), 'TestAdminCredentialsResult')
|
186
|
+
result.attributes['success'].to_i == 1
|
187
|
+
end
|
188
|
+
|
189
|
+
|
190
|
+
def _to_param(target, engine_id, port, siteid)
|
191
|
+
{ engineid: engine_id,
|
192
|
+
sc_creds_dev: target,
|
193
|
+
sc_creds_svc: @service,
|
194
|
+
sc_creds_database: @database,
|
195
|
+
sc_creds_domain: @domain,
|
196
|
+
sc_creds_uname: @username,
|
197
|
+
sc_creds_password: @password,
|
198
|
+
sc_creds_pemkey: @pem_key,
|
199
|
+
sc_creds_port: port,
|
200
|
+
sc_creds_privilegeelevationusername: @privilege_username,
|
201
|
+
sc_creds_privilegeelevationpassword: @privilege_password,
|
202
|
+
sc_creds_privilegeelevationtype: @privilege_type,
|
203
|
+
sc_creds_snmpv3authtype: @auth_type,
|
204
|
+
sc_creds_snmpv3privtype: @privacy_type,
|
205
|
+
sc_creds_snmpv3privpassword: @privacy_password,
|
206
|
+
siteid: siteid }
|
207
|
+
end
|
208
|
+
|
169
209
|
def to_xml
|
170
210
|
as_xml.to_s
|
171
211
|
end
|
data/lib/nexpose/version.rb
CHANGED
data/nexpose.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'nexpose/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = 'nexpose'
|
8
|
+
s.version = Nexpose::VERSION
|
9
|
+
s.homepage = 'https://github.com/rapid7/nexpose-client'
|
10
|
+
s.summary = 'Ruby API for Rapid7 Nexpose'
|
11
|
+
s.description = 'This gem provides a Ruby API to the Nexpose vulnerability management product by Rapid7.'
|
12
|
+
s.license = 'BSD'
|
13
|
+
s.authors = ['HD Moore', 'Chris Lee', 'Michael Daines', 'Brandon Turner', 'Gavin Schneider', 'Scott Green']
|
14
|
+
s.email = ['hd_moore@rapid7.com', 'christopher_lee@rapid7.com', 'michael_daines@rapid7.com', 'brandon_turner@rapid7.com', 'gavin_schneider@rapid7.com', 'scott_green@rapid7.com']
|
15
|
+
s.files = Dir['[A-Z]*'] + Dir['lib/**/*']
|
16
|
+
s.require_paths = ['lib']
|
17
|
+
s.extra_rdoc_files = ['README.markdown']
|
18
|
+
s.required_ruby_version = '>= 2.1'
|
19
|
+
s.platform = 'ruby'
|
20
|
+
|
21
|
+
s.add_development_dependency('bundler', '~> 1.3')
|
22
|
+
s.add_development_dependency('codeclimate-test-reporter', '~> 0.4.6')
|
23
|
+
s.add_development_dependency('simplecov', '~> 0.9.1')
|
24
|
+
s.add_development_dependency('rake')
|
25
|
+
s.add_development_dependency('rspec', '~> 3.2')
|
26
|
+
s.add_development_dependency('rubocop')
|
27
|
+
s.add_development_dependency('webmock', '~> 1.20.4')
|
28
|
+
s.add_development_dependency('vcr', '~> 2.9.3')
|
29
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexpose
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.3.
|
4
|
+
version: 5.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HD Moore
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2017-02
|
16
|
+
date: 2017-03-02 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: bundler
|
@@ -206,6 +206,7 @@ files:
|
|
206
206
|
- lib/nexpose/vuln_exception.rb
|
207
207
|
- lib/nexpose/wait.rb
|
208
208
|
- lib/nexpose/web_credentials.rb
|
209
|
+
- nexpose.gemspec
|
209
210
|
homepage: https://github.com/rapid7/nexpose-client
|
210
211
|
licenses:
|
211
212
|
- BSD
|
@@ -226,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
227
|
version: '0'
|
227
228
|
requirements: []
|
228
229
|
rubyforge_project:
|
229
|
-
rubygems_version: 2.5.1
|
230
|
+
rubygems_version: 2.4.5.1
|
230
231
|
signing_key:
|
231
232
|
specification_version: 4
|
232
233
|
summary: Ruby API for Rapid7 Nexpose
|