Skip to content

Commit 2b2a5ba

Browse files
committed
v0.14.2
1 parent e1cca8f commit 2b2a5ba

File tree

9 files changed

+115
-14
lines changed

9 files changed

+115
-14
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11

22
sploitscan/config.json
33
*.pyc
4-
sploitscan/config.json

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# 📆 Changelog
22

3+
## [18. October 2025] - Version 0.14.2
4+
5+
- **Directory Import Feature**
6+
Added support for importing CVE IDs from entire directories containing vulnerability reports. Use `--input-dir` to recursively scan directories and extract CVE IDs from all files. This complements the existing file import functionality and supports batch processing of multiple scanner reports.
7+
8+
- **Docker Improvements**
9+
Updated Dockerfile to Python 3.13, added virtual environment setup, installed git for repository operations, and created a dedicated `/results` directory for exports.
10+
11+
- **Export Path Enhancement**
12+
Modified export file generation to save results in `/results` directory when available.
13+
14+
*Special thanks to [diwskx](https://github.com/diwskx) for the directory import feature and Docker improvements.*
15+
316
## [07. October 2025] - Version 0.14.0
417

518
- **Modern modular refactor**

Dockerfile

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,38 @@
1-
FROM python:3.9-slim-buster
1+
FROM python:3.13-slim-trixie
22

3-
WORKDIR /app
4-
COPY . /app
5-
RUN pip install --no-cache-dir -r requirements.txt
3+
LABEL version="0.14.2"
4+
LABEL description="SploitScan is a powerful and user-friendly tool designed to streamline the process of identifying exploits for known vulnerabilities and their respective exploitation probability"
65

6+
ARG DEBIAN_FRONTEND=noninteractive
7+
8+
# Setting up venv
9+
ENV VENV=/venv
10+
ENV PATH=${VENV}/bin:${PATH}
11+
12+
# Installing packages including git
13+
RUN apt-get update && \
14+
apt-get install --yes --no-install-recommends git && \
15+
rm -rf /var/lib/apt/lists/*
16+
17+
# Downloading and installing dependencies
18+
COPY ./requirements.txt .
19+
20+
RUN python -m venv ${VENV} && \
21+
pip install --upgrade pip setuptools && \
22+
pip install --no-cache-dir -r requirements.txt
23+
24+
ENV APP_HOME=/app
25+
26+
# Copy application files
27+
WORKDIR $APP_HOME
28+
COPY ./sploitscan ./sploitscan
29+
COPY ./sploitscan.py .
30+
COPY ./LICENSE .
31+
COPY ./CHANGELOG.md .
32+
33+
# Make a directory for scan results
34+
RUN mkdir /results
35+
36+
# Start the application
737
ENTRYPOINT ["python", "sploitscan.py"]
38+
CMD ["-h"]

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ SploitScan is a powerful and user-friendly tool designed to streamline the proce
5050
- **Multi-CVE Support and Export Options**
5151
Work with multiple CVEs at once and export the results to HTML, JSON, or CSV formats.
5252

53-
- **Vulnerability Scanner Import**
54-
Import scan results from popular vulnerability scanners (Nessus, Nexpose, OpenVAS, Docker) to directly search for known exploits.
53+
- **Vulnerability Scanner Import**
54+
Import scan results from popular vulnerability scanners (Nessus, Nexpose, OpenVAS, Docker) to directly search for known exploits. Now supports directory-based import with `--input-dir` for batch processing multiple reports.
5555

5656
- **Granular Method Selection**
5757
Choose which specific data retrieval methods to run (such as CISA, EPSS, HackerOne, AI, etc.) so you only get the information you need.
@@ -180,9 +180,10 @@ options:
180180
-m METHODS, --methods METHODS
181181
Specify which methods to run, separated by commas (e.g., 'cisa,epss,hackerone,ai,prio,references').
182182
-i IMPORT_FILE, --import-file IMPORT_FILE
183-
Path to an import file. When provided, positional CVE IDs can be omitted. The file should be a plain text list with one CVE per line.
183+
Path to an import file. When provided, positional CVE IDs can be omitted. The file should be a plain text list with one CVE per line.
184+
--input-dir INPUT_DIR Path to a directory containing vulnerability reports to scan for CVE IDs.
184185
-c CONFIG, --config CONFIG
185-
Path to a custom configuration file.
186+
Path to a custom configuration file.
186187
-d, --debug Enable debug output.
187188
```
188189
@@ -277,6 +278,14 @@ Specify the type: 'nessus', 'nexpose', 'openvas', or 'docker' and provide the fi
277278
sploitscan --import-file path/to/yourfile.nessus --type nessus
278279
```
279280
281+
### Import from Directory
282+
283+
Scan an entire directory recursively for vulnerability reports and extract CVE IDs from all files.
284+
285+
```bash
286+
sploitscan --input-dir path/to/reports/directory
287+
```
288+
280289
### Select Specific Methods
281290
282291
To run only specific data retrieval methods (e.g., CISA, EPSS, AI risk assessment), use the `-m` argument:
@@ -413,6 +422,7 @@ Special thanks to:
413422
- [davidfortytwo](https://github.com/davidfortytwo) for enhancements (Updated CVE retrieval and PacketStorm addition).
414423
- [con-f-use](https://github.com/con-f-use) for support and fixes with setuptools/PyPi.
415424
- [Martijn Russchen](https://github.com/martijnrusschen) for his feedback and idea on HackerOne GraphQL.
425+
- [diwskx](https://github.com/diwskx) for the directory import feature and Docker improvements.
416426
417427
## 📌 Author
418428

sploitscan/cli.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from .ai import get_risk_assessment
3636
from .repo import clone_cvelistV5_repo
3737
from .search import search_cve_by_keywords
38-
from .importers import import_vulnerability_data
38+
from .importers import import_vulnerability_data, import_vulnerability_data_from_dir
3939
from .exporters.html_exporter import export_to_html
4040
from .exporters.json_exporter import export_to_json
4141
from .exporters.csv_exporter import export_to_csv
@@ -145,6 +145,7 @@ def main(
145145
methods: Optional[str] = None,
146146
debug: bool = False,
147147
fast_mode: bool = False,
148+
input_dir: Optional[str] = None,
148149
) -> None:
149150
"""
150151
Orchestrate SploitScan workflow for one or more CVE IDs.
@@ -166,6 +167,13 @@ def main(
166167
return
167168
cve_ids = imported_ids
168169

170+
if input_dir:
171+
imported_ids_from_dir = import_vulnerability_data_from_dir(input_dir)
172+
if not imported_ids_from_dir:
173+
print("❌ No valid CVE IDs found in the provided directory.")
174+
return
175+
cve_ids = imported_ids_from_dir
176+
169177
if not cve_ids:
170178
print("❌ No CVE IDs provided. Please provide CVE IDs or an import file.")
171179
return
@@ -352,6 +360,11 @@ def cli() -> None:
352360
type=str,
353361
help="Path to an import file. When provided, positional CVE IDs can be omitted. The file should be a plain text list with one CVE per line.",
354362
)
363+
parser.add_argument(
364+
"--input-dir",
365+
type=str,
366+
help="Path to a directory containing vulnerability reports to scan for CVE IDs.",
367+
)
355368
parser.add_argument("-c", "--config", type=str, help="Path to a custom configuration file.")
356369
parser.add_argument("-d", "--debug", action="store_true", help="Enable debug output.")
357370

@@ -378,4 +391,5 @@ def cli() -> None:
378391
methods=args.methods,
379392
debug=args.debug,
380393
fast_mode=args.fast_mode,
394+
input_dir=args.input_dir,
381395
)

sploitscan/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import Dict
66

77
# Version
8-
VERSION: str = "0.14.0"
8+
VERSION: str = "0.14.2"
99

1010
# ANSI Colors
1111
BLUE: str = "\033[94m"

sploitscan/importers/__init__.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,36 @@ def import_vulnerability_data(file_path: str, file_type: Optional[str] = None) -
111111
return import_file(file_path, parse_docker_file)
112112

113113
print(f"❌ Unsupported file type: {file_type}")
114-
return []
114+
return []
115+
116+
117+
def import_vulnerability_data_from_dir(dir_path: str) -> List[str]:
118+
if not os.path.exists(dir_path):
119+
print(f"❌ Error: The directory '{dir_path}' does not exist.")
120+
return []
121+
if not os.path.isdir(dir_path):
122+
print(f"❌ Error: '{dir_path}' is not a directory. Use --input-dir with a directory path.")
123+
return []
124+
125+
p = pathlib.Path(dir_path, encoding='utf-8').glob('**/*')
126+
reports_list = [str(x) for x in p if x.is_file()]
127+
128+
cve_ids_list = []
129+
130+
for report_path in reports_list:
131+
cve_ids_list.extend(import_file(report_path, parse_cve_in_report))
132+
133+
unique_cve_ids = list(set(cve_ids_list))
134+
print(f"📥 Successfully imported {len(unique_cve_ids)} CVE(s) from '{dir_path}'\n")
135+
return unique_cve_ids
136+
137+
138+
def parse_cve_in_report(file):
139+
cve_pattern = r'CVE-\d{4}-\d{4,7}'
140+
try:
141+
content = file.read()
142+
return [cve.upper() for cve in re.findall(cve_pattern, content, re.IGNORECASE)]
143+
144+
except Exception as e:
145+
print(f"❌ Error reading file '{file}': {e}")
146+
return []

sploitscan/templates/report_template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@
229229
<h1 class="text-lg font-semibold tracking-tight">SploitScan</h1>
230230
<p class="text-xs muted">Modern CVE & Exploit Aggregation Report</p>
231231
</div>
232-
<span class="badge bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-200">{{ "v" }}{{ 0 }}{{ "." }}{{ 14 }}{{ "." }}{{ 0 }}</span>
232+
<span class="badge bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-200">{{ "v" }}{{ 0 }}{{ "." }}{{ 14 }}{{ "." }}{{ 2 }}</span>
233233
</div>
234234
<div class="flex items-center gap-2 no-print">
235235
<button id="themeToggle" class="inline-flex items-center gap-2 rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm font-medium hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700">

sploitscan/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,6 @@ def generate_filename(cve_ids: Iterable[str], extension: str) -> str:
4545
ids: List[str] = list(cve_ids)
4646
cve_part = "_".join(ids[:3]) + ("_and_more" if len(ids) > 3 else "")
4747
cve_part = cve_part or "report"
48-
return f"{ts}_{cve_part}_export.{extension.lower()}"
48+
base_dir = "/results" if os.path.exists('/results') else "."
49+
filename = os.path.join(base_dir, f"{ts}_{cve_part}_export.{extension.lower()}")
50+
return filename

0 commit comments

Comments
 (0)