MCPcopy Create free account
hub / github.com/blacklanternsecurity/bbot / do_mining

Method do_mining

bbot/modules/paramminer_headers.py:112–132  ·  view source on GitHub ↗
(self, wl, url, batch_size, compare_helper)

Source from the content-addressed store, hash-verified

110 return self.helpers.rand_string(*args, **kwargs)
111
112 async def do_mining(self, wl, url, batch_size, compare_helper):
113 for i in wl:
114 if i not in self.wl:
115 h = hash(i + url)
116 self.already_checked.add(h)
117
118 results = set()
119 abort_threshold = 15
120 try:
121 for group in self.helpers.grouper(wl, batch_size):
122 async for result, reasons, reflection in self.binary_search(compare_helper, url, group):
123 results.add((result, ",".join(reasons), reflection))
124 if len(results) >= abort_threshold:
125 self.warning(
126 f"Abort threshold ({abort_threshold}) reached, too many {self.compare_mode}s found for url: {url}"
127 )
128 results.clear()
129 assert False
130 except AssertionError:
131 pass
132 return results
133
134 async def process_results(self, event, results):
135 url = event.data.get("url")

Callers 2

handle_eventMethod · 0.95
finishMethod · 0.95

Calls 5

binary_searchMethod · 0.95
setFunction · 0.85
clearMethod · 0.80
addMethod · 0.45
warningMethod · 0.45

Tested by

no test coverage detected