dradis-nmap 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 699a744dd4dd677e95e578d22f1e161ef5bae45ba9b4756a80abbb4c8ce084d7
4
- data.tar.gz: 7746d013c5e8e6e691ba8a9b9afd07f5463a0181f6de662288062a887ad8ff66
3
+ metadata.gz: 4ba84196cfdcaaa2d3d284bb95dc6c7ca3a6dcc4d4279e25052ecf47eef67e23
4
+ data.tar.gz: 9ce92665dfcf08eb3281a5f9934ec58201bbe1b7ae53602b9ae8e9e1c74738b5
5
5
  SHA512:
6
- metadata.gz: ad8d81ba71be5da76fcf4eae1a896c3c56594b5067871477746233864bbe4c2a6aae466fa19c7b21825531fe767b4bd201b8e72a1a6f2574de6dd81ba150d13f
7
- data.tar.gz: 4e9f518322977ddff874a3a4d52d67098237c67f306e8f8e24816aab801f4072717c631b30ebdb32a3165f35f12262345249db881b7332922367dbe2499681ca
6
+ metadata.gz: 1c7517d0ce2ef561e2446ae8d3f23bec382a3bcc7d5b551e7142ca3e1a4241f1b3b07970983ecc2015142dca834fd3034d8e13fe9e799c7c5770db87ad440aef
7
+ data.tar.gz: 2f8df32b179544eb79b9b6a95643c2e2acf2fd9b89dc8cefd868a976dab4efebe59a8658c6ba5ac33044422eb82fbe06eb77d2821626bdf717cb8775bef83349
@@ -1,3 +1,5 @@
1
+ Please review [CONTRIBUTING.md](https://github.com/dradis/dradis-ce/blob/develop/CONTRIBUTING.md) and remove this line.
2
+
1
3
  ### Summary
2
4
 
3
5
  Provide a general description of the code changes in your pull
@@ -6,6 +8,11 @@ these bugs have open GitHub issues, be sure to tag them here as well,
6
8
  to keep the conversation linked together.
7
9
 
8
10
 
11
+ ### Testing Steps
12
+
13
+ Provide steps to test functionality, described in detail for someone not familiar with this part of the application / code base
14
+
15
+
9
16
  ### Other Information
10
17
 
11
18
  If there's anything else that's important and relevant to your pull
@@ -26,11 +33,13 @@ products, we must have the copyright associated with the entire
26
33
  codebase. Any code you create which is merged must be owned by us.
27
34
  That's not us trying to be a jerks, that's just the way it works.
28
35
 
29
- Please review the [CONTRIBUTING.md](https://github.com/dradis/dradis-ce/blob/master/CONTRIBUTING.md)
30
- file for the details.
31
-
32
36
  You can delete this section, but the following sentence needs to
33
37
  remain in the PR's description:
34
38
 
35
39
  > I assign all rights, including copyright, to any future Dradis
36
40
  > work by myself to Security Roots.
41
+
42
+ ### Check List
43
+
44
+ - [ ] Added a CHANGELOG entry
45
+ - [ ] Added specs
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ v4.12.0 (May 2024)
2
+ - Migrate integration to use Mappings Manager
3
+ - Update Dradis links in README
4
+
5
+ v4.11.0 (January 2024)
6
+ - No changes
7
+
1
8
  v4.10.0 (September 2023)
2
9
  - Update gemspec links
3
10
 
data/README.md CHANGED
@@ -4,17 +4,16 @@
4
4
 
5
5
  Upload Nmap files into Dradis.
6
6
 
7
- The add-on requires [Dradis CE](https://dradisframework.org/) > 3.0, or [Dradis Pro](https://dradisframework.com/pro/).
8
-
7
+ The add-on requires [Dradis CE](https://dradis.com/ce/) > 3.0, or [Dradis Pro](https://dradis.com/).
9
8
 
10
9
  ## More information
11
10
 
12
- See the Dradis Framework's [README.md](https://github.com/dradis/dradisframework/blob/master/README.md)
11
+ See the Dradis Framework's [README.md](https://github.com/dradis/dradis-ce/blob/develop/README.md)
13
12
 
14
13
 
15
14
  ## Contributing
16
15
 
17
- See the Dradis Framework's [CONTRIBUTING.md](https://github.com/dradis/dradisframework/blob/master/CONTRIBUTING.md)
16
+ See the Dradis Framework's [CONTRIBUTING.md](https://github.com/dradis/dradis-ce/blob/develop/CONTRIBUTING.md)
18
17
 
19
18
 
20
19
  ## License
@@ -8,7 +8,7 @@ module Dradis
8
8
 
9
9
  module VERSION
10
10
  MAJOR = 4
11
- MINOR = 10
11
+ MINOR = 12
12
12
  TINY = 0
13
13
  PRE = nil
14
14
 
@@ -41,7 +41,7 @@ module Dradis::Plugins::Nmap
41
41
  host_node.set_property(:os, host.os.matches.map(&:name)) if host.os.present?
42
42
 
43
43
  # Old-style properties-in-a-note approach
44
- host_text = template_service.process_template(template: 'host', data: host)
44
+ host_text = mapping_service.apply_mapping(source: 'host', data: host)
45
45
  content_service.create_note(text: host_text, node: host_node)
46
46
 
47
47
  host.each_port do |port|
@@ -71,7 +71,7 @@ module Dradis::Plugins::Nmap
71
71
  port.host = host.ip
72
72
 
73
73
  # Add a note with the port information
74
- port_text = template_service.process_template(template: 'port', data: port)
74
+ port_text = mapping_service.apply_mapping(source: 'port', data: port)
75
75
  content_service.create_note(
76
76
  text: port_text,
77
77
  node: host_node)
@@ -0,0 +1,41 @@
1
+ module Dradis::Plugins::Nmap
2
+ module Mapping
3
+ DEFAULT_MAPPING = {
4
+ host: {
5
+ 'Title' => 'Nmap info: {{ nmap[host.ip] }}',
6
+ 'IP' => '{{ nmap[host.ip] }}',
7
+ 'Hostnames' => '{{ nmap[host.hostnames] }}',
8
+ 'OS' => '{{ nmap[host.os] }}',
9
+ 'Services' => "|_. Port number |_. Protocol |_. State |_. Service |_. Product |_. Version |\n{{ nmap[host.service_table] }}",
10
+ 'Type' => 'Properties'
11
+ },
12
+ port: {
13
+ 'Title' => '{{ nmap[port.number] }}/{{ nmap[port.protocol] }} is {{ nmap[port.state] }} ({{ nmap[port.reason] }})',
14
+ 'Service' => '{{ nmap[port.service.name] }}',
15
+ 'Product' => '{{ nmap[port.service.product] }}',
16
+ 'Version' => '{{ nmap[port.service.version] }}',
17
+ 'Host' => '{{ nmap[port.host] }}'
18
+ }
19
+ }.freeze
20
+
21
+ SOURCE_FIELDS = {
22
+ host: [
23
+ 'host.hostnames',
24
+ 'host.ip',
25
+ 'host.service_table',
26
+ 'host.os'
27
+ ],
28
+ port: [
29
+ 'port.number',
30
+ 'port.protocol',
31
+ 'port.state',
32
+ 'port.reason',
33
+ 'port.service.name',
34
+ 'port.service.product',
35
+ 'port.service.tunnel',
36
+ 'port.service.version',
37
+ 'port.host'
38
+ ]
39
+ }.freeze
40
+ end
41
+ end
@@ -7,5 +7,6 @@ end
7
7
 
8
8
  require 'dradis/plugins/nmap/engine'
9
9
  require 'dradis/plugins/nmap/field_processor'
10
+ require 'dradis/plugins/nmap/mapping'
10
11
  require 'dradis/plugins/nmap/importer'
11
12
  require 'dradis/plugins/nmap/version'
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: 4.10.0
4
+ version: 4.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Martin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-07 00:00:00.000000000 Z
11
+ date: 2024-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dradis-plugins
@@ -96,7 +96,7 @@ dependencies:
96
96
  version: 0.5.2
97
97
  description: This add-on allows you to upload and parse output produced from Nmap
98
98
  web server scanner into Dradis.
99
- email:
99
+ email:
100
100
  executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
@@ -119,6 +119,7 @@ files:
119
119
  - lib/dradis/plugins/nmap/field_processor.rb
120
120
  - lib/dradis/plugins/nmap/gem_version.rb
121
121
  - lib/dradis/plugins/nmap/importer.rb
122
+ - lib/dradis/plugins/nmap/mapping.rb
122
123
  - lib/dradis/plugins/nmap/version.rb
123
124
  - lib/tasks/thorfile.rb
124
125
  - spec/fixtures/files/invalid.xml
@@ -126,17 +127,13 @@ files:
126
127
  - spec/fixtures/files/sample.xml
127
128
  - spec/nmap_upload_spec.rb
128
129
  - spec/spec_helper.rb
129
- - templates/host.fields
130
130
  - templates/host.sample
131
- - templates/host.template
132
- - templates/port.fields
133
131
  - templates/port.sample
134
- - templates/port.template
135
132
  homepage: https://dradis.com/integrations/nmap.html
136
133
  licenses:
137
134
  - GPL-2
138
135
  metadata: {}
139
- post_install_message:
136
+ post_install_message:
140
137
  rdoc_options: []
141
138
  require_paths:
142
139
  - lib
@@ -152,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
149
  version: '0'
153
150
  requirements: []
154
151
  rubygems_version: 3.1.4
155
- signing_key:
152
+ signing_key:
156
153
  specification_version: 4
157
154
  summary: Nmap add-on for the Dradis Framework.
158
155
  test_files:
@@ -1,4 +0,0 @@
1
- host.hostnames
2
- host.ip
3
- host.service_table
4
- host.os
@@ -1,19 +0,0 @@
1
- #[Title]#
2
- Nmap info: %host.ip%
3
-
4
- #[IP]#
5
- %host.ip%
6
-
7
- #[Hostnames]#
8
- %host.hostnames%
9
-
10
- #[OS]#
11
- %host.os%
12
-
13
- #[Services]#
14
- |_. Port number |_. Protocol |_. State |_. Service |_. Product |_. Version |
15
- %host.service_table%
16
-
17
-
18
- #[Type]#
19
- Properties
@@ -1,9 +0,0 @@
1
- port.number
2
- port.protocol
3
- port.state
4
- port.reason
5
- port.service.name
6
- port.service.product
7
- port.service.tunnel
8
- port.service.version
9
- port.host
@@ -1,14 +0,0 @@
1
- #[Title]#
2
- %port.number%/%port.protocol% is %port.state% (%port.reason%)
3
-
4
- #[Service]#
5
- %port.service.name%
6
-
7
- #[Product]#
8
- %port.service.product%
9
-
10
- #[Version]#
11
- %port.service.version%
12
-
13
- #[Host]#
14
- %port.host%