MCPcopy Create free account
hub / github.com/Geeoon/asploit / __loadext

Method __loadext

src/LocalCommandProcessor.py:134–155  ·  view source on GitHub ↗
(self, options: str)

Source from the content-addressed store, hash-verified

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...")

Callers

nothing calls this directly

Calls 2

ExtensionExceptionClass · 0.85
get_nameMethod · 0.45

Tested by

no test coverage detected