Agent: Rename variables to make more sense

This commit is contained in:
Shreya Malviya 2022-02-21 14:50:33 +05:30
parent a9e000f100
commit 125412ee18
4 changed files with 14 additions and 12 deletions

View File

@ -18,7 +18,7 @@ class UnknownPluginError(Exception):
ExploiterResultData = namedtuple(
"ExploiterResultData",
["exploit_success", "propagation_success", "os", "info", "attempts", "error_message"],
["exploitation_success", "propagation_success", "os", "info", "attempts", "error_message"],
)
PingScanData = namedtuple("PingScanData", ["response_received", "os"])
PortScanData = namedtuple("PortScanData", ["port", "status", "banner", "service"])

View File

@ -102,7 +102,7 @@ class MockMaster(IMaster):
def _exploit(self):
logger.info("Exploiting victims")
(
exploit_result,
exploitation_result,
propagation_result,
os,
info,
@ -114,7 +114,7 @@ class MockMaster(IMaster):
ExploitTelem(
"PowerShellExploiter",
self._hosts["10.0.0.1"],
exploit_result,
exploitation_result,
propagation_result,
info,
attempts,
@ -122,7 +122,7 @@ class MockMaster(IMaster):
)
(
exploit_result,
exploitation_result,
propagation_result,
os,
info,
@ -134,7 +134,7 @@ class MockMaster(IMaster):
ExploitTelem(
"SSHExploiter",
self._hosts["10.0.0.3"],
exploit_result,
exploitation_result,
propagation_result,
info,
attempts,

View File

@ -155,7 +155,7 @@ class Propagator:
):
if result.propagation_success:
logger.info(f"Successfully propagated to {host} using {exploiter_name}")
elif result.exploit_success:
elif result.exploitation_success:
logger.info(
f"Successfully exploited (but did not propagate to) {host} using {exploiter_name}"
)
@ -169,7 +169,7 @@ class Propagator:
ExploitTelem(
exploiter_name,
host,
result.exploit_success,
result.exploitation_success,
result.propagation_success,
result.info,
result.attempts,

View File

@ -10,7 +10,7 @@ class ExploitTelem(BaseTelem):
self,
name: str,
host: VictimHost,
exploit_result: bool,
exploitation_result: bool,
propagation_result: bool,
info: Dict,
attempts: List,
@ -19,8 +19,10 @@ class ExploitTelem(BaseTelem):
Default exploit telemetry constructor
:param name: The name of exploiter used
:param host: The host machine
:param exploit_result: The result of exploitation from the 'exploit_host' method
:param propagation_result: The result of propagation from the 'exploit_host' method
:param exploitation_result: The result of the exploitation attempt from the 'exploit_host'
method
:param propagation_result: The result of the propagation attempt from the 'exploit_host'
method
:param info: Information about the exploiter
:param attempts: Information about the exploiter's attempts
"""
@ -28,7 +30,7 @@ class ExploitTelem(BaseTelem):
self.name = name
self.host = host.__dict__
self.exploit_result = exploit_result
self.exploitation_result = exploitation_result
self.propagation_result = propagation_result
self.info = info
self.attempts = attempts
@ -37,7 +39,7 @@ class ExploitTelem(BaseTelem):
def get_data(self) -> Dict:
return {
"exploit_result": self.exploit_result,
"exploitation_result": self.exploitation_result,
"propagation_result": self.propagation_result,
"machine": self.host,
"exploiter": self.name,