MCPcopy
hub / github.com/Pennyw0rth/NetExec / get_error_string

Method get_error_string

nxc/modules/notepad.py:185–196  ·  view source on GitHub ↗
(self, exception)

Source from the content-addressed store, hash-verified

183 context.log.info("No Notepad tab state files with meaningful content found")
184
185 def get_error_string(self, exception):
186 if hasattr(exception, "getErrorString"):
187 try:
188 es = exception.getErrorString()
189 except KeyError:
190 return f"Could not get nt error code {exception.getErrorCode()} from impacket: {exception}"
191 if type(es) is tuple:
192 return es[0]
193 else:
194 return es
195 else:
196 return str(exception)

Callers 1

on_admin_loginMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected