managed eof with stdin

This commit is contained in:
pirate sans barbe 2021-03-03 05:45:20 -10:00 committed by yvain douard
commit 7de88f2353

13
hydra.c
View file

@ -2280,6 +2280,7 @@ int main(int argc, char *argv[]) {
hydra_options.waittime = waittime = WAITTIME; hydra_options.waittime = waittime = WAITTIME;
bf_options.disable_symbols = 0; bf_options.disable_symbols = 0;
// command line processing // command line processing
if (argc > 1 && strncmp(argv[1], "-h", 2) == 0) if (argc > 1 && strncmp(argv[1], "-h", 2) == 0)
help(1); help(1);
@ -2447,13 +2448,14 @@ int main(int argc, char *argv[]) {
break; break;
case 'x': case 'x':
#ifndef HAVE_MATH_H #ifndef HAVE_MATH_H
fprintf(stderr, "[ERROR] -x option is not available as math.h was not " fprintf(stderr, "[ERROR] -x option is not available as math.h was not "
"found at compile time\n"); "found at compile time\n");
exit(-1); exit(-1);
#else #else
if (strcmp(optarg, "-h") == 0) if (strcmp(optarg, "-h") == 0)
help_bfg(); help_bfg();
bf_options.arg = optarg; bf_options.arg = optarg;
}
hydra_options.bfg = 1; hydra_options.bfg = 1;
hydra_options.mode = hydra_options.mode | MODE_PASSWORD_BRUTE; hydra_options.mode = hydra_options.mode | MODE_PASSWORD_BRUTE;
hydra_options.loop_mode = 1; hydra_options.loop_mode = 1;
@ -3442,6 +3444,7 @@ int main(int argc, char *argv[]) {
#else #else
sleep(1); sleep(1);
#endif #endif
}
} else { } else {
pass_ptr = hydra_options.pass = empty_login; pass_ptr = hydra_options.pass = empty_login;
hydra_brains.countpass = 0; hydra_brains.countpass = 0;