hammackj / risu

Risu is Nessus parser, that converts the generated reports into a ActiveRecord database, this allows for easy report generation and vulnerability verification.
http://hammackj.github.io/risu
MIT License
63 stars 20 forks source link

graphs template errors #14

Closed ebdavison closed 13 years ago

ebdavison commented 13 years ago

I am getting the following with the graphs.rb template:

Error: undefined method number_of_hosts' for #<Class:0xb660fe44> /usr/lib/ruby/gems/1.8/gems/nessusdb-1.2/bin/../lib/nessusdb/prawn_templater.rb:31:ingenerate' (eval):19:in generate' /usr/lib/ruby/gems/1.8/gems/prawn-core-0.8.4/lib/prawn/document.rb:238:ineval' /usr/lib/ruby/gems/1.8/gems/nessusdb-1.2/bin/../lib/nessusdb/prawn_templater.rb:31:in generate' /usr/lib/ruby/gems/1.8/gems/prawn-core-0.8.4/lib/prawn/document.rb:238:ininstance_eval' /usr/lib/ruby/gems/1.8/gems/prawn-core-0.8.4/lib/prawn/document.rb:238:in initialize' /usr/lib/ruby/gems/1.8/gems/prawn-core-0.8.4/lib/prawn/document.rb:130:innew' /usr/lib/ruby/gems/1.8/gems/prawn-core-0.8.4/lib/prawn/document.rb:130:in generate' /usr/lib/ruby/gems/1.8/gems/nessusdb-1.2/bin/../lib/nessusdb/prawn_templater.rb:29:ingenerate' /usr/lib/ruby/gems/1.8/gems/nessusdb-1.2/bin/nessusdb:230:in main' /usr/lib/ruby/gems/1.8/gems/nessusdb-1.2/bin/nessusdb:241 /usr/bin/nessusdb:19:inload' /usr/bin/nessusdb:19

ebdavison commented 13 years ago

Found the problem. Here is a patch:

88c88

< select("items.*").select("count() as count_all").joins(:plugin).where("plugin_id != 1").where(:severity => 3).group(:plugin_id).order("count_all DESC").limit(limit)

                                  select("items.*").select("count(*) as count_all").joins(:plugin).where("plugin_id != 1").where(:severity => 3).group(:plugin_id).order("count_all DESC").limit(limit)
ebdavison commented 13 years ago

I don't understand this git markup. I hope you can read that.

hammackj commented 13 years ago

1.1 template with 1.2 engine. Please use the 1.2 templates.

ebdavison commented 13 years ago

How do I do that. I have done a 'git pull' which says it is current at 1.3 and the templates directory is where these files are. How do I get the 1.2 templates if not with a 'git pull'?

hammackj commented 13 years ago

Try this I am assuming you are using the system ruby: First update your gems, this will give you nessusdb 1.2

sudo gem update

type nessusdb -v this should output soemthing like this: nessusdb - Nessus Parser and Report Generator v1.2

cd some_project_directory git://github.com/hammackj/nessusdb.git 1.3 cd 1.3 git checkout 1.3

then

nessusdb -t ./lib/nessusdb/templates/TEMPLATE -o output.pdf

this will use 1.2 to on a 1.3 template, all 1.3 templates should work except for the coversheet and that is because in 1.3, I expose the path to the template to the engine. So you will have to change the image path to your logo

You can try ./bin/nessusdb and use the binary from 1.3 but i am not sure that is fully functional yet, as 1.3 is a development branch. the config files for 1.3 are different along with other things.

ebdavison commented 13 years ago

I did get 1.3 to work finally; I just need to come up to speed with git. Going through the templates for now.

ebdavison commented 13 years ago

The graphs template still has the same error I already reported in 1.3 as well. Just ran through it and none of the graphs generate due to the 'count()' where it should be 'count(*)'.

I am fixing my copy of item.rb locally to handle for now. There are actually 5 of them that need to be fixed.

hammackj commented 13 years ago

I will look into the count(*) not sure why its not working for you.