diff --git a/CHANGES b/CHANGES index 6a6c48e2..c185553e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,11 +1,13 @@ Changelog for hydra ------------------- -Release 8.5-dev +Release 8.5 * New command line option: -b : format option for -o output file (json only so far, happy for patches supporting others :) ) - thanks to veggiespam for the patch * ./configure now honors the CC enviroment variable if present -* fixed a bug in the NCP module +* Fix for the restore file crash on some x64 platforms (finally! thanks to lukas227!) +* Changed the format of the restore file to detect cross platform copies +* Fixed a bug in the NCP module * Favor strrchr() over rindex() * Added refactoring patch by diadlo * Updated man page with missing command line options diff --git a/README b/README index 6162cbd0..072175a3 100644 --- a/README +++ b/README @@ -333,7 +333,7 @@ Version 1.00 example: "server": "127.0.0.1", "service": "http-post-form", "software": "Hydra", - "version": "v8.5-dev" + "version": "v8.5" }, "quantityfound": 2, "results": [ diff --git a/hydra.c b/hydra.c index 888e65ec..3f3f3582 100644 --- a/hydra.c +++ b/hydra.c @@ -171,7 +171,7 @@ char *SERVICES = #define RESTOREFILE "./hydra.restore" #define PROGRAM "Hydra" -#define VERSION "v8.5-dev" +#define VERSION "v8.5" #define AUTHOR "van Hauser/THC" #define EMAIL "" #define RESOURCE "http://www.thc.org/thc-hydra" @@ -726,7 +726,7 @@ void bail(char *text) { void hydra_restore_write(int print_msg) { FILE *f; hydra_brain brain; - char mynull[4] = { 0, 0, 0, 0 }; + char mynull[4] = { 0, 0, 0, 0 }, buf[4]; int i = 0, j = 0; hydra_head hh; @@ -750,6 +750,11 @@ void hydra_restore_write(int print_msg) { printf("[DEBUG] Writing restore file... "); fprintf(f, "%s\n", PROGRAM); + buf[0] = VERSION[1]; + buf[1] = VERSION[3]; + buf[2] = sizeof(int) % 256; + buf[3] = sizeof(hydra_target*) % 256; + fwrite(buf, 1, 4, f); memcpy(&brain, &hydra_brains, sizeof(hydra_brain)); brain.targets = i; brain.ofp = NULL; @@ -815,7 +820,7 @@ void hydra_restore_write(int print_msg) { void hydra_restore_read() { FILE *f; - char mynull[4]; + char mynull[4], buf[4]; int i, j, orig_debug = debug; char out[1024]; @@ -834,6 +839,22 @@ void hydra_restore_read() { fprintf(stderr, "[ERROR] invalid restore file (begin)\n"); exit(-1); } + + if ((fck = (int) fread(buf, 1, 4, f)) != 4) { + fprintf(stderr, "[ERROR] invalid restore file (platform)\n"); + exit(-1); + } + if (buf[0] == 0 || buf[1] == 0) { + fprintf(stderr, "[ERROR] restore file is prior hydra version v8.5!\n"); + exit(-1); + } + if (buf[0] != VERSION[1] || buf[1] != VERSION[3]) + fprintf(stderr, "[WARNING] restore file was created by version %c.%c, this is version %s\n", buf[0], buf[2], VERSION); + if (buf[2] != sizeof(int) % 256 || buf[3] != sizeof(hydra_head*) % 256) { + fprintf(stderr, "[ERROR] restore file was created on a different, incompatible processor platform!\n"); + exit(-1); + } + fck = (int) fread(&bf_options, sizeof(bf_options), 1, f); fck = (int) fread(mynull, sizeof(mynull), 1, f); if (debug) diff --git a/web/network_password_cracker_comparison.html b/web/network_password_cracker_comparison.html index c2286a1b..c72dbc35 100644 --- a/web/network_password_cracker_comparison.html +++ b/web/network_password_cracker_comparison.html @@ -62,13 +62,13 @@

Comparison of Features and Services Coverage

Version - 8.4 + 8.5 2.1 0.4 alpha Last Update - January 2017 + May 2017 April 2012 April 2011