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

Method run

modules/osint/tech_detect.py:45–82  ·  view source on GitHub ↗

Detect technologies used by target.

(self, target: Target)

Source from the content-addressed store, hash-verified

43
44 async def run(self, target: Target) -> ScanResult:
45 """Detect technologies used by target."""
46 result = self.create_result(target)
47 url = self._build_url(target)
48 self.logger.info(f"Detecting technologies for {url}")
49
50 try:
51 async with HTTPClient() as client:
52 response = await client.get(url)
53 headers = {k.lower(): v for k, v in response.headers.items()}
54 body = response.text
55 cookies = [c.name for c in response.cookies.jar]
56
57 result.raw_data["url"] = str(response.url)
58 result.raw_data["status_code"] = response.status_code
59
60 detected = []
61
62 for tech, sigs in self.SIGNATURES.items():
63 if self._check_signatures(sigs, headers, body, cookies):
64 detected.append(tech)
65
66 result.raw_data["technologies"] = detected
67
68 if detected:
69 result.add_finding(
70 title="Technologies Detected",
71 description=f"Identified {len(detected)} technology/technologies",
72 severity=Severity.INFO,
73 data={"technologies": detected},
74 )
75
76 except Exception as e:
77 result.errors.append(f"Failed to detect technologies: {str(e)}")
78 result.success = False
79
80 result.complete()
81 return result
82
83 def _check_signatures(self, sigs: dict, headers: dict, body: str, cookies: list) -> bool:
84 if "headers" in sigs:
85 for header, pattern in sigs["headers"].items():

Callers 1

osint_techFunction · 0.95

Calls 7

_build_urlMethod · 0.95
_check_signaturesMethod · 0.95
HTTPClientClass · 0.90
add_findingMethod · 0.80
completeMethod · 0.80
create_resultMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected