dradis-nexpose 3.12.0 → 3.17.0

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
- SHA1:
3
- metadata.gz: '03881daa4493f108a492e4bc88dd2767d0f64a65'
4
- data.tar.gz: 7c9bfa9ec80b3063010b003c740c856ec6ffa4c4
2
+ SHA256:
3
+ metadata.gz: 7e506b28196a1d7cc112e29e801f77f080401fb17e7e4d5f901ab6212f9ff8bd
4
+ data.tar.gz: 3f808fd409ae67090e2997a1a2ce023565b71448a79177ac3f66f363dba8d34b
5
5
  SHA512:
6
- metadata.gz: 843c2cd03307f5d79cb773d8888d401f10d368d07774ac6a17919866c8f9f3a0f5d86f8e816c64b29ea0d8d0ec74c6e3474b0fe20c90844580e0ad75bbbf7042
7
- data.tar.gz: 19fff845db01166889c731dff37e9dd886bd2fbd26c60a56c4e473f1f1ba79b5b73dcc0b0026ea884f24a65a10f6ed4d7f09e92121de1fd7f67cbbe79508c7bc
6
+ metadata.gz: 11ba2be2eeb45490194eb0534a0c20065c3230096ff5c9add71d47bd161c8071c34c3a1033f010bcfdc176ee8af2e738136884bb3f905255783119e55a5a182f
7
+ data.tar.gz: 3be294f97f4fde6f0d6b669b3db2c659a03a1e9e28636eefa5d6f4517527b8c618f3b4006bff4befaaced9725ee872336b1749878a18be2f2deb536a6ce12816
@@ -0,0 +1,16 @@
1
+ ### Steps to reproduce
2
+
3
+ Help us help you, how can we reproduce the problem?
4
+
5
+ ### Expected behavior
6
+ Tell us what should happen
7
+
8
+ ### Actual behavior
9
+ Tell us what happens instead
10
+
11
+ ### System configuration
12
+ **Dradis version**:
13
+
14
+ **Ruby version**:
15
+
16
+ **OS version**:
@@ -0,0 +1,36 @@
1
+ ### Summary
2
+
3
+ Provide a general description of the code changes in your pull
4
+ request... were there any bugs you had fixed? If so, mention them. If
5
+ these bugs have open GitHub issues, be sure to tag them here as well,
6
+ to keep the conversation linked together.
7
+
8
+
9
+ ### Other Information
10
+
11
+ If there's anything else that's important and relevant to your pull
12
+ request, mention that information here. This could include
13
+ benchmarks, or other information.
14
+
15
+ Thanks for contributing to Dradis!
16
+
17
+
18
+ ### Copyright assignment
19
+
20
+ Collaboration is difficult with commercial closed source but we want
21
+ to keep as much of the OSS ethos as possible available to users
22
+ who want to fix it themselves.
23
+
24
+ In order to unambiguously own and sell Dradis Framework commercial
25
+ products, we must have the copyright associated with the entire
26
+ codebase. Any code you create which is merged must be owned by us.
27
+ That's not us trying to be a jerks, that's just the way it works.
28
+
29
+ Please review the [CONTRIBUTING.md](https://github.com/dradis/dradis-ce/blob/master/CONTRIBUTING.md)
30
+ file for the details.
31
+
32
+ You can delete this section, but the following sentence needs to
33
+ remain in the PR's description:
34
+
35
+ > I assign all rights, including copyright, to any future Dradis
36
+ > work by myself to Security Roots.
@@ -1,3 +1,23 @@
1
+ ## Dradis Framework 3.17 (May, 2020) ##
2
+
3
+ * Expand coverage for cipher wrapping
4
+
5
+ ## Dradis Framework 3.16 (February, 2020) ##
6
+
7
+ * No changes.
8
+
9
+ ## Dradis Framework 3.15 (November, 2019) ##
10
+
11
+ * Wrap ciphers in code blocks
12
+
13
+ ## Dradis Framework 3.14 (August, 2019) ##
14
+
15
+ * Add risk-score attribute to nodes
16
+
17
+ ## Dradis Framework 3.13 (June, 2019) ##
18
+
19
+ * No changes.
20
+
1
21
  ## Dradis Framework 3.12 (March, 2019) ##
2
22
 
3
23
  * No changes.
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.add_dependency 'dradis-plugins', '~> 3.6'
29
29
  spec.add_dependency 'nokogiri', '~> 1.3'
30
30
 
31
- spec.add_development_dependency 'bundler', '~> 1.6'
31
+ spec.add_development_dependency 'bundler'
32
32
  spec.add_development_dependency 'rake', '~> 10.0'
33
33
  spec.add_development_dependency 'rspec-rails'
34
34
  spec.add_development_dependency 'combustion', '~> 0.5.2'
@@ -36,6 +36,7 @@ module Dradis::Plugins::Nexpose::Formats
36
36
  host_node.set_property(:ip, nexpose_node.address)
37
37
  host_node.set_property(:hostname, nexpose_node.site_name)
38
38
  host_node.set_property(:os, nexpose_node.software)
39
+ host_node.set_property(:risk_score, nexpose_node.risk_score)
39
40
  host_node.save
40
41
  end
41
42
 
@@ -8,7 +8,7 @@ module Dradis
8
8
 
9
9
  module VERSION
10
10
  MAJOR = 3
11
- MINOR = 12
11
+ MINOR = 17
12
12
  TINY = 0
13
13
  PRE = nil
14
14
 
@@ -18,7 +18,7 @@ module Nexpose
18
18
  def supported_tags
19
19
  [
20
20
  # attributes
21
- :address, :device_id, :hardware_address, :site_name, :status,
21
+ :address, :device_id, :hardware_address, :risk_score, :site_name, :status,
22
22
 
23
23
  # simple tags
24
24
 
@@ -71,9 +71,10 @@ module Nexpose
71
71
  # First we try the attributes. In Ruby we use snake_case, but in XML
72
72
  # hyphenated-case is used for some attributes
73
73
  translations_table = {
74
- :device_id => 'device-id',
75
- :hardware_address => 'hardware-address',
76
- :site_name => 'site-name'
74
+ device_id: 'device-id',
75
+ hardware_address: 'hardware-address',
76
+ risk_score: 'risk-score',
77
+ site_name: 'site-name'
77
78
  }
78
79
 
79
80
  method_name = translations_table.fetch(method, method.to_s)
@@ -8,6 +8,8 @@ module Nexpose
8
8
  # Instead of providing separate methods for each supported property we rely
9
9
  # on Ruby's #method_missing to do most of the work.
10
10
  class Vulnerability
11
+ SSL_CIPHER_VULN_IDS = %w[ssl-des-ciphers ssl-3des-ciphers ssl-export-ciphers ssl-static-key-ciphers rc4-cve-2013-2566 ssl-cve-2016-2183-sweet32 tls-dhe-export-ciphers-cve-2015-4000].freeze
12
+
11
13
  # Accepts an XML node from Nokogiri::XML.
12
14
  def initialize(xml_node)
13
15
  @xml = xml_node
@@ -76,7 +78,9 @@ module Nexpose
76
78
 
77
79
  # We need to clean up tags that have HTML content in them
78
80
  if tags_with_html_content.include?(method)
79
- return cleanup_html(tag)
81
+ result = cleanup_html(tag)
82
+ result = add_bc_to_ssl_cipher_list(result) if SSL_CIPHER_VULN_IDS.include?(@xml.attributes['id'].value)
83
+ return result
80
84
  # And we need to clean up the tags with nested content in them
81
85
  elsif tags_with_nested_content.include?(method)
82
86
  return cleanup_nested(nest)
@@ -99,15 +103,9 @@ module Nexpose
99
103
 
100
104
  private
101
105
 
102
- def cleanup_nested(source)
106
+ def add_bc_to_ssl_cipher_list(source)
103
107
  result = source.to_s
104
- result.gsub!(/<references>/, '')
105
- result.gsub!(/<\/references>/, '')
106
- result.gsub!(/<reference source=\"(.*?)\">(.*?)<\/reference>/i) {"#{$1.strip}: #{$2.strip}\n"}
107
- result.gsub!(/<tags>/, '')
108
- result.gsub!(/<\/tags>/, '')
109
- result.gsub!(/<tag>(.*?)<\/tag>/) {"#{$1}\n"}
110
- result.gsub!(/ /, '')
108
+ result.gsub!(/\n(.*?)!(.*?)/){"\nbc. #{ $1 }!#{ $2 }\n"}
111
109
  result
112
110
  end
113
111
 
@@ -121,10 +119,24 @@ module Nexpose
121
119
  result.gsub!(/<UnorderedList>(.*?)<\/UnorderedList>/m){|m| "#{ $1 }"}
122
120
  result.gsub!(/<ListItem>(.*?)<\/ListItem>/m){|m| "#{ $1 }\n"}
123
121
  result.gsub!(/ /, '')
122
+ result.gsub!(/\t\t/, '')
124
123
  result.gsub!(/<URLLink LinkTitle=\"(.*?)\" LinkURL=\"(.*?)\"\/>/i) { "\"#{$1.strip}\":#{$2.strip} " }
125
124
  result.gsub!(/<URLLink LinkURL=\"(.*?)\" LinkTitle=\"(.*?)\"\/>/i) { "\"#{$2.strip}\":#{$1.strip} " }
126
125
  result.gsub!(/<URLLink(.*)LinkURL=\"(.*?)\"(.*?)>(.*?)<\/URLLink>/m) {|m| "\"#{$4.strip}\":#{$2.strip} " }
126
+ result.gsub!(/&gt;/, '>')
127
+ result.gsub!(/&lt;/, '<')
128
+ result
129
+ end
127
130
 
131
+ def cleanup_nested(source)
132
+ result = source.to_s
133
+ result.gsub!(/<references>/, '')
134
+ result.gsub!(/<\/references>/, '')
135
+ result.gsub!(/<reference source=\"(.*?)\">(.*?)<\/reference>/i) {"#{$1.strip}: #{$2.strip}\n"}
136
+ result.gsub!(/<tags>/, '')
137
+ result.gsub!(/<\/tags>/, '')
138
+ result.gsub!(/<tag>(.*?)<\/tag>/) {"#{$1}\n"}
139
+ result.gsub!(/ /, '')
128
140
  result
129
141
  end
130
142
 
@@ -0,0 +1,53 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <NexposeReport version="2.0">
3
+ <scans>
4
+ <scan endTime="20141110T175832478" id="4" name="USDA_Internal" startTime="20141110T094538362" status="finished"/>
5
+ </scans>
6
+ <nodes>
7
+ <node address="1.1.1.1" device-id="75" risk-score="0.0" scan-template="Edge Standard" site-importance="Normal" site-name="USDA_Internal" status="alive">
8
+ <fingerprints>
9
+ <os certainty="0.80" family="IOS" product="IOS" vendor="Cisco"/>
10
+ </fingerprints>
11
+ <tests/>
12
+ <endpoints>
13
+ </endpoints>
14
+ </node>
15
+ </nodes>
16
+ <VulnerabilityDefinitions>
17
+ <vulnerability id="ssl-3des-ciphers" title="TLS/SSL Server Supports 3DES Cipher Suite" severity="1" pciSeverity="1" cvssScore="0.0" cvssVector="(AV:N/AC:H/Au:N/C:N/I:N/A:N)" published="20090201T000000000" added="20150930T000000000" modified="20181127T000000000" riskScore="0.0">
18
+ <malware></malware><exploits></exploits><description>
19
+
20
+ <ContainerBlockElement>
21
+
22
+ <Paragraph>
23
+ Transport Layer Security (TLS) versions 1.0 (RFC 2246) and 1.1 (RFC 4346) include cipher suites based on the
24
+ 3DES (Triple Data Encryption Standard) algorithm.
25
+ Since 3DES only provides an effective security of 112 bits, it is considered close to end of life by some agencies. Consequently, the 3DES algorithm is not included in the specifications for TLS version 1.3.
26
+ ECRYPT II (from 2012) recommends for generic application independent long-term protection at least 128 bits security. The same recommendation has also been reported by BSI Germany (from 2015) and ANSSI France (from 2014), 128 bit is the recommended symmetric size and should be mandatory after 2020. While NIST (from 2012) still considers 3DES being appropriate to use until the end of 2030.
27
+ </Paragraph>
28
+ </ContainerBlockElement></description>
29
+ <references>
30
+ <reference source="URL">http://www.nist.gov/manuscript-publication-search.cfm?pub_id=915295</reference>
31
+ <reference source="URL">http://www.ecrypt.eu.org/ecrypt2/documents/D.SPA.20.pdf</reference>
32
+ <reference source="URL">http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-52r1.pdf</reference>
33
+ <reference source="URL">https://wiki.mozilla.org/Security/Server_Side_TLS</reference>
34
+ <reference source="URL">https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Cryptographic_Ciphers</reference>
35
+ <reference source="URL">http://support.microsoft.com/kb/245030/</reference>
36
+ </references><tags>
37
+ <tag>Network</tag>
38
+ </tags>
39
+ <solution>
40
+
41
+ <ContainerBlockElement>
42
+ <Paragraph>
43
+ <Paragraph>Configure the server to disable support for 3DES suite.</Paragraph>
44
+ <Paragraph>For Microsoft IIS web servers, see Microsoft Knowledgebase article
45
+
46
+ <URLLink LinkURL="http://support.microsoft.com/kb/245030/" href="http://support.microsoft.com/kb/245030/" LinkTitle="http://support.microsoft.com/kb/245030/">245030</URLLink> for instructions on disabling 3DES cipher suite.
47
+ </Paragraph>
48
+ <Paragraph>The following recommended configuration provides a higher level of security. This configuration is compatible with Firefox 27, Chrome 22, IE 11, Opera 14 and Safari 7. SSLv2, SSLv3, and TLSv1 protocols are not recommended in this configuration. Instead, use TLSv1.1 and TLSv1.2 protocols.</Paragraph>
49
+ <Paragraph>Refer to your server vendor documentation to apply the recommended cipher configuration:</Paragraph>
50
+ <Paragraph>ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK</Paragraph></Paragraph></ContainerBlockElement></solution>
51
+ </vulnerability>
52
+ </VulnerabilityDefinitions>
53
+ </NexposeReport>
@@ -86,25 +86,20 @@ describe 'Nexpose upload plugin' do
86
86
  expect(args[:node].label).to eq("Nexpose Scan Summary")
87
87
  end.once
88
88
 
89
- expect(@content_service).to receive(:create_node).with(hash_including label: "1.1.1.1", type: :host).once
89
+ expect(@content_service).to receive(:create_node).with(
90
+ hash_including label: "1.1.1.1", type: :host
91
+ ).twice
92
+
90
93
  expect(@content_service).to receive(:create_note) do |args|
91
- expect(args[:text]).to include("#[Host]#\n1.1.1.1")
94
+ expect(args[:text]).to include("#[Title]#\n1.1.1.1")
92
95
  expect(args[:node].label).to eq("1.1.1.1")
93
96
  end.once
94
97
 
95
- expect(@content_service).to receive(:create_node) do |args|
96
- expect(args[:label]).to eq("Definitions")
97
- OpenStruct.new(args)
98
- end.once
99
98
  expect(@content_service).to receive(:create_note) do |args|
100
99
  expect(args[:text]).to include("#[Title]#\nService name: NTP")
101
100
  expect(args[:node].label).to eq("1.1.1.1")
102
101
  end.once
103
102
 
104
- expect(@content_service).to receive(:create_node) do |args|
105
- expect(args[:label]).to eq("1.1.1.1")
106
- OpenStruct.new(args)
107
- end.once
108
103
  expect(@content_service).to receive(:create_note) do |args|
109
104
  expect(args[:text]).to include("#[Title]#\nService name: SNMP")
110
105
  expect(args[:node].label).to eq("1.1.1.1")
@@ -131,19 +126,38 @@ describe 'Nexpose upload plugin' do
131
126
  @importer.import(file: 'spec/fixtures/files/full.xml')
132
127
  end
133
128
 
129
+ it "wraps ciphers inside ssl issues in code blocks" do
130
+ expect(@content_service).to receive(:create_issue) do |args|
131
+ expect(args[:text]).to include("bc. ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256")
132
+ OpenStruct.new(args)
133
+ end.once
134
+
135
+ @importer.import(file: 'spec/fixtures/files/ssl.xml')
136
+ end
137
+
134
138
  # Regression test for github.com/dradis/dradis-nexpose/issues/1
135
139
  it "populates solutions regardless they are wrapped in paragraphs or lists" do
136
140
  expect(@content_service).to receive(:create_issue) do |args|
137
- expect(args[:text]).to include("#[Solution]#\nApache HTTPD >= 2.0 and < 2.0.65")
141
+ expect(args[:text]).to include("#[Solution]#\n\nApache HTTPD >= 2.0 and < 2.0.65")
138
142
  OpenStruct.new(args)
139
143
  end.once
140
144
 
141
145
  expect(@content_service).to receive(:create_issue) do |args|
142
- expect(args[:text]).to include("#[Solution]#\nYou can remove inode information from the ETag header")
146
+ expect(args[:text]).to include("#[Solution]#\n")
147
+ expect(args[:text]).to include("You can remove inode information from the ETag header")
143
148
  OpenStruct.new(args)
144
149
  end.once
145
150
 
146
151
  @importer.import(file: 'spec/fixtures/files/full.xml')
147
152
  end
153
+
154
+ it "transforms html entities (&lt; and &gt;)" do
155
+ expect(@content_service).to receive(:create_issue) do |args|
156
+ expect(args[:text]).to include("#[Solution]#\n\nApache HTTPD >= 2.0 and < 2.0.65")
157
+ OpenStruct.new(args)
158
+ end
159
+
160
+ @importer.import(file: 'spec/fixtures/files/full.xml')
161
+ end
148
162
  end
149
163
  end
@@ -4,6 +4,7 @@ node.fingerprints
4
4
  node.hardware_address
5
5
  node.names
6
6
  node.tests
7
+ node.risk_score
7
8
  node.site_name
8
9
  node.status
9
- node.software
10
+ node.software
@@ -3,7 +3,8 @@
3
3
  site-name="snorby"
4
4
  status="alive"
5
5
  device-id="211"
6
- hardware-address="00:de:ad:be:ef:00">
6
+ hardware-address="00:de:ad:be:ef:00"
7
+ risk-score="123">
7
8
 
8
9
  <names>
9
10
  <name>iPad.local</name>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dradis-nexpose
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.12.0
4
+ version: 3.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Martin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-01 00:00:00.000000000 Z
11
+ date: 2020-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dradis-plugins
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.6'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1.6'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -102,6 +102,8 @@ executables: []
102
102
  extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
+ - ".github/issue_template.md"
106
+ - ".github/pull_request_template.md"
105
107
  - ".gitignore"
106
108
  - ".rspec"
107
109
  - CHANGELOG.md
@@ -129,6 +131,7 @@ files:
129
131
  - lib/tasks/thorfile.rb
130
132
  - spec/fixtures/files/full.xml
131
133
  - spec/fixtures/files/simple.xml
134
+ - spec/fixtures/files/ssl.xml
132
135
  - spec/nexpose_upload_spec.rb
133
136
  - spec/spec_helper.rb
134
137
  - templates/full_evidence.fields
@@ -168,13 +171,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
171
  - !ruby/object:Gem::Version
169
172
  version: '0'
170
173
  requirements: []
171
- rubyforge_project:
172
- rubygems_version: 2.6.12
174
+ rubygems_version: 3.0.1
173
175
  signing_key:
174
176
  specification_version: 4
175
177
  summary: Nexpose add-on for the Dradis Framework.
176
178
  test_files:
177
179
  - spec/fixtures/files/full.xml
178
180
  - spec/fixtures/files/simple.xml
181
+ - spec/fixtures/files/ssl.xml
179
182
  - spec/nexpose_upload_spec.rb
180
183
  - spec/spec_helper.rb