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

Method __load

src/BotnetCommandProcessor.py:148–170  ·  view source on GitHub ↗
(self, options: str)

Source from the content-addressed store, hash-verified

146 @throw CommandException if the file couldn't be targets couldn't be loaded.
147 """
148 def __load(self, options: str):
149 if len(options) == 0:
150 raise CommandException("No path given.")
151 path = Path(options)
152 if path.exists() and path.is_file():
153 try:
154 data = json.load(open(path))
155 for target in data["targets"]:
156 try:
157 print(f"{target['name']}: ")
158 self.__add((f"{target['name']} "
159 f"{target['host']} "
160 f"{target['path']} "
161 f"{target['type']} "
162 f"{target['method']} "
163 f"{target['header']}"))
164 print("-" * 80)
165 except CommandException as e:
166 print(str(e))
167 except:
168 raise CommandException("Could not parse file.")
169 else:
170 raise CommandException("File does not exist.")
171
172 """
173 @brief Exports targets as JSON onto disk with timestamp.

Callers

nothing calls this directly

Calls 2

__addMethod · 0.95
CommandExceptionClass · 0.85

Tested by

no test coverage detected