GithubHelp home page GithubHelp logo

cve_vulnerability_analyzer's Introduction

CVE Vulnerability Analyzer

The CVE Vulnerability Analyzer is an advanced Rust Command-Line Interface (CLI) tool designed for local analysis of the Common Vulnerabilities and Exposures (CVE) Mitre database. This tool empowers users to conduct thorough assessments of potential vulnerabilities within their systems, providing a comprehensive view of the security landscape.

Table of Contents

Features

Local Analysis: Perform in-depth analysis of CVE data directly on your machine, ensuring efficiency and security.
CVE Mitre Database: Access and leverage the extensive CVE Mitre database to stay informed about known vulnerabilities.
Rust Powered: Built with Rust, the CVE Vulnerability Analyzer offers robust performance and reliability.
Command-Line Interface: The CVE Vulnerability Analyzer is a command-line tool, allowing for quick and easy access to the CVE Mitre database.

Installation

Linux

This was tested using POP!_OS 22.04 LTS

Install Rust

Open a terminal and run the following commands:

  • sudo apt install build-essential
  • curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  • source $HOME/.cargo/env
  • rustup install stable
  • rustup default stable
  • rustup update

Install dependencies

  • sudo apt install libssl-dev
  • sudo apt install pkg-config
  • sudo apt install libudev-dev
  • sudo apt install libsqlite3-dev
  • sudo apt install libdbus

install docker

Installation

  • sudo apt install docker.io
  • sudo systemctl start docker
  • sudo systemctl enable docker
  • sudo systemctl status docker
  • sudo usermod -aG docker $USER
  • su - $USER
  • id -nG

Config

img.png
Dockerfile: src/config/Dockerfile
Bind ports: 5432:5432
Verify that these values are also matching in the /config/config.json file
Run

Configure Diesel

  • cargo install diesel_cli --no-default-features --features postgres
  • echo DATABASE_URL=postgres://docker:password@localhost/postgresdb >.env
    • Note: these are the default credentials present in the Dockerfile. change them as needed
  • diesel setup
  • diesel migration run
    • Note: If there are issues with the database, you can reset it via the changelogs by running diesel migration redo

Run the program

  • cargo run
  • cargo run --release

Windows

This was tested using A Windows 10 Virtual machine

Install Ubuntu through WSL

Open a powershell terminal and run the following commands:

  • wsl --install
  • wsl --set-default-version 2
  • wsl --list --verbose
  • wsl --set-version Ubuntu-20.04 2
  • wsl -d Ubuntu-20.04
  • sudo apt update
  • sudo apt upgrade

Install Rust

Open a terminal and run the following commands:

  • sudo apt install build-essential
  • curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  • source $HOME/.cargo/env
  • rustup install stable
  • rustup default stable
  • rustup update

Install dependencies

  • sudo apt install libssl-dev
  • sudo apt install pkg-config
  • sudo apt install libudev-dev
  • sudo apt install libsqlite3-dev
  • sudo apt install libdbus

Install Docker

Installation

  • sudo apt install docker.io
  • sudo systemctl start docker
  • sudo systemctl enable docker
  • sudo systemctl status docker
  • sudo usermod -aG docker $USER
  • su - $USER
  • id -nG

Config

img_1.png
Dockerfile: src/config/Dockerfile
Bind ports: 8080:5432
Note: This port is different from the linux setup because of the nature of WSL.
Verify that these values are also matching in the /config/config.json file

Configure Diesel

  • cargo install diesel_cli --no-default-features --features postgres
  • echo DATABASE_URL=postgres://docker:password@localhost/postgresdb >.env
    • Note: These are the default credentials present in the Dockerfile. Change them as needed
  • diesel setup diesel migration run
    • Note: If there are issues with the database, you can reset it via the changelogs by running diesel migration redo

Run the program

  • cargo run
  • cargo run --release

Viewing the database

Dbeaver was used to view the database

img_2.png
Host: localhost
Port: If Linux: 5432 If Windows: 8080
Database: postgresdb
Username: docker
Password: password
Note: These are the default credentials present in the Dockerfile. Change them as needed

Usage

Commands

  • help Displays the list of available commands
  • search [-p parameter] [-y year] Searches the database for a specific CVE
    • -p Adds a keyword based search. i.e -p java returns all CVE records containing the keyword Java
    • -y Adds a year based search. i.e -y 2023 returns all records from 2023
  • sync Downloads the latest CVE records and adds them to the postgres database Note: This takes a while
  • export Exports the last search result into a CSV file
  • examine Arg[0] Examines the cve record provided, listing more details about the vulnerability
  • exit quits the program

License

Copyright [2023] [Kyle Carr]

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

cve_vulnerability_analyzer's People

Contributors

kylecarr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.