SerpicoProject / Serpico

SimplE RePort wrIting and COllaboration tool
Other
1.09k stars 368 forks source link

Update VulnDB Import Script to Reflect New Data Format #477

Open y4utj4 opened 6 years ago

y4utj4 commented 6 years ago

Please fill out the Bug Form or Feature Request Below


Bug

Describe the issue and steps to reproduce Import_VulnDB script mentioned from the wiki no longer works as a pointer to the vulnerabilitiy's description is throwing an error "scripts/import_vulndb.rb:35:in block in <main>': undefined methodjoin' for {"$ref"=>"#/files/description/43"}:Hash (NoMethodError)".

It looks as though the VulnDB repository was updated to put descriptions into a folder in preparation for multiple languages and a pointer is used to reference the description instead of the description as well.

  1. follow the Serpico wiki video to pull down and configure import_vulndb.rb file
  2. run the import_vulndb.rb script
BuffaloWill commented 6 years ago

Thanks @y4utj4, you are correct and the script needs to be updated. You can get around the issue by cloning an older version of VulnDB. From the root directory of vulndb run:

git checkout 59d87559c7cba869dba425cb38da36c25a00fb91

Then re-run the script, it should import fine.

BuffaloWill commented 6 years ago

I'd like to start shipping VulnDB data with Serpico. The licenses are compatible (BSD 3).

The plan:

Hax0rG1rl commented 5 years ago

Hi @BuffaloWill, this would be a comprehensive steps list to make things working at this stage.

Overall, it would be really nice to have this project updated. I think you did an amazing job, tbh. Thank you!

OS: Ubuntu 18.04

  1. sudo apt purge libssl-dev && sudo apt install libssl1.0-dev
  2. install and configure rbenv

A possible automated script:

#!/usr/bin/env bash

clear

echo "[*] Configuring rbenv for you...stand by!" 

sudo apt update
sudo apt install git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev

export PATH="$HOME/.rbenv/bin:$PATH" >> ~/.bashrc
eval "$(rbenv init -)" >> ~/.bashrc
source ~/.bashrc

curl -sL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash -
  1. rbenv install 2.3.3
  2. rbenv global 2.3.3
  3. ruby -v
  4. wget serpico from the releases section. [https://github.com/SerpicoProject/Serpico/releases/]
  5. gdebi the .deb pacakge.
  6. cd Serpico
  7. gem install bundle
  8. bundle install
  9. download the import_vulndb_serpico.rb script from your gist
  10. git clone vulndb
  11. cd vulnd directory
  12. git checkout 59d87559c7cba869dba425cb38da36c25a00fb91
  13. nano / vim / pico / whatever import_vulndb_serpico.rb and change the location of the vulndb package.
  14. cd Serpico/Serpico
  15. ruby scripts/import_vulndb_serpico.rb
  16. Start the serpico server 19,. Authenticate and check the db to have the new imports displayed and available.

That would be all!