nexpose 0.8.5 → 0.8.6
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/lib/nexpose/discovery.rb +5 -43
- data/lib/nexpose/filter.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d155da8a6809996a0d6b256536545a3c45554be
|
4
|
+
data.tar.gz: 2ef562dc10924617e59593730c587791c3226523
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 084f5d5a5bded5948d052145cff788905552b745f2898dbb013da506d1affeaf36d5913f1bebaebb95fc339401f97ebda6e4742b2815a7f5bf239716daf47564
|
7
|
+
data.tar.gz: abd42a4cf1f65811dacc7533f811566f3d18fff448af16028d97cdab659a1a0f4a343d0c0b97bab9d3aa970320b94c5678e5258c2759db60baec330b33bb7e33
|
data/lib/nexpose/discovery.rb
CHANGED
@@ -35,11 +35,6 @@ module Nexpose
|
|
35
35
|
HTTPS = 'HTTPS'
|
36
36
|
end
|
37
37
|
|
38
|
-
module Type
|
39
|
-
V_SPHERE = 'VSPHERE'
|
40
|
-
AWS = 'AWS'
|
41
|
-
end
|
42
|
-
|
43
38
|
# A unique identifier for this connection.
|
44
39
|
attr_accessor :id
|
45
40
|
|
@@ -47,7 +42,6 @@ module Nexpose
|
|
47
42
|
attr_accessor :name
|
48
43
|
|
49
44
|
# The IP address or fully qualified domain name of the server.
|
50
|
-
# For AWS connections, this is the address of the regional server.
|
51
45
|
attr_accessor :address
|
52
46
|
|
53
47
|
# A user name that can be used to log into the server.
|
@@ -62,12 +56,6 @@ module Nexpose
|
|
62
56
|
# The port used for connecting to the server. A valid port from 1 to 65535.
|
63
57
|
attr_accessor :port
|
64
58
|
|
65
|
-
# The type of discovery connection.
|
66
|
-
attr_accessor :type
|
67
|
-
|
68
|
-
# Whether the console and scan engine are inside the AWS network.
|
69
|
-
attr_accessor :inside_network
|
70
|
-
|
71
59
|
# Whether or not the connection is active.
|
72
60
|
# Discovery is only possible when the connection is active.
|
73
61
|
attr_accessor :status
|
@@ -85,7 +73,6 @@ module Nexpose
|
|
85
73
|
@id = -1
|
86
74
|
@port = 443
|
87
75
|
@protocol = Protocol::HTTPS
|
88
|
-
@type = Type::V_SPHERE
|
89
76
|
end
|
90
77
|
|
91
78
|
# Save this discovery connection to a Nexpose console.
|
@@ -143,35 +130,13 @@ module Nexpose
|
|
143
130
|
end
|
144
131
|
|
145
132
|
def as_xml
|
146
|
-
# TODO
|
147
|
-
# <DiscoveryConfig id="-1" name="aws" port="443" protocol="HTTPS" username="asdf" type="AWS" usePrivateIPAddress="0" engineid="2" region="ec2.us-west-1.amazonaws.com" password="asdf"> </DiscoveryConfig>
|
148
|
-
# <DiscoveryConfig id="-1" name="external AWS" port="443" protocol="HTTPS" username="acess-key-id" type="AWS" usePrivateIPAddress="0" engineid="2" region="ec2.sa-east-1.amazonaws.com" password="secret Access Key">
|
149
|
-
# <DiscoveryConfig id="-1" name="internal-aws" port="443" protocol="HTTPS" username=" " type="AWS" usePrivateIPAddress="1" engineid="2" region="ec2.ap-northeast-1.amazonaws.com" password="Not required">
|
150
|
-
# <DiscoveryConfig id="-1" name="V the Final Battle" fqdn="vcenter001.osdc.lax.rapid7.com" port="443" protocol="HTTPS" username="TOR\lmnexpose" type="VSPHERE" usePrivateIPAddress="0" engineid="2" region="ec2.us-east-1.amazonaws.com" password="22yQCA0P8nSvfrE">
|
151
|
-
# <DiscoveryConfig id="-1" name="duplicate vSphere" fqdn="vcenter001.osdc.lax.rapid7.com" port="443" protocol="HTTPS" username="blah" type="VSPHERE" usePrivateIPAddress="0" engineid="2" region="ec2.us-east-1.amazonaws.com" password="blah">
|
152
|
-
# <DiscoveryConfig id="10" name ="vCenter" fqdn ="vcenter001.osdc.lax.rapid7.com" port ="443" protocol ="HTTPS" username ="TOR\lmnexpose" type="VSPHERE" usePrivateIPAddress="0"> </DiscoveryConfig>
|
153
133
|
xml = REXML::Element.new('DiscoveryConnection')
|
154
|
-
xml.add_attributes({ '
|
155
|
-
'
|
134
|
+
xml.add_attributes({ 'name' => @name,
|
135
|
+
'address' => @address,
|
156
136
|
'port' => @port,
|
157
|
-
'protocol' => @protocol
|
158
|
-
|
159
|
-
|
160
|
-
xml.add_attributes({ 'region' => @address })
|
161
|
-
if @inside_network
|
162
|
-
xml.add_attributes({ 'usePrivateIPAddress' => 1,
|
163
|
-
'username' => ' ',
|
164
|
-
'password' => 'Not required' })
|
165
|
-
else
|
166
|
-
xml.add_attributes({ 'usePrivateIPAddress' => 0,
|
167
|
-
'username' => @user,
|
168
|
-
'password' => @password })
|
169
|
-
end
|
170
|
-
when Type::V_SPHERE
|
171
|
-
xml.add_attributes({ 'fqdn' => @address,
|
172
|
-
'username' => @user,
|
173
|
-
'password' => @password })
|
174
|
-
end
|
137
|
+
'protocol' => @protocol,
|
138
|
+
'user-name' => @user,
|
139
|
+
'password' => @password })
|
175
140
|
xml
|
176
141
|
end
|
177
142
|
|
@@ -180,9 +145,6 @@ module Nexpose
|
|
180
145
|
end
|
181
146
|
|
182
147
|
def self.parse(xml)
|
183
|
-
# <DiscoveryConfig id="10" name ="vCenter" fqdn ="vcenter001.osdc.lax.rapid7.com" port ="443" protocol ="HTTPS" username ="TOR\lmnexpose" type="VSPHERE" usePrivateIPAddress="0"> </DiscoveryConfig>
|
184
|
-
# <DiscoveryConfig id="34" name ="external AWS" region ="ec2.sa-east-1.amazonaws.com" port ="443" protocol ="HTTPS" username ="acess-key-id" type="AWS" usePrivateIPAddress="0">
|
185
|
-
# <DiscoveryConfig id="32" name ="my-aws" region ="ec2.ap-northeast-1.amazonaws.com" port ="443" protocol ="HTTPS" username =" " type="AWS" usePrivateIPAddress="1">
|
186
148
|
conn = new(xml.attributes['name'],
|
187
149
|
xml.attributes['address'],
|
188
150
|
xml.attributes['user-name'])
|
data/lib/nexpose/filter.rb
CHANGED
@@ -329,7 +329,9 @@ module Nexpose
|
|
329
329
|
end
|
330
330
|
|
331
331
|
def self.parse(json)
|
332
|
-
|
332
|
+
# The call returns empty JSON, so default to 'AND' if not present.
|
333
|
+
operator = json['operator'] || 'AND'
|
334
|
+
ret = Criteria.new([], operator)
|
333
335
|
json['criteria'].each do |c|
|
334
336
|
ret.criteria << Criterion.parse(c)
|
335
337
|
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: 0.8.
|
4
|
+
version: 0.8.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HD Moore
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-10-
|
14
|
+
date: 2014-10-13 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rex
|