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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28266093c49d6743e5a662298252c67779d54659
4
- data.tar.gz: e1525369d7ee0b2052c87c0b3d14f763085f5276
3
+ metadata.gz: a42c70664170fab14be9e4ae17903c81da5360ff
4
+ data.tar.gz: 6938f2319a3f111f57384e07031b7fa88e69e7fa
5
5
  SHA512:
6
- metadata.gz: baa5a71852ad9259b8086ad9e0a6983cedd152f6da5efbbd3278070e4b633c4c81abd1eeb414aacb33a9010705df40ba30a46e30d85e103028a796f0c3883e10
7
- data.tar.gz: 481d97ce05e9b5976a3f679dcc502d6f071db593e28dab6fd4be00ccfc365680405c2eda62cb5bdb897059e1de1e78e830043e05b52089cf8303efc684b51c79
6
+ metadata.gz: 717acb49d1c6b133d706fb17de051f03995176acc032e94a129ac4af50860acff3a616ca3af5e87879d075772690a7f30399ff93983a531e1f20f841bfff6d87
7
+ data.tar.gz: 5b9c431a8f4c16b17e2decc10bcdd7039fbff6b142a8a3b52adc3875a99e3219d145c3c0a21a29d7288f26a20a7e9d194622e44e9265cce2797bc863a1272a44
data/lib/nexpose.rb CHANGED
@@ -55,6 +55,7 @@ require 'uri'
55
55
  require 'rex/mime'
56
56
  require 'ipaddr'
57
57
  require 'json'
58
+ require 'cgi'
58
59
  require 'nexpose/error'
59
60
  require 'nexpose/util'
60
61
  require 'nexpose/alert'
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 parametrized URI.
110
+ # @return [Hash] The parameterized URI.
111
111
 
112
- def parametrize_uri(uri, parameters)
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.parametrize_uri('/data/assetGroup/saveAssetGroup', params)
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
@@ -17,6 +17,7 @@ module Nexpose
17
17
  end
18
18
  arr
19
19
  end
20
+ alias_method :silo_users, :list_silo_users
20
21
 
21
22
  # Delete the specified silo user
22
23
  #
@@ -216,4 +217,4 @@ module Nexpose
216
217
  end
217
218
  end
218
219
  end
219
- end
220
+ end
@@ -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 scan
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.0
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-03-26 00:00:00.000000000 Z
13
+ date: 2014-04-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: librex