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

Method preload_module

bbot/core/modules.py:277–477  ·  view source on GitHub ↗

Preloads a BBOT module to gather its meta-information and dependencies. This function reads a BBOT module file, extracts its attributes such as events watched and produced, flags, meta-information, and dependencies. Args: module_file (str): Path to the

(self, module_file)

Source from the content-addressed store, hash-verified

275 return self._preloaded[module]["type"] == type
276
277 def preload_module(self, module_file):
278 """
279 Preloads a BBOT module to gather its meta-information and dependencies.
280
281 This function reads a BBOT module file, extracts its attributes such as
282 events watched and produced, flags, meta-information, and dependencies.
283
284 Args:
285 module_file (str): Path to the BBOT module file.
286
287 Returns:
288 dict: A dictionary containing meta-information and dependencies for the module.
289
290 Examples:
291 >>> preload_module("bbot/modules/wappalyzer.py")
292 {
293 "watched_events": [
294 "HTTP_RESPONSE"
295 ],
296 "produced_events": [
297 "TECHNOLOGY"
298 ],
299 "flags": [
300 "active",
301 "safe",
302 "web-basic",
303 "web-thorough"
304 ],
305 "meta": {
306 "description": "Extract technologies from web responses"
307 },
308 "config": {},
309 "options_desc": {},
310 "hash": "d5a88dd3866c876b81939c920bf4959716e2a374",
311 "deps": {
312 "modules": [
313 "httpx"
314 ]
315 "pip": [
316 "python-Wappalyzer~=0.3.1"
317 ],
318 "pip_constraints": [],
319 "shell": [],
320 "apt": [],
321 "ansible": []
322 },
323 "sudo": false
324 }
325 """
326 watched_events = set()
327 produced_events = set()
328 flags = set()
329 meta = {}
330 deps_modules = set()
331 deps_pip = []
332 deps_pip_constraints = []
333 deps_shell = []
334 deps_apt = []

Callers 1

preloadMethod · 0.95

Calls 12

BBOTErrorClass · 0.90
setFunction · 0.85
openFunction · 0.85
sha1Function · 0.85
os_platformFunction · 0.85
search_dict_by_keyFunction · 0.85
parseMethod · 0.45
debugMethod · 0.45
updateMethod · 0.45
addMethod · 0.45
getMethod · 0.45
resolveMethod · 0.45

Tested by

no test coverage detected