MCPcopy
hub / github.com/s0md3v/XSStrike / scan

Function scan

plugins/retireJs.py:18–33  ·  view source on GitHub ↗
(data, extractor, definitions, matcher=None)

Source from the content-addressed store, hash-verified

16
17
18def scan(data, extractor, definitions, matcher=None):
19 matcher = matcher or _simple_match
20 detected = []
21 for component in definitions:
22 extractors = definitions[component].get(
23 "extractors", None).get(
24 extractor, None)
25 if (not is_defined(extractors)):
26 continue
27 for i in extractors:
28 match = matcher(i, data)
29 if (match):
30 detected.append({"version": match,
31 "component": component,
32 "detection": extractor})
33 return detected
34
35
36def _simple_match(regex, data):

Callers 3

scan_uriFunction · 0.70
scan_filenameFunction · 0.70
scan_file_contentFunction · 0.70

Calls 1

is_definedFunction · 0.85

Tested by

no test coverage detected