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)
| 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 = [] |
no test coverage detected