MCPcopy Create free account
hub / github.com/TheSecuredAnalyst/security-suite / search

Method search

modules/exploit/searchsploit.py:19–58  ·  view source on GitHub ↗

Search for exploits matching query.

(
        self,
        query: str,
        exact_match: bool = False,
        exclude_dos: bool = True,
    )

Source from the content-addressed store, hash-verified

17
18 async def search(
19 self,
20 query: str,
21 exact_match: bool = False,
22 exclude_dos: bool = True,
23 ) -> list[dict]:
24 """Search for exploits matching query."""
25 if not self.searchsploit_available:
26 self.logger.warning("searchsploit not found. Install exploitdb package.")
27 return []
28
29 cmd = ["searchsploit", "--json"]
30
31 if exact_match:
32 cmd.append("--exact")
33
34 if exclude_dos:
35 cmd.append("--exclude=dos")
36
37 cmd.append(query)
38
39 try:
40 proc = await asyncio.create_subprocess_exec(
41 *cmd,
42 stdout=asyncio.subprocess.PIPE,
43 stderr=asyncio.subprocess.PIPE,
44 )
45
46 stdout, stderr = await proc.communicate()
47
48 if stdout:
49 data = json.loads(stdout.decode())
50 return data.get("RESULTS_EXPLOIT", [])
51
52 except json.JSONDecodeError:
53 self.logger.error("Failed to parse searchsploit output")
54 except Exception as e:
55 self.logger.error(f"searchsploit failed: {e}")
56
57 return []
58
59 async def search_for_service(
60 self,
61 service: str,

Callers 12

search_for_serviceMethod · 0.95
exploit_searchFunction · 0.95
_find_patternsFunction · 0.45
_check_signaturesMethod · 0.45
_check_reflectionMethod · 0.45
_check_sql_errorsMethod · 0.45
_extract_jsonMethod · 0.45
_has_id_parameterMethod · 0.45
_test_injectionMethod · 0.45
_phase_threat_huntMethod · 0.45
validate_scriptMethod · 0.45

Calls 1

getMethod · 0.45

Tested by 3

_has_id_parameterMethod · 0.36
_test_injectionMethod · 0.36