mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-08-20 13:23:57 -07:00
beautifications
This commit is contained in:
parent
e2219794c2
commit
e1419a0002
2 changed files with 4002 additions and 3937 deletions
124
hydra.c
124
hydra.c
|
@ -1,3 +1,4 @@
|
|||
|
||||
/*
|
||||
* hydra (c) 2001-2014 by van Hauser / THC <vh@thc.org>
|
||||
* http://www.thc.org
|
||||
|
@ -48,13 +49,11 @@ extern void service_xmpp(char *target, char *ip, int sp, unsigned char options,
|
|||
extern void service_irc(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_http_proxy_urlenum(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern void service_s7_300(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
|
||||
// ADD NEW SERVICES HERE
|
||||
|
||||
extern void service_rtsp(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
|
||||
// ADD NEW SERVICES HERE
|
||||
|
||||
|
||||
#ifdef HAVE_MATH_H
|
||||
extern void service_mysql(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_mysql_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
|
@ -138,14 +137,14 @@ extern int service_vmauthd_init(char *ip, int sp, unsigned char options, char *m
|
|||
extern int service_vnc_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_xmpp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
extern int service_s7_300_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
|
||||
// ADD NEW SERVICES HERE
|
||||
|
||||
extern int service_rtsp_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port);
|
||||
|
||||
// ADD NEW SERVICES HERE
|
||||
|
||||
|
||||
// ADD NEW SERVICES HERE
|
||||
char *SERVICES =
|
||||
"asterisk afp cisco cisco-enable cvs firebird ftp ftps http[s]-{head|get} http[s]-{get|post}-form http-proxy http-proxy-urlenum icq imap[s] irc ldap2[s] ldap3[-{cram|digest}md5][s] mssql mysql ncp nntp oracle oracle-listener oracle-sid pcanywhere pcnfs pop3[s] postgres rdp redis rexec rlogin rsh s7-300 sapr3 sip smb smtp[s] smtp-enum snmp socks5 ssh sshkey svn teamspeak telnet[s] vmauthd vnc xmpp rtsp";
|
||||
"asterisk afp cisco cisco-enable cvs firebird ftp ftps http[s]-{head|get} http[s]-{get|post}-form http-proxy http-proxy-urlenum icq imap[s] irc ldap2[s] ldap3[-{cram|digest}md5][s] mssql mysql ncp nntp oracle oracle-listener oracle-sid pcanywhere pcnfs pop3[s] postgres rdp redis rexec rlogin rsh rtsp s7-300 sapr3 sip smb smtp[s] smtp-enum snmp socks5 ssh sshkey svn teamspeak telnet[s] vmauthd vnc xmpp";
|
||||
|
||||
#define MAXBUF 520
|
||||
#define MAXLINESIZE ( ( MAXBUF / 2 ) - 4 )
|
||||
|
@ -768,7 +767,8 @@ void hydra_restore_read() {
|
|||
int i, j, orig_debug = debug;
|
||||
char out[1024];
|
||||
|
||||
if (debug) printf("[DEBUG] reading restore file %s\n", RESTOREFILE);
|
||||
if (debug)
|
||||
printf("[DEBUG] reading restore file %s\n", RESTOREFILE);
|
||||
if ((f = fopen(RESTOREFILE, "r")) == NULL) {
|
||||
fprintf(stderr, "[ERROR] restore file (%s) not found - ", RESTOREFILE);
|
||||
perror("");
|
||||
|
@ -784,7 +784,8 @@ void hydra_restore_read() {
|
|||
}
|
||||
fck = (int) fread(&bf_options, sizeof(bf_options), 1, f);
|
||||
fck = (int) fread(mynull, sizeof(mynull), 1, f);
|
||||
if (debug) printf("[DEBUG] reading restore file: Step 1 complete\n");
|
||||
if (debug)
|
||||
printf("[DEBUG] reading restore file: Step 1 complete\n");
|
||||
if (mynull[0] + mynull[1] + mynull[2] + mynull[3] == 0) {
|
||||
bf_options.crs = NULL;
|
||||
} else {
|
||||
|
@ -792,7 +793,8 @@ void hydra_restore_read() {
|
|||
memcpy(bf_options.crs, mynull, sizeof(mynull));
|
||||
fck = fread(bf_options.crs + sizeof(mynull), BF_CHARSMAX - sizeof(mynull), 1, f);
|
||||
}
|
||||
if (debug) printf("[DEBUG] reading restore file: Step 2 complete\n");
|
||||
if (debug)
|
||||
printf("[DEBUG] reading restore file: Step 2 complete\n");
|
||||
|
||||
fck = (int) fread(&hydra_brains, sizeof(hydra_brain), 1, f);
|
||||
hydra_brains.ofp = stdout;
|
||||
|
@ -800,7 +802,8 @@ void hydra_restore_read() {
|
|||
hydra_options.restore = 1;
|
||||
verbose = hydra_options.verbose;
|
||||
debug = hydra_options.debug;
|
||||
if (debug || orig_debug) printf("[DEBUG] run_debug %d, orig_debug %d\n", debug, orig_debug);
|
||||
if (debug || orig_debug)
|
||||
printf("[DEBUG] run_debug %d, orig_debug %d\n", debug, orig_debug);
|
||||
if (orig_debug) {
|
||||
debug = 1;
|
||||
hydra_options.debug = 1;
|
||||
|
@ -815,35 +818,42 @@ void hydra_restore_read() {
|
|||
sck = fgets(out, sizeof(out), f);
|
||||
if (out[0] != 0 && out[strlen(out) - 1] == '\n')
|
||||
out[strlen(out) - 1] = 0;
|
||||
if (debug) printf("[DEBUG] reading restore file: Step 3 complete\n");
|
||||
if (debug)
|
||||
printf("[DEBUG] reading restore file: Step 3 complete\n");
|
||||
if (strlen(out) > 0) {
|
||||
hydra_options.outfile_ptr = malloc(strlen(out) + 1);
|
||||
strcpy(hydra_options.outfile_ptr, out);
|
||||
} else
|
||||
hydra_options.outfile_ptr = NULL;
|
||||
if (debug) printf("[DEBUG] reading restore file: Step 4 complete\n");
|
||||
if (debug)
|
||||
printf("[DEBUG] reading restore file: Step 4 complete\n");
|
||||
sck = fgets(out, sizeof(out), f);
|
||||
if (out[0] != 0 && out[strlen(out) - 1] == '\n')
|
||||
out[strlen(out) - 1] = 0;
|
||||
if (debug) printf("[DEBUG] reading restore file: Step 5 complete\n");
|
||||
if (debug)
|
||||
printf("[DEBUG] reading restore file: Step 5 complete\n");
|
||||
if (strlen(out) == 0)
|
||||
hydra_options.miscptr = NULL;
|
||||
else {
|
||||
hydra_options.miscptr = malloc(strlen(out) + 1);
|
||||
strcpy(hydra_options.miscptr, out);
|
||||
}
|
||||
if (debug) printf("[DEBUG] reading restore file: Step 6 complete\n");
|
||||
if (debug)
|
||||
printf("[DEBUG] reading restore file: Step 6 complete\n");
|
||||
sck = fgets(out, sizeof(out), f);
|
||||
if (out[0] != 0 && out[strlen(out) - 1] == '\n')
|
||||
out[strlen(out) - 1] = 0;
|
||||
if (debug) printf("[DEBUG] reading restore file: Step 7 complete\n");
|
||||
if (debug)
|
||||
printf("[DEBUG] reading restore file: Step 7 complete\n");
|
||||
hydra_options.service = malloc(strlen(out) + 1);
|
||||
strcpy(hydra_options.service, out);
|
||||
if (debug) printf("[DEBUG] reading restore file: Step 8 complete\n");
|
||||
if (debug)
|
||||
printf("[DEBUG] reading restore file: Step 8 complete\n");
|
||||
|
||||
login_ptr = malloc(hydra_brains.sizelogin);
|
||||
fck = (int) fread(login_ptr, hydra_brains.sizelogin, 1, f);
|
||||
if (debug) printf("[DEBUG] reading restore file: Step 9 complete\n");
|
||||
if (debug)
|
||||
printf("[DEBUG] reading restore file: Step 9 complete\n");
|
||||
if ((hydra_options.mode & 64) != 64) { // NOT colonfile mode
|
||||
pass_ptr = malloc(hydra_brains.sizepass);
|
||||
fck = (int) fread(pass_ptr, hydra_brains.sizepass, 1, f);
|
||||
|
@ -851,7 +861,8 @@ void hydra_restore_read() {
|
|||
hydra_options.colonfile = empty_login; // dummy
|
||||
pass_ptr = csv_ptr = login_ptr;
|
||||
}
|
||||
if (debug) printf("[DEBUG] reading restore file: Step 10 complete\n");
|
||||
if (debug)
|
||||
printf("[DEBUG] reading restore file: Step 10 complete\n");
|
||||
|
||||
hydra_targets = malloc((hydra_brains.targets + 3) * sizeof(hydra_targets));
|
||||
for (j = 0; j < hydra_brains.targets; j++) {
|
||||
|
@ -901,7 +912,8 @@ void hydra_restore_read() {
|
|||
hydra_targets[j]->use_count = 0;
|
||||
hydra_targets[j]->failed = 0;
|
||||
}
|
||||
if (debug) printf("[DEBUG] reading restore file: Step 11 complete\n");
|
||||
if (debug)
|
||||
printf("[DEBUG] reading restore file: Step 11 complete\n");
|
||||
hydra_heads = malloc((hydra_options.max_use + 2) * sizeof(int) + 8);
|
||||
for (j = 0; j < hydra_options.max_use; j++) {
|
||||
hydra_heads[j] = malloc(sizeof(hydra_head));
|
||||
|
@ -919,7 +931,8 @@ void hydra_restore_read() {
|
|||
if (hydra_heads[j]->redo) {
|
||||
if (out[0] != 0 && out[strlen(out) - 1] == '\n')
|
||||
out[strlen(out) - 1] = 0;
|
||||
if (debug) printf("[DEBUG] TEMP head %d: out[0] == %d, hydra_heads[j]->current_login_ptr[0] == %d\n", j, out[0], hydra_heads[j]->current_login_ptr[0]);
|
||||
if (debug)
|
||||
printf("[DEBUG] TEMP head %d: out[0] == %d, hydra_heads[j]->current_login_ptr[0] == %d\n", j, out[0], hydra_heads[j]->current_login_ptr[0]);
|
||||
if (out[0] != 0 || hydra_heads[j]->current_login_ptr[0] != 0) {
|
||||
hydra_heads[j]->current_pass_ptr = malloc(strlen(out) + 1);
|
||||
strcpy(hydra_heads[j]->current_pass_ptr, out);
|
||||
|
@ -934,7 +947,8 @@ void hydra_restore_read() {
|
|||
hydra_heads[j]->current_login_ptr = hydra_heads[j]->current_pass_ptr = empty_login;
|
||||
}
|
||||
}
|
||||
if (debug) printf("[DEBUG] reading restore file: Step 12 complete\n");
|
||||
if (debug)
|
||||
printf("[DEBUG] reading restore file: Step 12 complete\n");
|
||||
sck = fgets(out, sizeof(out), f);
|
||||
if (out[0] != 0 && out[strlen(out) - 1] == '\n')
|
||||
out[strlen(out) - 1] = 0;
|
||||
|
@ -1185,10 +1199,10 @@ void hydra_service_init(int target_no) {
|
|||
x = service_xmpp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
if (strcmp(hydra_options.service, "s7-300") == 0)
|
||||
x = service_s7_300_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
// ADD NEW SERVICES HERE
|
||||
|
||||
if (strcmp(hydra_options.service, "rtsp") == 0)
|
||||
x = service_rtsp_init(hydra_targets[target_no]->ip, -1, options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
// ADD NEW SERVICES HERE
|
||||
|
||||
|
||||
if (x != 0 && x != 99) {
|
||||
if (x > 0 && x < 4)
|
||||
|
@ -1254,11 +1268,11 @@ int hydra_spawn_head(int head_no, int target_no) {
|
|||
service_asterisk(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
if (strcmp(hydra_options.service, "telnet") == 0)
|
||||
service_telnet(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
if (strcmp(hydra_options.service, "ftp") == 0){
|
||||
if (strcmp(hydra_options.service, "ftp") == 0) {
|
||||
|
||||
service_ftp(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
|
||||
}
|
||||
}
|
||||
if (strcmp(hydra_options.service, "ftps") == 0)
|
||||
service_ftps(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
if (strcmp(hydra_options.service, "redis") == 0)
|
||||
|
@ -1386,12 +1400,11 @@ int hydra_spawn_head(int head_no, int target_no) {
|
|||
#endif
|
||||
if (strcmp(hydra_options.service, "s7-300") == 0)
|
||||
service_s7_300(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
if (strcmp(hydra_options.service, "rtsp") == 0)
|
||||
service_rtsp(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
// ADD NEW SERVICES HERE
|
||||
|
||||
if (strcmp(hydra_options.service, "rtsp") == 0){
|
||||
|
||||
service_rtsp(hydra_targets[target_no]->ip, hydra_heads[head_no]->sp[1], options, hydra_options.miscptr, hydra_brains.ofp, hydra_targets[target_no]->port);
|
||||
}
|
||||
// just in case a module returns (which it shouldnt) we let it exit here
|
||||
exit(-1);
|
||||
} else {
|
||||
|
@ -1485,8 +1498,8 @@ int hydra_lookup_port(char *service) {
|
|||
{"rdp", PORT_RDP, PORT_RDP_SSL},
|
||||
{"asterisk", PORT_ASTERISK, PORT_ASTERISK_SSL},
|
||||
{"s7-300", PORT_S7_300, PORT_S7_300_SSL},
|
||||
// ADD NEW SERVICES HERE - add new port numbers to hydra.h
|
||||
{"rtsp", PORT_RTSP, PORT_RTSP_SSL},
|
||||
// ADD NEW SERVICES HERE - add new port numbers to hydra.h
|
||||
{"", PORT_NOPORT, PORT_NOPORT}
|
||||
};
|
||||
|
||||
|
@ -1507,7 +1520,8 @@ int hydra_lookup_port(char *service) {
|
|||
|
||||
// killit = 1 : kill(pid); fail = 1 : redo, fail = 2/3 : disable
|
||||
void hydra_kill_head(int head_no, int killit, int fail) {
|
||||
if (debug) printf("[DEBUG] head_no %d, kill %d, fail %d\n", head_no, killit, fail);
|
||||
if (debug)
|
||||
printf("[DEBUG] head_no %d, kill %d, fail %d\n", head_no, killit, fail);
|
||||
if (head_no < 0)
|
||||
return;
|
||||
if (hydra_heads[head_no]->active > 0) {
|
||||
|
@ -2972,6 +2986,7 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
// ADD NEW SERVICES HERE
|
||||
|
||||
|
||||
if (i == 0) {
|
||||
fprintf(stderr, "[ERROR] Unknown service: %s\n", hydra_options.service);
|
||||
exit(-1);
|
||||
|
@ -3044,7 +3059,6 @@ int main(int argc, char *argv[]) {
|
|||
fprintf(stderr, "[WARNING] reducing maximum tasks to MAXTASKS (%d)\n", MAXTASKS);
|
||||
hydra_options.max_use = MAXTASKS;
|
||||
}
|
||||
|
||||
// script kiddie patch
|
||||
if (hydra_options.server != NULL && (hydra_strcasestr(hydra_options.server, "gmail.") != NULL || hydra_strcasestr(hydra_options.server, "googlemail.") != NULL))
|
||||
fprintf(stderr, "[WARNING] Google Mail has bruteforce detection and sends false positives. You are not doing anything illegal right?!\n");
|
||||
|
@ -3594,7 +3608,8 @@ int main(int argc, char *argv[]) {
|
|||
tmp_time = time(NULL);
|
||||
|
||||
for (head_no = 0; head_no < hydra_options.max_use; head_no++) {
|
||||
if (debug && hydra_heads[head_no]->active != -1) printf("[DEBUG] head_no[%d] to target_no %d active %d\n", head_no, hydra_heads[head_no]->target_no, hydra_heads[head_no]->active);
|
||||
if (debug && hydra_heads[head_no]->active != -1)
|
||||
printf("[DEBUG] head_no[%d] to target_no %d active %d\n", head_no, hydra_heads[head_no]->target_no, hydra_heads[head_no]->active);
|
||||
switch (hydra_heads[head_no]->active) {
|
||||
case -1:
|
||||
// disabled head, ignored
|
||||
|
@ -3610,7 +3625,8 @@ int main(int argc, char *argv[]) {
|
|||
if (debug)
|
||||
printf("[DEBUG] child %d got target %d selected\n", head_no, hydra_heads[head_no]->target_no);
|
||||
if (hydra_heads[head_no]->target_no < 0) {
|
||||
if (debug) printf("[DEBUG] hydra_select_target() reports no more targets left\n");
|
||||
if (debug)
|
||||
printf("[DEBUG] hydra_select_target() reports no more targets left\n");
|
||||
hydra_kill_head(head_no, 0, 3);
|
||||
} else
|
||||
hydra_spawn_head(head_no, hydra_heads[head_no]->target_no); // target_no is ignored if head->redo == 1
|
||||
|
@ -3650,34 +3666,47 @@ int main(int argc, char *argv[]) {
|
|||
if (colored_output) {
|
||||
if (hydra_heads[head_no]->current_login_ptr == NULL || strlen(hydra_heads[head_no]->current_login_ptr) == 0) {
|
||||
if (hydra_heads[head_no]->current_pass_ptr == NULL || strlen(hydra_heads[head_no]->current_pass_ptr) == 0)
|
||||
printf("[\e[1;32m%d\e[0m][\e[1;32m%s\e[0m] host: \e[1;32m%s\e[0m\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
printf("[\e[1;32m%d\e[0m][\e[1;32m%s\e[0m] host: \e[1;32m%s\e[0m\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service,
|
||||
hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
else
|
||||
printf("[\e[1;32m%d\e[0m][\e[1;32m%s\e[0m] host: \e[1;32m%s\e[0m password: \e[1;32m%s\e[0m\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service, hydra_targets[hydra_heads[head_no]->target_no]->target, hydra_heads[head_no]->current_pass_ptr);
|
||||
printf("[\e[1;32m%d\e[0m][\e[1;32m%s\e[0m] host: \e[1;32m%s\e[0m password: \e[1;32m%s\e[0m\n", hydra_targets[hydra_heads[head_no]->target_no]->port,
|
||||
hydra_options.service, hydra_targets[hydra_heads[head_no]->target_no]->target, hydra_heads[head_no]->current_pass_ptr);
|
||||
} else if (hydra_heads[head_no]->current_pass_ptr == NULL || strlen(hydra_heads[head_no]->current_pass_ptr) == 0) {
|
||||
printf("[\e[1;32m%d\e[0m][\e[1;32m%s\e[0m] host: \e[1;32m%s\e[0m login: \e[1;32m%s\e[0m\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service, hydra_targets[hydra_heads[head_no]->target_no]->target, hydra_heads[head_no]->current_login_ptr);
|
||||
printf("[\e[1;32m%d\e[0m][\e[1;32m%s\e[0m] host: \e[1;32m%s\e[0m login: \e[1;32m%s\e[0m\n", hydra_targets[hydra_heads[head_no]->target_no]->port,
|
||||
hydra_options.service, hydra_targets[hydra_heads[head_no]->target_no]->target, hydra_heads[head_no]->current_login_ptr);
|
||||
} else
|
||||
printf("[\e[1;32m%d\e[0m][\e[1;32m%s\e[0m] host: \e[1;32m%s\e[0m login: \e[1;32m%s\e[0m password: \e[1;32m%s\e[0m\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service, hydra_targets[hydra_heads[head_no]->target_no]->target, hydra_heads[head_no]->current_login_ptr, hydra_heads[head_no]->current_pass_ptr);
|
||||
printf("[\e[1;32m%d\e[0m][\e[1;32m%s\e[0m] host: \e[1;32m%s\e[0m login: \e[1;32m%s\e[0m password: \e[1;32m%s\e[0m\n",
|
||||
hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service, hydra_targets[hydra_heads[head_no]->target_no]->target,
|
||||
hydra_heads[head_no]->current_login_ptr, hydra_heads[head_no]->current_pass_ptr);
|
||||
} else {
|
||||
if (hydra_heads[head_no]->current_login_ptr == NULL || strlen(hydra_heads[head_no]->current_login_ptr) == 0) {
|
||||
if (hydra_heads[head_no]->current_pass_ptr == NULL || strlen(hydra_heads[head_no]->current_pass_ptr) == 0)
|
||||
printf("[%d][%s] host: %s\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
printf("[%d][%s] host: %s\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service,
|
||||
hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
else
|
||||
printf("[%d][%s] host: %s password: %s\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service, hydra_targets[hydra_heads[head_no]->target_no]->target, hydra_heads[head_no]->current_pass_ptr);
|
||||
printf("[%d][%s] host: %s password: %s\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service,
|
||||
hydra_targets[hydra_heads[head_no]->target_no]->target, hydra_heads[head_no]->current_pass_ptr);
|
||||
} else if (hydra_heads[head_no]->current_pass_ptr == NULL || strlen(hydra_heads[head_no]->current_pass_ptr) == 0) {
|
||||
printf("[%d][%s] host: %s login: %s\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service, hydra_targets[hydra_heads[head_no]->target_no]->target, hydra_heads[head_no]->current_login_ptr);
|
||||
printf("[%d][%s] host: %s login: %s\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service,
|
||||
hydra_targets[hydra_heads[head_no]->target_no]->target, hydra_heads[head_no]->current_login_ptr);
|
||||
} else
|
||||
printf("[%d][%s] host: %s login: %s password: %s\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service, hydra_targets[hydra_heads[head_no]->target_no]->target, hydra_heads[head_no]->current_login_ptr, hydra_heads[head_no]->current_pass_ptr);
|
||||
printf("[%d][%s] host: %s login: %s password: %s\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service,
|
||||
hydra_targets[hydra_heads[head_no]->target_no]->target, hydra_heads[head_no]->current_login_ptr, hydra_heads[head_no]->current_pass_ptr);
|
||||
}
|
||||
if (hydra_options.outfile_ptr != NULL && hydra_brains.ofp != NULL) {
|
||||
if (hydra_heads[head_no]->current_login_ptr == NULL || strlen(hydra_heads[head_no]->current_login_ptr) == 0) {
|
||||
if (hydra_heads[head_no]->current_pass_ptr == NULL || strlen(hydra_heads[head_no]->current_pass_ptr) == 0)
|
||||
fprintf(hydra_brains.ofp, "[%d][%s] host: %s\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service, hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
fprintf(hydra_brains.ofp, "[%d][%s] host: %s\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service,
|
||||
hydra_targets[hydra_heads[head_no]->target_no]->target);
|
||||
else
|
||||
fprintf(hydra_brains.ofp, "[%d][%s] host: %s password: %s\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service, hydra_targets[hydra_heads[head_no]->target_no]->target, hydra_heads[head_no]->current_pass_ptr);
|
||||
fprintf(hydra_brains.ofp, "[%d][%s] host: %s password: %s\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service,
|
||||
hydra_targets[hydra_heads[head_no]->target_no]->target, hydra_heads[head_no]->current_pass_ptr);
|
||||
} else if (hydra_heads[head_no]->current_pass_ptr == NULL || strlen(hydra_heads[head_no]->current_pass_ptr) == 0) {
|
||||
fprintf(hydra_brains.ofp, "[%d][%s] host: %s login: %s\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service, hydra_targets[hydra_heads[head_no]->target_no]->target, hydra_heads[head_no]->current_login_ptr);
|
||||
fprintf(hydra_brains.ofp, "[%d][%s] host: %s login: %s\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service,
|
||||
hydra_targets[hydra_heads[head_no]->target_no]->target, hydra_heads[head_no]->current_login_ptr);
|
||||
} else
|
||||
fprintf(hydra_brains.ofp, "[%d][%s] host: %s login: %s password: %s\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service, hydra_targets[hydra_heads[head_no]->target_no]->target, hydra_heads[head_no]->current_login_ptr, hydra_heads[head_no]->current_pass_ptr);
|
||||
fprintf(hydra_brains.ofp, "[%d][%s] host: %s login: %s password: %s\n", hydra_targets[hydra_heads[head_no]->target_no]->port, hydra_options.service,
|
||||
hydra_targets[hydra_heads[head_no]->target_no]->target, hydra_heads[head_no]->current_login_ptr, hydra_heads[head_no]->current_pass_ptr);
|
||||
}
|
||||
if (hydra_options.exit_found) { // option set says quit target after on valid login/pass pair is found
|
||||
if (hydra_targets[hydra_heads[head_no]->target_no]->done == 0) {
|
||||
|
@ -3836,7 +3865,8 @@ int main(int argc, char *argv[]) {
|
|||
fprintf(stderr, "[ERROR] illegal target result value (%d=>%d)\n", i, hydra_targets[i]->done);
|
||||
}
|
||||
|
||||
if (debug) printf("[DEBUG] killing all remaining childs now that might be stuck\n");
|
||||
if (debug)
|
||||
printf("[DEBUG] killing all remaining childs now that might be stuck\n");
|
||||
for (i = 0; i < hydra_options.max_use; i++)
|
||||
if (hydra_heads[i]->active > 0 && hydra_heads[i]->pid > 0)
|
||||
hydra_kill_head(i, 1, 3);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue