mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-07-05 12:36:09 -07:00
Changed index() to strchr()
This commit is contained in:
parent
d6a42ace44
commit
c81f0b97e7
7 changed files with 47 additions and 47 deletions
|
@ -572,17 +572,17 @@ char *html_encode(char *string) {
|
||||||
if (ret == NULL)
|
if (ret == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (index(ret, '%') != NULL)
|
if (strchr(ret, '%') != NULL)
|
||||||
ret = hydra_strrep(ret, "%", "%25");
|
ret = hydra_strrep(ret, "%", "%25");
|
||||||
if (index(ret, ' ') != NULL)
|
if (strchr(ret, ' ') != NULL)
|
||||||
ret = hydra_strrep(ret, " ", "%20");
|
ret = hydra_strrep(ret, " ", "%20");
|
||||||
if (index(ret, '&') != NULL)
|
if (strchr(ret, '&') != NULL)
|
||||||
ret = hydra_strrep(ret, "&", "%26");
|
ret = hydra_strrep(ret, "&", "%26");
|
||||||
if (index(ret, '#') != NULL)
|
if (strchr(ret, '#') != NULL)
|
||||||
ret = hydra_strrep(ret, "#", "%23");
|
ret = hydra_strrep(ret, "#", "%23");
|
||||||
if (index(ret, '=') != NULL)
|
if (strchr(ret, '=') != NULL)
|
||||||
ret = hydra_strrep(ret, "=", "%3D");
|
ret = hydra_strrep(ret, "=", "%3D");
|
||||||
if (index(ret, '+') != NULL)
|
if (strchr(ret, '+') != NULL)
|
||||||
ret = hydra_strrep(ret, "+", "%2B");
|
ret = hydra_strrep(ret, "+", "%2B");
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -646,10 +646,10 @@ int32_t analyze_server_response(int32_t s) {
|
||||||
} else if (endcookie2 != NULL)
|
} else if (endcookie2 != NULL)
|
||||||
*endcookie2 = 0;
|
*endcookie2 = 0;
|
||||||
// is the cookie already there? if yes, remove it!
|
// is the cookie already there? if yes, remove it!
|
||||||
if (index(startcookie, '=') != NULL && (ptr = index(startcookie, '=')) - startcookie + 1 <= sizeof(tmpname)) {
|
if (strchr(startcookie, '=') != NULL && (ptr = strchr(startcookie, '=')) - startcookie + 1 <= sizeof(tmpname)) {
|
||||||
strncpy(tmpname, startcookie, sizeof(tmpname) - 2);
|
strncpy(tmpname, startcookie, sizeof(tmpname) - 2);
|
||||||
tmpname[sizeof(tmpname) - 2] = 0;
|
tmpname[sizeof(tmpname) - 2] = 0;
|
||||||
ptr = index(tmpname, '=');
|
ptr = strchr(tmpname, '=');
|
||||||
*(++ptr) = 0;
|
*(++ptr) = 0;
|
||||||
// is the cookie already in the cookiejar? (so, does it have to be
|
// is the cookie already in the cookiejar? (so, does it have to be
|
||||||
// replaced?)
|
// replaced?)
|
||||||
|
@ -675,7 +675,7 @@ int32_t analyze_server_response(int32_t s) {
|
||||||
strcpy(cookie, tmpcookie);
|
strcpy(cookie, tmpcookie);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ptr = index(str, '=');
|
ptr = strchr(str, '=');
|
||||||
// only copy the cookie if it has a value (otherwise the server wants to
|
// only copy the cookie if it has a value (otherwise the server wants to
|
||||||
// delete the cookie)
|
// delete the cookie)
|
||||||
if (ptr != NULL && *(ptr + 1) != ';' && *(ptr + 1) != 0 && *(ptr + 1) != '\n' && *(ptr + 1) != '\r') {
|
if (ptr != NULL && *(ptr + 1) != ';' && *(ptr + 1) != 0 && *(ptr + 1) != '\n' && *(ptr + 1) != '\r') {
|
||||||
|
@ -1286,7 +1286,7 @@ ptr_header_node initialize(char *ip, unsigned char options, char *miscptr) {
|
||||||
|
|
||||||
cond = ptr;
|
cond = ptr;
|
||||||
|
|
||||||
if ((ptr2 = index(ptr, ':')) != NULL) {
|
if ((ptr2 = strchr(ptr, ':')) != NULL) {
|
||||||
*ptr2++ = 0;
|
*ptr2++ = 0;
|
||||||
if (*ptr2)
|
if (*ptr2)
|
||||||
optional1 = ptr2;
|
optional1 = ptr2;
|
||||||
|
|
|
@ -28,17 +28,17 @@ int32_t start_http_proxy_urlenum(int32_t s, char *ip, int32_t port, unsigned cha
|
||||||
ptr++;
|
ptr++;
|
||||||
strncpy(mhost, ptr, sizeof(mhost) - 1);
|
strncpy(mhost, ptr, sizeof(mhost) - 1);
|
||||||
mhost[sizeof(mhost) - 1] = 0;
|
mhost[sizeof(mhost) - 1] = 0;
|
||||||
if ((ptr = index(mhost, '/')) != NULL)
|
if ((ptr = strchr(mhost, '/')) != NULL)
|
||||||
*ptr = 0;
|
*ptr = 0;
|
||||||
if ((ptr = index(mhost, ']')) != NULL)
|
if ((ptr = strchr(mhost, ']')) != NULL)
|
||||||
*ptr = 0;
|
*ptr = 0;
|
||||||
else if ((ptr = index(mhost, ':')) != NULL)
|
else if ((ptr = strchr(mhost, ':')) != NULL)
|
||||||
*ptr = 0;
|
*ptr = 0;
|
||||||
|
|
||||||
if (miscptr != NULL && index(miscptr, ':') != NULL) {
|
if (miscptr != NULL && strchr(miscptr, ':') != NULL) {
|
||||||
strncpy(mlogin, miscptr, sizeof(mlogin) - 1);
|
strncpy(mlogin, miscptr, sizeof(mlogin) - 1);
|
||||||
mlogin[sizeof(mlogin) - 1] = 0;
|
mlogin[sizeof(mlogin) - 1] = 0;
|
||||||
ptr = index(mlogin, ':');
|
ptr = strchr(mlogin, ':');
|
||||||
*ptr++ = 0;
|
*ptr++ = 0;
|
||||||
strncpy(mpass, ptr, sizeof(mpass) - 1);
|
strncpy(mpass, ptr, sizeof(mpass) - 1);
|
||||||
mpass[sizeof(mpass) - 1] = 0;
|
mpass[sizeof(mpass) - 1] = 0;
|
||||||
|
@ -215,7 +215,7 @@ int32_t start_http_proxy_urlenum(int32_t s, char *ip, int32_t port, unsigned cha
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// result analysis
|
// result analysis
|
||||||
ptr = ((char *)index(buf, ' ')) + 1;
|
ptr = ((char *)strchr(buf, ' ')) + 1;
|
||||||
if (*ptr == '2' || (*ptr == '3' && (*(ptr + 2) == '1' || *(ptr + 2) == '2')) || strncmp(ptr, "404", 4) == 0 || strncmp(ptr, "403", 4) == 0) {
|
if (*ptr == '2' || (*ptr == '3' && (*(ptr + 2) == '1' || *(ptr + 2) == '2')) || strncmp(ptr, "404", 4) == 0 || strncmp(ptr, "403", 4) == 0) {
|
||||||
hydra_report_found_host(port, ip, "http-proxy", fp);
|
hydra_report_found_host(port, ip, "http-proxy", fp);
|
||||||
if (fp != stdout)
|
if (fp != stdout)
|
||||||
|
|
|
@ -24,9 +24,9 @@ int32_t start_http_proxy(int32_t s, char *ip, int32_t port, unsigned char option
|
||||||
sprintf(url, "%.500s", miscptr);
|
sprintf(url, "%.500s", miscptr);
|
||||||
ptr = strstr(miscptr, "://"); // :// check is in hydra.c
|
ptr = strstr(miscptr, "://"); // :// check is in hydra.c
|
||||||
sprintf(host, "Host: %.50s", ptr + 3);
|
sprintf(host, "Host: %.50s", ptr + 3);
|
||||||
if ((ptr = index(host, '/')) != NULL)
|
if ((ptr = strchr(host, '/')) != NULL)
|
||||||
*ptr = 0;
|
*ptr = 0;
|
||||||
if ((ptr = index(host + 6, ':')) != NULL && host[0] != '[')
|
if ((ptr = strchr(host + 6, ':')) != NULL && host[0] != '[')
|
||||||
*ptr = 0;
|
*ptr = 0;
|
||||||
strcat(host, "\r\n");
|
strcat(host, "\r\n");
|
||||||
}
|
}
|
||||||
|
@ -232,7 +232,7 @@ int32_t start_http_proxy(int32_t s, char *ip, int32_t port, unsigned char option
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr = ((char *)index(http_proxy_buf, ' ')) + 1;
|
ptr = ((char *)strchr(http_proxy_buf, ' ')) + 1;
|
||||||
if (*ptr == '2' || (*ptr == '3' && *(ptr + 2) == '1') || (*ptr == '3' && *(ptr + 2) == '2') || (*ptr == '4' && *(ptr + 2) == '4')) {
|
if (*ptr == '2' || (*ptr == '3' && *(ptr + 2) == '1') || (*ptr == '3' && *(ptr + 2) == '2') || (*ptr == '4' && *(ptr + 2) == '4')) {
|
||||||
hydra_report_found_host(port, ip, "http-proxy", fp);
|
hydra_report_found_host(port, ip, "http-proxy", fp);
|
||||||
hydra_completed_pair_found();
|
hydra_completed_pair_found();
|
||||||
|
@ -240,7 +240,7 @@ int32_t start_http_proxy(int32_t s, char *ip, int32_t port, unsigned char option
|
||||||
http_proxy_buf = NULL;
|
http_proxy_buf = NULL;
|
||||||
} else {
|
} else {
|
||||||
if (*ptr != '4')
|
if (*ptr != '4')
|
||||||
hydra_report(stderr, "[INFO] Unusual return code: %c for %s:%s\n", (char)*(index(http_proxy_buf, ' ') + 1), login, pass);
|
hydra_report(stderr, "[INFO] Unusual return code: %c for %s:%s\n", (char)*(strchr(http_proxy_buf, ' ') + 1), login, pass);
|
||||||
else if (verbose && *(ptr + 2) == '3')
|
else if (verbose && *(ptr + 2) == '3')
|
||||||
hydra_report(stderr, "[INFO] Potential success, could be false positive: %s:%s\n", login, pass);
|
hydra_report(stderr, "[INFO] Potential success, could be false positive: %s:%s\n", login, pass);
|
||||||
hydra_completed_pair();
|
hydra_completed_pair();
|
||||||
|
|
|
@ -208,7 +208,7 @@ int32_t start_http(int32_t s, char *ip, int32_t port, unsigned char options, cha
|
||||||
complete_line = 0;
|
complete_line = 0;
|
||||||
tmpreplybuf[0] = 0;
|
tmpreplybuf[0] = 0;
|
||||||
|
|
||||||
while (http_buf != NULL && (strstr(http_buf, "HTTP/1.") == NULL || (index(http_buf, '\n') == NULL && complete_line == 0))) {
|
while (http_buf != NULL && (strstr(http_buf, "HTTP/1.") == NULL || (strchr(http_buf, '\n') == NULL && complete_line == 0))) {
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("il: %d, tmpreplybuf: %s, http_buf: %s\n", complete_line, tmpreplybuf, http_buf);
|
printf("il: %d, tmpreplybuf: %s, http_buf: %s\n", complete_line, tmpreplybuf, http_buf);
|
||||||
if (tmpreplybuf[0] == 0 && strstr(http_buf, "HTTP/1.") != NULL) {
|
if (tmpreplybuf[0] == 0 && strstr(http_buf, "HTTP/1.") != NULL) {
|
||||||
|
@ -245,7 +245,7 @@ int32_t start_http(int32_t s, char *ip, int32_t port, unsigned char options, cha
|
||||||
if (debug)
|
if (debug)
|
||||||
hydra_report(stderr, "S:%s\n", http_buf);
|
hydra_report(stderr, "S:%s\n", http_buf);
|
||||||
|
|
||||||
ptr = ((char *)index(http_buf, ' '));
|
ptr = ((char *)strchr(http_buf, ' '));
|
||||||
if (ptr != NULL)
|
if (ptr != NULL)
|
||||||
ptr++;
|
ptr++;
|
||||||
if (ptr != NULL && (*ptr == '2' || *ptr == '3' || strncmp(ptr, "403", 3) == 0 || strncmp(ptr, "404", 3) == 0)) {
|
if (ptr != NULL && (*ptr == '2' || *ptr == '3' || strncmp(ptr, "403", 3) == 0 || strncmp(ptr, "404", 3) == 0)) {
|
||||||
|
|
|
@ -295,13 +295,13 @@ int32_t internal__hydra_connect(char *host, int32_t port, int32_t type, int32_t
|
||||||
|
|
||||||
send(s, buf, strlen(buf), 0);
|
send(s, buf, strlen(buf), 0);
|
||||||
if (debug) {
|
if (debug) {
|
||||||
char *ptr = index(buf, '\r');
|
char *ptr = strchr(buf, '\r');
|
||||||
if (ptr != NULL)
|
if (ptr != NULL)
|
||||||
*ptr = 0;
|
*ptr = 0;
|
||||||
printf("DEBUG_CONNECT_PROXY_SENT: %s\n", buf);
|
printf("DEBUG_CONNECT_PROXY_SENT: %s\n", buf);
|
||||||
}
|
}
|
||||||
recv(s, buf, 4096, 0);
|
recv(s, buf, 4096, 0);
|
||||||
if (strncmp("HTTP/", buf, 5) == 0 && (tmpptr = index(buf, ' ')) != NULL && *++tmpptr == '2') {
|
if (strncmp("HTTP/", buf, 5) == 0 && (tmpptr = strchr(buf, ' ')) != NULL && *++tmpptr == '2') {
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("DEBUG_CONNECT_PROXY_OK\n");
|
printf("DEBUG_CONNECT_PROXY_OK\n");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -36,7 +36,7 @@ int32_t start_telnet(int32_t s, char *ip, int32_t port, unsigned char options, c
|
||||||
if ((buf = hydra_receive_line(s)) == NULL)
|
if ((buf = hydra_receive_line(s)) == NULL)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (index(buf, '/') != NULL || index(buf, '>') != NULL || index(buf, '%') != NULL || index(buf, '$') != NULL || index(buf, '#') != NULL) {
|
if (strchr(buf, '/') != NULL || strchr(buf, '>') != NULL || strchr(buf, '%') != NULL || strchr(buf, '$') != NULL || strchr(buf, '#') != NULL) {
|
||||||
hydra_report_found_host(port, ip, "telnet", fp);
|
hydra_report_found_host(port, ip, "telnet", fp);
|
||||||
hydra_completed_pair_found();
|
hydra_completed_pair_found();
|
||||||
free(buf);
|
free(buf);
|
||||||
|
@ -76,7 +76,7 @@ int32_t start_telnet(int32_t s, char *ip, int32_t port, unsigned char options, c
|
||||||
|
|
||||||
/*win7 answering with do terminal type = 0xfd 0x18 */
|
/*win7 answering with do terminal type = 0xfd 0x18 */
|
||||||
while ((buf = hydra_receive_line(s)) != NULL && make_to_lower(buf) && (strstr(buf, "login:") == NULL || strstr(buf, "last login:") != NULL) && strstr(buf, "sername:") == NULL) {
|
while ((buf = hydra_receive_line(s)) != NULL && make_to_lower(buf) && (strstr(buf, "login:") == NULL || strstr(buf, "last login:") != NULL) && strstr(buf, "sername:") == NULL) {
|
||||||
if ((miscptr != NULL && strstr(buf, miscptr) != NULL) || (miscptr == NULL && strstr(buf, "invalid") == NULL && strstr(buf, "failed") == NULL && strstr(buf, "bad ") == NULL && (index(buf, '/') != NULL || index(buf, '>') != NULL || index(buf, '$') != NULL || index(buf, '#') != NULL || index(buf, '%') != NULL || ((buf[1] == '\xfd') && (buf[2] == '\x18'))))) {
|
if ((miscptr != NULL && strstr(buf, miscptr) != NULL) || (miscptr == NULL && strstr(buf, "invalid") == NULL && strstr(buf, "failed") == NULL && strstr(buf, "bad ") == NULL && (strchr(buf, '/') != NULL || strchr(buf, '>') != NULL || strchr(buf, '$') != NULL || strchr(buf, '#') != NULL || strchr(buf, '%') != NULL || ((buf[1] == '\xfd') && (buf[2] == '\x18'))))) {
|
||||||
hydra_report_found_host(port, ip, "telnet", fp);
|
hydra_report_found_host(port, ip, "telnet", fp);
|
||||||
hydra_completed_pair_found();
|
hydra_completed_pair_found();
|
||||||
free(buf);
|
free(buf);
|
||||||
|
|
42
hydra.c
42
hydra.c
|
@ -1131,7 +1131,7 @@ void fill_mem(char *ptr, FILE *fd, int32_t colonmode) {
|
||||||
tmp[len] = 0;
|
tmp[len] = 0;
|
||||||
}
|
}
|
||||||
if (colonmode) {
|
if (colonmode) {
|
||||||
if ((ptr2 = index(tmp, ':')) == NULL) {
|
if ((ptr2 = strchr(tmp, ':')) == NULL) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"[ERROR] invalid line in colon file (-C), missing colon "
|
"[ERROR] invalid line in colon file (-C), missing colon "
|
||||||
"in line: %s\n",
|
"in line: %s\n",
|
||||||
|
@ -1494,7 +1494,7 @@ void hydra_increase_fail_count(int32_t target_no, int32_t head_no) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"[ERROR] Too many connect errors to target, disabling "
|
"[ERROR] Too many connect errors to target, disabling "
|
||||||
"%s://%s%s%s:%d\n",
|
"%s://%s%s%s:%d\n",
|
||||||
hydra_options.service, hydra_targets[target_no]->ip[0] == 16 && index(hydra_targets[target_no]->target, ':') != NULL ? "[" : "", hydra_targets[target_no]->target, hydra_targets[target_no]->ip[0] == 16 && index(hydra_targets[target_no]->target, ':') != NULL ? "]" : "", hydra_targets[target_no]->port);
|
hydra_options.service, hydra_targets[target_no]->ip[0] == 16 && strchr(hydra_targets[target_no]->target, ':') != NULL ? "[" : "", hydra_targets[target_no]->target, hydra_targets[target_no]->ip[0] == 16 && strchr(hydra_targets[target_no]->target, ':') != NULL ? "]" : "", hydra_targets[target_no]->port);
|
||||||
}
|
}
|
||||||
if (hydra_brains.targets > hydra_brains.finished)
|
if (hydra_brains.targets > hydra_brains.finished)
|
||||||
hydra_kill_head(head_no, 1, 0);
|
hydra_kill_head(head_no, 1, 0);
|
||||||
|
@ -2047,11 +2047,11 @@ void process_proxy_line(int32_t type, char *string) {
|
||||||
}
|
}
|
||||||
*sep = 0;
|
*sep = 0;
|
||||||
target_string = sep + 3;
|
target_string = sep + 3;
|
||||||
if ((sep = index(target_string, '@')) != NULL) {
|
if ((sep = strchr(target_string, '@')) != NULL) {
|
||||||
auth_string = target_string;
|
auth_string = target_string;
|
||||||
*sep = 0;
|
*sep = 0;
|
||||||
target_string = sep + 1;
|
target_string = sep + 1;
|
||||||
if (index(auth_string, ':') == NULL) {
|
if (strchr(auth_string, ':') == NULL) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"[WARNING] %s has an invalid authentication definition %s, must "
|
"[WARNING] %s has an invalid authentication definition %s, must "
|
||||||
"be in the format login:pass, entry ignored\n",
|
"be in the format login:pass, entry ignored\n",
|
||||||
|
@ -2059,14 +2059,14 @@ void process_proxy_line(int32_t type, char *string) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((sep = index(target_string, ':')) != NULL) {
|
if ((sep = strchr(target_string, ':')) != NULL) {
|
||||||
*sep = 0;
|
*sep = 0;
|
||||||
port_string = sep + 1;
|
port_string = sep + 1;
|
||||||
if ((sep = index(port_string, '%')) != NULL) {
|
if ((sep = strchr(port_string, '%')) != NULL) {
|
||||||
*sep = 0;
|
*sep = 0;
|
||||||
device_string = sep + 1;
|
device_string = sep + 1;
|
||||||
}
|
}
|
||||||
if ((sep = index(port_string, '/')) != NULL)
|
if ((sep = strchr(port_string, '/')) != NULL)
|
||||||
*sep = 0;
|
*sep = 0;
|
||||||
port = atoi(port_string);
|
port = atoi(port_string);
|
||||||
if (port < 1 || port > 65535) {
|
if (port < 1 || port > 65535) {
|
||||||
|
@ -2595,23 +2595,23 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
if (*target_pos == '[') {
|
if (*target_pos == '[') {
|
||||||
target_pos++;
|
target_pos++;
|
||||||
if ((param_pos = index(target_pos, ']')) == NULL)
|
if ((param_pos = strchr(target_pos, ']')) == NULL)
|
||||||
bail("no closing ']' found in target definition");
|
bail("no closing ']' found in target definition");
|
||||||
*param_pos++ = 0;
|
*param_pos++ = 0;
|
||||||
if (*param_pos == ':')
|
if (*param_pos == ':')
|
||||||
port_pos = ++param_pos;
|
port_pos = ++param_pos;
|
||||||
if ((param_pos = index(param_pos, '/')) != NULL)
|
if ((param_pos = strchr(param_pos, '/')) != NULL)
|
||||||
*param_pos++ = 0;
|
*param_pos++ = 0;
|
||||||
} else {
|
} else {
|
||||||
port_pos = index(target_pos, ':');
|
port_pos = strchr(target_pos, ':');
|
||||||
param_pos = index(target_pos, '/');
|
param_pos = strchr(target_pos, '/');
|
||||||
if (port_pos != NULL && param_pos != NULL && port_pos > param_pos)
|
if (port_pos != NULL && param_pos != NULL && port_pos > param_pos)
|
||||||
port_pos = NULL;
|
port_pos = NULL;
|
||||||
if (port_pos != NULL)
|
if (port_pos != NULL)
|
||||||
*port_pos++ = 0;
|
*port_pos++ = 0;
|
||||||
if (param_pos != NULL)
|
if (param_pos != NULL)
|
||||||
*param_pos++ = 0;
|
*param_pos++ = 0;
|
||||||
if (port_pos != NULL && index(port_pos, ':') != NULL) {
|
if (port_pos != NULL && strchr(port_pos, ':') != NULL) {
|
||||||
if (prefer_ipv6)
|
if (prefer_ipv6)
|
||||||
bail("Illegal IPv6 target definition must be written within '[' "
|
bail("Illegal IPv6 target definition must be written within '[' "
|
||||||
"']'");
|
"']'");
|
||||||
|
@ -2894,7 +2894,7 @@ int main(int argc, char *argv[]) {
|
||||||
"like parallel connections)\n");
|
"like parallel connections)\n");
|
||||||
hydra_options.tasks = 1;
|
hydra_options.tasks = 1;
|
||||||
}
|
}
|
||||||
if (hydra_options.login != NULL && (index(hydra_options.login, '\\') != NULL || index(hydra_options.login, '/') != NULL))
|
if (hydra_options.login != NULL && (strchr(hydra_options.login, '\\') != NULL || strchr(hydra_options.login, '/') != NULL))
|
||||||
fprintf(stderr, "[WARNING] potential windows domain specification found in "
|
fprintf(stderr, "[WARNING] potential windows domain specification found in "
|
||||||
"login. You must use the -m option to pass a domain.\n");
|
"login. You must use the -m option to pass a domain.\n");
|
||||||
i = 1;
|
i = 1;
|
||||||
|
@ -2918,7 +2918,7 @@ int main(int argc, char *argv[]) {
|
||||||
#if !defined(LIBSMBCLIENT)
|
#if !defined(LIBSMBCLIENT)
|
||||||
bail("Compiled without LIBSMBCLIENT support, module not available!");
|
bail("Compiled without LIBSMBCLIENT support, module not available!");
|
||||||
#else
|
#else
|
||||||
if (hydra_options.login != NULL && (index(hydra_options.login, '\\') != NULL || index(hydra_options.login, '/') != NULL))
|
if (hydra_options.login != NULL && (strchr(hydra_options.login, '\\') != NULL || strchr(hydra_options.login, '/') != NULL))
|
||||||
fprintf(stderr, "[WARNING] potential windows domain specification found in "
|
fprintf(stderr, "[WARNING] potential windows domain specification found in "
|
||||||
"login. You must use the -m option to pass a domain.\n");
|
"login. You must use the -m option to pass a domain.\n");
|
||||||
if (hydra_options.miscptr == NULL || (strlen(hydra_options.miscptr) == 0)) {
|
if (hydra_options.miscptr == NULL || (strlen(hydra_options.miscptr) == 0)) {
|
||||||
|
@ -3571,13 +3571,13 @@ int main(int argc, char *argv[]) {
|
||||||
if (*tmpptr == '[') {
|
if (*tmpptr == '[') {
|
||||||
tmpptr++;
|
tmpptr++;
|
||||||
hydra_targets[i]->target = tmpptr;
|
hydra_targets[i]->target = tmpptr;
|
||||||
if ((tmpptr2 = index(tmpptr, ']')) != NULL) {
|
if ((tmpptr2 = strchr(tmpptr, ']')) != NULL) {
|
||||||
*tmpptr2++ = 0;
|
*tmpptr2++ = 0;
|
||||||
tmpptr = tmpptr2;
|
tmpptr = tmpptr2;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
hydra_targets[i]->target = tmpptr;
|
hydra_targets[i]->target = tmpptr;
|
||||||
if ((tmpptr2 = index(hydra_targets[i]->target, ':')) != NULL) {
|
if ((tmpptr2 = strchr(hydra_targets[i]->target, ':')) != NULL) {
|
||||||
*tmpptr2++ = 0;
|
*tmpptr2++ = 0;
|
||||||
tmpptr = tmpptr2;
|
tmpptr = tmpptr2;
|
||||||
hydra_targets[i]->port = atoi(tmpptr2);
|
hydra_targets[i]->port = atoi(tmpptr2);
|
||||||
|
@ -3593,13 +3593,13 @@ int main(int argc, char *argv[]) {
|
||||||
} else if (hydra_options.server == NULL) {
|
} else if (hydra_options.server == NULL) {
|
||||||
fprintf(stderr, "Error: no target server given, nor -M option used\n");
|
fprintf(stderr, "Error: no target server given, nor -M option used\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
} else if (index(hydra_options.server, '/') != NULL) {
|
} else if (strchr(hydra_options.server, '/') != NULL) {
|
||||||
if (cmdlinetarget == NULL)
|
if (cmdlinetarget == NULL)
|
||||||
bail("You seem to mix up \"service://target:port/options\" syntax with "
|
bail("You seem to mix up \"service://target:port/options\" syntax with "
|
||||||
"\"target service options\" syntax. Read the README on how to use "
|
"\"target service options\" syntax. Read the README on how to use "
|
||||||
"hydra correctly!");
|
"hydra correctly!");
|
||||||
if (strstr(cmdlinetarget, "://") != NULL) {
|
if (strstr(cmdlinetarget, "://") != NULL) {
|
||||||
tmpptr = index(hydra_options.server, '/');
|
tmpptr = strchr(hydra_options.server, '/');
|
||||||
if (tmpptr != NULL)
|
if (tmpptr != NULL)
|
||||||
*tmpptr = 0;
|
*tmpptr = 0;
|
||||||
countservers = hydra_brains.targets = 1;
|
countservers = hydra_brains.targets = 1;
|
||||||
|
@ -3622,7 +3622,7 @@ int main(int argc, char *argv[]) {
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
strcpy(tmpptr, hydra_options.server);
|
strcpy(tmpptr, hydra_options.server);
|
||||||
tmpptr2 = index(tmpptr, '/');
|
tmpptr2 = strchr(tmpptr, '/');
|
||||||
*tmpptr2++ = 0;
|
*tmpptr2++ = 0;
|
||||||
if ((k = atoi(tmpptr2)) < 16 || k > 31) {
|
if ((k = atoi(tmpptr2)) < 16 || k > 31) {
|
||||||
fprintf(stderr, "Error: network size may only be between /16 and /31: %s\n", hydra_options.server);
|
fprintf(stderr, "Error: network size may only be between /16 and /31: %s\n", hydra_options.server);
|
||||||
|
@ -3788,7 +3788,7 @@ int main(int argc, char *argv[]) {
|
||||||
printf(" per task\n");
|
printf(" per task\n");
|
||||||
|
|
||||||
if (hydra_brains.targets == 1) {
|
if (hydra_brains.targets == 1) {
|
||||||
if (index(hydra_targets[0]->target, ':') == NULL) {
|
if (strchr(hydra_targets[0]->target, ':') == NULL) {
|
||||||
printf("[DATA] attacking %s%s://%s:", hydra_options.service, hydra_options.ssl == 1 ? "s" : "", hydra_targets[0]->target);
|
printf("[DATA] attacking %s%s://%s:", hydra_options.service, hydra_options.ssl == 1 ? "s" : "", hydra_targets[0]->target);
|
||||||
printf("%d%s%s\n", port, hydra_options.miscptr == NULL || hydra_options.miscptr[0] != '/' ? "/" : "", hydra_options.miscptr != NULL ? hydra_options.miscptr : "");
|
printf("%d%s%s\n", port, hydra_options.miscptr == NULL || hydra_options.miscptr[0] != '/' ? "/" : "", hydra_options.miscptr != NULL ? hydra_options.miscptr : "");
|
||||||
} else {
|
} else {
|
||||||
|
@ -3864,7 +3864,7 @@ int main(int argc, char *argv[]) {
|
||||||
#ifdef AF_INET6
|
#ifdef AF_INET6
|
||||||
ipv6 = NULL;
|
ipv6 = NULL;
|
||||||
#endif
|
#endif
|
||||||
if ((device = index(hydra_targets[i]->target, '%')) != NULL)
|
if ((device = strchr(hydra_targets[i]->target, '%')) != NULL)
|
||||||
*device++ = 0;
|
*device++ = 0;
|
||||||
if (getaddrinfo(hydra_targets[i]->target, NULL, &hints, &res) != 0) {
|
if (getaddrinfo(hydra_targets[i]->target, NULL, &hints, &res) != 0) {
|
||||||
if (use_proxy == 0) {
|
if (use_proxy == 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue