mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-07-05 12:36:09 -07:00
Adapt with freerdp changes
FreeRDP/FreeRDP#7738 use fields under rdpContext instead of freerdp FreeRDP/FreeRDP@5f8100 removes reference to MaxTimeInCheckLoop since FreeRDP has dropped this field after migrating away from blocking poll loop.
This commit is contained in:
parent
03cdc31f98
commit
eb7ab3907b
1 changed files with 21 additions and 11 deletions
32
hydra-rdp.c
32
hydra-rdp.c
|
@ -16,24 +16,34 @@ void dummy_rdp() { printf("\n"); }
|
|||
#else
|
||||
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <freerdp/version.h>
|
||||
freerdp *instance = 0;
|
||||
BOOL rdp_connect(char *server, int32_t port, char *domain, char *login, char *password) {
|
||||
int32_t err = 0;
|
||||
|
||||
instance->settings->Username = login;
|
||||
instance->settings->Password = password;
|
||||
instance->settings->IgnoreCertificate = TRUE;
|
||||
#if FREERDP_VERSION_MAJOR == 3
|
||||
rdpSettings* settings = instance->context->settings;
|
||||
#else
|
||||
rdpSettings* settings = instance->settings;
|
||||
#endif
|
||||
|
||||
settings->Username = login;
|
||||
settings->Password = password;
|
||||
settings->IgnoreCertificate = TRUE;
|
||||
if (password[0] == 0)
|
||||
instance->settings->AuthenticationOnly = FALSE;
|
||||
settings->AuthenticationOnly = FALSE;
|
||||
else
|
||||
instance->settings->AuthenticationOnly = TRUE;
|
||||
instance->settings->ServerHostname = server;
|
||||
instance->settings->ServerPort = port;
|
||||
instance->settings->Domain = domain;
|
||||
instance->settings->MaxTimeInCheckLoop = 100;
|
||||
settings->AuthenticationOnly = TRUE;
|
||||
settings->ServerHostname = server;
|
||||
settings->ServerPort = port;
|
||||
settings->Domain = domain;
|
||||
|
||||
#if FREERDP_VERSION_MAJOR == 2
|
||||
settings->MaxTimeInCheckLoop = 100;
|
||||
#endif
|
||||
// freerdp timeout format is microseconds -> default:15000
|
||||
instance->settings->TcpConnectTimeout = hydra_options.waittime * 1000;
|
||||
instance->settings->TlsSecLevel = 0;
|
||||
settings->TcpConnectTimeout = hydra_options.waittime * 1000;
|
||||
settings->TlsSecLevel = 0;
|
||||
freerdp_connect(instance);
|
||||
err = freerdp_get_last_error(instance->context);
|
||||
return err;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue