Adding support to check for freerdp2 and freerdp3

Adding logic to check for freerdp2 first and if not the rdp module will check for freerdp3 to support the rdp module
This commit is contained in:
Henry Robalino 2020-06-12 11:19:01 -04:00 committed by GitHub
commit bc6e8aec41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 92 additions and 11 deletions

11
hydra.c
View file

@ -117,7 +117,7 @@ extern int32_t service_oracle_sid_init(char *ip, int32_t sp, unsigned char optio
extern void service_sip(char *ip, int32_t sp, unsigned char options, char *miscptr, FILE *fp, int32_t port, char *hostname);
extern int32_t service_sip_init(char *ip, int32_t sp, unsigned char options, char *miscptr, FILE *fp, int32_t port, char *hostname);
#endif
#ifdef LIBFREERDP3
#if defined(LIBFREERDP2) || (LIBFREERDP3)
extern void service_rdp(char *ip, int32_t sp, unsigned char options, char *miscptr, FILE *fp, int32_t port, char *hostname);
extern int32_t service_rdp_init(char *ip, int32_t sp, unsigned char options, char *miscptr, FILE *fp, int32_t port, char *hostname);
#endif
@ -426,7 +426,7 @@ static const struct {
#endif
SERVICE(redis),
SERVICE(rexec),
#ifdef LIBFREERDP3
#if defined(LIBFREERDP2) || (LIBFREERDP3)
SERVICE3("rdp", rdp),
#endif
SERVICE(rlogin),
@ -2237,7 +2237,7 @@ int main(int argc, char *argv[]) {
strcat(unsupported, "SSL-services (ftps, sip, rdp, oracle-services, ...) ");
#endif
#ifndef LIBFREERDP3
#if !defined(LIBFREERDP2) || (LIBFREERDP3)
// for rdp
SERVICES = hydra_string_replace(SERVICES, " rdp", "");
#endif
@ -2905,7 +2905,10 @@ int main(int argc, char *argv[]) {
}
if (strcmp(hydra_options.service, "rdp") == 0) {
#ifndef LIBFREERDP3
#if !defined(LIBFREERDP2)|| (LIBFREERDP3)
if(!LIBFREERDP2)
bail("Compiled without FREERDP2 support, module not available!");
else
bail("Compiled without FREERDP3 support, module not available!");
#endif
}