Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CVE Local Library
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ramaguru Radhakrishnan
CVE Local Library
Commits
d55e403c
Commit
d55e403c
authored
2 years ago
by
Ramaguru Radhakrishnan
Browse files
Options
Downloads
Patches
Plain Diff
Added script to collect CVE
parent
fd61b1e6
Branches
main
No related tags found
No related merge requests found
Checking pipeline status
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/CVE_Collector.py
+30
-0
30 additions, 0 deletions
scripts/CVE_Collector.py
with
30 additions
and
0 deletions
scripts/CVE_Collector.py
0 → 100644
+
30
−
0
View file @
d55e403c
# 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
(
'
---
'
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment