Skip to main content

CVSS2/3 library with interactive calculator for Python 2 and Python 3

Project description

This Python package contains CVSS v2 and v3 computation utilities and interactive calculator compatible with both Python 2 and Python 3.

It is tested on Python 2.7 and 3.4, but there is no magic or dependencies, so it should run or many Python versions.

Installation

# pip install cvss

Usage

Library

from cvss import CVSS2, CVSS3


vector = 'AV:L/AC:L/Au:M/C:N/I:P/A:C/E:U/RL:W/RC:ND/CDP:L/TD:H/CR:ND/IR:ND/AR:M'
c = CVSS2(vector)
print(vector)
print(c.clean_vector())
print(c.scores())

print()

vector = 'S:C/C:H/I:H/A:N/AV:P/AC:H/PR:H/UI:R/E:H/RL:O/RC:R/CR:H/IR:X/AR:X/MAC:H/MPR:X/MUI:X/MC:L/MA:X'
c = CVSS3(vector)
print(vector)
print(c.clean_vector())
print(c.scores())
print(c.severities())

Sample output:

AV:L/AC:L/Au:M/C:N/I:P/A:C/E:U/RL:W/RC:ND/CDP:L/TD:H/CR:ND/IR:ND/AR:M
AV:L/AC:L/Au:M/C:N/I:P/A:C/E:U/RL:W/CDP:L/TD:H/AR:M
(5.0, 4.0, 4.6)

S:C/C:H/I:H/A:N/AV:P/AC:H/PR:H/UI:R/E:H/RL:O/RC:R/CR:H/IR:X/AR:X/MAC:H/MPR:X/MUI:X/MC:L/MA:X
AV:P/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:N/E:H/RL:O/RC:R/CR:H/MAC:H/MC:L
(6.5, 6.0, 5.3)
('Medium', 'Medium', 'Medium')

Interactive calculator

For interactive calculator run the following:

$ cvss_calculator.py

For help on the calculator options run:

$ cvss_calculator.py --help

Testing

For extensive testing, the test vectors were generated using official JavaScript generators and cvsslib.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cvss-1.0-py2.py3-none-any.whl (14.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file cvss-1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: cvss-1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cvss-1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5893608e101c023046ab7287ec608944eecdab9ae1beadd063771b56839fe469
MD5 1123c21f096ed26eca059df148d9e5cf
BLAKE2b-256 2c8f693c9e6587878ee82e992efd645c07e1912677fcfda5070c3eef9cabb72a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page