Hi Will,
> You recently worked on adding a persistent nmap upload plugin for us that would stay persistent throughout dradis upgrades. The plugin you created for us is gone now after the most recent upgrade. I have modified your default plugin again to perform how we needed the custom one to perform and it is working except for the fact that the notes it creates are tagged as default category instead of advanced word export ready.
As discussed last time the main problem you’re having is that the “custom” nmap plugin you’ve created is just a copy of the official plugin, this means that both plugins have the same namespace, class name, etc. This is bound to cause trouble (each plugin is supposed to have a unique name, namespace, etc.).
> Can you explain how to make these notes have the correct property when they are imported? I would also like to get with you about the persistent plugin when you have time. It would be really nice to know that I don't have to troubleshoot the uploader each time I need to patch dradis.
The file you want to edit is:
/opt/dradispro/dradispro/current/vendor/cache/dradis-nmap/lib/dradis/plugins/nmap/importer.rb
In Line 41, replace:
content_service.create_note(text: host_text, node: host_node)
With
note = content_service.create_note(text: host_text, node: host_node)
note.category_id = 3
note.save
The 3 needs to be replaced with the category ID that corresponds to "AdvancedWordExport ready” in your instance. You can find it like this:
$ cd /opt/dradispro/dradispro/current/
$ RAILS_ENV=production bundle exec rails console
irb> Category.find_by_name( Configuration.find_by_name('advanced_word_export:category').value ).id
=> 3
After making changes, restart the app and background services, through /setup or the console:
$ god restart dradispro-unicorn
$ god restart dradispro-resque-1
Let us know how it goes.
HTH,
Daniel
—
Morris's three golden rules of computer security:
do not own a computer;
do not power it on;
and do not use one