nexpose 0.7.5 → 0.7.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nexpose/scan_template.rb +14 -0
- data/lib/nexpose/tag.rb +21 -4
- 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: 4489a1cf24aae595c8e33906c072e337e2e3fe3b
|
4
|
+
data.tar.gz: 43bd09c01a8f777a1da5545f92c5e41da3f6e99e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bcef060fd7b3b78d811863560bb5bcb3437a75f3b7a2368e0182abc31b2c1ddbb15962e1d55c2fc712d6ce7b4764178d97550328ca6c11ad769567caa7ac41b
|
7
|
+
data.tar.gz: 4ef93a44863abf77d5c51cee2899e0a420b83b633a7f8c7add3d8e76bdadf3363a10908bab6995f343600f37101cef06249f3f5c5421ead06095b8c833c56b25
|
@@ -155,6 +155,13 @@ module Nexpose
|
|
155
155
|
REXML::XPath.first(service_ports, './portList').text = ports.join(",")
|
156
156
|
end
|
157
157
|
|
158
|
+
# Exclude TCP ports when scanning for services
|
159
|
+
# @param [Array] ports to exclude from scan
|
160
|
+
def exclude_tcp_service_ports=(ports)
|
161
|
+
service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/ExcludedTCPPortScan')
|
162
|
+
REXML::XPath.first(service_ports, './portList').text = ports.join(",")
|
163
|
+
end
|
164
|
+
|
158
165
|
# Disable TCP port scanning.
|
159
166
|
# @param [Boolean] enable or disable TCP ports
|
160
167
|
def enable_tcp_ports=(enable)
|
@@ -170,6 +177,13 @@ module Nexpose
|
|
170
177
|
REXML::XPath.first(service_ports, './portList').text = ports.join(",")
|
171
178
|
end
|
172
179
|
|
180
|
+
# Exclude UDP ports when scanning for services
|
181
|
+
# @param [Array] ports to exclude from scan
|
182
|
+
def exclude_udp_service_ports=(ports)
|
183
|
+
service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/ExcludedUDPPortScan')
|
184
|
+
REXML::XPath.first(service_ports, './portList').text = ports.join(",")
|
185
|
+
end
|
186
|
+
|
173
187
|
# Disable UDP port scanning.
|
174
188
|
# @param [Boolean] enable or disable UDP ports
|
175
189
|
def enable_udp_ports=(enable)
|
data/lib/nexpose/tag.rb
CHANGED
@@ -167,15 +167,22 @@ module Nexpose
|
|
167
167
|
LOCATION = 'LOCATION'
|
168
168
|
CRITICALITY = 'CRITICALITY'
|
169
169
|
end
|
170
|
-
end
|
171
170
|
|
172
|
-
|
171
|
+
module Color
|
172
|
+
BLUE = "#496a77"
|
173
|
+
DEFAULT = "#f6f6f6"
|
174
|
+
GREEN = "#7d8a58"
|
175
|
+
ORANGE = "#de7200"
|
176
|
+
PURPLE = "#844f7d"
|
177
|
+
RED = "#a0392e"
|
178
|
+
end
|
179
|
+
end
|
173
180
|
|
174
181
|
# Creation source
|
175
182
|
attr_accessor :source
|
176
183
|
|
177
184
|
# HEX color code of tag
|
178
|
-
|
185
|
+
attr_reader :color
|
179
186
|
|
180
187
|
# Risk modifier
|
181
188
|
attr_accessor :risk_modifier
|
@@ -200,9 +207,19 @@ module Nexpose
|
|
200
207
|
def initialize(name, type, id = -1)
|
201
208
|
@name, @type, @id = name, type, id
|
202
209
|
@source = 'nexpose-client'
|
203
|
-
@color = @type == Type::Generic::CUSTOM ?
|
210
|
+
@color = @type == Type::Generic::CUSTOM ? Type::Color::DEFAULT : nil
|
204
211
|
end
|
205
212
|
|
213
|
+
# Set the color but validate it
|
214
|
+
def color=(hex)
|
215
|
+
valid_colors = Type::Color::constants.map { |c| Type::Color.const_get(c) }
|
216
|
+
unless hex.nil? || valid_colors.include?(hex.to_s.downcase)
|
217
|
+
raise ArgumentError, "Unable to set color to an invalid color.\nUse one of #{valid_colors}"
|
218
|
+
end
|
219
|
+
|
220
|
+
@color = hex
|
221
|
+
end
|
222
|
+
|
206
223
|
# Creates and saves a tag to Nexpose console
|
207
224
|
#
|
208
225
|
# @param [Connection] connection Nexpose connection
|
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.6
|
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-06-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: librex
|