mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-07-05 20:41:39 -07:00
CIDR notation now correctly identifed
This commit is contained in:
parent
3ac0595f25
commit
ffb7b5bc8a
2 changed files with 6 additions and 5 deletions
1
CHANGES
1
CHANGES
|
@ -3,6 +3,7 @@ Changelog for hydra
|
|||
|
||||
Release 8.9-dev
|
||||
* your patch? :)
|
||||
* CIDR notation (hydra -l test -p test 192.168.0.0/24 ftp) was not detected, fixed
|
||||
|
||||
|
||||
Release 8.8
|
||||
|
|
10
hydra.c
10
hydra.c
|
@ -2046,7 +2046,7 @@ void process_proxy_line(int32_t type, char *string) {
|
|||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
char *proxy_string = NULL, *device = NULL, *memcheck, *cmdtarget = NULL;
|
||||
char *proxy_string = NULL, *device = NULL, *memcheck;
|
||||
char *outfile_format_tmp;
|
||||
FILE *lfp = NULL, *pfp = NULL, *cfp = NULL, *ifp = NULL, *rfp = NULL, *proxyfp;
|
||||
size_t countinfile = 1, sizeinfile = 0;
|
||||
|
@ -2425,7 +2425,7 @@ int main(int argc, char *argv[]) {
|
|||
// check if targetdef follow syntax <service-name>://<target>[:<port-number>][/<parameters>] or it's a syntax error
|
||||
char *targetdef = strdup(argv[optind]);
|
||||
char *service_pos, *target_pos, *port_pos = NULL, *param_pos = NULL;
|
||||
cmdtarget = argv[optind];
|
||||
cmdlinetarget = argv[optind];
|
||||
|
||||
if ((targetdef != NULL) && (strstr(targetdef, "://") != NULL)) {
|
||||
service_pos = strstr(targetdef, "://");
|
||||
|
@ -2478,7 +2478,7 @@ int main(int argc, char *argv[]) {
|
|||
printf("[DEBUG] opt:%d argc:%d mod:%s tgt:%s port:%u misc:%s\n", optind, argc, hydra_options.service, hydra_options.server, hydra_options.port, hydra_options.miscptr);
|
||||
} else {
|
||||
hydra_options.server = NULL;
|
||||
hydra_options.service = NULL;
|
||||
hydra_options.service = NULL;
|
||||
|
||||
if (modusage) {
|
||||
hydra_options.service = targetdef;
|
||||
|
@ -3296,9 +3296,9 @@ int main(int argc, char *argv[]) {
|
|||
fprintf(stderr, "Error: no target server given, nor -M option used\n");
|
||||
exit(-1);
|
||||
} else if (index(hydra_options.server, '/') != NULL) {
|
||||
if (cmdtarget == NULL)
|
||||
if (cmdlinetarget == NULL)
|
||||
bail("You seem to mix up \"service://target:port/options\" syntax with \"target service options\" syntax. Read the README on how to use hydra correctly!");
|
||||
if (strstr(cmdtarget, "://") != NULL) {
|
||||
if (strstr(cmdlinetarget, "://") != NULL) {
|
||||
tmpptr = index(hydra_options.server, '/');
|
||||
if (tmpptr != NULL)
|
||||
*tmpptr = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue