mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-08-20 21:33:51 -07:00
Fix logical issue. It cause adding wrong output file head when restore session using JSON format
This commit is contained in:
parent
5120f03645
commit
486f33cd5f
1 changed files with 9 additions and 7 deletions
4
hydra.c
4
hydra.c
|
@ -3560,7 +3560,8 @@ int main(int argc, char *argv[]) {
|
|||
perror("[ERROR] Error creating outputfile");
|
||||
exit(-1);
|
||||
}
|
||||
if (hydra_options.outfile_format == FORMAT_JSONV1 && hydra_options.restore != 1) { // No JSON head while using -R
|
||||
if (hydra_options.outfile_format == FORMAT_JSONV1) {
|
||||
if (hydra_options.restore != 1) { // No JSON head while using -R
|
||||
fprintf(hydra_brains.ofp, "{ \"generator\": {\n"
|
||||
"\t\"software\": \"%s\", \"version\": \"%s\", \"built\": \"%s\",\n"
|
||||
"\t\"server\": \"%s\", \"service\": \"%s\", \"jsonoutputversion\": \"1.00\",\n"
|
||||
|
@ -3573,6 +3574,7 @@ int main(int argc, char *argv[]) {
|
|||
free(t);
|
||||
}
|
||||
fprintf(hydra_brains.ofp, "\"\n\t},\n\"results\": [");
|
||||
}
|
||||
} else { // else default is plain text aka == 0
|
||||
fprintf(hydra_brains.ofp, "# %s %s run at %s on %s %s (%s", PROGRAM, VERSION, hydra_build_time(),
|
||||
hydra_options.server == NULL ? hydra_options.infile_ptr : hydra_options.server, hydra_options.service, prg);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue