Skip to content
Snippets Groups Projects
Commit d55e403c authored by Ramaguru Radhakrishnan's avatar Ramaguru Radhakrishnan :speech_balloon:
Browse files

Added script to collect CVE

parent fd61b1e6
Branches main
No related tags found
No related merge requests found
Checking pipeline status
# Author: Ramaguru Radhakrishnan
# Date: 08-April-2023
# Description : To collect the CVEs from the NIST Endpoint API
import requests
import json
from bs4 import BeautifulSoup
# Define the base URL for the NVD API
base_url = 'https://services.nvd.nist.gov/rest/json/cves/1.0'
#search_url = 'https://nvd.nist.gov/vuln/search/results?form_type=Advanced&results_type=overview&search_type=all&query=crypto&startIndex=0'
# Define the query parameters for the API request
params = {'resultsPerPage': 1000, 'startIndex': 0}
# Send the API request and get the response
response = requests.get(base_url, params=params)
# Parse the response JSON and get the CVE items
cve_items = json.loads(response.content)['result']['CVE_Items']
#print (cve_items)
# Print the CVE IDs and descriptions for the first 10 items
for item in cve_items[:10]:
print('CVE ID:', item['cve']['CVE_data_meta']['ID'])
print('Description:', item['cve']['description']['description_data'][0]['value'])
print('---')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment