forked from p34709852/monkey
Agent: Report successful propagation if agent ran
This commit is contained in:
parent
7b13817b66
commit
f917654f41
|
@ -93,7 +93,8 @@ class SMBExploiter(HostExploiter):
|
|||
|
||||
return self.exploit_result
|
||||
|
||||
self._run_agent_on_victim(scmr_rpc, cmdline, timestamp)
|
||||
if not self._run_agent_on_victim(scmr_rpc, cmdline, timestamp):
|
||||
return self.exploit_result
|
||||
|
||||
logger.info(
|
||||
"Executed monkey '%s' on remote victim %r (cmdline=%r)",
|
||||
|
@ -220,7 +221,7 @@ class SMBExploiter(HostExploiter):
|
|||
|
||||
return None
|
||||
|
||||
def _run_agent_on_victim(self, scmr_rpc: DCERPC_v5, cmdline: str, start_time: float):
|
||||
def _run_agent_on_victim(self, scmr_rpc: DCERPC_v5, cmdline: str, start_time: float) -> bool:
|
||||
scmr_rpc.bind(scmr.MSRPC_UUID_SCMR)
|
||||
resp = scmr.hROpenSCManagerW(scmr_rpc)
|
||||
sc_handle = resp["lpScHandle"]
|
||||
|
@ -240,7 +241,7 @@ class SMBExploiter(HostExploiter):
|
|||
else:
|
||||
self.exploit_result.error_message = str(err)
|
||||
self._publish_propagation_event(start_time, False, error_message=str(err))
|
||||
return
|
||||
return False
|
||||
|
||||
service = resp["lpServiceHandle"]
|
||||
try:
|
||||
|
@ -255,3 +256,5 @@ class SMBExploiter(HostExploiter):
|
|||
self.telemetry_messenger.send_telemetry(T1035Telem(status, UsageEnum.SMB))
|
||||
scmr.hRDeleteService(scmr_rpc, service)
|
||||
scmr.hRCloseServiceHandle(scmr_rpc, service)
|
||||
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue