(self, options: str)
| 132 | @throw ExtensionException if the extension couldn't be loaded properly. |
| 133 | """ |
| 134 | def __loadext(self, options: str): |
| 135 | try: |
| 136 | modulePath = Path(options) |
| 137 | spec = importlib.util.spec_from_file_location( |
| 138 | modulePath.stem, |
| 139 | modulePath.resolve()) |
| 140 | module = importlib.util.module_from_spec(spec) |
| 141 | spec.loader.exec_module(module) |
| 142 | for name, obj in inspect.getmembers(module): |
| 143 | if (inspect.isclass(obj) and |
| 144 | issubclass(obj, ExploitProcessor) and |
| 145 | name != "ExploitProcessor"): |
| 146 | for exploit in self.exploitClasses: |
| 147 | if exploit.get_name() == obj.get_name(): |
| 148 | raise ExtensionException( |
| 149 | "Already loaded extension of same type.") |
| 150 | self.exploitClasses.append(obj) |
| 151 | except (CommandException, ExtensionException) as e: |
| 152 | raise e |
| 153 | except Exception: |
| 154 | raise ExtensionException("Couldn't load extension, check the path.") |
| 155 | pass |
| 156 | |
| 157 | def __botnet(self, options: str): |
| 158 | print("Switching to botnet mode...") |
nothing calls this directly
no test coverage detected