forked from p15670423/monkey
Agent: Collect timestamp before powershell connect
This commit is contained in:
parent
c4573673ce
commit
65dd386603
|
@ -121,13 +121,14 @@ class PowerShellExploiter(HostExploiter):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
client = PowerShellClient(self.host.ip_addr, creds, opts)
|
client = PowerShellClient(self.host.ip_addr, creds, opts)
|
||||||
|
connect_timestamp = time()
|
||||||
client.connect()
|
client.connect()
|
||||||
logger.info(
|
logger.info(
|
||||||
f"Successfully logged into {self.host.ip_addr} using Powershell. User: "
|
f"Successfully logged into {self.host.ip_addr} using Powershell. User: "
|
||||||
f"{creds.username}, Secret Type: {creds.secret_type.name}"
|
f"{creds.username}, Secret Type: {creds.secret_type.name}"
|
||||||
)
|
)
|
||||||
|
|
||||||
self._publish_exploitation_event(success=True)
|
self._publish_exploitation_event(time=connect_timestamp, success=True)
|
||||||
self.exploit_result.exploitation_success = True
|
self.exploit_result.exploitation_success = True
|
||||||
self._report_login_attempt(True, creds)
|
self._report_login_attempt(True, creds)
|
||||||
|
|
||||||
|
@ -138,7 +139,9 @@ class PowerShellExploiter(HostExploiter):
|
||||||
f"{creds.username}, SecretType: {creds.secret_type.name} -- Error: {ex}"
|
f"{creds.username}, SecretType: {creds.secret_type.name} -- Error: {ex}"
|
||||||
)
|
)
|
||||||
logger.debug(error_message)
|
logger.debug(error_message)
|
||||||
self._publish_exploitation_event(success=False, error_message=error_message)
|
self._publish_exploitation_event(
|
||||||
|
time=connect_timestamp, success=False, error_message=error_message
|
||||||
|
)
|
||||||
self._report_login_attempt(False, creds)
|
self._report_login_attempt(False, creds)
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Reference in New Issue