nexpose 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nexpose.rb +1 -0
- data/lib/nexpose/ajax.rb +2 -2
- data/lib/nexpose/dag.rb +1 -1
- data/lib/nexpose/multi_tenant_user.rb +2 -1
- data/lib/nexpose/report.rb +5 -1
- data/lib/nexpose/scan_template.rb +8 -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: a42c70664170fab14be9e4ae17903c81da5360ff
|
4
|
+
data.tar.gz: 6938f2319a3f111f57384e07031b7fa88e69e7fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 717acb49d1c6b133d706fb17de051f03995176acc032e94a129ac4af50860acff3a616ca3af5e87879d075772690a7f30399ff93983a531e1f20f841bfff6d87
|
7
|
+
data.tar.gz: 5b9c431a8f4c16b17e2decc10bcdd7039fbff6b142a8a3b52adc3875a99e3219d145c3c0a21a29d7288f26a20a7e9d194622e44e9265cce2797bc863a1272a44
|
data/lib/nexpose.rb
CHANGED
data/lib/nexpose/ajax.rb
CHANGED
@@ -107,9 +107,9 @@ module Nexpose
|
|
107
107
|
# @param [String] uri Controller address relative to https://host:port
|
108
108
|
# @param [Hash] parameters Hash of attributes that need to be sent
|
109
109
|
# to the controller.
|
110
|
-
# @return [Hash] The
|
110
|
+
# @return [Hash] The parameterized URI.
|
111
111
|
|
112
|
-
def
|
112
|
+
def parameterize_uri(uri, parameters)
|
113
113
|
uri = uri.concat(('?').concat(parameters.map { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join('&'))) if parameters
|
114
114
|
end
|
115
115
|
|
data/lib/nexpose/dag.rb
CHANGED
@@ -32,7 +32,7 @@ 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 = AJAX.
|
35
|
+
uri = AJAX.parameterize_uri('/data/assetGroup/saveAssetGroup', params)
|
36
36
|
data = JSON.parse(AJAX.post(nsc, uri, _to_entity_details, AJAX::CONTENT_TYPE::JSON))
|
37
37
|
data['response'] == 'success.'
|
38
38
|
end
|
data/lib/nexpose/report.rb
CHANGED
@@ -85,6 +85,8 @@ module Nexpose
|
|
85
85
|
|
86
86
|
# The report definition (config) ID.
|
87
87
|
attr_reader :config_id
|
88
|
+
# The report config name.
|
89
|
+
attr_reader :name
|
88
90
|
# The ID of the report template.
|
89
91
|
attr_reader :template_id
|
90
92
|
# The current status of the report.
|
@@ -98,8 +100,9 @@ module Nexpose
|
|
98
100
|
# One of: (global|silo).
|
99
101
|
attr_reader :scope
|
100
102
|
|
101
|
-
def initialize(config_id, template_id, status, generated_on, uri, scope)
|
103
|
+
def initialize(config_id, name, template_id, status, generated_on, uri, scope)
|
102
104
|
@config_id = config_id.to_i
|
105
|
+
@name = name
|
103
106
|
@template_id = template_id
|
104
107
|
@status = status
|
105
108
|
@generated_on = generated_on
|
@@ -109,6 +112,7 @@ module Nexpose
|
|
109
112
|
|
110
113
|
def self.parse(xml)
|
111
114
|
ReportConfigSummary.new(xml.attributes['cfg-id'].to_i,
|
115
|
+
xml.attributes['name'],
|
112
116
|
xml.attributes['template-id'],
|
113
117
|
xml.attributes['status'],
|
114
118
|
xml.attributes['generated-on'],
|
@@ -155,6 +155,13 @@ module Nexpose
|
|
155
155
|
REXML::XPath.first(service_ports, './portList').text = ports.join(",")
|
156
156
|
end
|
157
157
|
|
158
|
+
# Disable TCP port scanning.
|
159
|
+
# @param [Boolean] enable or disable TCP ports
|
160
|
+
def enable_tcp_ports=(enable)
|
161
|
+
service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/TCPPortScan')
|
162
|
+
service_ports.attributes['mode'] = 'none' unless enable
|
163
|
+
end
|
164
|
+
|
158
165
|
# Add custom UDP ports to scan for services
|
159
166
|
# @param [Array] posts to scan
|
160
167
|
def udp_service_ports=(ports)
|
@@ -163,7 +170,7 @@ module Nexpose
|
|
163
170
|
REXML::XPath.first(service_ports, './portList').text = ports.join(",")
|
164
171
|
end
|
165
172
|
|
166
|
-
# Disable UDP port
|
173
|
+
# Disable UDP port scanning.
|
167
174
|
# @param [Boolean] enable or disable UDP ports
|
168
175
|
def enable_udp_ports=(enable)
|
169
176
|
service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/UDPPortScan')
|
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.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HD Moore
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-04-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: librex
|