dradis-nmap 3.15.0 → 3.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/dradis-nmap.gemspec +1 -1
- data/lib/dradis/plugins/nmap/gem_version.rb +1 -1
- data/spec/nmap_upload_spec.rb +8 -27
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a110471150b27489da28e66a2823c61c9390194bef78e0adec44d96221c905e7
|
4
|
+
data.tar.gz: 760067acfb3c386063b17d8bb86f219d733a9ece916de394e9ac504de8c9fe99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c04804b0b7b458ef50c0c229545048b43518bb2aaf68821cc5dfa6a40d4190177e027237d00aa46618a0b3c6d183fb4275b3be3fbbfafd709b2b5f7251acc4e
|
7
|
+
data.tar.gz: 44b141ebf8e55c74882004375ed743a88e7c4a940f27f89b47fba47d6d2ea16b9d24adaca50aa0c72124e0c4c4ff68115d26da301cb5a2c72dbb41a4a404d947
|
data/CHANGELOG.md
CHANGED
data/dradis-nmap.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_dependency 'dradis-plugins', '~> 3.6'
|
28
28
|
spec.add_dependency 'ruby-nmap', '~> 0.7'
|
29
29
|
|
30
|
-
spec.add_development_dependency 'bundler'
|
30
|
+
spec.add_development_dependency 'bundler'
|
31
31
|
spec.add_development_dependency 'rake', '~> 10.0'
|
32
32
|
spec.add_development_dependency 'rspec-rails'
|
33
33
|
spec.add_development_dependency 'combustion', '~> 0.5.2'
|
data/spec/nmap_upload_spec.rb
CHANGED
@@ -12,34 +12,11 @@ describe 'Nmap upload plugin' do
|
|
12
12
|
# Init services
|
13
13
|
plugin = Dradis::Plugins::Nmap
|
14
14
|
|
15
|
-
@content_service = Dradis::Plugins::ContentService.new(plugin: plugin)
|
16
|
-
template_service = Dradis::Plugins::TemplateService.new(plugin: plugin)
|
15
|
+
@content_service = Dradis::Plugins::ContentService::Base.new(plugin: plugin)
|
17
16
|
|
18
17
|
@importer = plugin::Importer.new(
|
19
|
-
content_service: @content_service
|
20
|
-
template_service: template_service
|
18
|
+
content_service: @content_service
|
21
19
|
)
|
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
|
-
# puts "create_node: #{ args.inspect }"
|
29
|
-
OpenStruct.new(args)
|
30
|
-
end
|
31
|
-
allow(@content_service).to receive(:create_note) do |args|
|
32
|
-
# puts "create_note: #{ args.inspect }"
|
33
|
-
OpenStruct.new(args)
|
34
|
-
end
|
35
|
-
allow(@content_service).to receive(:create_issue) do |args|
|
36
|
-
# puts "create_issue: #{ args.inspect }"
|
37
|
-
OpenStruct.new(args)
|
38
|
-
end
|
39
|
-
allow(@content_service).to receive(:create_evidence) do |args|
|
40
|
-
# puts "create_evidence: #{ args.inspect }"
|
41
|
-
OpenStruct.new(args)
|
42
|
-
end
|
43
20
|
end
|
44
21
|
|
45
22
|
it "creates an error note when the xml is not valid" do
|
@@ -47,16 +24,20 @@ describe 'Nmap upload plugin' do
|
|
47
24
|
expect(args[:text]).to include("#[Title]#\nInvalid file format")
|
48
25
|
OpenStruct.new(args)
|
49
26
|
end.once
|
27
|
+
|
50
28
|
# Run the import
|
51
29
|
@importer.import(file: 'spec/fixtures/files/invalid.xml')
|
52
30
|
end
|
53
31
|
|
54
32
|
it "creates nodes, issues, notes and an evidences as needed" do
|
55
33
|
expect(@content_service).to receive(:create_node) do |args|
|
56
|
-
|
34
|
+
puts "create_node: #{ args.inspect }"
|
57
35
|
expect(args[:label]).to eq('74.207.244.221')
|
58
36
|
expect(args[:type]).to eq(:host)
|
59
|
-
OpenStruct.new(args)
|
37
|
+
obj = OpenStruct.new(args)
|
38
|
+
obj.define_singleton_method(:set_property) { |*| }
|
39
|
+
obj.define_singleton_method(:set_service) { |*| }
|
40
|
+
obj
|
60
41
|
end.once
|
61
42
|
expect(@content_service).to receive(:create_note) do |args|
|
62
43
|
puts "create_note: #{ args.inspect }"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dradis-nmap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.16.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:
|
11
|
+
date: 2020-02-26 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: '
|
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: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|