dradis-nexpose 4.10.0 → 4.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/pull_request_template.md +12 -3
- data/CHANGELOG.md +11 -0
- data/README.md +3 -4
- data/lib/dradis/plugins/nexpose/formats/full.rb +45 -44
- data/lib/dradis/plugins/nexpose/formats/simple.rb +1 -1
- data/lib/dradis/plugins/nexpose/gem_version.rb +2 -2
- data/lib/dradis/plugins/nexpose/mapping.rb +101 -0
- data/lib/dradis/plugins/nexpose.rb +1 -0
- data/lib/nexpose/endpoint.rb +5 -7
- data/lib/nexpose/node.rb +6 -12
- data/lib/nexpose/service.rb +18 -11
- data/lib/nexpose/test.rb +17 -8
- data/lib/nexpose/vulnerability.rb +3 -2
- data/spec/fixtures/files/full.xml +25 -30
- data/spec/fixtures/files/full_with_duplicate_node.xml +136 -0
- data/spec/nexpose_upload_spec.rb +197 -146
- data/templates/full_evidence.sample +1 -1
- data/templates/full_service.sample +1 -1
- data/templates/full_vulnerability.sample +1 -0
- metadata +9 -18
- data/templates/full_evidence.fields +0 -3
- data/templates/full_evidence.template +0 -8
- data/templates/full_node.fields +0 -10
- data/templates/full_node.template +0 -16
- data/templates/full_scan.fields +0 -5
- data/templates/full_scan.template +0 -9
- data/templates/full_service.fields +0 -4
- data/templates/full_service.template +0 -11
- data/templates/full_vulnerability.fields +0 -13
- data/templates/full_vulnerability.template +0 -34
- data/templates/simple_port.fields +0 -2
- data/templates/simple_port.template +0 -5
@@ -9,7 +9,7 @@
|
|
9
9
|
<name>localhost:5000</name>
|
10
10
|
</names>
|
11
11
|
<fingerprints>
|
12
|
-
<os certainty="0.80" family="IOS" product="IOS" vendor="Cisco"/>
|
12
|
+
<os certainty="0.80" family="IOS" product="IOS" vendor="Cisco" arch="x86_64"/>
|
13
13
|
</fingerprints>
|
14
14
|
<tests/>
|
15
15
|
<endpoints>
|
@@ -20,23 +20,32 @@
|
|
20
20
|
<fingerprint certainty="0.90" family="NTP" product="NTP" vendor="Cisco"/>
|
21
21
|
</fingerprints>
|
22
22
|
<configuration>
|
23
|
-
<config name="ntp.variables">system="cisco", leap=0, stratum=5, rootdelay=88.21,
|
24
|
-
|
25
|
-
rootdispersion=108.54, peer=24960, refid=135.89.100.96,
|
26
|
-
|
27
|
-
reftime=0xD80BB6B5.715ACDD8, poll=10, clock=0xD80BB78F.8931F3F6,
|
28
|
-
|
29
|
-
phase=8.259, freq=-141.24, error=11.32</config>
|
23
|
+
<config name="ntp.variables">system="cisco", leap=0, stratum=5, rootdelay=88.21,rootdispersion=108.54, peer=24960, refid=135.89.100.96,reftime=0xD80BB6B5.715ACDD8, poll=10, clock=0xD80BB78F.8931F3F6,phase=8.259, freq=-141.24, error=11.32</config>
|
30
24
|
</configuration>
|
31
25
|
<tests>
|
32
26
|
<test id="ntp-clock-variables-disclosure" pci-compliance-status="pass" scan-id="4" status="vulnerable-exploited" vulnerable-since="20141110T161846666">
|
33
27
|
<Paragraph>
|
34
|
-
<Paragraph>The following NTP variables were found from a readvar request: system="cisco", leap=0, stratum=5, rootdelay=88.21,
|
35
|
-
rootdispersion=108.54, peer=24960, refid=135.89.100.96,
|
36
|
-
reftime=0xD80BB6B5.715ACDD8, poll=10, clock=0xD80BB78F.8931F3F6,
|
37
|
-
phase=8.259, freq=-141.24, error=11.32</Paragraph>
|
28
|
+
<Paragraph>The following NTP variables were found from a readvar request: system="cisco", leap=0, stratum=5, rootdelay=88.21, rootdispersion=108.54, peer=24960, refid=135.89.100.96, reftime=0xD80BB6B5.715ACDD8, poll=10, clock=0xD80BB78F.8931F3F6,phase=8.259, freq=-141.24, error=11.32</Paragraph>
|
38
29
|
</Paragraph>
|
39
30
|
</test>
|
31
|
+
<test id="test-02" pci-compliance-status="pass" scan-id="4" status="vulnerable-exploited" vulnerable-since="20141110T161846666">
|
32
|
+
<ContainerBlockElement>
|
33
|
+
<Paragraph>Vulnerable URL:
|
34
|
+
<URLLink LinkURL="https://1.2.3.4/" LinkTitle="https://1.2.3.4/"></URLLink>
|
35
|
+
More info
|
36
|
+
</Paragraph>
|
37
|
+
<Paragraph>CRAWL TRAFFIC
|
38
|
+
Vulnerable response matched:
|
39
|
+
</Paragraph>
|
40
|
+
<Paragraph>ATTACK TRAFFIC
|
41
|
+
Vulnerability proven via 1 attack
|
42
|
+
<Paragraph>(1) Attack proof:
|
43
|
+
Attack description:
|
44
|
+
Missing HTTP header "Content-Security-Policy"
|
45
|
+
Vulnerable response matched:
|
46
|
+
</Paragraph></Paragraph>
|
47
|
+
</ContainerBlockElement>
|
48
|
+
</test>
|
40
49
|
</tests>
|
41
50
|
</service>
|
42
51
|
</services>
|
@@ -86,7 +95,7 @@ phase=8.259, freq=-141.24, error=11.32</Paragraph>
|
|
86
95
|
</ContainerBlockElement>
|
87
96
|
</solution>
|
88
97
|
</vulnerability>
|
89
|
-
<vulnerability added="20120412T000000000" cvssScore="4.3" cvssVector="(AV:N/AC:M/Au:N/C:P/I:N/A:N)" id="
|
98
|
+
<vulnerability added="20120412T000000000" cvssScore="4.3" cvssVector="(AV:N/AC:M/Au:N/C:P/I:N/A:N)" id="test-02" modified="20130828T000000000" pciSeverity="3" published="20031231T000000000" riskScore="549.07043" severity="4" title="Apache HTTPD: ETag Inode Information Leakage (CVE-2003-1418)">
|
90
99
|
<malware/>
|
91
100
|
<exploits/>
|
92
101
|
<description>
|
@@ -110,33 +119,19 @@ phase=8.259, freq=-141.24, error=11.32</Paragraph>
|
|
110
119
|
<UnorderedList>
|
111
120
|
<ListItem>
|
112
121
|
<Paragraph>
|
113
|
-
<Paragraph>You can remove inode information from the ETag header by adding the
|
114
|
-
following directive to your Apache config:</Paragraph>
|
122
|
+
<Paragraph>You can remove inode information from the ETag header by adding the following directive to your Apache config:</Paragraph>
|
115
123
|
<Paragraph preformat="true">FileETag MTime Size</Paragraph>
|
116
124
|
</Paragraph>
|
117
125
|
</ListItem>
|
118
126
|
<ListItem>
|
119
127
|
<Paragraph>OpenBSD</Paragraph>
|
120
128
|
<Paragraph>Download and apply the patch from:
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
129
|
<URLLink LinkTitle="http://www.openbsd.org/errata32.html#httpd" LinkURL="http://www.openbsd.org/errata32.html#httpd"/></Paragraph>
|
127
130
|
<Paragraph>
|
128
131
|
<Paragraph>The OpenBSD team has released a
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
132
|
<URLLink LinkTitle="http://www.openbsd.org/errata32.html#httpd" LinkURL="http://www.openbsd.org/errata32.html#httpd" href="http://www.openbsd.org/errata32.html#httpd">
|
135
|
-
patch</URLLink>for the Apache inode and pid leak problem. This patch can be applied
|
136
|
-
|
137
|
-
take effect. OpenBSD 3.3 will ship with the patched httpd by default.
|
138
|
-
The patch can be applied to earlier 3.x versions of OpenBSD, but it
|
139
|
-
may require editing of the source code.</Paragraph>
|
133
|
+
patch</URLLink>for the Apache inode and pid leak problem. This patch can be applied cleanly to 3.2 stable and rebuilt. Restart httpd for the changes to take effect. OpenBSD 3.3 will ship with the patched httpd by default. The patch can be applied to earlier 3.x versions of OpenBSD, but it may require editing of the source code.
|
134
|
+
</Paragraph>
|
140
135
|
</Paragraph>
|
141
136
|
</ListItem>
|
142
137
|
</UnorderedList>
|
@@ -0,0 +1,136 @@
|
|
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
|
+
<names>
|
9
|
+
<name>localhost:5000</name>
|
10
|
+
</names>
|
11
|
+
<fingerprints>
|
12
|
+
<os certainty="0.80" family="IOS" product="IOS" vendor="Cisco" arch="x86_64"/>
|
13
|
+
</fingerprints>
|
14
|
+
<tests/>
|
15
|
+
<endpoints>
|
16
|
+
<endpoint port="123" protocol="udp" status="open">
|
17
|
+
<services>
|
18
|
+
<service name="NTP">
|
19
|
+
<fingerprints>
|
20
|
+
<fingerprint certainty="0.90" family="NTP" product="NTP" vendor="Cisco"/>
|
21
|
+
</fingerprints>
|
22
|
+
<configuration>
|
23
|
+
<config name="ntp.variables">system="cisco", leap=0, stratum=5, rootdelay=88.21,
|
24
|
+
|
25
|
+
rootdispersion=108.54, peer=24960, refid=135.89.100.96,
|
26
|
+
|
27
|
+
reftime=0xD80BB6B5.715ACDD8, poll=10, clock=0xD80BB78F.8931F3F6,
|
28
|
+
|
29
|
+
phase=8.259, freq=-141.24, error=11.32</config>
|
30
|
+
</configuration>
|
31
|
+
<tests>
|
32
|
+
<test id="ntp-clock-variables-disclosure" pci-compliance-status="pass" scan-id="4" status="vulnerable-exploited" vulnerable-since="20141110T161846666">
|
33
|
+
<Paragraph>
|
34
|
+
<Paragraph>The following NTP variables were found from a readvar request: system="cisco", leap=0, stratum=5, rootdelay=88.21,
|
35
|
+
rootdispersion=108.54, peer=24960, refid=135.89.100.96,
|
36
|
+
reftime=0xD80BB6B5.715ACDD8, poll=10, clock=0xD80BB78F.8931F3F6,
|
37
|
+
phase=8.259, freq=-141.24, error=11.32</Paragraph>
|
38
|
+
</Paragraph>
|
39
|
+
</test>
|
40
|
+
</tests>
|
41
|
+
</service>
|
42
|
+
</services>
|
43
|
+
</endpoint>
|
44
|
+
<endpoint port="161" protocol="udp" status="open">
|
45
|
+
<services>
|
46
|
+
<service name="SNMP">
|
47
|
+
<tests/>
|
48
|
+
</service>
|
49
|
+
</services>
|
50
|
+
</endpoint>
|
51
|
+
</endpoints>
|
52
|
+
</node>
|
53
|
+
<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">
|
54
|
+
<names>
|
55
|
+
<name>localhost:6000</name>
|
56
|
+
</names>
|
57
|
+
<fingerprints>
|
58
|
+
<os certainty="0.80" family="IOS" product="IOS" vendor="Cisco" arch="x86_64"/>
|
59
|
+
</fingerprints>
|
60
|
+
<tests/>
|
61
|
+
<endpoints>
|
62
|
+
<endpoint port="123" protocol="udp" status="open">
|
63
|
+
<services>
|
64
|
+
<service name="NTP">
|
65
|
+
<fingerprints>
|
66
|
+
<fingerprint certainty="0.90" family="NTP" product="NTP" vendor="Cisco"/>
|
67
|
+
</fingerprints>
|
68
|
+
<configuration>
|
69
|
+
<config name="ntp.variables">system="cisco", leap=0, stratum=5, rootdelay=88.21,
|
70
|
+
|
71
|
+
rootdispersion=108.54, peer=24960, refid=135.89.100.96,
|
72
|
+
|
73
|
+
reftime=0xD80BB6B5.715ACDD8, poll=10, clock=0xD80BB78F.8931F3F6,
|
74
|
+
|
75
|
+
phase=8.259, freq=-141.24, error=11.32</config>
|
76
|
+
</configuration>
|
77
|
+
<tests>
|
78
|
+
<test id="ntp-clock-variables-disclosure" pci-compliance-status="pass" scan-id="4" status="vulnerable-exploited" vulnerable-since="20141110T161846666">
|
79
|
+
<Paragraph>
|
80
|
+
<Paragraph>The following NTP variables were found from a readvar request: system="cisco", leap=0, stratum=5, rootdelay=88.21,
|
81
|
+
rootdispersion=108.54, peer=24960, refid=135.89.100.96,
|
82
|
+
reftime=0xD80BB6B5.715ACDD8, poll=10, clock=0xD80BB78F.8931F3F6,
|
83
|
+
phase=8.259, freq=-141.24, error=11.32</Paragraph>
|
84
|
+
</Paragraph>
|
85
|
+
</test>
|
86
|
+
</tests>
|
87
|
+
</service>
|
88
|
+
</services>
|
89
|
+
</endpoint>
|
90
|
+
<endpoint port="161" protocol="udp" status="open">
|
91
|
+
<services>
|
92
|
+
<service name="SNMP">
|
93
|
+
<tests/>
|
94
|
+
</service>
|
95
|
+
</services>
|
96
|
+
</endpoint>
|
97
|
+
</endpoints>
|
98
|
+
</node>
|
99
|
+
</nodes>
|
100
|
+
<VulnerabilityDefinitions>
|
101
|
+
<vulnerability added="20120412T000000000" cvssScore="4.3" cvssVector="(AV:N/AC:M/Au:N/C:P/I:N/A:N)" id="ntp-clock-variables-disclosure" modified="20131205T000000000" pciSeverity="3" published="20120127T000000000" riskScore="378.27377" severity="4" title="Apache HTTPD: error responses can expose cookies (CVE-2012-0053)">
|
102
|
+
<malware/>
|
103
|
+
<exploits>
|
104
|
+
<exploit id="3479" link="http://www.exploit-db.com/exploits/18442" skillLevel="Expert" title="Apache httpOnly Cookie Disclosure" type="exploitdb"/>
|
105
|
+
</exploits>
|
106
|
+
<description>
|
107
|
+
<ContainerBlockElement>
|
108
|
+
<Paragraph>A flaw was found in the default error response for status code 400. This flaw could be used by an attacker to expose "httpOnly" cookies when no custom ErrorDocument is specified.</Paragraph>
|
109
|
+
</ContainerBlockElement>
|
110
|
+
</description>
|
111
|
+
<references>
|
112
|
+
<reference source="APPLE">APPLE-SA-2012-09-19-2</reference>
|
113
|
+
<reference source="BID">51706</reference>
|
114
|
+
<reference source="CVE">CVE-2012-0053</reference>
|
115
|
+
<reference source="REDHAT">RHSA-2012:0128</reference>
|
116
|
+
<reference source="SECUNIA">48551</reference>
|
117
|
+
<reference source="URL">http://httpd.apache.org/security/vulnerabilities_20.html</reference>
|
118
|
+
<reference source="URL">http://httpd.apache.org/security/vulnerabilities_22.html</reference>
|
119
|
+
</references>
|
120
|
+
<tags>
|
121
|
+
<tag>Apache</tag>
|
122
|
+
<tag>Apache HTTP Server</tag>
|
123
|
+
<tag>Web</tag>
|
124
|
+
</tags>
|
125
|
+
<solution>
|
126
|
+
<ContainerBlockElement>
|
127
|
+
<Paragraph>Apache HTTPD >= 2.0 and < 2.0.65</Paragraph>
|
128
|
+
<Paragraph>Download and apply the upgrade from:
|
129
|
+
|
130
|
+
<URLLink LinkTitle="http://archive.apache.org/dist/httpd/httpd-2.0.65.tar.gz" LinkURL="http://archive.apache.org/dist/httpd/httpd-2.0.65.tar.gz"/></Paragraph>
|
131
|
+
<Paragraph>Many platforms and distributions provide pre-built binary packages for Apache HTTP server. These pre-built packages are usually customized and optimized for a particular distribution, therefore we recommend that you use the packages if they are available for your operating system.</Paragraph>
|
132
|
+
</ContainerBlockElement>
|
133
|
+
</solution>
|
134
|
+
</vulnerability>
|
135
|
+
</VulnerabilityDefinitions>
|
136
|
+
</NexposeReport>
|
data/spec/nexpose_upload_spec.rb
CHANGED
@@ -1,170 +1,221 @@
|
|
1
|
-
require '
|
1
|
+
require 'rails_helper'
|
2
2
|
require 'ostruct'
|
3
3
|
|
4
4
|
describe 'Nexpose upload plugin' do
|
5
|
-
before
|
6
|
-
|
7
|
-
templates_dir = File.expand_path('../../templates', __FILE__)
|
8
|
-
expect_any_instance_of(Dradis::Plugins::TemplateService)
|
9
|
-
.to receive(:default_templates_dir).and_return(templates_dir)
|
10
|
-
|
11
|
-
# Init services
|
12
|
-
plugin = Dradis::Plugins::Nexpose
|
13
|
-
|
14
|
-
@content_service = Dradis::Plugins::ContentService::Base.new(
|
15
|
-
logger: Logger.new(STDOUT),
|
16
|
-
plugin: plugin
|
17
|
-
)
|
18
|
-
|
19
|
-
@importer = plugin::Importer.new(
|
20
|
-
content_service: @content_service,
|
21
|
-
)
|
22
|
-
|
23
|
-
# Stub dradis-plugins methods
|
24
|
-
#
|
25
|
-
# They return their argument hashes as objects mimicking
|
26
|
-
# Nodes, Issues, etc
|
27
|
-
allow(@content_service).to receive(:create_node) do |args|
|
28
|
-
OpenStruct.new(args)
|
29
|
-
end
|
30
|
-
allow(@content_service).to receive(:create_note) do |args|
|
31
|
-
OpenStruct.new(args)
|
32
|
-
end
|
33
|
-
allow(@content_service).to receive(:create_issue) do |args|
|
34
|
-
OpenStruct.new(args)
|
35
|
-
end
|
36
|
-
allow(@content_service).to receive(:create_evidence) do |args|
|
37
|
-
OpenStruct.new(args)
|
38
|
-
end
|
5
|
+
before do
|
6
|
+
@fixtures_dir = File.expand_path('../fixtures/files/', __FILE__)
|
39
7
|
end
|
40
8
|
|
41
|
-
describe
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
9
|
+
describe 'importer' do
|
10
|
+
before(:each) do
|
11
|
+
# Stub template service
|
12
|
+
templates_dir = File.expand_path('../../templates', __FILE__)
|
13
|
+
expect_any_instance_of(Dradis::Plugins::TemplateService)
|
14
|
+
.to receive(:default_templates_dir).and_return(templates_dir)
|
15
|
+
|
16
|
+
# Init services
|
17
|
+
plugin = Dradis::Plugins::Nexpose
|
18
|
+
|
19
|
+
@content_service = Dradis::Plugins::ContentService::Base.new(
|
20
|
+
logger: Logger.new(STDOUT),
|
21
|
+
plugin: plugin
|
22
|
+
)
|
23
|
+
|
24
|
+
@importer = plugin::Importer.new(
|
25
|
+
content_service: @content_service,
|
26
|
+
)
|
27
|
+
|
28
|
+
# Stub dradis-plugins methods
|
29
|
+
#
|
30
|
+
# They return their argument hashes as objects mimicking
|
31
|
+
# Nodes, Issues, etc
|
32
|
+
allow(@content_service).to receive(:create_node) do |args|
|
55
33
|
OpenStruct.new(args)
|
56
|
-
end
|
57
|
-
|
58
|
-
expect(@content_service).to receive(:create_node) do |args|
|
59
|
-
expect(args[:label]).to eq('udp-000')
|
60
|
-
expect(args[:parent].label).to eq("1.1.1.1")
|
34
|
+
end
|
35
|
+
allow(@content_service).to receive(:create_note) do |args|
|
61
36
|
OpenStruct.new(args)
|
62
|
-
end
|
63
|
-
|
64
|
-
expect(@content_service).to receive(:create_note) do |args|
|
65
|
-
expect(args[:text]).to include("#[Id]#\nntpd-crypto")
|
66
|
-
expect(args[:text]).to include("#[host]#\n1.1.1.1")
|
67
|
-
expect(args[:node].label).to eq("udp-000")
|
68
|
-
end.once
|
69
|
-
|
70
|
-
expect(@content_service).to receive(:create_note) do |args|
|
71
|
-
expect(args[:text]).to include("#[Id]#\nntp-clock-radio")
|
72
|
-
expect(args[:text]).to include("#[host]#\n1.1.1.1")
|
73
|
-
expect(args[:node].label).to eq("udp-000")
|
74
|
-
end.once
|
75
|
-
|
76
|
-
@importer.import(file: 'spec/fixtures/files/simple.xml')
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
describe "Importer: Full" do
|
81
|
-
it "creates nodes, issues, notes and an evidences as needed" do
|
82
|
-
expect(@content_service).to receive(:create_node).with(hash_including label: "Nexpose Scan Summary").once
|
83
|
-
expect(@content_service).to receive(:create_note) do |args|
|
84
|
-
expect(args[:text]).to include("#[Title]#\nUSDA_Internal (4)")
|
85
|
-
expect(args[:node].label).to eq("Nexpose Scan Summary")
|
86
|
-
end.once
|
87
|
-
|
88
|
-
expect(@content_service).to receive(:create_node).with(
|
89
|
-
hash_including label: "1.1.1.1", type: :host
|
90
|
-
).twice
|
91
|
-
|
92
|
-
expect(@content_service).to receive(:create_note) do |args|
|
93
|
-
expect(args[:text]).to include("#[Title]#\n1.1.1.1")
|
94
|
-
expect(args[:node].label).to eq("1.1.1.1")
|
95
|
-
end.once
|
96
|
-
|
97
|
-
expect(@content_service).to receive(:create_note) do |args|
|
98
|
-
expect(args[:text]).to include("#[Title]#\nService name: NTP")
|
99
|
-
expect(args[:node].label).to eq("1.1.1.1")
|
100
|
-
end.once
|
101
|
-
|
102
|
-
expect(@content_service).to receive(:create_note) do |args|
|
103
|
-
expect(args[:text]).to include("#[Title]#\nService name: SNMP")
|
104
|
-
expect(args[:node].label).to eq("1.1.1.1")
|
105
|
-
end.once
|
106
|
-
|
107
|
-
expect(@content_service).to receive(:create_issue) do |args|
|
108
|
-
expect(args[:text]).to include("#[Title]#\nApache HTTPD: error responses can expose cookies (CVE-2012-0053)")
|
109
|
-
expect(args[:id]).to eq("ntp-clock-variables-disclosure")
|
37
|
+
end
|
38
|
+
allow(@content_service).to receive(:create_issue) do |args|
|
110
39
|
OpenStruct.new(args)
|
111
|
-
end
|
112
|
-
|
113
|
-
expect(@content_service).to receive(:create_issue) do |args|
|
114
|
-
expect(args[:text]).to include("#[Title]#\nApache HTTPD: ETag Inode Information Leakage (CVE-2003-1418)")
|
115
|
-
expect(args[:id]).to eq("ntp-clock-variables-disclosure")
|
40
|
+
end
|
41
|
+
allow(@content_service).to receive(:create_evidence) do |args|
|
116
42
|
OpenStruct.new(args)
|
117
|
-
end
|
43
|
+
end
|
44
|
+
end
|
118
45
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
expect(
|
123
|
-
|
46
|
+
describe 'Importer: Simple' do
|
47
|
+
it 'creates nodes, issues, notes and an evidences as needed' do
|
48
|
+
|
49
|
+
expect(@content_service).to receive(:create_node).with(hash_including label: '1.1.1.1', type: :host).once
|
50
|
+
|
51
|
+
expect(@content_service).to receive(:create_note) do |args|
|
52
|
+
expect(args[:text]).to include('Host Description : Linux 2.6.9-89.ELsmp')
|
53
|
+
expect(args[:text]).to include('Scanner Fingerprint certainty : 0.80')
|
54
|
+
expect(args[:node].label).to eq('1.1.1.1')
|
55
|
+
end.once
|
56
|
+
|
57
|
+
expect(@content_service).to receive(:create_node) do |args|
|
58
|
+
expect(args[:label]).to eq('Generic Findings')
|
59
|
+
expect(args[:parent].label).to eq('1.1.1.1')
|
60
|
+
OpenStruct.new(args)
|
61
|
+
end.once
|
62
|
+
|
63
|
+
expect(@content_service).to receive(:create_node) do |args|
|
64
|
+
expect(args[:label]).to eq('udp-000')
|
65
|
+
expect(args[:parent].label).to eq('1.1.1.1')
|
66
|
+
OpenStruct.new(args)
|
67
|
+
end.once
|
68
|
+
|
69
|
+
expect(@content_service).to receive(:create_note) do |args|
|
70
|
+
expect(args[:text]).to include("#[Id]#\nntpd-crypto")
|
71
|
+
expect(args[:text]).to include("#[host]#\n1.1.1.1")
|
72
|
+
expect(args[:node].label).to eq('udp-000')
|
73
|
+
end.once
|
74
|
+
|
75
|
+
expect(@content_service).to receive(:create_note) do |args|
|
76
|
+
expect(args[:text]).to include("#[Id]#\nntp-clock-radio")
|
77
|
+
expect(args[:text]).to include("#[host]#\n1.1.1.1")
|
78
|
+
expect(args[:node].label).to eq('udp-000')
|
79
|
+
end.once
|
80
|
+
|
81
|
+
@importer.import(file: @fixtures_dir + '/simple.xml')
|
82
|
+
end
|
83
|
+
end
|
124
84
|
|
125
|
-
|
126
|
-
|
85
|
+
describe 'Importer: Full' do
|
86
|
+
it 'creates nodes, issues, notes and an evidences as needed' do
|
87
|
+
expect(@content_service).to receive(:create_node).with(hash_including label: 'Nexpose Scan Summary').once
|
88
|
+
expect(@content_service).to receive(:create_note) do |args|
|
89
|
+
expect(args[:text]).to include("#[Title]#\nUSDA_Internal (4)")
|
90
|
+
expect(args[:node].label).to eq('Nexpose Scan Summary')
|
91
|
+
end.once
|
92
|
+
|
93
|
+
expect(@content_service).to receive(:create_node) do |args|
|
94
|
+
expect(args[:label]).to eq('1.1.1.1')
|
95
|
+
expect(args[:type]).to eq(:host)
|
96
|
+
create(:node, args.except(:type))
|
97
|
+
end
|
98
|
+
|
99
|
+
expect(@content_service).to receive(:create_note) do |args|
|
100
|
+
expect(args[:text]).to include("#[Title]#\n1.1.1.1")
|
101
|
+
expect(args[:node].label).to eq('1.1.1.1')
|
102
|
+
end.once
|
103
|
+
|
104
|
+
expect(@content_service).to receive(:create_note) do |args|
|
105
|
+
expect(args[:text]).to include("#[Title]#\nService name: NTP")
|
106
|
+
expect(args[:node].label).to eq('1.1.1.1')
|
107
|
+
end.once
|
108
|
+
|
109
|
+
expect(@content_service).to receive(:create_note) do |args|
|
110
|
+
expect(args[:text]).to include("#[Title]#\nService name: SNMP")
|
111
|
+
expect(args[:node].label).to eq('1.1.1.1')
|
112
|
+
end.once
|
113
|
+
|
114
|
+
expect(@content_service).to receive(:create_issue) do |args|
|
115
|
+
expect(args[:text]).to include("#[Title]#\nApache HTTPD: error responses can expose cookies (CVE-2012-0053)")
|
116
|
+
expect(args[:id]).to eq('ntp-clock-variables-disclosure')
|
117
|
+
OpenStruct.new(args)
|
118
|
+
end.once
|
119
|
+
|
120
|
+
expect(@content_service).to receive(:create_issue) do |args|
|
121
|
+
expect(args[:text]).to include("#[Title]#\nApache HTTPD: ETag Inode Information Leakage (CVE-2003-1418)")
|
122
|
+
expect(args[:id]).to eq('test-02')
|
123
|
+
OpenStruct.new(args)
|
124
|
+
end.once
|
125
|
+
|
126
|
+
expect(@content_service).to receive(:create_evidence) do |args|
|
127
|
+
expect(args[:content]).to include("#[ID]#\nntp-clock-variables-disclosure\n\n")
|
128
|
+
expect(args[:issue].id).to eq('ntp-clock-variables-disclosure')
|
129
|
+
expect(args[:node].label).to eq('1.1.1.1')
|
130
|
+
end.once
|
131
|
+
|
132
|
+
expect(@content_service).to receive(:create_evidence) do |args|
|
133
|
+
expect(args[:content]).to include("#[ID]#\ntest-02\n\n")
|
134
|
+
expect(args[:issue].id).to eq('test-02')
|
135
|
+
expect(args[:node].label).to eq('1.1.1.1')
|
136
|
+
end.once
|
137
|
+
|
138
|
+
@importer.import(file: @fixtures_dir + '/full.xml')
|
139
|
+
|
140
|
+
expect(Node.find_by(label: '1.1.1.1').properties[:os]).to eq('IOS')
|
141
|
+
end
|
127
142
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
143
|
+
it 'wraps ciphers inside ssl issues in code blocks' do
|
144
|
+
expect(@content_service).to receive(:create_issue) do |args|
|
145
|
+
expect(args[:text]).to include('bc. ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256')
|
146
|
+
OpenStruct.new(args)
|
147
|
+
end.once
|
132
148
|
|
133
|
-
|
134
|
-
|
149
|
+
@importer.import(file: @fixtures_dir + '/ssl.xml')
|
150
|
+
end
|
135
151
|
|
136
|
-
|
137
|
-
|
138
|
-
expect(
|
139
|
-
|
140
|
-
|
152
|
+
# Regression test for github.com/dradis/dradis-nexpose/issues/1
|
153
|
+
it 'populates solutions regardless of if they are wrapped in paragraphs or lists' do
|
154
|
+
expect(@content_service).to receive(:create_issue) do |args|
|
155
|
+
expect(args[:text]).to include("#[Solution]#\n\nApache HTTPD >= 2.0 and < 2.0.65")
|
156
|
+
OpenStruct.new(args)
|
157
|
+
end.once
|
141
158
|
|
142
|
-
|
143
|
-
|
159
|
+
expect(@content_service).to receive(:create_issue) do |args|
|
160
|
+
expect(args[:text]).to include("#[Solution]#\n")
|
161
|
+
expect(args[:text]).to include('You can remove inode information from the ETag header')
|
162
|
+
OpenStruct.new(args)
|
163
|
+
end.once
|
144
164
|
|
145
|
-
|
146
|
-
|
147
|
-
expect(@content_service).to receive(:create_issue) do |args|
|
148
|
-
expect(args[:text]).to include("#[Solution]#\n\nApache HTTPD >= 2.0 and < 2.0.65")
|
149
|
-
OpenStruct.new(args)
|
150
|
-
end.once
|
165
|
+
@importer.import(file: @fixtures_dir + '/full.xml')
|
166
|
+
end
|
151
167
|
|
152
|
-
|
153
|
-
expect(
|
154
|
-
|
155
|
-
|
156
|
-
|
168
|
+
it 'populates tests regardless of if they contain paragraphs or containerblockelements' do
|
169
|
+
expect(@content_service).to receive(:create_evidence) do |args|
|
170
|
+
expect(args[:content]).to include("#[Content]#\nThe following NTP variables")
|
171
|
+
OpenStruct.new(args)
|
172
|
+
end.once
|
173
|
+
|
174
|
+
expect(@content_service).to receive(:create_evidence) do |args|
|
175
|
+
expect(args[:content]).to include("#[Content]#\nVulnerable URL:")
|
176
|
+
OpenStruct.new(args)
|
177
|
+
end.once
|
178
|
+
|
179
|
+
@importer.import(file: @fixtures_dir + '/full.xml')
|
180
|
+
end
|
157
181
|
|
158
|
-
|
159
|
-
|
182
|
+
it 'transforms html entities (< and >)' do
|
183
|
+
expect(@content_service).to receive(:create_issue) do |args|
|
184
|
+
expect(args[:text]).to include("#[Solution]#\n\nApache HTTPD >= 2.0 and < 2.0.65")
|
185
|
+
OpenStruct.new(args)
|
186
|
+
end
|
160
187
|
|
161
|
-
|
162
|
-
expect(@content_service).to receive(:create_issue) do |args|
|
163
|
-
expect(args[:text]).to include("#[Solution]#\n\nApache HTTPD >= 2.0 and < 2.0.65")
|
164
|
-
OpenStruct.new(args)
|
188
|
+
@importer.import(file: @fixtures_dir + '/full.xml')
|
165
189
|
end
|
190
|
+
end
|
166
191
|
|
167
|
-
|
192
|
+
describe 'Importer: Full with duplicate nodes' do
|
193
|
+
it 'creates evidence for each instance of the node' do
|
194
|
+
expect(@content_service).to receive(:create_node).with(hash_including label: 'Nexpose Scan Summary').once
|
195
|
+
expect(@content_service).to receive(:create_node) do |args|
|
196
|
+
expect(args[:label]).to eq('1.1.1.1')
|
197
|
+
expect(args[:type]).to eq(:host)
|
198
|
+
create(:node, args.except(:type))
|
199
|
+
end
|
200
|
+
|
201
|
+
expect(@content_service).to receive(:create_evidence) do |args|
|
202
|
+
expect(args[:content]).to include("#[ID]#\nntp-clock-variables-disclosure\n\n")
|
203
|
+
expect(args[:issue].id).to eq('ntp-clock-variables-disclosure')
|
204
|
+
expect(args[:node].label).to eq('1.1.1.1')
|
205
|
+
end.twice
|
206
|
+
|
207
|
+
@importer.import(file: @fixtures_dir + '/full_with_duplicate_node.xml')
|
208
|
+
end
|
168
209
|
end
|
169
210
|
end
|
211
|
+
|
212
|
+
it 'parses the fingerprints field' do
|
213
|
+
doc = Nokogiri::XML(File.read(@fixtures_dir + '/full.xml'))
|
214
|
+
|
215
|
+
ts = Dradis::Plugins::TemplateService.new(plugin: Dradis::Plugins::Nexpose)
|
216
|
+
ts.set_template(template: 'full_node', content: "#[Fingerprints]#\n%node.fingerprints%\n")
|
217
|
+
result = ts.process_template(data: doc.at_xpath('//nodes/node'), template: 'full_node')
|
218
|
+
|
219
|
+
expect(result).to include('IOS')
|
220
|
+
end
|
170
221
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<test id="http-coldfusion-cfide-unprotected" key="/CFIDE/adminapi/base.cfc?wsdl" status="vulnerable-exploited" scan-id="4" vulnerable-since="20141110T165124356" pci-compliance-status="fail">
|
1
|
+
<test id="http-coldfusion-cfide-unprotected" key="/CFIDE/adminapi/base.cfc?wsdl" status="vulnerable-exploited" scan-id="4" vulnerable-since="20141110T165124356" pci-compliance-status="fail" port="123" protocol="udp">
|
2
2
|
<Paragraph>
|
3
3
|
<UnorderedList>
|
4
4
|
<ListItem>Running HTTP service</ListItem>
|