mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-07-05 20:41:39 -07:00
rdp implementing-w and -W support
This commit is contained in:
parent
eb939baaa5
commit
d830ac795e
1 changed files with 7 additions and 6 deletions
13
hydra-rdp.c
13
hydra-rdp.c
|
@ -19,7 +19,6 @@ void dummy_rdp() { printf("\n"); }
|
|||
freerdp *instance = 0;
|
||||
BOOL rdp_connect(char *server, int32_t port, char *domain, char *login, char *password) {
|
||||
int32_t err = 0;
|
||||
int32_t waittime = hydra_options.waittime;
|
||||
|
||||
instance->settings->Username = login;
|
||||
instance->settings->Password = password;
|
||||
|
@ -32,11 +31,8 @@ BOOL rdp_connect(char *server, int32_t port, char *domain, char *login, char *pa
|
|||
instance->settings->ServerPort = port;
|
||||
instance->settings->Domain = domain;
|
||||
instance->settings->MaxTimeInCheckLoop = 100;
|
||||
// hydra_options.waittime default value -> 32
|
||||
if (waittime != 32) {
|
||||
// freerdp timeout format is microseconds -> default:15000
|
||||
instance->settings->TcpConnectTimeout = waittime * 1000;
|
||||
}
|
||||
// freerdp timeout format is microseconds -> default:15000
|
||||
instance->settings->TcpConnectTimeout = hydra_options.waittime * 1000;
|
||||
instance->settings->TlsSecLevel = 0;
|
||||
freerdp_connect(instance);
|
||||
err = freerdp_get_last_error(instance->context);
|
||||
|
@ -108,6 +104,7 @@ int32_t start_rdp(char *ip, int32_t port, unsigned char options, char *miscptr,
|
|||
void service_rdp(char *ip, int32_t sp, unsigned char options, char *miscptr, FILE *fp, int32_t port, char *hostname) {
|
||||
int32_t run = 1, next_run = 1;
|
||||
int32_t myport = PORT_RDP;
|
||||
int32_t __first_rdp_connect = 1;
|
||||
|
||||
if (port != 0)
|
||||
myport = port;
|
||||
|
@ -119,6 +116,10 @@ void service_rdp(char *ip, int32_t sp, unsigned char options, char *miscptr, FIL
|
|||
next_run = 0;
|
||||
switch (run) {
|
||||
case 1: /* run the cracking function */
|
||||
if (__first_rdp_connect != 0)
|
||||
__first_rdp_connect = 0;
|
||||
else
|
||||
sleep(hydra_options.conwait);
|
||||
next_run = start_rdp(ip, myport, options, miscptr, fp);
|
||||
break;
|
||||
case 2: /* clean exit */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue