Giter Site home page Giter Site logo

cvss's Introduction

CVSS

A utility for reporting and manipulating CVSS v3 metrics

The motivation for this tool came from looking for a simple command line tool to report the CVSS base score metric for a given CVE and asking the question 'how does that score apply in my environment'. The CVSS V3 specification includes a modify base score string to address this question.

This utility extracts the CVE vector from NVD JSON record for the CVE.

This utility only works for CVSS V3. If the CVE record does not have CVSS V3 record an error is returned.

Documentation of the CVSS v3.1 specification.

Installation

Only Python 3 is supported.

pip -r requirements.txt

Usage

 python CVSS.py [-h] [-C CVE] [-m MOD_VECTOR] [-b] [-e] [-i] [-s] [-V] [-v]
 Arguments:
   -h, --help            show this help message and exit
   -C CVE, --CVE CVE     CVE Identity
   -m MOD_VECTOR, --modify MOD_VECTOR
                         Modified CVSS Base Metric string (e.g. MAV:L/MC:H)
   -b, --base            Report base score (default)
   -e, --exploit         Report exploit score
   -i, --impact          Report impact score
   -s, --string          Report CVSS Vector String
   -V, --verbose         Verbose reporting
   -v, --version         Show version information and exit

Apart from -C option all arguments are optional.

Examples

python CVSS.py -C CVE-2020-0001

Returns the CVE base score

python CVSS.py -C CVE-2020-0001 -V

Verbose reporting of the CVE base score

python CVSS.py -C CVE-2020-0001 -i -e

Returns the CVE base, impact and exploitability scores

python CVSS.py -C CVE-2020-0001 -m "MAV:L/MC:H"

Report the modified CVE base score

Error Messages

[ERROR] CVE parameter not specified.

The -C parameter was not specified

[ERROR] No CVE record for found

The specified CVE does not exist

[ERROR] No CVSSv3 data for

A CVSSv3 record was not found for the specified CVE although there may be a CVSSv2 record.

ERROR] Invalid JSON received for CVE

The NVD JSON record for CVE was not valid

[ERROR] Discrepancy between base score calculations for CVE

Internal error

Information Messages

Various information messages are produced when Verbose mode is selected

Licence

MIT Licence

Referenced components may be released under different licences.

Extra

The 'docs' directory contains the base score calculation for all of the CVSS V3 base score strings (all 2592 combinations).

Postscript

This was a simple exercise to get experience in publishing a utility on GitHub in the hope that it might be useful to someone. I know that there are much better ways of writing the code but hopefully the code is clear if anyone wants to take it to the next stage.

cvss's People

Contributors

anthonyharrison avatar

Watchers

 avatar  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.