Agent: Add "error_message" to ExploiterResultData

This commit is contained in:
Mike Salvatore 2021-12-14 12:18:50 -05:00
parent eb7612d80d
commit 1e02286b2a
2 changed files with 9 additions and 3 deletions

View File

@ -16,7 +16,9 @@ class UnknownPluginError(Exception):
pass
ExploiterResultData = namedtuple("ExploiterResultData", ["success", "info", "attempts"])
ExploiterResultData = namedtuple(
"ExploiterResultData", ["success", "info", "attempts", "error_message"]
)
PingScanData = namedtuple("PingScanData", ["response_received", "os"])
PortScanData = namedtuple("PortScanData", ["port", "status", "banner", "service"])
FingerprintData = namedtuple("FingerprintData", ["os_type", "os_version", "services"])

View File

@ -280,8 +280,12 @@ class MockPuppet(IPuppet):
"executed_cmds": [],
}
successful_exploiters = {
DOT_1: {"PowerShellExploiter": ExploiterResultData(True, info_powershell, attempts)},
DOT_3: {"SSHExploiter": ExploiterResultData(False, info_ssh, attempts)},
DOT_1: {
"PowerShellExploiter": ExploiterResultData(True, info_powershell, attempts, None)
},
DOT_3: {
"SSHExploiter": ExploiterResultData(False, info_ssh, attempts, "Failed exploiting")
},
}
return successful_exploiters[host][name]