Unable to Parse XML results from demo.testfire.net

Please see the following.

[04:59:28] Small attachment detected. Processing in line.

[04:59:28] Parsing Nmap output from /usr/lib/dradis/attachments/3/demo.xml...

[04:59:28] Done.

[04:59:28] Validating Nmap output...

[04:59:28] Done.

[04:59:28] New host: 65.61.137.117

[04:59:28] New port: 80/tcp

[04:59:28] There was a fatal error processing your upload:

[04:59:28] undefined method `set_service' for #<Node:0x00007fafe508d558>

[04:59:28] /usr/lib/dradis/ruby/2.5.0/gems/activemodel-5.1.6/lib/active_model/attribute_methods.rb:432:in `method_missing'

[04:59:28] /usr/lib/dradis/ruby/2.5.0/bundler/gems/dradis-nmap-ef0b6218b69e/lib/dradis/plugins/nmap/importer.rb:61:in `block (2 levels) in import'

[04:59:28] /usr/lib/dradis/ruby/2.5.0/gems/ruby-nmap-0.9.3/lib/nmap/host.rb:384:in `block in each_port'

[04:59:29] /usr/lib/dradis/ruby/2.5.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/node_set.rb:190:in `block in each'

[04:59:29] /usr/lib/dradis/ruby/2.5.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/node_set.rb:189:in `upto'

[04:59:29] /usr/lib/dradis/ruby/2.5.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/node_set.rb:189:in `each'

[04:59:29] /usr/lib/dradis/ruby/2.5.0/gems/ruby-nmap-0.9.3/lib/nmap/host.rb:383:in `each_port'


[04:59:29] /usr/lib/dradis/ruby/2.5.0/bundler/gems/dradis-nmap-ef0b6218b69e/lib/dradis/plugins/nmap/importer.rb:43:in `block in import'

[04:59:30] /usr/lib/dradis/ruby/2.5.0/gems/ruby-nmap-0.9.3/lib/nmap/xml.rb:293:in `block in each_host'

[04:59:30] /usr/lib/dradis/ruby/2.5.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/node_set.rb:190:in `block in each'

[04:59:30] /usr/lib/dradis/ruby/2.5.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/node_set.rb:189:in `upto'

[04:59:30] Worker process completed.

@xracerx could you try running the following commands from your dradis-ce folder? I think we’ve ended up with an updated Nmap plugin without an update to dradis-plugins.

$ git pull origin master
$ bundle update
$ bundle exec rails server

That should do the trick! If not, just let me know.

Hi there,

Still having the same issue.
However using the inbuilt dradis from Kali Linux.
Didn’t use the git pull version.

05:48:43] Small attachment detected. Processing in line.

[05:48:43] Parsing Nmap output from /usr/lib/dradis/attachments/3/localhost...

[05:48:43] Done.

[05:48:43] Validating Nmap output...

[05:48:43] Done.

[05:48:43] New host: 93.184.216.34

[05:48:43] New port: 443/tcp

[05:48:43] There was a fatal error processing your upload:

[05:48:43] undefined method `set_service' for #<Node:0x000055d90cc2a110>

[05:48:43] /usr/lib/dradis/ruby/2.5.0/gems/activemodel-5.1.6/lib/active_model/attribute_methods.rb:432:in `method_missing'

[05:48:44] /usr/lib/dradis/ruby/2.5.0/bundler/gems/dradis-nmap-ef0b6218b69e/lib/dradis/plugins/nmap/importer.rb:61:in `block (2 levels) in import'

[05:48:44] /usr/lib/dradis/ruby/2.5.0/gems/ruby-nmap-0.9.3/lib/nmap/host.rb:384:in `block in each_port'

[05:48:44] /usr/lib/dradis/ruby/2.5.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/node_set.rb:190:in `block in each'

[05:48:44] /usr/lib/dradis/ruby/2.5.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/node_set.rb:189:in `upto'

[05:48:44] /usr/lib/dradis/ruby/2.5.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/node_set.rb:189:in `each'

[05:48:45] /usr/lib/dradis/ruby/2.5.0/gems/ruby-nmap-0.9.3/lib/nmap/host.rb:383:in `each_port'

[05:48:45] /usr/lib/dradis/ruby/2.5.0/bundler/gems/dradis-nmap-ef0b6218b69e/lib/dradis/plugins/nmap/importer.rb:43:in `block in import'

[05:48:45] /usr/lib/dradis/ruby/2.5.0/gems/ruby-nmap-0.9.3/lib/nmap/xml.rb:293:in `block in each_host'

[05:48:45] /usr/lib/dradis/ruby/2.5.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/node_set.rb:190:in `block in each'

[05:48:46] /usr/lib/dradis/ruby/2.5.0/gems/nokogiri-1.8.1/lib/nokogiri/xml/node_set.rb:189:in `upto'

[05:48:46] Worker process completed.

@xracerx thanks for the update! Could you go ahead and re-install Dradis using these instructions? Installing Dradis on Kali Linux | Dradis Framework. I’ve seen this error before and it happened when a few of the plugins got out of sync with each other. There’s no good way for us to fix the built-in version from Kali but those instructions will get you the latest changes plus a quick and easy way to keep up to date with the changes we’ll be rolling out in the future!

Hi Yes,

I managed to installed the dradis-ce from the git.
Initially installation was hard, I realised there are couple of dependencies from apt-get that I have to install first before using the bundle.

@xracerx great work! Is everything running smoothly now with the Nmap uploads?

Hi

Yes definitely.

But a good feature to have will be to parse the Vulnerability as well

Sorry, I’m not sure what you mean. Could you give more details? Here’s a link to the Pro support site that gives more detail on what the Nmap plugin creates: Tools, Templates, and Fields | Dradis Pro Help. The Plugin Manager feature isn’t available in the Community Edition but the uploads create the same data.

Hi there,

I got the idea when I look at the plugin.
Btw the way I have a few question.

  1. How do I delete everything from the Dradis CE project
  2. Is there a good editor for me to edit the erb project \file?
  3. Is there a way to upload the metholodology?

Hi @xracerx ,

  1. You can remove everything manually (though you can select all issues at once to delete with the topmost checkbox), or you can remove everything at once from the command line using
    RAILS_ENV=production bundle exec thor dradis:reset

  2. Any text editor would do. I just use gedit, usually. What are you wanting to edit and in which file? Changing your project files may damage your instance of Dradis.

  3. Yes there is! Once you have the methodology .xml file (e.g. from here: Compliance standards templates and samples - Dradis Academy), just copy it to the /templates/methodologies/ folder in your local installation folder.

Does that help?

Hi Chris,

Meanwhile the part that are not working is:
fbfb8998/lib/dradis/plugins/projects/export/v2/template.rb:22:in build_issues' /usr/lib/dradis-ce/ruby/2.5.0/gems/activerecord-5.1.6/lib/active_record/dynamic_matchers.rb:22:in method_missing’: undefined method `issue_library’ for #Class:0x0000561bd0e322a8 (NoMethodError)

When I type in:
RAILS_ENV=production bundle exec thor dradis:reset

@xracerx I actually saw a similar error last week while testing. My hunch is that an update of your Dradis instance will do the trick! Can you check the following? (run from your dradis-ce folder)

$ git rev-parse --short HEAD

^ that outputs the short slug showing the latest commit on your system. If the output is anything other than d7b5dc4, it’s time to upgrade! To get the latest version:

$ git pull origin master
$ bundle exec rails server

And that should do the trick! Keep me posted.