mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-01-02 11:36:22 +01:00
Add support for getting timeouts for comms
This commit is contained in:
parent
5c1f39623e
commit
93b48b9bdf
@ -328,3 +328,59 @@ BOOL remote_request_core_migrate(Remote * remote, Packet * packet, DWORD* pResul
|
||||
// if migration succeeded, return 'FALSE' to indicate server thread termination.
|
||||
return ERROR_SUCCESS == dwResult ? FALSE : TRUE;
|
||||
}
|
||||
|
||||
DWORD remote_request_transport_get_timeouts(Remote * remote, Packet * packet)
|
||||
{
|
||||
DWORD result = ERROR_SUCCESS;
|
||||
Packet* response = NULL;
|
||||
|
||||
do
|
||||
{
|
||||
response = packet_create_response(packet);
|
||||
if (!response)
|
||||
{
|
||||
result = ERROR_NOT_ENOUGH_MEMORY;
|
||||
break;
|
||||
}
|
||||
|
||||
// for the session expiry, return how many seconds are left before the session actually expires
|
||||
packet_add_tlv_uint(response, TLV_TYPE_TRANS_SESSION_EXP, remote->transport->expiration_end - current_unix_timestamp());
|
||||
packet_add_tlv_uint(response, TLV_TYPE_TRANS_COMM_TIMEOUT, remote->transport->comms_timeout);
|
||||
packet_add_tlv_uint(response, TLV_TYPE_TRANS_RETRY_TOTAL, remote->transport->retry_total);
|
||||
packet_add_tlv_uint(response, TLV_TYPE_TRANS_RETRY_WAIT, remote->transport->retry_wait);
|
||||
|
||||
} while (0);
|
||||
|
||||
if (response)
|
||||
{
|
||||
packet_transmit_response(result, remote, response);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
DWORD remote_request_transport_set_timeouts(Remote * remote, Packet * packet)
|
||||
{
|
||||
DWORD result = ERROR_SUCCESS;
|
||||
Packet* response = NULL;
|
||||
|
||||
do
|
||||
{
|
||||
response = packet_create_response(packet);
|
||||
if (!response)
|
||||
{
|
||||
result = ERROR_NOT_ENOUGH_MEMORY;
|
||||
break;
|
||||
}
|
||||
|
||||
// TODO
|
||||
|
||||
} while (0);
|
||||
|
||||
if (response)
|
||||
{
|
||||
packet_transmit_response(result, remote, response);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -20,6 +20,9 @@ extern DWORD remote_request_core_crypto_negotiate( Remote *remote, Packet *packe
|
||||
|
||||
extern BOOL remote_request_core_shutdown(Remote *remote, Packet *packet, DWORD* pResult);
|
||||
|
||||
extern DWORD remote_request_transport_get_timeouts(Remote * remote, Packet * packet);
|
||||
extern DWORD remote_request_transport_set_timeouts(Remote * remote, Packet * packet);
|
||||
|
||||
#ifdef _WIN32
|
||||
// POSIX support coming soon
|
||||
extern BOOL remote_request_core_change_transport( Remote *remote, Packet *packet, DWORD* pResult );
|
||||
@ -75,6 +78,9 @@ Command baseCommands[] =
|
||||
COMMAND_REQ("core_channel_interact", remote_request_core_channel_interact),
|
||||
// Crypto
|
||||
COMMAND_REQ("core_crypto_negotiate", remote_request_core_crypto_negotiate),
|
||||
// timeouts
|
||||
COMMAND_REQ("core_transport_get_timeouts", remote_request_transport_get_timeouts),
|
||||
COMMAND_REQ("core_transport_set_timeouts", remote_request_transport_set_timeouts),
|
||||
#ifdef _WIN32
|
||||
// TODO: finalise the implementation of stageless POSIX before enabling this for the
|
||||
// POSIX meterpreter.
|
||||
|
Loading…
Reference in New Issue
Block a user