From 4cc2dcebc2ec2f07374537fd869eaafb44a8b050 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Fri, 28 Nov 2014 22:13:09 +0100 Subject: [PATCH] removed warnings --- hydra-cisco.c | 2 +- hydra-pop3.c | 2 +- hydra-smb.c | 2 +- hydra-snmp.c | 40 ++++++++++++++++++++-------------------- hydra-sshkey.c | 2 +- hydra-telnet.c | 3 +-- hydra.c | 2 +- 7 files changed, 26 insertions(+), 27 deletions(-) diff --git a/hydra-cisco.c b/hydra-cisco.c index 65fd31b..eb87ec2 100644 --- a/hydra-cisco.c +++ b/hydra-cisco.c @@ -167,7 +167,7 @@ void service_cisco(char *ip, int sp, unsigned char options, char *miscptr, FILE hydra_child_exit(0); } } - if (buf2 != NULL && hydra_strcasestr(buf2, "ress ENTER") != NULL) + if (buf2 != NULL && hydra_strcasestr((char*)buf2, "ress ENTER") != NULL) hydra_send(sock, "\r\n", 2, 0); } while (strstr((char *) buf2, "assw") == NULL); free(buf2); diff --git a/hydra-pop3.c b/hydra-pop3.c index 7841ce4..f1c2803 100644 --- a/hydra-pop3.c +++ b/hydra-pop3.c @@ -406,7 +406,7 @@ int start_pop3(int s, char *ip, int port, unsigned char options, char *miscptr, } void service_pop3(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) { - int run = 1, next_run = 1, sock = -1, i; + int run = 1, next_run = 1, sock = -1; char *ptr = NULL; //extract data from the pool, ip is the key diff --git a/hydra-smb.c b/hydra-smb.c index 78759a2..0d6fb2e 100644 --- a/hydra-smb.c +++ b/hydra-smb.c @@ -900,7 +900,7 @@ unsigned long SMBSessionSetup(int s, char *szLogin, char *szPassword, char *misc unsigned char *NTLMv2hash = NULL; unsigned char *NTLMhash = NULL; unsigned char *LMhash = NULL; - unsigned char unicodeLogin[32 * 2]; +// unsigned char unicodeLogin[32 * 2]; int j; char bufReceive[512]; int nReceiveBufferSize = 0; diff --git a/hydra-snmp.c b/hydra-snmp.c index 4a7150d..5649bb7 100644 --- a/hydra-snmp.c +++ b/hydra-snmp.c @@ -15,7 +15,7 @@ extern int child_head_no; char snmpv3buf[1024], *snmpv3info = NULL; int snmpv3infolen = 0, snmpversion = 1, snmpread = 1, hashtype = 1, enctype = 0; -char snmpv3_init[] = { 0x30, 0x3e, 0x02, 0x01, 0x03, 0x30, 0x11, 0x02, +unsigned char snmpv3_init[] = { 0x30, 0x3e, 0x02, 0x01, 0x03, 0x30, 0x11, 0x02, 0x04, 0x08, 0x86, 0xdd, 0xf0, 0x02, 0x03, 0x00, 0xff, 0xe3, 0x04, 0x01, 0x04, 0x02, 0x01, 0x03, 0x04, 0x10, 0x30, 0x0e, 0x04, 0x00, 0x02, 0x01, @@ -25,12 +25,12 @@ char snmpv3_init[] = { 0x30, 0x3e, 0x02, 0x01, 0x03, 0x30, 0x11, 0x02, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x30, 0x00 }; -char snmpv3_get1[] = { 0x30, 0x77, 0x02, 0x01, 0x03, 0x30, 0x11, 0x02, +unsigned char snmpv3_get1[] = { 0x30, 0x77, 0x02, 0x01, 0x03, 0x30, 0x11, 0x02, 0x04, 0x08, 0x86, 0xdd, 0xef, 0x02, 0x03, 0x00, 0xff, 0xe3, 0x04, 0x01, 0x05, 0x02, 0x01, 0x03 }; -char snmpv3_get2[] = { 0x30, 0x2e, 0x04, 0x0c, 0x80, 0x00, 0x00, +unsigned char snmpv3_get2[] = { 0x30, 0x2e, 0x04, 0x0c, 0x80, 0x00, 0x00, 0x09, 0x03, 0x00, 0x00, 0x1f, 0xca, 0x8d, 0x82, 0x1b, 0x04, 0x00, 0xa0, 0x1c, 0x02, 0x04, 0x3f, 0x44, 0x5c, 0xbb, 0x02, 0x01, 0x00, 0x02, 0x01, @@ -39,7 +39,7 @@ char snmpv3_get2[] = { 0x30, 0x2e, 0x04, 0x0c, 0x80, 0x00, 0x00, 0x00 }; -char snmpv3_nouser[] = { 0x04, 0x00, 0x04, 0x00, 0x04, 0x00 }; +unsigned char snmpv3_nouser[] = { 0x04, 0x00, 0x04, 0x00, 0x04, 0x00 }; struct SNMPV1_A { char ID; @@ -58,14 +58,14 @@ struct SNMPV1_A snmpv1_a = { }; struct SNMPV1_R { - char type[2]; - char identid[2]; - char ident[4]; - char errstat[3]; - char errind[3]; - char objectid[2]; - char object[11]; - char value[3]; + unsigned char type[2]; + unsigned char identid[2]; + unsigned char ident[4]; + unsigned char errstat[3]; + unsigned char errind[3]; + unsigned char objectid[2]; + unsigned char object[11]; + unsigned char value[3]; } snmpv1_r = { .type = "\xa0\x1b", /* GET */ .identid = "\x02\x04",.ident = "\x1a\x5e\x97\x00", /* random crap :) */ @@ -76,14 +76,14 @@ struct SNMPV1_R { }; struct SNMPV1_W { - char type[2]; - char identid[2]; - char ident[4]; - char errstat[3]; - char errind[3]; - char objectid[2]; - char object[12]; - char value[8]; + unsigned char type[2]; + unsigned char identid[2]; + unsigned char ident[4]; + unsigned char errstat[3]; + unsigned char errind[3]; + unsigned char objectid[2]; + unsigned char object[12]; + unsigned char value[8]; } snmpv1_w = { .type = "\xa3\x21", /* SET */ .identid = "\x02\x04",.ident = "\x1a\x5e\x97\x22", /* random crap :) */ diff --git a/hydra-sshkey.c b/hydra-sshkey.c index d5374cb..47ecacc 100644 --- a/hydra-sshkey.c +++ b/hydra-sshkey.c @@ -24,7 +24,7 @@ extern int new_session; int start_sshkey(int s, char *ip, int port, unsigned char options, char *miscptr, FILE * fp) { char *empty = ""; char *login, *key, keep_login[300]; - int auth_state = 0, rc = 0, i = 0; + int auth_state = 0, rc = 0; ssh_private_key privkey; if (strlen(login = hydra_get_next_login()) == 0) diff --git a/hydra-telnet.c b/hydra-telnet.c index 069046b..30b0a12 100644 --- a/hydra-telnet.c +++ b/hydra-telnet.c @@ -96,9 +96,8 @@ int start_telnet(int s, char *ip, int port, unsigned char options, char *miscptr } void service_telnet(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port) { - int run = 1, next_run = 1, sock = -1; + int run = 1, next_run = 1, sock = -1, fck; int myport = PORT_TELNET, mysslport = PORT_TELNET_SSL; - int fck = 0; hydra_register_socket(sp); if (memcmp(hydra_get_next_pair(), &HYDRA_EXIT, sizeof(HYDRA_EXIT)) == 0) diff --git a/hydra.c b/hydra.c index 896d55a..78332c2 100644 --- a/hydra.c +++ b/hydra.c @@ -3603,7 +3603,7 @@ int main(int argc, char *argv[]) { } for (j = 0; j < hydra_options.max_use; j++) if (hydra_heads[j]->active >= 0 && (hydra_heads[j]->target_no == target_no || hydra_options.exit_found == 2)) { - if (hydra_brains.targets > 1 && hydra_options.exit_found < 2) + if (hydra_brains.targets > hydra_brains.finished && hydra_options.exit_found < 2) hydra_kill_head(j, 1, 0); // kill all heads working on the target else hydra_kill_head(j, 1, 2); // kill all heads working on the target