pyExploitDb 0.2.102__tar.gz → 0.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,110 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyexploitdb
3
+ Version: 0.3.1
4
+ Summary: An optimized Python3 library to fetch the most recent exploit-database,
5
+ Home-page: https://github.com/Hackman238/pyExploitDb
6
+ Author: Shane William Scott
7
+ Author-email: shane@shanewilliamscott.com
8
+ License: GPL-3.0-only
9
+ Project-URL: Source, https://github.com/Hackman238/pyExploitDb
10
+ Project-URL: Issue Tracker, https://github.com/Hackman238/pyExploitDb/issues
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Operating System :: OS Independent
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: GitPython>=3.1
23
+ Requires-Dist: requests>=2.28
24
+ Dynamic: author
25
+ Dynamic: author-email
26
+ Dynamic: classifier
27
+ Dynamic: description
28
+ Dynamic: description-content-type
29
+ Dynamic: home-page
30
+ Dynamic: license
31
+ Dynamic: license-file
32
+ Dynamic: project-url
33
+ Dynamic: requires-dist
34
+ Dynamic: requires-python
35
+ Dynamic: summary
36
+
37
+ ## NOTICE
38
+
39
+ This is the new home of "pyexploitdb".
40
+
41
+ ##
42
+
43
+ pyexploitdb (https://shanewilliamscott.com)
44
+ ==
45
+ [![Python package](https://github.com/Hackman238/pyExploitDb/actions/workflows/master.yml/badge.svg)](https://github.com/Hackman238/pyExploitDb/actions/workflows/master.yml)
46
+ [![Known Vulnerabilities](https://snyk.io/test/github/Hackman238/pyExploitDb/badge.svg?targetFile=requirements.txt)](https://snyk.io/test/github/Hackman238/pyExploitDb?targetFile=requirements.txt)
47
+
48
+
49
+ ## Authors:
50
+ Shane William Scott
51
+
52
+ ## About pyexploitdb
53
+ pyexploitdb builds and maintains local CVE↔EDB indexes from the official exploit-db repository with a focus on resilience and observability.
54
+
55
+ ### Highlights
56
+ - Validates on-disk caches and normalises mappings to keep indexes trustworthy.
57
+ - Rebuilds quickly by parsing `files_exploits.csv` first and only scraping missing CVEs with bounded concurrency.
58
+ - Ships with a practical smoke-test suite (`python -m tests.smoke_test`) so releases can be verified before publishing.
59
+
60
+ ## Upcoming features
61
+ > CPE database, indexes and mappings
62
+
63
+ ## Installation
64
+ pip install pyexploitdb
65
+ > Note: This assumes pip is for your python3 environment. Use pip3 if pip is for your python2 environment.
66
+
67
+ ## Example Usage
68
+ ```python
69
+ from pyexploitdb import PyExploitDb
70
+ exploit_db = PyExploitDb()
71
+ exploit_db.debug = False
72
+ exploit_db.open_file()
73
+ results = exploit_db.search_cve("CVE-2018-14592")
74
+ for exploit in results:
75
+ print(f"{exploit['id']} -> {exploit['file']}")
76
+ ```
77
+
78
+ `search_cve` returns a list of dictionaries (one per matching exploit). The library raises `pyexploitdb.PyExploitDbError` when required data is missing or network/git operations fail after retrying.
79
+
80
+ To rebuild the CVE caches from scratch without hammering exploit-db, metadata is extracted from `files_exploits.csv` first and any missing CVEs fall back to concurrent (throttled) scraping:
81
+
82
+ ```python
83
+ from pyexploitdb import PyExploitDb
84
+
85
+ with PyExploitDb() as exploit_db:
86
+ exploit_db.update_db(workers=6) # adjust workers to control parallel HTTP fetches
87
+ ```
88
+
89
+ ## Tests
90
+ Run the practical smoke tests before publishing to PyPI:
91
+
92
+ ```
93
+ python -m tests.smoke_test
94
+ ```
95
+
96
+ ## Example debug/verbose output
97
+ CVE-2018-1459
98
+ Found
99
+ Exploit DB Id: 45447
100
+ File: ./exploit-database/exploits/php/webapps/45447.txt
101
+ Date: 2018-09-24
102
+ Author: Haboob Team
103
+ Platform: webapps
104
+ Type: php
105
+ Port: 80
106
+ {'edbid': '45447', 'exploit': './exploit-database/exploits/php/webapps/45447.txt', 'date': '2018-09-24', 'author': 'Haboob Team', 'platform': 'webapps', 'type': 'php', 'port': '80'}
107
+
108
+ ## Credits
109
+ Based on fork from https://github.com/GoVanguard/pyExploitDb by Shane Scott.
110
+ Originally based on fork of cve_searchsploit by Andrea Fioraldi.
@@ -0,0 +1,74 @@
1
+ ## NOTICE
2
+
3
+ This is the new home of "pyexploitdb".
4
+
5
+ ##
6
+
7
+ pyexploitdb (https://shanewilliamscott.com)
8
+ ==
9
+ [![Python package](https://github.com/Hackman238/pyExploitDb/actions/workflows/master.yml/badge.svg)](https://github.com/Hackman238/pyExploitDb/actions/workflows/master.yml)
10
+ [![Known Vulnerabilities](https://snyk.io/test/github/Hackman238/pyExploitDb/badge.svg?targetFile=requirements.txt)](https://snyk.io/test/github/Hackman238/pyExploitDb?targetFile=requirements.txt)
11
+
12
+
13
+ ## Authors:
14
+ Shane William Scott
15
+
16
+ ## About pyexploitdb
17
+ pyexploitdb builds and maintains local CVE↔EDB indexes from the official exploit-db repository with a focus on resilience and observability.
18
+
19
+ ### Highlights
20
+ - Validates on-disk caches and normalises mappings to keep indexes trustworthy.
21
+ - Rebuilds quickly by parsing `files_exploits.csv` first and only scraping missing CVEs with bounded concurrency.
22
+ - Ships with a practical smoke-test suite (`python -m tests.smoke_test`) so releases can be verified before publishing.
23
+
24
+ ## Upcoming features
25
+ > CPE database, indexes and mappings
26
+
27
+ ## Installation
28
+ pip install pyexploitdb
29
+ > Note: This assumes pip is for your python3 environment. Use pip3 if pip is for your python2 environment.
30
+
31
+ ## Example Usage
32
+ ```python
33
+ from pyexploitdb import PyExploitDb
34
+ exploit_db = PyExploitDb()
35
+ exploit_db.debug = False
36
+ exploit_db.open_file()
37
+ results = exploit_db.search_cve("CVE-2018-14592")
38
+ for exploit in results:
39
+ print(f"{exploit['id']} -> {exploit['file']}")
40
+ ```
41
+
42
+ `search_cve` returns a list of dictionaries (one per matching exploit). The library raises `pyexploitdb.PyExploitDbError` when required data is missing or network/git operations fail after retrying.
43
+
44
+ To rebuild the CVE caches from scratch without hammering exploit-db, metadata is extracted from `files_exploits.csv` first and any missing CVEs fall back to concurrent (throttled) scraping:
45
+
46
+ ```python
47
+ from pyexploitdb import PyExploitDb
48
+
49
+ with PyExploitDb() as exploit_db:
50
+ exploit_db.update_db(workers=6) # adjust workers to control parallel HTTP fetches
51
+ ```
52
+
53
+ ## Tests
54
+ Run the practical smoke tests before publishing to PyPI:
55
+
56
+ ```
57
+ python -m tests.smoke_test
58
+ ```
59
+
60
+ ## Example debug/verbose output
61
+ CVE-2018-1459
62
+ Found
63
+ Exploit DB Id: 45447
64
+ File: ./exploit-database/exploits/php/webapps/45447.txt
65
+ Date: 2018-09-24
66
+ Author: Haboob Team
67
+ Platform: webapps
68
+ Type: php
69
+ Port: 80
70
+ {'edbid': '45447', 'exploit': './exploit-database/exploits/php/webapps/45447.txt', 'date': '2018-09-24', 'author': 'Haboob Team', 'platform': 'webapps', 'type': 'php', 'port': '80'}
71
+
72
+ ## Credits
73
+ Based on fork from https://github.com/GoVanguard/pyExploitDb by Shane Scott.
74
+ Originally based on fork of cve_searchsploit by Andrea Fioraldi.
@@ -0,0 +1,447 @@
1
+ from __future__ import annotations
2
+
3
+ import csv
4
+ import json
5
+ import os
6
+ import re
7
+ import shutil
8
+ import time
9
+ import warnings
10
+ from concurrent.futures import ThreadPoolExecutor, as_completed
11
+ from pathlib import Path
12
+ from typing import Dict, Iterable, List, Optional, Sequence, Set
13
+
14
+ import git
15
+ import requests
16
+
17
+ __all__ = ["PyExploitDb", "PyExploitDbError", "InvalidDataError"]
18
+
19
+ CveDetails = Dict[str, str]
20
+ ExploitMap = Dict[str, List[str]]
21
+ _CVE_PATTERN = re.compile(r"CVE-\d{4}-\d{4,7}", re.IGNORECASE)
22
+ _CVE_PATTERN_BYTES = re.compile(rb"CVE-\d{4}-\d{4,7}", re.IGNORECASE)
23
+
24
+
25
+ class PyExploitDbError(Exception):
26
+ """Base exception for pyexploitdb related failures."""
27
+
28
+
29
+ class InvalidDataError(PyExploitDbError):
30
+ """Raised when on-disk data cannot be parsed or validated."""
31
+
32
+
33
+ class PyExploitDb:
34
+ """High level interface for working with exploit-db offline data."""
35
+
36
+ EXPLOIT_DB_REPO = "https://gitlab.com/exploit-database/exploitdb.git"
37
+ FILES_EXPLOITS = "files_exploits.csv"
38
+ USER_AGENT = {"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) Chrome/39.0 Safari/537.36"}
39
+
40
+ def __init__(
41
+ self,
42
+ *,
43
+ exploit_db_path: Optional[Path] = None,
44
+ request_cool_off_time: float = 1.0,
45
+ max_retries: int = 3,
46
+ session: Optional[requests.Session] = None,
47
+ ) -> None:
48
+ self.current_path = Path(__file__).resolve().parent
49
+ self.exploit_db_path = exploit_db_path or self.current_path / "exploit-database"
50
+ self.edbid_to_cve_file = self.current_path / "edbidToCve.json"
51
+ self.cve_to_edbid_file = self.current_path / "cveToEdbid.json"
52
+ self.request_cool_off_time = max(0.0, float(request_cool_off_time))
53
+ self.max_retries = max(1, int(max_retries))
54
+
55
+ self.cve_to_exploit_map: ExploitMap = {}
56
+ self._exploit_cache: Dict[str, Sequence[str]] = {}
57
+
58
+ self._session = session or requests.Session()
59
+ self._owns_session = session is None
60
+ self._session.headers.setdefault("User-Agent", self.USER_AGENT["User-Agent"])
61
+
62
+ self.debug = False
63
+
64
+ def log_debug(self, message: str) -> None:
65
+ if self.debug:
66
+ print(message)
67
+
68
+ def clone_or_update_repo(self) -> None:
69
+ if not self.exploit_db_path.exists():
70
+ self._clone_repo()
71
+ return
72
+
73
+ try:
74
+ repo = git.Repo(self.exploit_db_path)
75
+ except (git.exc.InvalidGitRepositoryError, git.exc.NoSuchPathError):
76
+ self.log_debug("Existing exploit-database directory invalid, re-cloning...")
77
+ self.delete_and_reclone_repo()
78
+ return
79
+
80
+ try:
81
+ self.log_debug("Pulling exploit-database updates...")
82
+ repo.remotes.origin.pull("main")
83
+ except git.exc.GitCommandError as exc:
84
+ self.log_debug(f"Pull failed ({exc}); attempting to re-clone repository.")
85
+ self.delete_and_reclone_repo()
86
+
87
+ def pull_latest_updates(self) -> None:
88
+ self.clone_or_update_repo()
89
+
90
+ def delete_and_reclone_repo(self) -> None:
91
+ if self.exploit_db_path.exists():
92
+ shutil.rmtree(self.exploit_db_path, ignore_errors=True)
93
+ self._clone_repo()
94
+ self._exploit_cache.clear()
95
+
96
+ def open_file(self, exploit_map: str = "cveToEdbid.json", encoding: str = "utf-8") -> None:
97
+ self.clone_or_update_repo()
98
+ data = self._load_json_file(self.current_path / exploit_map, encoding)
99
+ self._set_cve_map(data)
100
+
101
+ def get_cve_details(self, cve_search: str) -> List[CveDetails]:
102
+ if not self.cve_to_exploit_map:
103
+ raise PyExploitDbError("Exploit data is not loaded; call open_file() or update_db() first.")
104
+ if not cve_search:
105
+ return []
106
+
107
+ edb_ids = self.cve_to_exploit_map.get(cve_search.upper(), [])
108
+ if not edb_ids:
109
+ return []
110
+
111
+ self._ensure_exploit_cache()
112
+ results: List[CveDetails] = []
113
+ for edb_id in edb_ids:
114
+ row = self._exploit_cache.get(edb_id)
115
+ if row:
116
+ results.append(self.extract_cve_details(row))
117
+ else:
118
+ self.log_debug(f"EDB {edb_id} referenced by CVE {cve_search} not present in CSV data.")
119
+ return results
120
+
121
+ def extract_cve_details(self, row: Sequence[str]) -> CveDetails:
122
+ if len(row) < 16:
123
+ raise InvalidDataError("files_exploits.csv row is malformed; expected at least 16 columns.")
124
+ details = {
125
+ "id": row[0],
126
+ "file": row[1],
127
+ "description": row[2],
128
+ "date": row[3],
129
+ "author": row[4],
130
+ "type": row[5],
131
+ "platform": row[6],
132
+ "port": row[7],
133
+ "date_updated": row[9],
134
+ "verified": row[10],
135
+ "codes": row[11],
136
+ "tags": row[12],
137
+ "aliases": row[13],
138
+ "app_url": row[14],
139
+ "src_url": row[15],
140
+ }
141
+ self.log_debug(f"CVE details extracted: {details}")
142
+ return details
143
+
144
+ def search_cve(self, cve_search: str) -> List[CveDetails]:
145
+ return self.get_cve_details(cve_search)
146
+
147
+ def update_db(self, *, workers: Optional[int] = None) -> None:
148
+ self.clone_or_update_repo()
149
+ data = self.load_existing_data(self.edbid_to_cve_file)
150
+ exploits = self.load_exploit_csv()
151
+
152
+ missing_ids: List[str] = []
153
+ for row in exploits:
154
+ if not row or not row[0]:
155
+ continue
156
+ edb_id = row[0]
157
+ if edb_id in data:
158
+ continue
159
+
160
+ cves = self._extract_cves_from_row(row)
161
+ if cves:
162
+ data[edb_id] = sorted(cves)
163
+ else:
164
+ missing_ids.append(edb_id)
165
+
166
+ if missing_ids:
167
+ unique_ids = list(dict.fromkeys(missing_ids))
168
+ fetched = self._fetch_missing_cves(unique_ids, workers=workers)
169
+ data.update(fetched)
170
+
171
+ self.write_json(self.edbid_to_cve_file, data)
172
+ self.create_cve_to_exploit_map(data)
173
+ self.write_json(self.cve_to_edbid_file, self.cve_to_exploit_map)
174
+
175
+ def load_existing_data(self, file_path: Path | str) -> ExploitMap:
176
+ path = Path(file_path)
177
+ if not path.exists():
178
+ return {}
179
+
180
+ try:
181
+ with path.open(encoding="utf-8") as file_data:
182
+ raw = json.load(file_data)
183
+ except json.JSONDecodeError as exc:
184
+ raise InvalidDataError(f"Corrupt JSON detected at {path}; delete file and retry.") from exc
185
+ except OSError as exc:
186
+ raise PyExploitDbError(f"Unable to read {path}") from exc
187
+
188
+ return self._normalise_edbid_mapping(raw)
189
+
190
+ def load_exploit_csv(self) -> List[List[str]]:
191
+ path = self.exploit_db_path / self.FILES_EXPLOITS
192
+ try:
193
+ with path.open(encoding="utf-8", newline="") as file:
194
+ reader = csv.reader(file)
195
+ next(reader, None) # skip header
196
+ rows = [row for row in reader if row]
197
+ except FileNotFoundError as exc:
198
+ raise PyExploitDbError(f"{self.FILES_EXPLOITS} not found at {path}.") from exc
199
+ except OSError as exc:
200
+ raise PyExploitDbError(f"Unable to read {path}") from exc
201
+
202
+ self._exploit_cache = {row[0]: row for row in rows if row and row[0]}
203
+ return rows
204
+
205
+ def fetch_cves_for_exploit(self, edb_id: str, session: Optional[requests.Session] = None) -> Set[str]:
206
+ request_uri = f"https://www.exploit-db.com/exploits/{edb_id}"
207
+ active_session = session or self._session
208
+ for attempt in range(1, self.max_retries + 1):
209
+ try:
210
+ response = active_session.get(request_uri, timeout=10)
211
+ except requests.RequestException as exc:
212
+ self.log_debug(f"Request error for {request_uri} (attempt {attempt}/{self.max_retries}): {exc}")
213
+ else:
214
+ if response.status_code == 404:
215
+ self.log_debug(f"Exploit {edb_id} returned 404; no CVEs available.")
216
+ return set()
217
+ if response.ok:
218
+ return self.parse_cves_from_content(response.content)
219
+ self.log_debug(
220
+ f"Unexpected status {response.status_code} for {request_uri} "
221
+ f"(attempt {attempt}/{self.max_retries})."
222
+ )
223
+
224
+ if attempt < self.max_retries:
225
+ time.sleep(self.request_cool_off_time)
226
+
227
+ raise PyExploitDbError(f"Failed to fetch CVEs for exploit {edb_id} after {self.max_retries} attempts.")
228
+
229
+ def parse_cves_from_content(self, content: bytes) -> Set[str]:
230
+ return {match.group(0).decode("ascii").upper() for match in _CVE_PATTERN_BYTES.finditer(content)}
231
+
232
+ def write_json(self, file_path: Path | str, data: ExploitMap) -> None:
233
+ path = Path(file_path)
234
+ path.parent.mkdir(parents=True, exist_ok=True)
235
+ try:
236
+ with path.open("w", encoding="utf-8") as file_data:
237
+ json.dump(data, file_data, indent=2, sort_keys=True)
238
+ except OSError as exc:
239
+ raise PyExploitDbError(f"Unable to write {path}") from exc
240
+
241
+ def create_cve_to_exploit_map(self, data: Dict[str, Iterable[str]]) -> None:
242
+ mapping: ExploitMap = {}
243
+ for edb_id, cves in data.items():
244
+ if not edb_id:
245
+ continue
246
+ for cve in cves:
247
+ cve_key = str(cve).upper()
248
+ if not cve_key:
249
+ continue
250
+ mapping.setdefault(cve_key, []).append(str(edb_id))
251
+ for ids in mapping.values():
252
+ ids.sort()
253
+ self.cve_to_exploit_map = mapping
254
+ self._exploit_cache.clear()
255
+
256
+ def _fetch_missing_cves(self, missing_ids: Sequence[str], *, workers: Optional[int]) -> ExploitMap:
257
+ max_workers = workers or min(8, max(1, (os.cpu_count() or 4) // 2))
258
+ results: ExploitMap = {}
259
+
260
+ def task(edb_id: str) -> tuple[str, List[str]]:
261
+ with requests.Session() as session:
262
+ session.headers["User-Agent"] = self.USER_AGENT["User-Agent"]
263
+ try:
264
+ cves = sorted(self.fetch_cves_for_exploit(edb_id, session=session))
265
+ except PyExploitDbError as exc:
266
+ self.log_debug(f"Failed to hydrate CVEs for {edb_id}: {exc}")
267
+ return edb_id, []
268
+ return edb_id, cves
269
+
270
+ with ThreadPoolExecutor(max_workers=max_workers) as executor:
271
+ future_map = {executor.submit(task, edb_id): edb_id for edb_id in missing_ids}
272
+ for future in as_completed(future_map):
273
+ edb_id = future_map[future]
274
+ try:
275
+ resolved_id, cves = future.result()
276
+ except Exception as exc: # noqa: BLE001
277
+ self.log_debug(f"Unhandled exception while hydrating CVEs for {edb_id}: {exc}")
278
+ results[edb_id] = []
279
+ continue
280
+ results[resolved_id] = cves
281
+ return results
282
+
283
+ def _extract_cves_from_row(self, row: Sequence[str]) -> Set[str]:
284
+ cve_fields = [
285
+ row[11] if len(row) > 11 else "",
286
+ row[12] if len(row) > 12 else "",
287
+ row[13] if len(row) > 13 else "",
288
+ row[2] if len(row) > 2 else "",
289
+ ]
290
+ cves: Set[str] = set()
291
+ for field in cve_fields:
292
+ if not field:
293
+ continue
294
+ cves.update(match.group(0).upper() for match in _CVE_PATTERN.finditer(field))
295
+ return cves
296
+
297
+ def close(self) -> None:
298
+ if self._owns_session:
299
+ self._session.close()
300
+
301
+ def __enter__(self) -> "PyExploitDb":
302
+ return self
303
+
304
+ def __exit__(self, exc_type, exc_val, exc_tb) -> None:
305
+ self.close()
306
+
307
+ def _clone_repo(self) -> None:
308
+ self.log_debug("Cloning exploit-database repository...")
309
+ git.Repo.clone_from(self.EXPLOIT_DB_REPO, str(self.exploit_db_path))
310
+
311
+ def _ensure_exploit_cache(self) -> None:
312
+ if not self._exploit_cache:
313
+ self.load_exploit_csv()
314
+
315
+ def _set_cve_map(self, raw: object) -> None:
316
+ self.cve_to_exploit_map = self._normalise_cve_mapping(raw)
317
+
318
+ def _load_json_file(self, path: Path, encoding: str) -> object:
319
+ try:
320
+ with path.open(encoding=encoding) as file_data:
321
+ return json.load(file_data)
322
+ except FileNotFoundError as exc:
323
+ raise PyExploitDbError(f"Required JSON file not found: {path}") from exc
324
+ except json.JSONDecodeError as exc:
325
+ raise InvalidDataError(f"Corrupt JSON detected in {path}") from exc
326
+ except OSError as exc:
327
+ raise PyExploitDbError(f"Unable to read {path}") from exc
328
+
329
+ def _normalise_edbid_mapping(self, raw: object) -> ExploitMap:
330
+ if not isinstance(raw, dict):
331
+ raise InvalidDataError("Expected mapping of exploit IDs to CVE lists.")
332
+
333
+ result: ExploitMap = {}
334
+ for edb_id, cves in raw.items():
335
+ if not isinstance(edb_id, str):
336
+ self.log_debug(f"Skipping non-string exploit ID key {edb_id!r}")
337
+ continue
338
+ if not isinstance(cves, (list, tuple, set)):
339
+ self.log_debug(f"Skipping malformed CVE container for exploit {edb_id}")
340
+ continue
341
+ normalised = sorted({str(cve).upper() for cve in cves if str(cve).strip()})
342
+ if normalised:
343
+ result[edb_id] = normalised
344
+ return result
345
+
346
+ def _normalise_cve_mapping(self, raw: object) -> ExploitMap:
347
+ if not isinstance(raw, dict):
348
+ raise InvalidDataError("Expected mapping of CVE IDs to exploit lists.")
349
+
350
+ mapping: ExploitMap = {}
351
+ for cve, exploits in raw.items():
352
+ if not isinstance(cve, str):
353
+ continue
354
+ if not isinstance(exploits, (list, tuple, set)):
355
+ continue
356
+ cleaned = [str(edb).strip() for edb in exploits if str(edb).strip()]
357
+ if cleaned:
358
+ mapping[cve.upper()] = sorted(cleaned)
359
+ return mapping
360
+
361
+ def __del__(self) -> None:
362
+ self.close()
363
+
364
+
365
+ def logDebug(self, message: str) -> None:
366
+ warnings.warn("logDebug is deprecated; use log_debug instead.", DeprecationWarning, stacklevel=2)
367
+ self.log_debug(message)
368
+
369
+ def cloneOrUpdateRepo(self) -> None:
370
+ warnings.warn("cloneOrUpdateRepo is deprecated; use clone_or_update_repo instead.", DeprecationWarning, stacklevel=2)
371
+ self.clone_or_update_repo()
372
+
373
+ def pullLatestUpdates(self) -> None:
374
+ warnings.warn("pullLatestUpdates is deprecated; use pull_latest_updates instead.", DeprecationWarning, stacklevel=2)
375
+ self.pull_latest_updates()
376
+
377
+ def deleteAndRecloneRepo(self) -> None:
378
+ warnings.warn("deleteAndRecloneRepo is deprecated; use delete_and_reclone_repo instead.", DeprecationWarning, stacklevel=2)
379
+ self.delete_and_reclone_repo()
380
+
381
+ def openFile(self, exploitMap: str = "cveToEdbid.json", encoding: str = "utf-8") -> None:
382
+ warnings.warn("openFile is deprecated; use open_file instead.", DeprecationWarning, stacklevel=2)
383
+ self.open_file(exploit_map=exploitMap, encoding=encoding)
384
+
385
+ def getCveDetails(self, cveSearch: str) -> List[CveDetails]:
386
+ warnings.warn("getCveDetails is deprecated; use get_cve_details instead.", DeprecationWarning, stacklevel=2)
387
+ return self.get_cve_details(cveSearch)
388
+
389
+ def extractCveDetails(self, row: Sequence[str]) -> CveDetails:
390
+ warnings.warn("extractCveDetails is deprecated; use extract_cve_details instead.", DeprecationWarning, stacklevel=2)
391
+ return self.extract_cve_details(row)
392
+
393
+ def searchCve(self, cveSearch: str) -> List[CveDetails]:
394
+ warnings.warn("searchCve is deprecated; use search_cve instead.", DeprecationWarning, stacklevel=2)
395
+ return self.search_cve(cveSearch)
396
+
397
+ def updateDb(self, *, workers: Optional[int] = None) -> None:
398
+ warnings.warn("updateDb is deprecated; use update_db instead.", DeprecationWarning, stacklevel=2)
399
+ self.update_db(workers=workers)
400
+
401
+ def loadExistingData(self, file_path: Path | str) -> ExploitMap:
402
+ warnings.warn("loadExistingData is deprecated; use load_existing_data instead.", DeprecationWarning, stacklevel=2)
403
+ return self.load_existing_data(file_path)
404
+
405
+ def loadExploitCsv(self) -> List[List[str]]:
406
+ warnings.warn("loadExploitCsv is deprecated; use load_exploit_csv instead.", DeprecationWarning, stacklevel=2)
407
+ return self.load_exploit_csv()
408
+
409
+ def fetchCvesForExploit(self, edb_id: str) -> Set[str]:
410
+ warnings.warn(
411
+ "fetchCvesForExploit is deprecated; use fetch_cves_for_exploit instead.",
412
+ DeprecationWarning,
413
+ stacklevel=2,
414
+ )
415
+ return self.fetch_cves_for_exploit(edb_id)
416
+
417
+ def parseCvesFromContent(self, content: bytes) -> Set[str]:
418
+ warnings.warn(
419
+ "parseCvesFromContent is deprecated; use parse_cves_from_content instead.",
420
+ DeprecationWarning,
421
+ stacklevel=2,
422
+ )
423
+ return self.parse_cves_from_content(content)
424
+
425
+ def writeJson(self, file_path: Path | str, data: ExploitMap) -> None:
426
+ warnings.warn("writeJson is deprecated; use write_json instead.", DeprecationWarning, stacklevel=2)
427
+ self.write_json(file_path, data)
428
+
429
+ def createCveToExploitMap(self, data: Dict[str, Iterable[str]]) -> None:
430
+ warnings.warn(
431
+ "createCveToExploitMap is deprecated; use create_cve_to_exploit_map instead.",
432
+ DeprecationWarning,
433
+ stacklevel=2,
434
+ )
435
+ self.create_cve_to_exploit_map(data)
436
+
437
+
438
+ def test() -> None:
439
+ exploit_db = PyExploitDb()
440
+ exploit_db.debug = False
441
+ exploit_db.open_file()
442
+ results = exploit_db.search_cve("CVE-2018-14592")
443
+ print("PASS" if results else "FAIL")
444
+
445
+
446
+ if __name__ == "__main__":
447
+ test()
@@ -0,0 +1,110 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyexploitdb
3
+ Version: 0.3.1
4
+ Summary: An optimized Python3 library to fetch the most recent exploit-database,
5
+ Home-page: https://github.com/Hackman238/pyExploitDb
6
+ Author: Shane William Scott
7
+ Author-email: shane@shanewilliamscott.com
8
+ License: GPL-3.0-only
9
+ Project-URL: Source, https://github.com/Hackman238/pyExploitDb
10
+ Project-URL: Issue Tracker, https://github.com/Hackman238/pyExploitDb/issues
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Operating System :: OS Independent
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: GitPython>=3.1
23
+ Requires-Dist: requests>=2.28
24
+ Dynamic: author
25
+ Dynamic: author-email
26
+ Dynamic: classifier
27
+ Dynamic: description
28
+ Dynamic: description-content-type
29
+ Dynamic: home-page
30
+ Dynamic: license
31
+ Dynamic: license-file
32
+ Dynamic: project-url
33
+ Dynamic: requires-dist
34
+ Dynamic: requires-python
35
+ Dynamic: summary
36
+
37
+ ## NOTICE
38
+
39
+ This is the new home of "pyexploitdb".
40
+
41
+ ##
42
+
43
+ pyexploitdb (https://shanewilliamscott.com)
44
+ ==
45
+ [![Python package](https://github.com/Hackman238/pyExploitDb/actions/workflows/master.yml/badge.svg)](https://github.com/Hackman238/pyExploitDb/actions/workflows/master.yml)
46
+ [![Known Vulnerabilities](https://snyk.io/test/github/Hackman238/pyExploitDb/badge.svg?targetFile=requirements.txt)](https://snyk.io/test/github/Hackman238/pyExploitDb?targetFile=requirements.txt)
47
+
48
+
49
+ ## Authors:
50
+ Shane William Scott
51
+
52
+ ## About pyexploitdb
53
+ pyexploitdb builds and maintains local CVE↔EDB indexes from the official exploit-db repository with a focus on resilience and observability.
54
+
55
+ ### Highlights
56
+ - Validates on-disk caches and normalises mappings to keep indexes trustworthy.
57
+ - Rebuilds quickly by parsing `files_exploits.csv` first and only scraping missing CVEs with bounded concurrency.
58
+ - Ships with a practical smoke-test suite (`python -m tests.smoke_test`) so releases can be verified before publishing.
59
+
60
+ ## Upcoming features
61
+ > CPE database, indexes and mappings
62
+
63
+ ## Installation
64
+ pip install pyexploitdb
65
+ > Note: This assumes pip is for your python3 environment. Use pip3 if pip is for your python2 environment.
66
+
67
+ ## Example Usage
68
+ ```python
69
+ from pyexploitdb import PyExploitDb
70
+ exploit_db = PyExploitDb()
71
+ exploit_db.debug = False
72
+ exploit_db.open_file()
73
+ results = exploit_db.search_cve("CVE-2018-14592")
74
+ for exploit in results:
75
+ print(f"{exploit['id']} -> {exploit['file']}")
76
+ ```
77
+
78
+ `search_cve` returns a list of dictionaries (one per matching exploit). The library raises `pyexploitdb.PyExploitDbError` when required data is missing or network/git operations fail after retrying.
79
+
80
+ To rebuild the CVE caches from scratch without hammering exploit-db, metadata is extracted from `files_exploits.csv` first and any missing CVEs fall back to concurrent (throttled) scraping:
81
+
82
+ ```python
83
+ from pyexploitdb import PyExploitDb
84
+
85
+ with PyExploitDb() as exploit_db:
86
+ exploit_db.update_db(workers=6) # adjust workers to control parallel HTTP fetches
87
+ ```
88
+
89
+ ## Tests
90
+ Run the practical smoke tests before publishing to PyPI:
91
+
92
+ ```
93
+ python -m tests.smoke_test
94
+ ```
95
+
96
+ ## Example debug/verbose output
97
+ CVE-2018-1459
98
+ Found
99
+ Exploit DB Id: 45447
100
+ File: ./exploit-database/exploits/php/webapps/45447.txt
101
+ Date: 2018-09-24
102
+ Author: Haboob Team
103
+ Platform: webapps
104
+ Type: php
105
+ Port: 80
106
+ {'edbid': '45447', 'exploit': './exploit-database/exploits/php/webapps/45447.txt', 'date': '2018-09-24', 'author': 'Haboob Team', 'platform': 'webapps', 'type': 'php', 'port': '80'}
107
+
108
+ ## Credits
109
+ Based on fork from https://github.com/GoVanguard/pyExploitDb by Shane Scott.
110
+ Originally based on fork of cve_searchsploit by Andrea Fioraldi.
@@ -0,0 +1,14 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ setup.cfg
5
+ setup.py
6
+ pyexploitdb/__init__.py
7
+ pyexploitdb/cveToEdbid.json
8
+ pyexploitdb/edbidToCve.json
9
+ pyexploitdb.egg-info/PKG-INFO
10
+ pyexploitdb.egg-info/SOURCES.txt
11
+ pyexploitdb.egg-info/dependency_links.txt
12
+ pyexploitdb.egg-info/not-zip-safe
13
+ pyexploitdb.egg-info/requires.txt
14
+ pyexploitdb.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ GitPython>=3.1
2
+ requests>=2.28
@@ -0,0 +1 @@
1
+ pyexploitdb
@@ -0,0 +1,3 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61", "wheel"]
3
+ build-backend = "setuptools.build_meta"
@@ -0,0 +1,40 @@
1
+ from pathlib import Path
2
+ from setuptools import find_packages, setup
3
+
4
+ README_PATH = Path(__file__).parent / "README.md"
5
+
6
+ with README_PATH.open(encoding="utf-8") as fh:
7
+ long_description = fh.read()
8
+
9
+ setup(
10
+ name="pyexploitdb",
11
+ version="0.3.1",
12
+ author="Shane William Scott",
13
+ author_email="shane@shanewilliamscott.com",
14
+ description="""An optimized Python3 library to fetch the most recent exploit-database,
15
+ create searchable indexes for CVE->EDBID and EDBID -> CVE, and provide
16
+ methods to perform searches.""",
17
+ long_description=long_description,
18
+ long_description_content_type="text/markdown",
19
+ url="https://github.com/Hackman238/pyExploitDb",
20
+ project_urls={
21
+ "Source": "https://github.com/Hackman238/pyExploitDb",
22
+ "Issue Tracker": "https://github.com/Hackman238/pyExploitDb/issues",
23
+ },
24
+ license="GPL-3.0-only",
25
+ packages=find_packages(exclude=("tests", "tests.*")),
26
+ package_data={"pyexploitdb": ["*.json"]},
27
+ install_requires=["GitPython>=3.1", "requests>=2.28"],
28
+ python_requires=">=3.10",
29
+ zip_safe=False,
30
+ classifiers=(
31
+ "Development Status :: 5 - Production/Stable",
32
+ "Intended Audience :: Developers",
33
+ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
34
+ "Programming Language :: Python :: 3 :: Only",
35
+ "Programming Language :: Python :: 3.10",
36
+ "Programming Language :: Python :: 3.11",
37
+ "Programming Language :: Python :: 3.12",
38
+ "Operating System :: OS Independent",
39
+ ),
40
+ )
@@ -1,71 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: pyExploitDb
3
- Version: 0.2.102
4
- Summary: An optimized Python3 library to fetch the most recent exploit-database,
5
- Home-page: https://github.com/Hackman238/pyExploitDb
6
- Author: Shane William Scott
7
- Author-email: gs@shanewilliamscott.com
8
- Classifier: Development Status :: 5 - Production/Stable
9
- Classifier: Intended Audience :: Developers
10
- Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
11
- Classifier: Programming Language :: Python :: 3.6
12
- Classifier: Programming Language :: Python :: 3.7
13
- Classifier: Programming Language :: Python :: 3.8
14
- Classifier: Programming Language :: Python :: 3.9
15
- Classifier: Programming Language :: Python :: 3.10
16
- Classifier: Programming Language :: Python :: 3.11
17
- Classifier: Operating System :: OS Independent
18
- Description-Content-Type: text/markdown
19
- License-File: LICENSE
20
-
21
- ## NOTICE
22
-
23
- This is the new home of "pyExploidDb".
24
-
25
- ##
26
-
27
- pyExploitDb (https://shanewilliamscott.com)
28
- ==
29
- [![Python package](https://github.com/Hackman238/pyExploitDb/actions/workflows/master.yml/badge.svg)](https://github.com/Hackman238/pyExploitDb/actions/workflows/master.yml)
30
- [![Known Vulnerabilities](https://snyk.io/test/github/Hackman238/pyExploitDb/badge.svg?targetFile=requirements.txt)](https://snyk.io/test/github/Hackman238/pyExploitDb?targetFile=requirements.txt)
31
- [![Maintainability](https://api.codeclimate.com/v1/badges/a11151ec3314f93a777f/maintainability)](https://codeclimate.com/github/Hackman238/pyExploitDb/maintainability)
32
-
33
-
34
- ## Authors:
35
- Shane William Scott
36
-
37
- ## About pyExploitDb
38
- An optimized Python3 library to fetch the most recent exploit-database, create searchable indexes for CVE->EDBID and EDBID -> CVE, and provide methods to perform searches.
39
-
40
- ## Upcoming features
41
- > CPE database, indexes and mappings
42
-
43
- ## Installation
44
- pip install pyExploitDb
45
- > Note: This assumes pip is for your python3 environment. Use pip3 if pip is for your python2 environment.
46
-
47
- ## Example Usage
48
- ```python
49
- from pyExploitDb import PyExploitDb
50
- pEdb = PyExploitDb()
51
- pEdb.debug = False
52
- pEdb.openFile()
53
- results = pEdb.searchCve("CVE-2018-14592")
54
- print(results)
55
- ```
56
-
57
- ## Example debug/verbose output
58
- CVE-2018-1459
59
- Found
60
- Exploit DB Id: 45447
61
- File: ./exploit-database/exploits/php/webapps/45447.txt
62
- Date: 2018-09-24
63
- Author: Haboob Team
64
- Platform: webapps
65
- Type: php
66
- Port: 80
67
- {'edbid': '45447', 'exploit': './exploit-database/exploits/php/webapps/45447.txt', 'date': '2018-09-24', 'author': 'Haboob Team', 'platform': 'webapps', 'type': 'php', 'port': '80'}
68
-
69
- ## Credits
70
- Based on fork from https://github.com/GoVanguard/pyExploitDb by Shane Scott.
71
- Originally based on fork of cve_searchsploit by Andrea Fioraldi.
@@ -1,51 +0,0 @@
1
- ## NOTICE
2
-
3
- This is the new home of "pyExploidDb".
4
-
5
- ##
6
-
7
- pyExploitDb (https://shanewilliamscott.com)
8
- ==
9
- [![Python package](https://github.com/Hackman238/pyExploitDb/actions/workflows/master.yml/badge.svg)](https://github.com/Hackman238/pyExploitDb/actions/workflows/master.yml)
10
- [![Known Vulnerabilities](https://snyk.io/test/github/Hackman238/pyExploitDb/badge.svg?targetFile=requirements.txt)](https://snyk.io/test/github/Hackman238/pyExploitDb?targetFile=requirements.txt)
11
- [![Maintainability](https://api.codeclimate.com/v1/badges/a11151ec3314f93a777f/maintainability)](https://codeclimate.com/github/Hackman238/pyExploitDb/maintainability)
12
-
13
-
14
- ## Authors:
15
- Shane William Scott
16
-
17
- ## About pyExploitDb
18
- An optimized Python3 library to fetch the most recent exploit-database, create searchable indexes for CVE->EDBID and EDBID -> CVE, and provide methods to perform searches.
19
-
20
- ## Upcoming features
21
- > CPE database, indexes and mappings
22
-
23
- ## Installation
24
- pip install pyExploitDb
25
- > Note: This assumes pip is for your python3 environment. Use pip3 if pip is for your python2 environment.
26
-
27
- ## Example Usage
28
- ```python
29
- from pyExploitDb import PyExploitDb
30
- pEdb = PyExploitDb()
31
- pEdb.debug = False
32
- pEdb.openFile()
33
- results = pEdb.searchCve("CVE-2018-14592")
34
- print(results)
35
- ```
36
-
37
- ## Example debug/verbose output
38
- CVE-2018-1459
39
- Found
40
- Exploit DB Id: 45447
41
- File: ./exploit-database/exploits/php/webapps/45447.txt
42
- Date: 2018-09-24
43
- Author: Haboob Team
44
- Platform: webapps
45
- Type: php
46
- Port: 80
47
- {'edbid': '45447', 'exploit': './exploit-database/exploits/php/webapps/45447.txt', 'date': '2018-09-24', 'author': 'Haboob Team', 'platform': 'webapps', 'type': 'php', 'port': '80'}
48
-
49
- ## Credits
50
- Based on fork from https://github.com/GoVanguard/pyExploitDb by Shane Scott.
51
- Originally based on fork of cve_searchsploit by Andrea Fioraldi.
@@ -1,153 +0,0 @@
1
- import os
2
- import json
3
- import csv
4
- import requests
5
- import time
6
- import git
7
- import re
8
-
9
- class PyExploitDb:
10
- EXPLOIT_DB_REPO = "https://gitlab.com/exploit-database/exploitdb.git"
11
- USER_AGENT = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) Chrome/39.0 Safari/537.36'}
12
-
13
- def __init__(self):
14
- self.cveToExploitMap = {}
15
- self.currentPath = os.path.dirname(os.path.abspath(__file__))
16
- self.edbidToCveFile = os.path.join(self.currentPath, "edbidToCve.json")
17
- self.cveToEdbidFile = os.path.join(self.currentPath, "cveToEdbid.json")
18
- self.exploitDbPath = os.path.join(self.currentPath, "exploit-database")
19
- self.requestCoolOffTime = 1
20
- self.debug = False
21
-
22
- def logDebug(self, message):
23
- if self.debug:
24
- print(message)
25
-
26
- def cloneOrUpdateRepo(self):
27
- if not os.path.isdir(self.exploitDbPath):
28
- self.logDebug("Cloning exploit-database repository")
29
- git.Repo.clone_from(self.EXPLOIT_DB_REPO, self.exploitDbPath)
30
- else:
31
- self.pullLatestUpdates()
32
-
33
- def pullLatestUpdates(self):
34
- try:
35
- self.logDebug("Pulling exploit-database updates...")
36
- git.Git(self.exploitDbPath).pull('origin', 'main')
37
- except git.exc.GitCommandError:
38
- self.logDebug("Repo broken, re-cloning...")
39
- self.deleteAndRecloneRepo()
40
-
41
- def deleteAndRecloneRepo(self):
42
- os.rmdir(self.exploitDbPath)
43
- git.Repo.clone_from(self.EXPLOIT_DB_REPO, self.exploitDbPath)
44
-
45
- def openFile(self, exploitMap="cveToEdbid.json", encoding="utf-8"):
46
- self.cloneOrUpdateRepo()
47
- with open(os.path.join(self.currentPath, exploitMap), encoding=encoding) as fileData:
48
- self.cveToExploitMap = json.load(fileData)
49
- self.logDebug(self.cveToExploitMap)
50
-
51
- def getCveDetails(self, cveSearch):
52
- with open(os.path.join(self.exploitDbPath, "files_exploits.csv"), encoding="utf-8") as file:
53
- reader = csv.reader(file)
54
- next(reader)
55
- for row in reader:
56
- if row[0] in self.cveToExploitMap.get(cveSearch, []):
57
- return self.extractCveDetails(row)
58
- self.logDebug("ERROR - No EDB Id found")
59
- return {}
60
-
61
- def extractCveDetails(self, row):
62
- details = {
63
- 'id': row[0],
64
- 'file': row[1],
65
- 'description': row[2],
66
- 'date': row[3],
67
- 'author': row[4],
68
- 'type': row[5],
69
- 'platform': row[6],
70
- 'port': row[7],
71
- 'date_updated': row[9],
72
- 'verified': row[10],
73
- 'codes': row[11],
74
- 'tags': row[12],
75
- 'aliases': row[13],
76
- 'app_url': row[14],
77
- 'src_url': row[15],
78
- }
79
- self.logDebug(f"CVE Details: {details}")
80
- return details
81
-
82
- def searchCve(self, cveSearch):
83
- if not cveSearch:
84
- return []
85
- cveSearch = cveSearch.upper()
86
- self.logDebug(f"Searching for CVE: {cveSearch}")
87
- if cveSearch in self.cveToExploitMap:
88
- return self.getCveDetails(cveSearch)
89
- return []
90
-
91
- def updateDb(self):
92
- data = self.loadExistingData(self.edbidToCveFile)
93
- exploits = self.loadExploitCsv()
94
-
95
- for i, row in enumerate(exploits):
96
- edb_id = row[0]
97
- if edb_id not in data:
98
- data[edb_id] = self.fetchCvesForExploit(edb_id)
99
-
100
- self.writeJson(self.edbidToCveFile, data)
101
- self.createCveToExploitMap(data)
102
- self.writeJson(self.cveToEdbidFile, self.cveToExploitMap)
103
-
104
- def loadExistingData(self, file_path):
105
- if os.path.exists(file_path):
106
- with open(file_path, encoding="utf-8") as fileData:
107
- try:
108
- return json.load(fileData)
109
- except json.JSONDecodeError:
110
- self.logDebug(f"Corrupt file detected at {file_path}, recreating...")
111
- return {}
112
-
113
- def loadExploitCsv(self):
114
- with open(os.path.join(self.exploitDbPath, "files_exploits.csv"), encoding="utf-8") as file:
115
- reader = csv.reader(file)
116
- next(reader)
117
- return list(reader)
118
-
119
- def fetchCvesForExploit(self, edb_id):
120
- requestUri = f"https://www.exploit-db.com/exploits/{edb_id}"
121
- self.logDebug(f"Requesting {requestUri}")
122
- while True:
123
- try:
124
- response = requests.get(requestUri, headers=self.USER_AGENT, timeout=10)
125
- return self.parseCvesFromContent(response.content)
126
- except requests.RequestException as e:
127
- self.logDebug(f"Request error: {e}, retrying after cool-off")
128
- time.sleep(self.requestCoolOffTime)
129
-
130
- def parseCvesFromContent(self, content):
131
- indexes = [m.start() for m in re.finditer('https://nvd.nist.gov/vuln/detail/CVE-', content)]
132
- return {content[pos + 33: pos + 47].decode("ISO-8859-1").strip() for pos in indexes}
133
-
134
- def writeJson(self, file_path, data):
135
- with open(file_path, "w", encoding="utf-8") as fileData:
136
- json.dump(data, fileData, indent=2)
137
-
138
- def createCveToExploitMap(self, data):
139
- for edb_id, cves in data.items():
140
- for cve in cves:
141
- if cve not in self.cveToExploitMap:
142
- self.cveToExploitMap[cve] = []
143
- self.cveToExploitMap[cve].append(edb_id)
144
-
145
- def test():
146
- pEdb = PyExploitDb()
147
- pEdb.debug = False
148
- pEdb.openFile()
149
- results = pEdb.searchCve("CVE-2018-14592")
150
- print('PASS' if results else 'FAIL')
151
-
152
- if __name__ == "__main__":
153
- test()
@@ -1,71 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: pyExploitDb
3
- Version: 0.2.102
4
- Summary: An optimized Python3 library to fetch the most recent exploit-database,
5
- Home-page: https://github.com/Hackman238/pyExploitDb
6
- Author: Shane William Scott
7
- Author-email: gs@shanewilliamscott.com
8
- Classifier: Development Status :: 5 - Production/Stable
9
- Classifier: Intended Audience :: Developers
10
- Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
11
- Classifier: Programming Language :: Python :: 3.6
12
- Classifier: Programming Language :: Python :: 3.7
13
- Classifier: Programming Language :: Python :: 3.8
14
- Classifier: Programming Language :: Python :: 3.9
15
- Classifier: Programming Language :: Python :: 3.10
16
- Classifier: Programming Language :: Python :: 3.11
17
- Classifier: Operating System :: OS Independent
18
- Description-Content-Type: text/markdown
19
- License-File: LICENSE
20
-
21
- ## NOTICE
22
-
23
- This is the new home of "pyExploidDb".
24
-
25
- ##
26
-
27
- pyExploitDb (https://shanewilliamscott.com)
28
- ==
29
- [![Python package](https://github.com/Hackman238/pyExploitDb/actions/workflows/master.yml/badge.svg)](https://github.com/Hackman238/pyExploitDb/actions/workflows/master.yml)
30
- [![Known Vulnerabilities](https://snyk.io/test/github/Hackman238/pyExploitDb/badge.svg?targetFile=requirements.txt)](https://snyk.io/test/github/Hackman238/pyExploitDb?targetFile=requirements.txt)
31
- [![Maintainability](https://api.codeclimate.com/v1/badges/a11151ec3314f93a777f/maintainability)](https://codeclimate.com/github/Hackman238/pyExploitDb/maintainability)
32
-
33
-
34
- ## Authors:
35
- Shane William Scott
36
-
37
- ## About pyExploitDb
38
- An optimized Python3 library to fetch the most recent exploit-database, create searchable indexes for CVE->EDBID and EDBID -> CVE, and provide methods to perform searches.
39
-
40
- ## Upcoming features
41
- > CPE database, indexes and mappings
42
-
43
- ## Installation
44
- pip install pyExploitDb
45
- > Note: This assumes pip is for your python3 environment. Use pip3 if pip is for your python2 environment.
46
-
47
- ## Example Usage
48
- ```python
49
- from pyExploitDb import PyExploitDb
50
- pEdb = PyExploitDb()
51
- pEdb.debug = False
52
- pEdb.openFile()
53
- results = pEdb.searchCve("CVE-2018-14592")
54
- print(results)
55
- ```
56
-
57
- ## Example debug/verbose output
58
- CVE-2018-1459
59
- Found
60
- Exploit DB Id: 45447
61
- File: ./exploit-database/exploits/php/webapps/45447.txt
62
- Date: 2018-09-24
63
- Author: Haboob Team
64
- Platform: webapps
65
- Type: php
66
- Port: 80
67
- {'edbid': '45447', 'exploit': './exploit-database/exploits/php/webapps/45447.txt', 'date': '2018-09-24', 'author': 'Haboob Team', 'platform': 'webapps', 'type': 'php', 'port': '80'}
68
-
69
- ## Credits
70
- Based on fork from https://github.com/GoVanguard/pyExploitDb by Shane Scott.
71
- Originally based on fork of cve_searchsploit by Andrea Fioraldi.
@@ -1,12 +0,0 @@
1
- LICENSE
2
- README.md
3
- setup.cfg
4
- setup.py
5
- pyExploitDb/__init__.py
6
- pyExploitDb/cveToEdbid.json
7
- pyExploitDb/edbidToCve.json
8
- pyExploitDb.egg-info/PKG-INFO
9
- pyExploitDb.egg-info/SOURCES.txt
10
- pyExploitDb.egg-info/dependency_links.txt
11
- pyExploitDb.egg-info/requires.txt
12
- pyExploitDb.egg-info/top_level.txt
@@ -1,2 +0,0 @@
1
- GitPython
2
- requests
@@ -1 +0,0 @@
1
- pyExploitDb
@@ -1,32 +0,0 @@
1
- import setuptools
2
-
3
- with open("README.md", "r") as fh:
4
- long_description = fh.read()
5
-
6
- setuptools.setup(
7
- name="pyExploitDb",
8
- version="0.2.102",
9
- author="Shane William Scott",
10
- author_email="gs@shanewilliamscott.com",
11
- description="""An optimized Python3 library to fetch the most recent exploit-database,
12
- create searchable indexes for CVE->EDBID and EDBID -> CVE, and provide
13
- methods to perform searches.""",
14
- long_description=long_description,
15
- long_description_content_type="text/markdown",
16
- url="https://github.com/Hackman238/pyExploitDb",
17
- packages=['pyExploitDb'],
18
- package_data={'pyExploitDb': ['cveToEdbid.json', 'edbidToCve.json', 'pyExploitDb/*.json']},
19
- install_requires=['GitPython', 'requests'],
20
- classifiers=(
21
- 'Development Status :: 5 - Production/Stable',
22
- 'Intended Audience :: Developers',
23
- 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
24
- 'Programming Language :: Python :: 3.6',
25
- 'Programming Language :: Python :: 3.7',
26
- 'Programming Language :: Python :: 3.8',
27
- 'Programming Language :: Python :: 3.9',
28
- 'Programming Language :: Python :: 3.10',
29
- 'Programming Language :: Python :: 3.11',
30
- 'Operating System :: OS Independent',
31
- ),
32
- )
File without changes
File without changes