Skip to content

A Python 3 script that gets CPE URIs based on COTS names, and puts them in a CSV output file.

Notifications You must be signed in to change notification settings

rammam/cpe_retriever

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

CPE Retriever script v1.1.1 - by rammam

Usage : python3 cpe_retriever.py <INPUT.txt> [apiKey]

Recommended formatting for the input file :

line 1>GNU Bash 4.3.10

line 2>libarchive 3.3.1

etc..

Installation :

git clone https://github.com/rammam/cpe_retriever
pip3 install -r requirements.txt

Description :

This Python 3 script gets COTS names and versions from a user-supplied input file, and sends them to the NIST's CPE search API.

The API returns a json response containing the corresponding CPE 2.3 URIs.

Then, the script puts the CPE URIs in a csv output file.

The request rate is about 10/min, and can be increased to 100/min with a NIST API key (obtainable on the NIST's website).

Changes :

v1.1.1 : Added parallel request limiter.

v1.1 : Added asynchronous API requests, API key support, and Windows support.

v1.0 : Initial version