Skip to content

Commit 2d5dd7b

Browse files
committed
v0.10.4
1 parent f6a5fbe commit 2d5dd7b

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "sploitscan"
7-
version = "0.10.3"
7+
version = "0.10.4"
88
description = "SploitScan is a sophisticated cybersecurity utility designed to provide detailed information on vulnerabilities and associated exploits."
99
authors = [ { name = "Alexander Hagenah", email = "[email protected]" } ]
1010
license = { file = "LICENSE" }

sploitscan/sploitscan.py

+19-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from jinja2 import Environment, FileSystemLoader
1818

1919

20-
VERSION = "0.10.3"
20+
VERSION = "0.10.4"
2121

2222
BLUE = "\033[94m"
2323
GREEN = "\033[92m"
@@ -216,8 +216,7 @@ def template(data):
216216
cve_item = data["containers"]["cna"]
217217
published = data["cveMetadata"].get("datePublished", "")
218218
if published:
219-
published_date = datetime.datetime.fromisoformat(
220-
published.rstrip("Z"))
219+
published_date = datetime.datetime.fromisoformat(published.rstrip("Z"))
221220
published = published_date.strftime("%Y-%m-%d")
222221
description = (
223222
next(
@@ -234,8 +233,10 @@ def template(data):
234233
wrapped_description = textwrap.fill(
235234
description, width=100, subsequent_indent=" " * 15
236235
)
236+
237237
metrics = cve_item.get("metrics", [])
238238
baseScore, baseSeverity, vectorString = "N/A", "N/A", "N/A"
239+
239240
for metric in metrics:
240241
cvss_data = metric.get("cvssV3_1") or metric.get("cvssV3")
241242
if cvss_data:
@@ -244,6 +245,21 @@ def template(data):
244245
vectorString = cvss_data.get("vectorString", "N/A")
245246
if baseScore != "N/A":
246247
break
248+
249+
if baseScore == "N/A":
250+
adp = data["containers"].get("adp", [])
251+
for adp_entry in adp:
252+
for metric in adp_entry.get("metrics", []):
253+
cvss_data = metric.get("cvssV3_1") or metric.get("cvssV3")
254+
if cvss_data:
255+
baseScore = cvss_data.get("baseScore", "N/A")
256+
baseSeverity = cvss_data.get("baseSeverity", "N/A")
257+
vectorString = cvss_data.get("vectorString", "N/A")
258+
if baseScore != "N/A":
259+
break
260+
if baseScore != "N/A":
261+
break
262+
247263
return [
248264
f"├ Published: {published}",
249265
f"├ Base Score: {baseScore} ({baseSeverity})",

0 commit comments

Comments
 (0)