nexpose 7.0.0 → 7.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -3
- data/Gemfile.lock +1 -1
- data/lib/nexpose/ajax.rb +12 -16
- data/lib/nexpose/alert.rb +20 -21
- data/lib/nexpose/api.rb +3 -3
- data/lib/nexpose/asset.rb +23 -23
- data/lib/nexpose/blackout.rb +6 -14
- data/lib/nexpose/common.rb +87 -92
- data/lib/nexpose/connection.rb +8 -10
- data/lib/nexpose/console.rb +9 -9
- data/lib/nexpose/dag.rb +2 -2
- data/lib/nexpose/data_table.rb +8 -12
- data/lib/nexpose/device.rb +35 -34
- data/lib/nexpose/discovery.rb +69 -69
- data/lib/nexpose/discovery/filter.rb +7 -8
- data/lib/nexpose/engine.rb +22 -21
- data/lib/nexpose/error.rb +7 -5
- data/lib/nexpose/external.rb +21 -16
- data/lib/nexpose/filter.rb +51 -52
- data/lib/nexpose/global_blackout.rb +6 -7
- data/lib/nexpose/global_settings.rb +2 -3
- data/lib/nexpose/group.rb +25 -19
- data/lib/nexpose/json_serializer.rb +4 -14
- data/lib/nexpose/maint.rb +8 -9
- data/lib/nexpose/manage.rb +2 -2
- data/lib/nexpose/multi_tenant_user.rb +42 -42
- data/lib/nexpose/password_policy.rb +14 -14
- data/lib/nexpose/pool.rb +6 -5
- data/lib/nexpose/report.rb +30 -34
- data/lib/nexpose/report_template.rb +17 -18
- data/lib/nexpose/role.rb +64 -55
- data/lib/nexpose/scan.rb +77 -60
- data/lib/nexpose/scan_template.rb +17 -17
- data/lib/nexpose/scheduled_backup.rb +8 -8
- data/lib/nexpose/scheduled_maintenance.rb +9 -9
- data/lib/nexpose/shared_credential.rb +30 -33
- data/lib/nexpose/shared_secret.rb +5 -5
- data/lib/nexpose/silo.rb +68 -66
- data/lib/nexpose/silo_profile.rb +47 -50
- data/lib/nexpose/site.rb +101 -123
- data/lib/nexpose/site_credentials.rb +15 -17
- data/lib/nexpose/tag.rb +73 -80
- data/lib/nexpose/ticket.rb +45 -42
- data/lib/nexpose/user.rb +45 -45
- data/lib/nexpose/util.rb +1 -1
- data/lib/nexpose/version.rb +1 -1
- data/lib/nexpose/vuln.rb +45 -43
- data/lib/nexpose/vuln_def.rb +7 -7
- data/lib/nexpose/vuln_exception.rb +35 -36
- data/lib/nexpose/wait.rb +32 -28
- data/lib/nexpose/web_credentials.rb +34 -36
- metadata +2 -2
data/lib/nexpose/connection.rb
CHANGED
@@ -97,17 +97,15 @@ module Nexpose
|
|
97
97
|
|
98
98
|
# Establish a new connection and Session ID
|
99
99
|
def login
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
true
|
107
|
-
end
|
108
|
-
rescue APIError
|
109
|
-
raise AuthenticationFailed.new(r)
|
100
|
+
login_hash = { 'sync-id' => 0, 'password' => @password, 'user-id' => @username, 'token' => @token }
|
101
|
+
login_hash['silo-id'] = @silo_id if @silo_id
|
102
|
+
r = execute(make_xml('LoginRequest', login_hash))
|
103
|
+
if r.success
|
104
|
+
@session_id = r.sid
|
105
|
+
true
|
110
106
|
end
|
107
|
+
rescue APIError
|
108
|
+
raise AuthenticationFailed.new(r)
|
111
109
|
end
|
112
110
|
|
113
111
|
# Logout of the current connection
|
data/lib/nexpose/console.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# here uh what
|
1
2
|
module Nexpose
|
2
3
|
|
3
4
|
# Nexpose console configuration class.
|
@@ -32,13 +33,12 @@ module Nexpose
|
|
32
33
|
#
|
33
34
|
def initialize(xml)
|
34
35
|
@xml = xml
|
35
|
-
|
36
|
-
|
37
|
-
@scan_threads_limit = nsc.attributes['scanThreadsLimit'].to_i
|
36
|
+
nsc = REXML::XPath.first(@xml, 'NeXposeSecurityConsole')
|
37
|
+
@scan_threads_limit = nsc.attributes['scanThreadsLimit'].to_i
|
38
38
|
@incremental_scan_results = nsc.attributes['realtimeIntegration'] == '1'
|
39
39
|
|
40
|
-
web_server
|
41
|
-
@session_timeout
|
40
|
+
web_server = REXML::XPath.first(nsc, 'WebServer')
|
41
|
+
@session_timeout = web_server.attributes['sessionTimeout'].to_i
|
42
42
|
end
|
43
43
|
|
44
44
|
# Load existing Nexpose security console configuration.
|
@@ -56,15 +56,15 @@ module Nexpose
|
|
56
56
|
# @return [Boolean] true if configuration successfully saved.
|
57
57
|
#
|
58
58
|
def save(connection)
|
59
|
-
nsc
|
60
|
-
nsc.attributes['scanThreadsLimit']
|
59
|
+
nsc = REXML::XPath.first(@xml, 'NeXposeSecurityConsole')
|
60
|
+
nsc.attributes['scanThreadsLimit'] = @scan_threads_limit.to_i
|
61
61
|
nsc.attributes['realtimeIntegration'] = @incremental_scan_results ? '1' : '0'
|
62
62
|
|
63
|
-
web_server
|
63
|
+
web_server = REXML::XPath.first(nsc, 'WebServer')
|
64
64
|
web_server.attributes['sessionTimeout'] = @session_timeout.to_i
|
65
65
|
|
66
66
|
response = REXML::Document.new(Nexpose::AJAX.post(connection, '/data/admin/config/nsc', @xml))
|
67
|
-
saved
|
67
|
+
saved = REXML::XPath.first(response, 'SaveConfig')
|
68
68
|
saved.attributes['success'] == '1'
|
69
69
|
end
|
70
70
|
end
|
data/lib/nexpose/dag.rb
CHANGED
@@ -32,8 +32,8 @@ module Nexpose
|
|
32
32
|
admins = nsc.users.select { |u| u.is_admin }.map { |u| u.id }
|
33
33
|
@users.reject! { |id| admins.member? id }
|
34
34
|
params = @id ? { 'entityid' => @id, 'mode' => 'edit' } : { 'entityid' => false, 'mode' => false }
|
35
|
-
uri
|
36
|
-
data
|
35
|
+
uri = AJAX.parameterize_uri('/data/assetGroup/saveAssetGroup', params)
|
36
|
+
data = JSON.parse(AJAX.post(nsc, uri, _to_entity_details, AJAX::CONTENT_TYPE::JSON))
|
37
37
|
data['response'] == 'success.'
|
38
38
|
end
|
39
39
|
|
data/lib/nexpose/data_table.rb
CHANGED
@@ -32,30 +32,26 @@ module Nexpose
|
|
32
32
|
# 'siteID' => site_id })
|
33
33
|
#
|
34
34
|
def _get_json_table(console, address, parameters = {}, page_size = 500, records = nil, post = true)
|
35
|
-
parameters['dir']
|
35
|
+
parameters['dir'] = 'DESC'
|
36
36
|
parameters['startIndex'] = -1
|
37
|
-
parameters['results']
|
38
|
-
|
37
|
+
parameters['results'] = -1
|
39
38
|
if post
|
40
39
|
request = lambda { |p| AJAX.form_post(console, address, p) }
|
41
40
|
else
|
42
41
|
request = lambda { |p| AJAX.get(console, address.dup, AJAX::CONTENT_TYPE::JSON, p) }
|
43
42
|
end
|
44
43
|
|
45
|
-
response = request.(parameters)
|
46
|
-
data
|
47
|
-
|
44
|
+
response = request.call(parameters)
|
45
|
+
data = JSON.parse(response)
|
48
46
|
# Don't attept to grab more records than there are.
|
49
47
|
total = data['totalRecords']
|
50
|
-
return [] if total
|
48
|
+
return [] if total.zero?
|
51
49
|
total = records.nil? ? total : [records, total].min
|
52
|
-
|
53
|
-
rows = []
|
50
|
+
rows = []
|
54
51
|
parameters['results'] = page_size
|
55
52
|
while rows.length < total
|
56
53
|
parameters['startIndex'] = rows.length
|
57
|
-
|
58
|
-
data = JSON.parse(request.(parameters))
|
54
|
+
data = JSON.parse(request.call(parameters))
|
59
55
|
rows.concat data['records']
|
60
56
|
end
|
61
57
|
rows
|
@@ -80,7 +76,7 @@ module Nexpose
|
|
80
76
|
response = REXML::Document.new(response)
|
81
77
|
|
82
78
|
headers = _dyn_headers(response)
|
83
|
-
rows
|
79
|
+
rows = _dyn_rows(response)
|
84
80
|
rows.map { |row| Hash[headers.zip(row)] }
|
85
81
|
end
|
86
82
|
|
data/lib/nexpose/device.rb
CHANGED
@@ -18,16 +18,18 @@ module Nexpose
|
|
18
18
|
r = execute(make_xml('SiteDeviceListingRequest', { 'site-id' => site_id }))
|
19
19
|
if r.success
|
20
20
|
device = REXML::XPath.first(r.res, "SiteDeviceListingResponse/SiteDevices/device[@address='#{address}']")
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
if device
|
22
|
+
return Device.new(device.attributes['id'].to_i,
|
23
|
+
device.attributes['address'],
|
24
|
+
device.parent.attributes['site-id'],
|
25
|
+
device.attributes['riskfactor'].to_f,
|
26
|
+
device.attributes['riskscore'].to_f)
|
27
|
+
end
|
26
28
|
end
|
27
29
|
nil
|
28
30
|
end
|
29
31
|
|
30
|
-
|
32
|
+
alias find_asset_by_address find_device_by_address
|
31
33
|
|
32
34
|
# Retrieve a list of all of the assets in a site.
|
33
35
|
#
|
@@ -57,10 +59,10 @@ module Nexpose
|
|
57
59
|
devices
|
58
60
|
end
|
59
61
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
62
|
+
alias devices list_site_devices
|
63
|
+
alias list_devices list_site_devices
|
64
|
+
alias assets list_site_devices
|
65
|
+
alias list_assets list_site_devices
|
64
66
|
|
65
67
|
# Get a list of all assets currently associated with a group.
|
66
68
|
#
|
@@ -89,9 +91,9 @@ module Nexpose
|
|
89
91
|
json.map { |vuln| VulnFinding.new(vuln) }
|
90
92
|
end
|
91
93
|
|
92
|
-
|
93
|
-
|
94
|
-
|
94
|
+
alias list_asset_vulns list_device_vulns
|
95
|
+
alias asset_vulns list_device_vulns
|
96
|
+
alias device_vulns list_device_vulns
|
95
97
|
|
96
98
|
# Retrieve a list of assets which completed in a given scan. If called
|
97
99
|
# during a scan, this method returns currently completed assets. A
|
@@ -129,7 +131,7 @@ module Nexpose
|
|
129
131
|
r.success
|
130
132
|
end
|
131
133
|
|
132
|
-
|
134
|
+
alias delete_asset delete_device
|
133
135
|
|
134
136
|
# Retrieve the scan history for an asset.
|
135
137
|
# Note: This is not optimized for querying many assets.
|
@@ -174,11 +176,11 @@ module Nexpose
|
|
174
176
|
attr_reader :site_id
|
175
177
|
|
176
178
|
def initialize(id, address, site_id, risk_factor = 1.0, risk_score = 0.0)
|
177
|
-
@id
|
178
|
-
@address
|
179
|
-
@site_id
|
179
|
+
@id = id.to_i
|
180
|
+
@address = address
|
181
|
+
@site_id = site_id.to_i
|
180
182
|
@risk_factor = risk_factor.to_f
|
181
|
-
@risk_score
|
183
|
+
@risk_score = risk_score.to_f
|
182
184
|
end
|
183
185
|
end
|
184
186
|
|
@@ -220,13 +222,13 @@ module Nexpose
|
|
220
222
|
# object.
|
221
223
|
def self.parse_json(json)
|
222
224
|
new do
|
223
|
-
@id
|
224
|
-
@ip
|
225
|
+
@id = json['assetID'].to_i
|
226
|
+
@ip = json['ipAddress']
|
225
227
|
@host_name = json['hostName']
|
226
|
-
@os
|
227
|
-
@vulns
|
228
|
-
@status
|
229
|
-
@duration
|
228
|
+
@os = json['operatingSystem']
|
229
|
+
@vulns = json['vulnerabilityCount']
|
230
|
+
@status = json['scanStatusTranslation'].downcase.to_sym
|
231
|
+
@duration = json['duration']
|
230
232
|
end
|
231
233
|
end
|
232
234
|
end
|
@@ -236,7 +238,6 @@ module Nexpose
|
|
236
238
|
class IncompleteAsset < CompletedAsset
|
237
239
|
end
|
238
240
|
|
239
|
-
|
240
241
|
# Summary object of a scan for a particular asset.
|
241
242
|
#
|
242
243
|
class AssetScan
|
@@ -268,15 +269,15 @@ module Nexpose
|
|
268
269
|
|
269
270
|
def self.parse_json(json)
|
270
271
|
new do
|
271
|
-
@asset_id
|
272
|
-
@scan_id
|
273
|
-
@site_id
|
274
|
-
@ip
|
275
|
-
@host_name
|
276
|
-
@os
|
277
|
-
@vulns
|
278
|
-
@end_time
|
279
|
-
@site_name
|
272
|
+
@asset_id = json['assetID'].to_i
|
273
|
+
@scan_id = json['scanID'].to_i
|
274
|
+
@site_id = json['siteID'].to_i
|
275
|
+
@ip = json['ipAddress']
|
276
|
+
@host_name = json['hostname']
|
277
|
+
@os = json['operatingSystem']
|
278
|
+
@vulns = json['vulnCount']
|
279
|
+
@end_time = Time.at(json['completed'].to_i / 1000)
|
280
|
+
@site_name = json['siteName']
|
280
281
|
@engine_name = json['scanEngineName']
|
281
282
|
end
|
282
283
|
end
|
data/lib/nexpose/discovery.rb
CHANGED
@@ -6,22 +6,22 @@ module Nexpose
|
|
6
6
|
# discovery of assets, including whether or not connections are active.
|
7
7
|
#
|
8
8
|
def list_discovery_connections
|
9
|
-
xml
|
10
|
-
response
|
9
|
+
xml = make_xml('DiscoveryConnectionListingRequest')
|
10
|
+
response = execute(xml, '1.2')
|
11
11
|
connections = []
|
12
12
|
response.res.elements.each('DiscoveryConnectionListingResponse/DiscoveryConnectionSummary') do |conn|
|
13
13
|
connections << DiscoveryConnection.parse(conn)
|
14
14
|
end
|
15
15
|
connections
|
16
16
|
end
|
17
|
-
|
17
|
+
alias discovery_connections list_discovery_connections
|
18
18
|
|
19
19
|
# Delete an existing connection to a target used for dynamic discovery of assets.
|
20
20
|
#
|
21
21
|
# @param [Fixnum] id ID of an existing discovery connection.
|
22
22
|
#
|
23
23
|
def delete_discovery_connection(id)
|
24
|
-
xml
|
24
|
+
xml = make_xml('DiscoveryConnectionDeleteRequest', { 'id' => id })
|
25
25
|
response = execute(xml, '1.2')
|
26
26
|
response.success
|
27
27
|
end
|
@@ -32,22 +32,22 @@ module Nexpose
|
|
32
32
|
|
33
33
|
module CollectionMethod
|
34
34
|
DIRECTORY_WATCHER = 'DIRECTORY_WATCHER'
|
35
|
-
SYSLOG
|
35
|
+
SYSLOG = 'SYSLOG'
|
36
36
|
end
|
37
37
|
|
38
38
|
module EventSource
|
39
39
|
INFOBLOX_TRINZIC = 'INFOBLOX_TRINZIC'
|
40
|
-
MICROSOFT_DHCP
|
40
|
+
MICROSOFT_DHCP = 'MICROSOFT_DHCP'
|
41
41
|
end
|
42
42
|
|
43
43
|
module Protocol
|
44
|
-
HTTP
|
45
|
-
HTTPS
|
46
|
-
LDAP
|
47
|
-
LDAPS
|
44
|
+
HTTP = 'HTTP'
|
45
|
+
HTTPS = 'HTTPS'
|
46
|
+
LDAP = 'LDAP'
|
47
|
+
LDAPS = 'LDAPS'
|
48
48
|
SERVICE_PROXY = 'SERVICE_PROXY'
|
49
|
-
TCP
|
50
|
-
UDP
|
49
|
+
TCP = 'TCP'
|
50
|
+
UDP = 'UDP'
|
51
51
|
end
|
52
52
|
|
53
53
|
module Type
|
@@ -56,51 +56,37 @@ module Nexpose
|
|
56
56
|
ACTIVESYNC = 'ACTIVESYNC'
|
57
57
|
ACTIVESYNC_POWERSHELL = 'ACTIVESYNC_POWERSHELL'
|
58
58
|
ACTIVESYNC_OFFICE365 = 'ACTIVESYNC_OFFICE365'
|
59
|
-
DHCP_SERVICE
|
59
|
+
DHCP_SERVICE = 'DHCP_SERVICE'
|
60
60
|
end
|
61
61
|
|
62
62
|
# A unique identifier for this connection.
|
63
63
|
attr_accessor :id
|
64
|
-
|
65
64
|
# A unique name for this connection.
|
66
65
|
attr_accessor :name
|
67
|
-
|
68
66
|
# Type of discovery connection
|
69
67
|
attr_accessor :type
|
70
|
-
|
71
68
|
# The IP address or fully qualified domain name of the server.
|
72
69
|
attr_accessor :address
|
73
|
-
|
74
70
|
# The engine ID to use for this connection.
|
75
71
|
attr_accessor :engine_id
|
76
|
-
|
77
72
|
# A user name that can be used to log into the server.
|
78
73
|
attr_accessor :user
|
79
|
-
|
80
74
|
# The password to use when connecting with the defined user.
|
81
75
|
attr_accessor :password
|
82
|
-
|
83
76
|
# The protocol used for connecting to the server. One of DiscoveryConnection::Protocol
|
84
77
|
attr_accessor :protocol
|
85
|
-
|
86
78
|
# The port used for connecting to the server. A valid port from 1 to 65535.
|
87
79
|
attr_accessor :port
|
88
|
-
|
89
80
|
# The hostname of the exchange server to connect for exchange powershell connections
|
90
81
|
attr_accessor :exchange_hostname
|
91
|
-
|
92
82
|
# The exchange username to connect for exchange powershell connections
|
93
83
|
attr_accessor :exchange_username
|
94
|
-
|
95
84
|
# The exchange password to connect for exchange powershell connections
|
96
85
|
attr_accessor :exchange_password
|
97
|
-
|
98
86
|
# The collection method (e.g. for DHCP discovery connections)
|
99
87
|
attr_accessor :collection_method
|
100
|
-
|
101
88
|
# The event source (e.g. for DHCP discovery connections)
|
102
89
|
attr_accessor :event_source
|
103
|
-
|
104
90
|
# Whether or not the connection is active.
|
105
91
|
# Discovery is only possible when the connection is active.
|
106
92
|
attr_accessor :status
|
@@ -114,10 +100,13 @@ module Nexpose
|
|
114
100
|
# @param [String] password Password for credentials on this connection.
|
115
101
|
#
|
116
102
|
def initialize(name = nil, address = nil, user = nil, password = nil)
|
117
|
-
@name
|
118
|
-
@
|
119
|
-
@
|
120
|
-
@
|
103
|
+
@name = name
|
104
|
+
@address = address
|
105
|
+
@user = user
|
106
|
+
@password = password
|
107
|
+
@type = nil # For backwards compatibilitly, at some point should set this to Type::VSPHERE
|
108
|
+
@id = -1
|
109
|
+
@port = 443
|
121
110
|
@protocol = Protocol::HTTPS
|
122
111
|
end
|
123
112
|
|
@@ -155,7 +144,6 @@ module Nexpose
|
|
155
144
|
#
|
156
145
|
def save(nsc)
|
157
146
|
@id == -1 ? create(nsc) : update(nsc)
|
158
|
-
|
159
147
|
@id
|
160
148
|
end
|
161
149
|
|
@@ -181,7 +169,7 @@ module Nexpose
|
|
181
169
|
# @param [Connection] nsc Connection to a console.
|
182
170
|
#
|
183
171
|
def connect(nsc)
|
184
|
-
xml
|
172
|
+
xml = nsc.make_xml('DiscoveryConnectionConnectRequest', { 'id' => id })
|
185
173
|
response = nsc.execute(xml, '1.2')
|
186
174
|
response.success
|
187
175
|
end
|
@@ -221,10 +209,10 @@ module Nexpose
|
|
221
209
|
conn = new(xml.attributes['name'],
|
222
210
|
xml.attributes['address'],
|
223
211
|
xml.attributes['user-name'])
|
224
|
-
conn.id
|
225
|
-
conn.protocol
|
226
|
-
conn.port
|
227
|
-
conn.status
|
212
|
+
conn.id = xml.attributes['id'].to_i
|
213
|
+
conn.protocol = xml.attributes['protocol']
|
214
|
+
conn.port = xml.attributes['port'].to_i
|
215
|
+
conn.status = xml.attributes['connection-status']
|
228
216
|
conn.engine_id = xml.attributes['engine-id'].to_i
|
229
217
|
conn
|
230
218
|
end
|
@@ -234,10 +222,11 @@ module Nexpose
|
|
234
222
|
end
|
235
223
|
|
236
224
|
def to_h
|
237
|
-
{
|
225
|
+
{
|
226
|
+
id: id,
|
238
227
|
name: name,
|
239
228
|
type: type
|
240
|
-
# TODO Add remaining instance fields, once it is introduced in resource object
|
229
|
+
# TODO: Add remaining instance fields, once it is introduced in resource object
|
241
230
|
}
|
242
231
|
end
|
243
232
|
|
@@ -246,10 +235,8 @@ module Nexpose
|
|
246
235
|
end
|
247
236
|
|
248
237
|
def eql?(other)
|
249
|
-
id.eql?(other.id) &&
|
250
|
-
|
251
|
-
type.eql?(other.type)
|
252
|
-
# TODO Add remaining instance fields, once it is introduced in resource object
|
238
|
+
id.eql?(other.id) && name.eql?(other.name) && type.eql?(other.type)
|
239
|
+
# TODO: Add remaining instance fields, once it is introduced in resource object
|
253
240
|
end
|
254
241
|
|
255
242
|
# Override of filter criterion to account for proper JSON naming.
|
@@ -306,7 +293,7 @@ module Nexpose
|
|
306
293
|
attr_accessor :status
|
307
294
|
|
308
295
|
def initialize(&block)
|
309
|
-
instance_eval
|
296
|
+
instance_eval(&block) if block_given?
|
310
297
|
end
|
311
298
|
|
312
299
|
def on?
|
@@ -315,14 +302,14 @@ module Nexpose
|
|
315
302
|
|
316
303
|
def self.parse(json)
|
317
304
|
new do |asset|
|
318
|
-
asset.ip
|
319
|
-
asset.os
|
320
|
-
asset.name
|
321
|
-
asset.cluster
|
305
|
+
asset.ip = json['IPAddress']
|
306
|
+
asset.os = json['OSName']
|
307
|
+
asset.name = json['assetDiscoveryName']
|
308
|
+
asset.cluster = json['cluster']
|
322
309
|
asset.datacenter = json['datacenter']
|
323
|
-
asset.host
|
324
|
-
asset.status
|
325
|
-
asset.pool
|
310
|
+
asset.host = json['host']
|
311
|
+
asset.status = json['powerStatus']
|
312
|
+
asset.pool = json['resourcePool']
|
326
313
|
end
|
327
314
|
end
|
328
315
|
end
|
@@ -338,13 +325,17 @@ module Nexpose
|
|
338
325
|
# @param [String] password Password for credentials on this connection.
|
339
326
|
#
|
340
327
|
def initialize(name, protocol, address, user, password = nil)
|
341
|
-
@name
|
342
|
-
@
|
343
|
-
@
|
344
|
-
@
|
328
|
+
@name = name
|
329
|
+
@protocol = protocol
|
330
|
+
@address = address
|
331
|
+
@user = user
|
332
|
+
@password = password
|
333
|
+
@type = Type::ACTIVESYNC
|
334
|
+
@id = -1
|
335
|
+
@port = 443 # port not used for mobile connection
|
345
336
|
end
|
346
337
|
end
|
347
|
-
|
338
|
+
|
348
339
|
class MobilePowershellDiscoveryConnection < DiscoveryConnection
|
349
340
|
# Create a new Mobile Powershell discovery connection.
|
350
341
|
#
|
@@ -358,12 +349,17 @@ module Nexpose
|
|
358
349
|
# @param [String] exchange_password Exchange password for exchange credentials on this connection.
|
359
350
|
#
|
360
351
|
def initialize(name, address, user, password, exchange_hostname, exchange_username, exchange_password)
|
361
|
-
@name
|
362
|
-
@
|
363
|
-
@
|
364
|
-
@
|
365
|
-
@
|
366
|
-
@
|
352
|
+
@name = name
|
353
|
+
@address = address
|
354
|
+
@user = user
|
355
|
+
@password = password
|
356
|
+
@protocol = Protocol::HTTPS
|
357
|
+
@exchange_hostname = exchange_hostname
|
358
|
+
@exchange_username = exchange_username
|
359
|
+
@exchange_password = exchange_password
|
360
|
+
@type = Type::ACTIVESYNC_POWERSHELL
|
361
|
+
@id = -1
|
362
|
+
@port = 443 # Port not used for mobile connection
|
367
363
|
end
|
368
364
|
end
|
369
365
|
|
@@ -379,13 +375,17 @@ module Nexpose
|
|
379
375
|
# @param [String] exchange_password Exchange password for exchange credentials on this connection.
|
380
376
|
#
|
381
377
|
def initialize(name, address, user, password, exchange_username, exchange_password)
|
382
|
-
@name
|
383
|
-
@
|
384
|
-
@
|
385
|
-
@
|
386
|
-
@
|
387
|
-
@
|
388
|
-
@
|
378
|
+
@name = name
|
379
|
+
@address = address
|
380
|
+
@user = user
|
381
|
+
@password = password
|
382
|
+
@protocol = Protocol::HTTPS
|
383
|
+
@exchange_hostname = '' # Nexpose will set to office365 server
|
384
|
+
@exchange_username = exchange_username
|
385
|
+
@exchange_password = exchange_password
|
386
|
+
@type = Type::ACTIVESYNC_OFFICE365
|
387
|
+
@id = -1
|
388
|
+
@port = 443 # Port not used for mobile connection
|
389
389
|
end
|
390
390
|
end
|
391
391
|
end
|