dradis-nmap 3.1.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +6 -1
- data/dradis-nmap.gemspec +1 -1
- data/lib/dradis/plugins/nmap/gem_version.rb +1 -1
- data/lib/dradis/plugins/nmap/importer.rb +2 -2
- data/lib/tasks/thorfile.rb +8 -22
- metadata +6 -5
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: ad88aa579df07ddec0d385d367fe10330d3ccb6a
         | 
| 4 | 
            +
              data.tar.gz: 38c604da41ded39e24fa23ce1caa173dead61530
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 562b18567f3fe7d3c912b728172a7d8deb0dfb9aa4690f5da11fcf0add3e823ab72ae7520e800194b0802e157f86d21c8fa56a9276e9bd365ec9571a8725ca88
         | 
| 7 | 
            +
              data.tar.gz: d77b30f6f67c6e6ee581eda0778df247eeffb0c071cc9e06879ffc5567f8092117660b52c2473fcb01388399662cadfc5b65823b076b02aeb174ceda8c70b1f6
         | 
    
        data/CHANGELOG.md
    ADDED
    
    
    
        data/README.md
    CHANGED
    
    | @@ -4,7 +4,7 @@ | |
| 4 4 |  | 
| 5 5 | 
             
            Upload Nmap files into Dradis.
         | 
| 6 6 |  | 
| 7 | 
            -
            The  | 
| 7 | 
            +
            The add-on requires [Dradis CE](https://dradisframework.org/) > 3.0, or [Dradis Pro](https://dradisframework.com/pro/).
         | 
| 8 8 |  | 
| 9 9 |  | 
| 10 10 | 
             
            ## More information
         | 
| @@ -20,3 +20,8 @@ See the Dradis Framework's [CONTRIBUTING.md](https://github.com/dradis/dradisfra | |
| 20 20 | 
             
            ## License
         | 
| 21 21 |  | 
| 22 22 | 
             
            Dradis Framework and all its components are released under [GNU General Public License version 2.0](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file.
         | 
| 23 | 
            +
             | 
| 24 | 
            +
             | 
| 25 | 
            +
            ## Feature requests and bugs
         | 
| 26 | 
            +
             | 
| 27 | 
            +
            Please use the [Dradis Framework issue tracker](https://github.com/dradis/dradis-ce/issues) for add-on improvements and bug reports.
         | 
    
        data/dradis-nmap.gemspec
    CHANGED
    
    | @@ -24,7 +24,7 @@ Gem::Specification.new do |spec| | |
| 24 24 | 
             
              # versions of Rails (a sure recipe for disaster, I'm sure), which is needed
         | 
| 25 25 | 
             
              # until we bump Dradis Pro to 4.1.
         | 
| 26 26 | 
             
              # s.add_dependency 'rails', '~> 4.1.1'
         | 
| 27 | 
            -
              spec.add_dependency 'dradis-plugins', '~> 3. | 
| 27 | 
            +
              spec.add_dependency 'dradis-plugins', '~> 3.6'
         | 
| 28 28 | 
             
              spec.add_dependency 'ruby-nmap', '~> 0.7'
         | 
| 29 29 |  | 
| 30 30 | 
             
              spec.add_development_dependency 'bundler', '~> 1.6'
         | 
| @@ -46,8 +46,8 @@ module Dradis::Plugins::Nmap | |
| 46 46 | 
             
                      # Add service to host properties
         | 
| 47 47 | 
             
                      host_node.set_property(:services, {
         | 
| 48 48 | 
             
                          port: port.number,
         | 
| 49 | 
            -
                          protocol: port.protocol,
         | 
| 50 | 
            -
                          state: port.state,
         | 
| 49 | 
            +
                          protocol: port.protocol.to_s,
         | 
| 50 | 
            +
                          state: port.state.to_s,
         | 
| 51 51 | 
             
                          reason: port.reason,
         | 
| 52 52 | 
             
                          name: port.try('service').try('name'),
         | 
| 53 53 | 
             
                          product: port.try('service').try('product'),
         | 
    
        data/lib/tasks/thorfile.rb
    CHANGED
    
    | @@ -1,42 +1,28 @@ | |
| 1 1 | 
             
            class NmapTasks < Thor
         | 
| 2 | 
            -
              include  | 
| 2 | 
            +
              include Rails.application.config.dradis.thor_helper_module
         | 
| 3 3 |  | 
| 4 4 | 
             
              namespace "dradis:plugins:nmap"
         | 
| 5 5 |  | 
| 6 6 | 
             
              desc      "upload FILE", "upload the results of an Nmap scan"
         | 
| 7 7 | 
             
              long_desc "Upload an Nmap scan to create nodes and notes for the hosts and "\
         | 
| 8 8 | 
             
                        "ports discovered during scanning."
         | 
| 9 | 
            +
             | 
| 9 10 | 
             
              def upload(file_path)
         | 
| 10 11 | 
             
                require 'config/environment'
         | 
| 11 12 |  | 
| 13 | 
            +
                logger = Logger.new(STDOUT)
         | 
| 14 | 
            +
                logger.level = Logger::DEBUG
         | 
| 15 | 
            +
             | 
| 12 16 | 
             
                unless File.exists?(file_path)
         | 
| 13 17 | 
             
                  $stderr.puts "** the file [#{file_path}] does not exist"
         | 
| 14 18 | 
             
                  exit(-1)
         | 
| 15 19 | 
             
                end
         | 
| 16 20 |  | 
| 17 | 
            -
                 | 
| 18 | 
            -
                detect_and_set_project_scope if defined?(::Core::Pro)
         | 
| 19 | 
            -
             | 
| 20 | 
            -
                plugin = Dradis::Plugins::Nmap
         | 
| 21 | 
            +
                detect_and_set_project_scope
         | 
| 21 22 |  | 
| 22 | 
            -
                Dradis::Plugins::Nmap::Importer.new(
         | 
| 23 | 
            -
             | 
| 24 | 
            -
                  content_service:  service_namespace::ContentService.new(plugin: plugin),
         | 
| 25 | 
            -
                  template_service: service_namespace::TemplateService.new(plugin: plugin)
         | 
| 26 | 
            -
                ).import(file: file_path)
         | 
| 23 | 
            +
                importer = Dradis::Plugins::Nmap::Importer.new(logger: logger)
         | 
| 24 | 
            +
                importer.import(file: file_path)
         | 
| 27 25 |  | 
| 28 26 | 
             
                logger.close
         | 
| 29 27 | 
             
              end
         | 
| 30 | 
            -
             | 
| 31 | 
            -
             | 
| 32 | 
            -
              private
         | 
| 33 | 
            -
             | 
| 34 | 
            -
              def logger
         | 
| 35 | 
            -
                @logger ||= Logger.new(STDOUT).tap { |l| l.level = Logger::DEBUG }
         | 
| 36 | 
            -
              end
         | 
| 37 | 
            -
             | 
| 38 | 
            -
              def service_namespace
         | 
| 39 | 
            -
                defined?(Dradis::Pro) ? Dradis::Pro::Plugins : Dradis::Plugins
         | 
| 40 | 
            -
              end
         | 
| 41 | 
            -
             | 
| 42 28 | 
             
            end
         | 
    
        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.6.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: 2017-04-06 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: dradis-plugins
         | 
| @@ -16,14 +16,14 @@ dependencies: | |
| 16 16 | 
             
                requirements:
         | 
| 17 17 | 
             
                - - "~>"
         | 
| 18 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            -
                    version: '3. | 
| 19 | 
            +
                    version: '3.6'
         | 
| 20 20 | 
             
              type: :runtime
         | 
| 21 21 | 
             
              prerelease: false
         | 
| 22 22 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 23 | 
             
                requirements:
         | 
| 24 24 | 
             
                - - "~>"
         | 
| 25 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            -
                    version: '3. | 
| 26 | 
            +
                    version: '3.6'
         | 
| 27 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 28 28 | 
             
              name: ruby-nmap
         | 
| 29 29 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -104,6 +104,7 @@ extra_rdoc_files: [] | |
| 104 104 | 
             
            files:
         | 
| 105 105 | 
             
            - ".gitignore"
         | 
| 106 106 | 
             
            - ".rspec"
         | 
| 107 | 
            +
            - CHANGELOG.md
         | 
| 107 108 | 
             
            - CONTRIBUTING.md
         | 
| 108 109 | 
             
            - Gemfile
         | 
| 109 110 | 
             
            - LICENSE
         | 
| @@ -149,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 149 150 | 
             
                  version: '0'
         | 
| 150 151 | 
             
            requirements: []
         | 
| 151 152 | 
             
            rubyforge_project: 
         | 
| 152 | 
            -
            rubygems_version: 2. | 
| 153 | 
            +
            rubygems_version: 2.4.5
         | 
| 153 154 | 
             
            signing_key: 
         | 
| 154 155 | 
             
            specification_version: 4
         | 
| 155 156 | 
             
            summary: Nmap add-on for the Dradis Framework.
         |