Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sploitscan/importers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import re
import xml.etree.ElementTree as ET
from typing import Callable, Iterable, List, Optional
import os
from pathlib import Path


_CVE_REGEX = re.compile(r"CVE-\d{4}-\d{4,7}$")
Expand Down Expand Up @@ -122,7 +124,7 @@ def import_vulnerability_data_from_dir(dir_path: str) -> List[str]:
print(f"❌ Error: '{dir_path}' is not a directory. Use --input-dir with a directory path.")
return []

p = pathlib.Path(dir_path, encoding='utf-8').glob('**/*')
p = Path(dir_path).glob('**/*')
reports_list = [str(x) for x in p if x.is_file()]

cve_ids_list = []
Expand Down
2 changes: 1 addition & 1 deletion sploitscan/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def generate_filename(cve_ids: Iterable[str], extension: str) -> str:
Generate a timestamped filename like:
20250101T123456Z_CVE-2024-1709_CVE-2024-21413_and_more_export.html
"""
ts = datetime.datetime.utcnow().strftime("%Y%m%dT%H%M%SZ")
ts = datetime.datetime.now(datetime.timezone.utc).strftime("%Y%m%dT%H%M%SZ")
ids: List[str] = list(cve_ids)
cve_part = "_".join(ids[:3]) + ("_and_more" if len(ids) > 3 else "")
cve_part = cve_part or "report"
Expand Down