mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-07-05 20:41:39 -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
|
#else
|
||||||
|
|
||||||
#include <freerdp/freerdp.h>
|
#include <freerdp/freerdp.h>
|
||||||
|
#include <freerdp/version.h>
|
||||||
freerdp *instance = 0;
|
freerdp *instance = 0;
|
||||||
BOOL rdp_connect(char *server, int32_t port, char *domain, char *login, char *password) {
|
BOOL rdp_connect(char *server, int32_t port, char *domain, char *login, char *password) {
|
||||||
int32_t err = 0;
|
int32_t err = 0;
|
||||||
|
|
||||||
instance->settings->Username = login;
|
#if FREERDP_VERSION_MAJOR == 3
|
||||||
instance->settings->Password = password;
|
rdpSettings* settings = instance->context->settings;
|
||||||
instance->settings->IgnoreCertificate = TRUE;
|
#else
|
||||||
|
rdpSettings* settings = instance->settings;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
settings->Username = login;
|
||||||
|
settings->Password = password;
|
||||||
|
settings->IgnoreCertificate = TRUE;
|
||||||
if (password[0] == 0)
|
if (password[0] == 0)
|
||||||
instance->settings->AuthenticationOnly = FALSE;
|
settings->AuthenticationOnly = FALSE;
|
||||||
else
|
else
|
||||||
instance->settings->AuthenticationOnly = TRUE;
|
settings->AuthenticationOnly = TRUE;
|
||||||
instance->settings->ServerHostname = server;
|
settings->ServerHostname = server;
|
||||||
instance->settings->ServerPort = port;
|
settings->ServerPort = port;
|
||||||
instance->settings->Domain = domain;
|
settings->Domain = domain;
|
||||||
instance->settings->MaxTimeInCheckLoop = 100;
|
|
||||||
|
#if FREERDP_VERSION_MAJOR == 2
|
||||||
|
settings->MaxTimeInCheckLoop = 100;
|
||||||
|
#endif
|
||||||
// freerdp timeout format is microseconds -> default:15000
|
// freerdp timeout format is microseconds -> default:15000
|
||||||
instance->settings->TcpConnectTimeout = hydra_options.waittime * 1000;
|
settings->TcpConnectTimeout = hydra_options.waittime * 1000;
|
||||||
instance->settings->TlsSecLevel = 0;
|
settings->TlsSecLevel = 0;
|
||||||
freerdp_connect(instance);
|
freerdp_connect(instance);
|
||||||
err = freerdp_get_last_error(instance->context);
|
err = freerdp_get_last_error(instance->context);
|
||||||
return err;
|
return err;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue