2016-09-06 11:16:38 +00:00
|
|
|
/**
|
2016-09-11 20:20:15 +00:00
|
|
|
* Author......: See docs/credits.txt
|
2016-09-06 11:16:38 +00:00
|
|
|
* License.....: MIT
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "common.h"
|
2016-09-15 02:21:41 +00:00
|
|
|
#include "types.h"
|
2016-10-17 21:49:44 +00:00
|
|
|
#include "memory.h"
|
2016-10-12 12:17:30 +00:00
|
|
|
#include "event.h"
|
2016-10-16 17:32:43 +00:00
|
|
|
#include "convert.h"
|
2016-09-20 11:18:47 +00:00
|
|
|
#include "thread.h"
|
2016-10-04 09:13:33 +00:00
|
|
|
#include "timer.h"
|
2016-09-15 02:21:41 +00:00
|
|
|
#include "status.h"
|
2016-10-04 09:13:33 +00:00
|
|
|
#include "restore.h"
|
2016-09-20 10:32:39 +00:00
|
|
|
#include "shared.h"
|
2016-10-16 17:32:43 +00:00
|
|
|
#include "hwmon.h"
|
|
|
|
#include "interface.h"
|
|
|
|
#include "outfile.h"
|
2016-09-06 11:16:38 +00:00
|
|
|
#include "terminal.h"
|
2016-10-17 21:49:44 +00:00
|
|
|
#include "hashcat.h"
|
2016-09-06 11:16:38 +00:00
|
|
|
|
2017-03-24 09:45:40 +00:00
|
|
|
static const size_t TERMINAL_LINE_LENGTH = 79;
|
|
|
|
|
2016-10-30 17:55:27 +00:00
|
|
|
static const char *PROMPT = "[s]tatus [p]ause [r]esume [b]ypass [c]heckpoint [q]uit => ";
|
2016-09-11 08:28:59 +00:00
|
|
|
|
2016-10-23 15:31:22 +00:00
|
|
|
void welcome_screen (hashcat_ctx_t *hashcat_ctx, const char *version_tag)
|
2016-09-28 21:53:46 +00:00
|
|
|
{
|
2016-10-23 15:31:22 +00:00
|
|
|
const user_options_t *user_options = hashcat_ctx->user_options;
|
2016-10-06 18:57:29 +00:00
|
|
|
|
2016-09-28 21:53:46 +00:00
|
|
|
if (user_options->quiet == true) return;
|
|
|
|
if (user_options->keyspace == true) return;
|
|
|
|
if (user_options->stdout_flag == true) return;
|
|
|
|
if (user_options->show == true) return;
|
|
|
|
if (user_options->left == true) return;
|
|
|
|
|
|
|
|
if (user_options->benchmark == true)
|
|
|
|
{
|
|
|
|
if (user_options->machine_readable == false)
|
|
|
|
{
|
2016-10-14 19:38:52 +00:00
|
|
|
event_log_info (hashcat_ctx, "%s (%s) starting in benchmark mode...", PROGNAME, version_tag);
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-09-28 21:53:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-10-23 15:31:22 +00:00
|
|
|
event_log_info (hashcat_ctx, "# %s (%s)", PROGNAME, version_tag);
|
2016-09-28 21:53:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (user_options->restore == true)
|
|
|
|
{
|
2016-10-14 19:38:52 +00:00
|
|
|
event_log_info (hashcat_ctx, "%s (%s) starting in restore mode...", PROGNAME, version_tag);
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-10-14 19:38:52 +00:00
|
|
|
}
|
|
|
|
else if (user_options->speed_only == true)
|
|
|
|
{
|
|
|
|
event_log_info (hashcat_ctx, "%s (%s) starting in speed-only mode...", PROGNAME, version_tag);
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-09-28 21:53:46 +00:00
|
|
|
}
|
2016-12-09 22:44:43 +00:00
|
|
|
else if (user_options->progress_only == true)
|
|
|
|
{
|
|
|
|
event_log_info (hashcat_ctx, "%s (%s) starting in progress-only mode...", PROGNAME, version_tag);
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-12-09 22:44:43 +00:00
|
|
|
}
|
2016-09-28 21:53:46 +00:00
|
|
|
else
|
|
|
|
{
|
2016-10-12 12:17:30 +00:00
|
|
|
event_log_info (hashcat_ctx, "%s (%s) starting...", PROGNAME, version_tag);
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-09-28 21:53:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-06 18:57:29 +00:00
|
|
|
void goodbye_screen (hashcat_ctx_t *hashcat_ctx, const time_t proc_start, const time_t proc_stop)
|
2016-09-28 21:53:46 +00:00
|
|
|
{
|
2016-10-06 18:57:29 +00:00
|
|
|
const user_options_t *user_options = hashcat_ctx->user_options;
|
|
|
|
|
2016-09-28 21:53:46 +00:00
|
|
|
if (user_options->quiet == true) return;
|
|
|
|
if (user_options->keyspace == true) return;
|
|
|
|
if (user_options->stdout_flag == true) return;
|
|
|
|
if (user_options->show == true) return;
|
|
|
|
if (user_options->left == true) return;
|
|
|
|
|
2017-01-27 15:29:18 +00:00
|
|
|
char start_buf[32]; memset (start_buf, 0, sizeof (start_buf));
|
|
|
|
char stop_buf[32]; memset (start_buf, 0, sizeof (stop_buf));
|
2016-12-03 05:32:18 +00:00
|
|
|
|
2016-12-03 13:59:35 +00:00
|
|
|
event_log_info_nn (hashcat_ctx, "Started: %s", ctime_r (&proc_start, start_buf));
|
2017-01-27 15:29:18 +00:00
|
|
|
event_log_info_nn (hashcat_ctx, "Stopped: %s", ctime_r (&proc_stop, stop_buf));
|
2016-09-28 21:53:46 +00:00
|
|
|
}
|
|
|
|
|
2016-10-23 15:31:22 +00:00
|
|
|
int setup_console ()
|
2016-09-28 21:40:16 +00:00
|
|
|
{
|
|
|
|
#if defined (_WIN)
|
|
|
|
SetConsoleWindowSize (132);
|
|
|
|
|
|
|
|
if (_setmode (_fileno (stdin), _O_BINARY) == -1)
|
|
|
|
{
|
2016-12-17 01:30:03 +00:00
|
|
|
__mingw_fprintf (stderr, "%s: %m", "stdin");
|
2016-09-28 21:40:16 +00:00
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_setmode (_fileno (stdout), _O_BINARY) == -1)
|
|
|
|
{
|
2016-12-17 01:30:03 +00:00
|
|
|
__mingw_fprintf (stderr, "%s: %m", "stdin");
|
2016-09-28 21:40:16 +00:00
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_setmode (_fileno (stderr), _O_BINARY) == -1)
|
|
|
|
{
|
2016-12-17 01:30:03 +00:00
|
|
|
__mingw_fprintf (stderr, "%s: %m", "stdin");
|
2016-09-28 21:40:16 +00:00
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-09-11 08:39:19 +00:00
|
|
|
void send_prompt ()
|
|
|
|
{
|
|
|
|
fprintf (stdout, "%s", PROMPT);
|
|
|
|
|
|
|
|
fflush (stdout);
|
|
|
|
}
|
|
|
|
|
|
|
|
void clear_prompt ()
|
|
|
|
{
|
|
|
|
fputc ('\r', stdout);
|
|
|
|
|
|
|
|
for (size_t i = 0; i < strlen (PROMPT); i++)
|
|
|
|
{
|
|
|
|
fputc (' ', stdout);
|
|
|
|
}
|
|
|
|
|
|
|
|
fputc ('\r', stdout);
|
|
|
|
|
|
|
|
fflush (stdout);
|
|
|
|
}
|
|
|
|
|
2016-09-30 20:52:44 +00:00
|
|
|
static void keypress (hashcat_ctx_t *hashcat_ctx)
|
2016-09-15 02:21:41 +00:00
|
|
|
{
|
2016-10-06 14:34:30 +00:00
|
|
|
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
|
|
|
|
user_options_t *user_options = hashcat_ctx->user_options;
|
2016-09-20 10:32:39 +00:00
|
|
|
|
2016-09-30 20:52:44 +00:00
|
|
|
// this is required, because some of the variables down there are not initialized at that point
|
2016-10-17 11:44:07 +00:00
|
|
|
while (status_ctx->devices_status == STATUS_INIT) hc_sleep_msec (100);
|
2016-09-20 10:32:39 +00:00
|
|
|
|
2016-09-24 23:02:44 +00:00
|
|
|
const bool quiet = user_options->quiet;
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2016-09-20 10:32:39 +00:00
|
|
|
tty_break ();
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2016-09-29 21:49:33 +00:00
|
|
|
while (status_ctx->shutdown_outer == false)
|
2016-09-15 02:21:41 +00:00
|
|
|
{
|
2016-09-20 10:32:39 +00:00
|
|
|
int ch = tty_getchar ();
|
2016-09-15 02:21:41 +00:00
|
|
|
|
|
|
|
if (ch == -1) break;
|
|
|
|
|
|
|
|
if (ch == 0) continue;
|
|
|
|
|
|
|
|
//https://github.com/hashcat/hashcat/issues/302
|
|
|
|
//#if defined (_POSIX)
|
|
|
|
//if (ch != '\n')
|
|
|
|
//#endif
|
|
|
|
|
2016-09-29 22:04:12 +00:00
|
|
|
hc_thread_mutex_lock (status_ctx->mux_display);
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-09-15 02:21:41 +00:00
|
|
|
|
|
|
|
switch (ch)
|
|
|
|
{
|
|
|
|
case 's':
|
|
|
|
case '\r':
|
|
|
|
case '\n':
|
|
|
|
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2016-10-04 14:35:24 +00:00
|
|
|
status_display (hashcat_ctx);
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2016-09-21 14:07:49 +00:00
|
|
|
if (quiet == false) send_prompt ();
|
2016-09-15 02:21:41 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'b':
|
|
|
|
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2016-10-09 20:41:55 +00:00
|
|
|
bypass (hashcat_ctx);
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2016-10-12 12:17:30 +00:00
|
|
|
event_log_info (hashcat_ctx, "Next dictionary / mask in queue selected, bypassing current one");
|
2016-10-09 20:41:55 +00:00
|
|
|
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2016-09-21 14:07:49 +00:00
|
|
|
if (quiet == false) send_prompt ();
|
2016-09-15 02:21:41 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'p':
|
|
|
|
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-10-09 20:41:55 +00:00
|
|
|
|
|
|
|
SuspendThreads (hashcat_ctx);
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2016-10-09 20:41:55 +00:00
|
|
|
if (status_ctx->devices_status == STATUS_PAUSED)
|
|
|
|
{
|
2016-10-12 12:17:30 +00:00
|
|
|
event_log_info (hashcat_ctx, "Paused");
|
2016-10-09 20:41:55 +00:00
|
|
|
}
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2016-09-21 14:07:49 +00:00
|
|
|
if (quiet == false) send_prompt ();
|
2016-09-15 02:21:41 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'r':
|
|
|
|
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-10-09 20:41:55 +00:00
|
|
|
|
|
|
|
ResumeThreads (hashcat_ctx);
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2016-10-09 20:41:55 +00:00
|
|
|
if (status_ctx->devices_status == STATUS_RUNNING)
|
|
|
|
{
|
2016-10-12 12:17:30 +00:00
|
|
|
event_log_info (hashcat_ctx, "Resumed");
|
2016-10-09 20:41:55 +00:00
|
|
|
}
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2016-09-21 14:07:49 +00:00
|
|
|
if (quiet == false) send_prompt ();
|
2016-09-15 02:21:41 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'c':
|
|
|
|
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2016-10-06 14:34:30 +00:00
|
|
|
stop_at_checkpoint (hashcat_ctx);
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2016-10-23 11:38:41 +00:00
|
|
|
if (status_ctx->checkpoint_shutdown == true)
|
|
|
|
{
|
|
|
|
event_log_info (hashcat_ctx, "Checkpoint enabled: Will quit at next Restore Point update");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
event_log_info (hashcat_ctx, "Checkpoint disabled: Restore Point updates will no longer be monitored");
|
|
|
|
}
|
|
|
|
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2016-09-21 14:07:49 +00:00
|
|
|
if (quiet == false) send_prompt ();
|
2016-09-15 02:21:41 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'q':
|
|
|
|
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2016-10-16 17:32:43 +00:00
|
|
|
myquit (hashcat_ctx);
|
2016-09-15 02:21:41 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
//https://github.com/hashcat/hashcat/issues/302
|
|
|
|
//#if defined (_POSIX)
|
|
|
|
//if (ch != '\n')
|
|
|
|
//#endif
|
|
|
|
|
2016-09-29 22:04:12 +00:00
|
|
|
hc_thread_mutex_unlock (status_ctx->mux_display);
|
2016-09-15 02:21:41 +00:00
|
|
|
}
|
|
|
|
|
2016-09-20 10:32:39 +00:00
|
|
|
tty_fix ();
|
2016-09-30 20:52:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void *thread_keypress (void *p)
|
|
|
|
{
|
|
|
|
hashcat_ctx_t *hashcat_ctx = (hashcat_ctx_t *) p;
|
|
|
|
|
|
|
|
keypress (hashcat_ctx);
|
2016-09-15 02:21:41 +00:00
|
|
|
|
2016-09-30 20:52:44 +00:00
|
|
|
return NULL;
|
2016-09-15 02:21:41 +00:00
|
|
|
}
|
|
|
|
|
2016-09-08 07:21:25 +00:00
|
|
|
#if defined (_WIN)
|
|
|
|
void SetConsoleWindowSize (const int x)
|
|
|
|
{
|
|
|
|
HANDLE h = GetStdHandle (STD_OUTPUT_HANDLE);
|
|
|
|
|
|
|
|
if (h == INVALID_HANDLE_VALUE) return;
|
|
|
|
|
|
|
|
CONSOLE_SCREEN_BUFFER_INFO bufferInfo;
|
|
|
|
|
|
|
|
if (!GetConsoleScreenBufferInfo (h, &bufferInfo)) return;
|
|
|
|
|
|
|
|
SMALL_RECT *sr = &bufferInfo.srWindow;
|
|
|
|
|
|
|
|
sr->Right = MAX (sr->Right, x - 1);
|
|
|
|
|
|
|
|
COORD co;
|
|
|
|
|
|
|
|
co.X = sr->Right + 1;
|
|
|
|
co.Y = 9999;
|
|
|
|
|
|
|
|
if (!SetConsoleScreenBufferSize (h, co)) return;
|
|
|
|
|
|
|
|
if (!SetConsoleWindowInfo (h, TRUE, sr)) return;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-11-29 21:39:22 +00:00
|
|
|
#if defined (__linux__) || defined (__CYGWIN__)
|
2016-09-06 11:16:38 +00:00
|
|
|
static struct termios savemodes;
|
|
|
|
static int havemodes = 0;
|
|
|
|
|
|
|
|
int tty_break()
|
|
|
|
{
|
|
|
|
struct termios modmodes;
|
|
|
|
|
|
|
|
if (tcgetattr (fileno (stdin), &savemodes) < 0) return -1;
|
|
|
|
|
|
|
|
havemodes = 1;
|
|
|
|
|
|
|
|
modmodes = savemodes;
|
|
|
|
modmodes.c_lflag &= ~ICANON;
|
|
|
|
modmodes.c_cc[VMIN] = 1;
|
|
|
|
modmodes.c_cc[VTIME] = 0;
|
|
|
|
|
|
|
|
return tcsetattr (fileno (stdin), TCSANOW, &modmodes);
|
|
|
|
}
|
|
|
|
|
|
|
|
int tty_getchar()
|
|
|
|
{
|
|
|
|
fd_set rfds;
|
|
|
|
|
|
|
|
FD_ZERO (&rfds);
|
|
|
|
|
|
|
|
FD_SET (fileno (stdin), &rfds);
|
|
|
|
|
|
|
|
struct timeval tv;
|
|
|
|
|
|
|
|
tv.tv_sec = 1;
|
|
|
|
tv.tv_usec = 0;
|
|
|
|
|
|
|
|
int retval = select (1, &rfds, NULL, NULL, &tv);
|
|
|
|
|
|
|
|
if (retval == 0) return 0;
|
|
|
|
if (retval == -1) return -1;
|
|
|
|
|
|
|
|
return getchar();
|
|
|
|
}
|
|
|
|
|
|
|
|
int tty_fix()
|
|
|
|
{
|
|
|
|
if (!havemodes) return 0;
|
|
|
|
|
|
|
|
return tcsetattr (fileno (stdin), TCSADRAIN, &savemodes);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-02-23 23:55:06 +00:00
|
|
|
#if defined (__APPLE__) || defined (__FreeBSD__)
|
2016-09-06 11:16:38 +00:00
|
|
|
static struct termios savemodes;
|
|
|
|
static int havemodes = 0;
|
|
|
|
|
|
|
|
int tty_break()
|
|
|
|
{
|
|
|
|
struct termios modmodes;
|
|
|
|
|
|
|
|
if (ioctl (fileno (stdin), TIOCGETA, &savemodes) < 0) return -1;
|
|
|
|
|
|
|
|
havemodes = 1;
|
|
|
|
|
|
|
|
modmodes = savemodes;
|
|
|
|
modmodes.c_lflag &= ~ICANON;
|
|
|
|
modmodes.c_cc[VMIN] = 1;
|
|
|
|
modmodes.c_cc[VTIME] = 0;
|
|
|
|
|
|
|
|
return ioctl (fileno (stdin), TIOCSETAW, &modmodes);
|
|
|
|
}
|
|
|
|
|
|
|
|
int tty_getchar()
|
|
|
|
{
|
|
|
|
fd_set rfds;
|
|
|
|
|
|
|
|
FD_ZERO (&rfds);
|
|
|
|
|
|
|
|
FD_SET (fileno (stdin), &rfds);
|
|
|
|
|
|
|
|
struct timeval tv;
|
|
|
|
|
|
|
|
tv.tv_sec = 1;
|
|
|
|
tv.tv_usec = 0;
|
|
|
|
|
|
|
|
int retval = select (1, &rfds, NULL, NULL, &tv);
|
|
|
|
|
|
|
|
if (retval == 0) return 0;
|
|
|
|
if (retval == -1) return -1;
|
|
|
|
|
|
|
|
return getchar();
|
|
|
|
}
|
|
|
|
|
|
|
|
int tty_fix()
|
|
|
|
{
|
|
|
|
if (!havemodes) return 0;
|
|
|
|
|
|
|
|
return ioctl (fileno (stdin), TIOCSETAW, &savemodes);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-09-07 20:29:57 +00:00
|
|
|
#if defined (_WIN)
|
2016-09-06 11:16:38 +00:00
|
|
|
static DWORD saveMode = 0;
|
|
|
|
|
|
|
|
int tty_break()
|
|
|
|
{
|
|
|
|
HANDLE stdinHandle = GetStdHandle (STD_INPUT_HANDLE);
|
|
|
|
|
|
|
|
GetConsoleMode (stdinHandle, &saveMode);
|
|
|
|
SetConsoleMode (stdinHandle, ENABLE_PROCESSED_INPUT);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int tty_getchar()
|
|
|
|
{
|
|
|
|
HANDLE stdinHandle = GetStdHandle (STD_INPUT_HANDLE);
|
|
|
|
|
|
|
|
DWORD rc = WaitForSingleObject (stdinHandle, 1000);
|
|
|
|
|
|
|
|
if (rc == WAIT_TIMEOUT) return 0;
|
|
|
|
if (rc == WAIT_ABANDONED) return -1;
|
|
|
|
if (rc == WAIT_FAILED) return -1;
|
|
|
|
|
|
|
|
// The whole ReadConsoleInput () part is a workaround.
|
|
|
|
// For some unknown reason, maybe a mingw bug, a random signal
|
|
|
|
// is sent to stdin which unblocks WaitForSingleObject () and sets rc 0.
|
|
|
|
// Then it wants to read with getche () a keyboard input
|
|
|
|
// which has never been made.
|
|
|
|
|
|
|
|
INPUT_RECORD buf[100];
|
|
|
|
|
|
|
|
DWORD num = 0;
|
|
|
|
|
|
|
|
memset (buf, 0, sizeof (buf));
|
|
|
|
|
|
|
|
ReadConsoleInput (stdinHandle, buf, 100, &num);
|
|
|
|
|
|
|
|
FlushConsoleInputBuffer (stdinHandle);
|
|
|
|
|
|
|
|
for (DWORD i = 0; i < num; i++)
|
|
|
|
{
|
|
|
|
if (buf[i].EventType != KEY_EVENT) continue;
|
|
|
|
|
|
|
|
KEY_EVENT_RECORD KeyEvent = buf[i].Event.KeyEvent;
|
|
|
|
|
|
|
|
if (KeyEvent.bKeyDown != TRUE) continue;
|
|
|
|
|
|
|
|
return KeyEvent.uChar.AsciiChar;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int tty_fix()
|
|
|
|
{
|
|
|
|
HANDLE stdinHandle = GetStdHandle (STD_INPUT_HANDLE);
|
|
|
|
|
|
|
|
SetConsoleMode (stdinHandle, saveMode);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2017-03-24 09:45:40 +00:00
|
|
|
void compress_terminal_line_length (char *out_buf, const size_t keep_from_beginning, const size_t keep_from_end)
|
|
|
|
{
|
|
|
|
const size_t target_len = TERMINAL_LINE_LENGTH - keep_from_beginning;
|
|
|
|
|
|
|
|
const size_t out_len = strlen (out_buf);
|
|
|
|
|
|
|
|
if (out_len < target_len) return;
|
|
|
|
|
|
|
|
char *ptr1 = out_buf + target_len - 3 - keep_from_end;
|
|
|
|
char *ptr2 = out_buf + out_len - keep_from_end;
|
|
|
|
|
|
|
|
*ptr1++ = '.';
|
|
|
|
*ptr1++ = '.';
|
|
|
|
*ptr1++ = '.';
|
|
|
|
|
|
|
|
for (size_t i = 0; i < keep_from_end; i++)
|
|
|
|
{
|
|
|
|
*ptr1++ = *ptr2++;
|
|
|
|
}
|
|
|
|
|
|
|
|
*ptr1 = 0;
|
|
|
|
}
|
|
|
|
|
2016-10-25 14:40:06 +00:00
|
|
|
void opencl_info (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
{
|
|
|
|
const opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx;
|
|
|
|
|
|
|
|
event_log_info (hashcat_ctx, "OpenCL Info:");
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-10-25 14:40:06 +00:00
|
|
|
|
|
|
|
cl_uint platforms_cnt = opencl_ctx->platforms_cnt;
|
|
|
|
cl_platform_id *platforms = opencl_ctx->platforms;
|
|
|
|
char **platforms_vendor = opencl_ctx->platforms_vendor;
|
|
|
|
char **platforms_name = opencl_ctx->platforms_name;
|
|
|
|
char **platforms_version = opencl_ctx->platforms_version;
|
|
|
|
cl_uint devices_cnt = opencl_ctx->devices_cnt;
|
|
|
|
|
|
|
|
for (cl_uint platforms_idx = 0; platforms_idx < platforms_cnt; platforms_idx++)
|
|
|
|
{
|
|
|
|
cl_platform_id platform_id = platforms[platforms_idx];
|
|
|
|
char *platform_vendor = platforms_vendor[platforms_idx];
|
|
|
|
char *platform_name = platforms_name[platforms_idx];
|
|
|
|
char *platform_version = platforms_version[platforms_idx];
|
|
|
|
|
|
|
|
event_log_info (hashcat_ctx, "Platform ID #%u", platforms_idx + 1);
|
|
|
|
event_log_info (hashcat_ctx, " Vendor : %s", platform_vendor);
|
|
|
|
event_log_info (hashcat_ctx, " Name : %s", platform_name);
|
|
|
|
event_log_info (hashcat_ctx, " Version : %s", platform_version);
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-10-25 14:40:06 +00:00
|
|
|
|
|
|
|
for (cl_uint devices_idx = 0; devices_idx < devices_cnt; devices_idx++)
|
|
|
|
{
|
2016-10-26 09:24:00 +00:00
|
|
|
const hc_device_param_t *device_param = opencl_ctx->devices_param + devices_idx;
|
|
|
|
|
|
|
|
if (device_param->platform != platform_id) continue;
|
|
|
|
|
|
|
|
cl_device_type device_type = device_param->device_type;
|
|
|
|
cl_uint device_vendor_id = device_param->device_vendor_id;
|
|
|
|
char *device_vendor = device_param->device_vendor;
|
|
|
|
char *device_name = device_param->device_name;
|
|
|
|
u32 device_processors = device_param->device_processors;
|
|
|
|
u32 device_maxclock_frequency = device_param->device_maxclock_frequency;
|
|
|
|
u64 device_maxmem_alloc = device_param->device_maxmem_alloc;
|
|
|
|
u64 device_global_mem = device_param->device_global_mem;
|
|
|
|
char *device_opencl_version = device_param->device_opencl_version;
|
|
|
|
char *device_version = device_param->device_version;
|
|
|
|
char *driver_version = device_param->driver_version;
|
2016-10-25 14:40:06 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx, " Device ID #%u", devices_idx + 1);
|
|
|
|
event_log_info (hashcat_ctx, " Type : %s", ((device_type & CL_DEVICE_TYPE_CPU) ? "CPU" : ((device_type & CL_DEVICE_TYPE_GPU) ? "GPU" : "Accelerator")));
|
|
|
|
event_log_info (hashcat_ctx, " Vendor ID : %u", device_vendor_id);
|
|
|
|
event_log_info (hashcat_ctx, " Vendor : %s", device_vendor);
|
|
|
|
event_log_info (hashcat_ctx, " Name : %s", device_name);
|
|
|
|
event_log_info (hashcat_ctx, " Version : %s", device_version);
|
|
|
|
event_log_info (hashcat_ctx, " Processor(s) : %u", device_processors);
|
|
|
|
event_log_info (hashcat_ctx, " Clock : %u", device_maxclock_frequency);
|
|
|
|
event_log_info (hashcat_ctx, " Memory : %" PRIu64 "/%" PRIu64 " MB allocatable", device_maxmem_alloc / 1024 / 1024, device_global_mem / 1024 / 1024);
|
2016-10-31 08:19:37 +00:00
|
|
|
event_log_info (hashcat_ctx, " OpenCL Version : %s", device_opencl_version);
|
|
|
|
event_log_info (hashcat_ctx, " Driver Version : %s", driver_version);
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-10-25 14:40:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-26 09:24:00 +00:00
|
|
|
void opencl_info_compact (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
{
|
|
|
|
const opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx;
|
|
|
|
const user_options_t *user_options = hashcat_ctx->user_options;
|
|
|
|
|
|
|
|
if (user_options->quiet == true) return;
|
|
|
|
if (user_options->machine_readable == true) return;
|
|
|
|
|
|
|
|
cl_uint platforms_cnt = opencl_ctx->platforms_cnt;
|
|
|
|
cl_platform_id *platforms = opencl_ctx->platforms;
|
|
|
|
char **platforms_vendor = opencl_ctx->platforms_vendor;
|
|
|
|
bool *platforms_skipped = opencl_ctx->platforms_skipped;
|
|
|
|
cl_uint devices_cnt = opencl_ctx->devices_cnt;
|
|
|
|
|
|
|
|
for (cl_uint platforms_idx = 0; platforms_idx < platforms_cnt; platforms_idx++)
|
|
|
|
{
|
|
|
|
cl_platform_id platform_id = platforms[platforms_idx];
|
|
|
|
char *platform_vendor = platforms_vendor[platforms_idx];
|
|
|
|
bool platform_skipped = platforms_skipped[platforms_idx];
|
|
|
|
|
|
|
|
if (platform_skipped == false)
|
|
|
|
{
|
|
|
|
const int len = event_log_info (hashcat_ctx, "OpenCL Platform #%u: %s", platforms_idx + 1, platform_vendor);
|
|
|
|
|
|
|
|
char line[HCBUFSIZ_TINY];
|
|
|
|
|
|
|
|
memset (line, '=', len);
|
|
|
|
|
|
|
|
line[len] = 0;
|
|
|
|
|
2016-10-31 08:19:37 +00:00
|
|
|
event_log_info (hashcat_ctx, "%s", line);
|
2016-10-26 09:24:00 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
event_log_info (hashcat_ctx, "OpenCL Platform #%u: %s, skipped or no OpenCL compatible devices found", platforms_idx + 1, platform_vendor);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (cl_uint devices_idx = 0; devices_idx < devices_cnt; devices_idx++)
|
|
|
|
{
|
|
|
|
const hc_device_param_t *device_param = opencl_ctx->devices_param + devices_idx;
|
|
|
|
|
|
|
|
if (device_param->platform != platform_id) continue;
|
|
|
|
|
|
|
|
char *device_name = device_param->device_name;
|
|
|
|
u32 device_processors = device_param->device_processors;
|
|
|
|
u64 device_maxmem_alloc = device_param->device_maxmem_alloc;
|
|
|
|
u64 device_global_mem = device_param->device_global_mem;
|
|
|
|
|
|
|
|
if (device_param->skipped == false)
|
|
|
|
{
|
2016-10-31 08:19:37 +00:00
|
|
|
event_log_info (hashcat_ctx, "* Device #%u: %s, %" PRIu64 "/%" PRIu64 " MB allocatable, %uMCU",
|
2016-10-26 09:24:00 +00:00
|
|
|
devices_idx + 1,
|
|
|
|
device_name,
|
2016-10-31 08:19:37 +00:00
|
|
|
device_maxmem_alloc / 1024 / 1024,
|
|
|
|
device_global_mem / 1024 / 1024,
|
|
|
|
device_processors);
|
2016-10-26 09:24:00 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
event_log_info (hashcat_ctx, "* Device #%u: %s, skipped",
|
|
|
|
devices_idx + 1,
|
|
|
|
device_name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-10 18:46:52 +00:00
|
|
|
event_log_info (hashcat_ctx, NULL);
|
2016-10-26 09:24:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-16 17:32:43 +00:00
|
|
|
void status_display_machine_readable (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
{
|
2016-10-17 22:13:40 +00:00
|
|
|
const user_options_t *user_options = hashcat_ctx->user_options;
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-11-20 21:54:52 +00:00
|
|
|
hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
|
2016-10-17 22:13:40 +00:00
|
|
|
|
|
|
|
const int rc_status = hashcat_get_status (hashcat_ctx, hashcat_status);
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 22:13:40 +00:00
|
|
|
if (rc_status == -1)
|
2016-10-16 17:32:43 +00:00
|
|
|
{
|
2016-10-17 22:13:40 +00:00
|
|
|
hcfree (hashcat_status);
|
2016-10-16 17:32:43 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-11-14 00:56:31 +00:00
|
|
|
printf ("STATUS\t%d\t", hashcat_status->status_number);
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 22:13:40 +00:00
|
|
|
printf ("SPEED\t");
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 22:13:40 +00:00
|
|
|
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
|
2016-10-16 17:32:43 +00:00
|
|
|
{
|
2016-10-17 22:13:40 +00:00
|
|
|
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 22:13:40 +00:00
|
|
|
if (device_info->skipped_dev == true) continue;
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 22:15:25 +00:00
|
|
|
printf ("%" PRIu64 "\t", (u64) device_info->hashes_msec_dev);
|
|
|
|
|
|
|
|
// that 1\t is for backward compatibility
|
|
|
|
printf ("1\t");
|
2016-10-16 17:32:43 +00:00
|
|
|
}
|
|
|
|
|
2016-10-17 22:13:40 +00:00
|
|
|
printf ("EXEC_RUNTIME\t");
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 22:13:40 +00:00
|
|
|
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
|
2016-10-16 17:32:43 +00:00
|
|
|
{
|
2016-10-17 22:13:40 +00:00
|
|
|
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 22:13:40 +00:00
|
|
|
if (device_info->skipped_dev == true) continue;
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 22:13:40 +00:00
|
|
|
printf ("%f\t", device_info->exec_msec_dev);
|
2016-10-16 17:32:43 +00:00
|
|
|
}
|
|
|
|
|
2016-10-17 22:13:40 +00:00
|
|
|
printf ("CURKU\t%" PRIu64 "\t", hashcat_status->restore_point);
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 22:13:40 +00:00
|
|
|
printf ("PROGRESS\t%" PRIu64 "\t%" PRIu64 "\t", hashcat_status->progress_cur_relative_skip, hashcat_status->progress_end_relative_skip);
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-11-14 00:56:31 +00:00
|
|
|
printf ("RECHASH\t%d\t%d\t", hashcat_status->digests_done, hashcat_status->digests_cnt);
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-11-14 00:56:31 +00:00
|
|
|
printf ("RECSALT\t%d\t%d\t", hashcat_status->salts_done, hashcat_status->salts_cnt);
|
2016-10-16 17:32:43 +00:00
|
|
|
|
|
|
|
if (user_options->gpu_temp_disable == false)
|
|
|
|
{
|
2016-10-17 22:13:40 +00:00
|
|
|
printf ("TEMP\t");
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 22:13:40 +00:00
|
|
|
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
|
2016-10-16 17:32:43 +00:00
|
|
|
{
|
2016-10-17 22:13:40 +00:00
|
|
|
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 22:13:40 +00:00
|
|
|
if (device_info->skipped_dev == true) continue;
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 22:13:40 +00:00
|
|
|
// ok, little cheat here...
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 22:13:40 +00:00
|
|
|
const int temp = hm_get_temperature_with_device_id (hashcat_ctx, device_id);
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 22:13:40 +00:00
|
|
|
printf ("%d\t", temp);
|
|
|
|
}
|
2016-10-16 17:32:43 +00:00
|
|
|
}
|
|
|
|
|
2017-03-30 07:47:52 +00:00
|
|
|
printf ("REJECTED\t%" PRIu64 "\t", hashcat_status->progress_rejected);
|
|
|
|
|
2016-10-25 10:25:53 +00:00
|
|
|
fwrite (EOL, strlen (EOL), 1, stdout);
|
2016-10-17 22:13:40 +00:00
|
|
|
|
|
|
|
fflush (stdout);
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 22:13:40 +00:00
|
|
|
hcfree (hashcat_status);
|
2016-10-16 17:32:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void status_display (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
{
|
2016-10-17 21:49:44 +00:00
|
|
|
const user_options_t *user_options = hashcat_ctx->user_options;
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
if (user_options->machine_readable == true)
|
2016-10-16 17:32:43 +00:00
|
|
|
{
|
2016-10-17 21:49:44 +00:00
|
|
|
status_display_machine_readable (hashcat_ctx);
|
2016-10-16 17:32:43 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-11-20 21:54:52 +00:00
|
|
|
hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
const int rc_status = hashcat_get_status (hashcat_ctx, hashcat_status);
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
if (rc_status == -1)
|
2016-10-16 17:32:43 +00:00
|
|
|
{
|
2016-10-17 21:49:44 +00:00
|
|
|
hcfree (hashcat_status);
|
2016-10-16 17:32:43 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* show something
|
|
|
|
*/
|
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Session..........: %s",
|
2016-10-17 21:49:44 +00:00
|
|
|
hashcat_status->session);
|
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Status...........: %s",
|
2016-10-17 22:27:15 +00:00
|
|
|
hashcat_status->status_string);
|
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Hash.Type........: %s",
|
2016-10-17 22:27:15 +00:00
|
|
|
hashcat_status->hash_type);
|
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Hash.Target......: %s",
|
2016-10-17 22:27:15 +00:00
|
|
|
hashcat_status->hash_target);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Time.Started.....: %s (%s)",
|
2016-10-17 21:49:44 +00:00
|
|
|
hashcat_status->time_started_absolute,
|
|
|
|
hashcat_status->time_started_relative);
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Time.Estimated...: %s (%s)",
|
2016-10-17 21:49:44 +00:00
|
|
|
hashcat_status->time_estimated_absolute,
|
|
|
|
hashcat_status->time_estimated_relative);
|
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
switch (hashcat_status->guess_mode)
|
2016-10-16 17:32:43 +00:00
|
|
|
{
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_STRAIGHT_FILE:
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Base.......: File (%s)",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_base);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2016-10-16 17:32:43 +00:00
|
|
|
break;
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_STRAIGHT_FILE_RULES_FILE:
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Base.......: File (%s)",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_base);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Mod........: Rules (%s)",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_mod);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2016-10-16 17:32:43 +00:00
|
|
|
break;
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_STRAIGHT_FILE_RULES_GEN:
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Base.......: File (%s)",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_base);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Mod........: Rules (Generated)");
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2016-10-16 17:32:43 +00:00
|
|
|
break;
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_STRAIGHT_STDIN:
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Base.......: Pipe");
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2016-10-16 17:32:43 +00:00
|
|
|
break;
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_STRAIGHT_STDIN_RULES_FILE:
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Base.......: Pipe");
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Mod........: Rules (%s)",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_mod);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2016-10-16 17:32:43 +00:00
|
|
|
break;
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_STRAIGHT_STDIN_RULES_GEN:
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Base.......: Pipe");
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Mod........: Rules (Generated)");
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2016-10-16 17:32:43 +00:00
|
|
|
break;
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_COMBINATOR_BASE_LEFT:
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Base.......: File (%s), Left Side",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_base);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Mod........: File (%s), Right Side",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_mod);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2016-10-16 17:32:43 +00:00
|
|
|
break;
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_COMBINATOR_BASE_RIGHT:
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Base.......: File (%s), Right Side",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_base);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Mod........: File (%s), Left Side",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_mod);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2016-10-16 17:32:43 +00:00
|
|
|
break;
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_MASK:
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Mask.......: %s [%d]",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_base,
|
|
|
|
hashcat_status->guess_mask_length);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2016-10-16 17:32:43 +00:00
|
|
|
break;
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_MASK_CS:
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Mask.......: %s [%d]",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_base,
|
|
|
|
hashcat_status->guess_mask_length);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Charset....: %s ",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_charset);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2016-10-16 17:32:43 +00:00
|
|
|
break;
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_HYBRID1:
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Base.......: File (%s), Left Side",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_base);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Mod........: Mask (%s) [%d], Right Side",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_mod,
|
|
|
|
hashcat_status->guess_mask_length);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2016-10-16 17:32:43 +00:00
|
|
|
break;
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_HYBRID1_CS:
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Base.......: File (%s), Left Side",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_base);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Mod........: Mask (%s) [%d], Right Side",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_mod,
|
|
|
|
hashcat_status->guess_mask_length);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Charset....: %s",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_charset);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2016-10-16 17:32:43 +00:00
|
|
|
break;
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_HYBRID2:
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Base.......: File (%s), Right Side",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_base);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Mod........: Mask (%s) [%d], Left Side",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_mod,
|
|
|
|
hashcat_status->guess_mask_length);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2016-10-16 17:32:43 +00:00
|
|
|
break;
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_HYBRID2_CS:
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Base.......: File (%s), Right Side",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_base);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Mod........: Mask (%s) [%d], Left Side",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_mod,
|
|
|
|
hashcat_status->guess_mask_length);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Charset....: %s",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_charset);
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2016-10-16 17:32:43 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
switch (hashcat_status->guess_mode)
|
2016-11-10 21:30:17 +00:00
|
|
|
{
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_STRAIGHT_FILE:
|
2016-11-10 21:30:17 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Queue......: %d/%d (%.02f%%)",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_base_offset,
|
|
|
|
hashcat_status->guess_base_count,
|
|
|
|
hashcat_status->guess_base_percent);
|
2016-11-10 21:30:17 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_STRAIGHT_FILE_RULES_FILE:
|
2016-12-31 12:37:26 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Queue......: %d/%d (%.02f%%)",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_base_offset,
|
|
|
|
hashcat_status->guess_base_count,
|
|
|
|
hashcat_status->guess_base_percent);
|
2016-12-31 12:37:26 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_STRAIGHT_FILE_RULES_GEN:
|
2016-12-31 12:37:26 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Queue......: %d/%d (%.02f%%)",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_base_offset,
|
|
|
|
hashcat_status->guess_base_count,
|
|
|
|
hashcat_status->guess_base_percent);
|
2016-12-31 12:37:26 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_MASK:
|
2016-11-10 21:30:17 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Queue......: %d/%d (%.02f%%)",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_base_offset,
|
|
|
|
hashcat_status->guess_base_count,
|
|
|
|
hashcat_status->guess_base_percent);
|
2016-11-10 21:30:17 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_MASK_CS:
|
2016-12-29 09:43:58 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Queue......: %d/%d (%.02f%%)",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_base_offset,
|
|
|
|
hashcat_status->guess_base_count,
|
|
|
|
hashcat_status->guess_base_percent);
|
2016-12-29 09:43:58 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_HYBRID1:
|
2016-11-10 21:30:17 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Queue.Base.: %d/%d (%.02f%%)",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_base_offset,
|
|
|
|
hashcat_status->guess_base_count,
|
|
|
|
hashcat_status->guess_base_percent);
|
2016-11-10 21:30:17 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Queue.Mod..: %d/%d (%.02f%%)",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_mod_offset,
|
|
|
|
hashcat_status->guess_mod_count,
|
|
|
|
hashcat_status->guess_mod_percent);
|
2016-11-10 21:30:17 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
case GUESS_MODE_HYBRID2:
|
2016-11-10 21:30:17 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Queue.Base.: %d/%d (%.02f%%)",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_base_offset,
|
|
|
|
hashcat_status->guess_base_count,
|
|
|
|
hashcat_status->guess_base_percent);
|
2016-11-10 21:30:17 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Guess.Queue.Mod..: %d/%d (%.02f%%)",
|
2017-03-24 22:39:09 +00:00
|
|
|
hashcat_status->guess_mod_offset,
|
|
|
|
hashcat_status->guess_mod_count,
|
|
|
|
hashcat_status->guess_mod_percent);
|
2016-11-10 21:30:17 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
|
2016-10-17 14:46:16 +00:00
|
|
|
{
|
2016-10-17 21:49:44 +00:00
|
|
|
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
2016-10-17 14:46:16 +00:00
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
if (device_info->skipped_dev == true) continue;
|
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Speed.Dev.#%d.....: %9sH/s (%0.2fms)", device_id + 1,
|
2016-10-17 22:27:15 +00:00
|
|
|
device_info->speed_sec_dev,
|
|
|
|
device_info->exec_msec_dev);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hashcat_status->device_info_active > 1)
|
|
|
|
{
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Speed.Dev.#*.....: %9sH/s",
|
2016-10-17 22:27:15 +00:00
|
|
|
hashcat_status->speed_sec_all);
|
2016-10-17 14:46:16 +00:00
|
|
|
}
|
|
|
|
|
2016-10-17 22:27:15 +00:00
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Recovered........: %d/%d (%.2f%%) Digests, %d/%d (%.2f%%) Salts",
|
2016-10-17 22:27:15 +00:00
|
|
|
hashcat_status->digests_done,
|
|
|
|
hashcat_status->digests_cnt,
|
|
|
|
hashcat_status->digests_percent,
|
|
|
|
hashcat_status->salts_done,
|
|
|
|
hashcat_status->salts_cnt,
|
|
|
|
hashcat_status->salts_percent);
|
|
|
|
|
2016-11-30 10:12:30 +00:00
|
|
|
if (hashcat_status->digests_cnt > 1000)
|
|
|
|
{
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Recovered/Time...: %s",
|
2016-11-30 10:12:30 +00:00
|
|
|
hashcat_status->cpt);
|
|
|
|
}
|
2016-10-17 22:27:15 +00:00
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
switch (hashcat_status->progress_mode)
|
2016-10-17 14:22:32 +00:00
|
|
|
{
|
|
|
|
case PROGRESS_MODE_KEYSPACE_KNOWN:
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Progress.........: %" PRIu64 "/%" PRIu64 " (%.02f%%)",
|
2016-10-17 21:49:44 +00:00
|
|
|
hashcat_status->progress_cur_relative_skip,
|
|
|
|
hashcat_status->progress_end_relative_skip,
|
|
|
|
hashcat_status->progress_finished_percent);
|
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Rejected.........: %" PRIu64 "/%" PRIu64 " (%.02f%%)",
|
2016-10-17 21:49:44 +00:00
|
|
|
hashcat_status->progress_rejected,
|
|
|
|
hashcat_status->progress_cur_relative_skip,
|
|
|
|
hashcat_status->progress_rejected_percent);
|
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Restore.Point....: %" PRIu64 "/%" PRIu64 " (%.02f%%)",
|
2016-10-17 21:49:44 +00:00
|
|
|
hashcat_status->restore_point,
|
|
|
|
hashcat_status->restore_total,
|
|
|
|
hashcat_status->restore_percent);
|
|
|
|
|
2016-10-17 14:22:32 +00:00
|
|
|
break;
|
2016-10-17 21:49:44 +00:00
|
|
|
|
2016-10-17 14:22:32 +00:00
|
|
|
case PROGRESS_MODE_KEYSPACE_UNKNOWN:
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Progress.........: %" PRIu64,
|
2016-10-17 21:49:44 +00:00
|
|
|
hashcat_status->progress_cur_relative_skip);
|
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Rejected.........: %" PRIu64,
|
2016-10-17 21:49:44 +00:00
|
|
|
hashcat_status->progress_rejected);
|
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Restore.Point....: %" PRIu64,
|
2016-10-17 21:49:44 +00:00
|
|
|
hashcat_status->restore_point);
|
|
|
|
|
2016-10-17 14:22:32 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
|
2016-10-17 13:19:25 +00:00
|
|
|
{
|
2016-10-17 21:49:44 +00:00
|
|
|
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
|
|
|
|
|
|
|
if (device_info->skipped_dev == true) continue;
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2017-03-24 22:39:09 +00:00
|
|
|
if (device_info->guess_candidates_dev == NULL) continue;
|
2016-10-23 15:31:22 +00:00
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Candidates.#%d....: %s", device_id + 1,
|
2017-03-24 22:39:09 +00:00
|
|
|
device_info->guess_candidates_dev);
|
2016-10-17 15:02:56 +00:00
|
|
|
}
|
2016-10-16 17:32:43 +00:00
|
|
|
|
|
|
|
if (user_options->gpu_temp_disable == false)
|
|
|
|
{
|
2016-10-17 21:49:44 +00:00
|
|
|
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
|
2016-10-16 17:32:43 +00:00
|
|
|
{
|
2016-10-17 21:49:44 +00:00
|
|
|
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
|
|
|
|
|
|
|
if (device_info->skipped_dev == true) continue;
|
2016-10-23 15:31:22 +00:00
|
|
|
|
|
|
|
if (device_info->hwmon_dev == NULL) continue;
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"HWMon.Dev.#%d.....: %s", device_id + 1,
|
2016-10-17 21:49:44 +00:00
|
|
|
device_info->hwmon_dev);
|
2016-10-16 17:32:43 +00:00
|
|
|
}
|
|
|
|
}
|
2016-10-17 21:49:44 +00:00
|
|
|
|
|
|
|
hcfree (hashcat_status);
|
2016-10-16 17:32:43 +00:00
|
|
|
}
|
|
|
|
|
2016-12-09 22:44:43 +00:00
|
|
|
void status_benchmark_machine_readable (hashcat_ctx_t *hashcat_ctx)
|
2016-10-16 17:32:43 +00:00
|
|
|
{
|
|
|
|
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
|
|
|
|
2016-10-17 15:20:19 +00:00
|
|
|
const u32 hash_mode = hashconfig->hash_mode;
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-11-20 21:54:52 +00:00
|
|
|
hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
const int rc_status = hashcat_get_status (hashcat_ctx, hashcat_status);
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
if (rc_status == -1)
|
2016-10-16 17:32:43 +00:00
|
|
|
{
|
2016-10-17 21:49:44 +00:00
|
|
|
hcfree (hashcat_status);
|
2016-10-16 17:32:43 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
|
2016-10-16 17:32:43 +00:00
|
|
|
{
|
2016-10-17 21:49:44 +00:00
|
|
|
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
if (device_info->skipped_dev == true) continue;
|
|
|
|
|
2016-11-30 23:02:26 +00:00
|
|
|
event_log_info (hashcat_ctx, "%d:%u:%d:%d:%.2f:%" PRIu64, device_id + 1, hash_mode, device_info->corespeed_dev, device_info->memoryspeed_dev, device_info->exec_msec_dev, (u64) (device_info->hashes_msec_dev_benchmark * 1000));
|
2016-10-16 17:32:43 +00:00
|
|
|
}
|
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
hcfree (hashcat_status);
|
|
|
|
}
|
|
|
|
|
|
|
|
void status_benchmark (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
{
|
|
|
|
const user_options_t *user_options = hashcat_ctx->user_options;
|
2016-10-16 17:32:43 +00:00
|
|
|
|
|
|
|
if (user_options->machine_readable == true)
|
|
|
|
{
|
2016-12-09 22:44:43 +00:00
|
|
|
status_benchmark_machine_readable (hashcat_ctx);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
|
|
|
|
|
|
|
|
const int rc_status = hashcat_get_status (hashcat_ctx, hashcat_status);
|
|
|
|
|
|
|
|
if (rc_status == -1)
|
|
|
|
{
|
|
|
|
hcfree (hashcat_status);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
|
|
|
|
{
|
|
|
|
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
|
|
|
|
|
|
|
if (device_info->skipped_dev == true) continue;
|
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Speed.Dev.#%d.....: %9sH/s (%0.2fms)", device_id + 1,
|
2016-12-09 22:44:43 +00:00
|
|
|
device_info->speed_sec_dev,
|
|
|
|
device_info->exec_msec_dev);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hashcat_status->device_info_active > 1)
|
|
|
|
{
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Speed.Dev.#*.....: %9sH/s",
|
2016-12-09 22:44:43 +00:00
|
|
|
hashcat_status->speed_sec_all);
|
|
|
|
}
|
|
|
|
|
|
|
|
hcfree (hashcat_status);
|
|
|
|
}
|
|
|
|
|
|
|
|
void status_speed_machine_readable (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
{
|
|
|
|
hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
|
|
|
|
|
|
|
|
const int rc_status = hashcat_get_status (hashcat_ctx, hashcat_status);
|
|
|
|
|
|
|
|
if (rc_status == -1)
|
|
|
|
{
|
|
|
|
hcfree (hashcat_status);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
|
|
|
|
{
|
|
|
|
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
|
|
|
|
|
|
|
if (device_info->skipped_dev == true) continue;
|
|
|
|
|
|
|
|
event_log_info (hashcat_ctx, "%d:%" PRIu64, device_id + 1, (u64) (device_info->hashes_msec_dev_benchmark * 1000));
|
|
|
|
}
|
|
|
|
|
|
|
|
hcfree (hashcat_status);
|
|
|
|
}
|
|
|
|
|
|
|
|
void status_speed (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
{
|
|
|
|
const user_options_t *user_options = hashcat_ctx->user_options;
|
|
|
|
|
|
|
|
if (user_options->machine_readable == true)
|
|
|
|
{
|
|
|
|
status_speed_machine_readable (hashcat_ctx);
|
2016-10-16 17:32:43 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-11-20 21:54:52 +00:00
|
|
|
hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
const int rc_status = hashcat_get_status (hashcat_ctx, hashcat_status);
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
if (rc_status == -1)
|
2016-10-16 17:32:43 +00:00
|
|
|
{
|
2016-10-17 21:49:44 +00:00
|
|
|
hcfree (hashcat_status);
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
return;
|
2016-10-16 17:32:43 +00:00
|
|
|
}
|
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
|
2016-10-16 17:32:43 +00:00
|
|
|
{
|
2016-10-17 21:49:44 +00:00
|
|
|
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
if (device_info->skipped_dev == true) continue;
|
2016-10-16 17:32:43 +00:00
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Speed.Dev.#%d.....: %9sH/s (%0.2fms)", device_id + 1,
|
2016-10-17 21:49:44 +00:00
|
|
|
device_info->speed_sec_dev,
|
|
|
|
device_info->exec_msec_dev);
|
2016-10-16 17:32:43 +00:00
|
|
|
}
|
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
if (hashcat_status->device_info_active > 1)
|
2016-10-16 17:32:43 +00:00
|
|
|
{
|
2016-10-17 21:49:44 +00:00
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Speed.Dev.#*.....: %9sH/s",
|
2016-10-17 21:49:44 +00:00
|
|
|
hashcat_status->speed_sec_all);
|
2016-10-16 17:32:43 +00:00
|
|
|
}
|
|
|
|
|
2016-10-17 21:49:44 +00:00
|
|
|
hcfree (hashcat_status);
|
2016-10-16 17:32:43 +00:00
|
|
|
}
|
2016-12-09 22:44:43 +00:00
|
|
|
|
|
|
|
void status_progress_machine_readable (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
{
|
|
|
|
hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
|
|
|
|
|
|
|
|
const int rc_status = hashcat_get_status (hashcat_ctx, hashcat_status);
|
|
|
|
|
|
|
|
if (rc_status == -1)
|
|
|
|
{
|
|
|
|
hcfree (hashcat_status);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
|
|
|
|
{
|
|
|
|
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
|
|
|
|
|
|
|
if (device_info->skipped_dev == true) continue;
|
|
|
|
|
|
|
|
event_log_info (hashcat_ctx, "%d:%d:%0.2f", device_id + 1, device_info->progress_dev, device_info->runtime_msec_dev);
|
|
|
|
}
|
|
|
|
|
|
|
|
hcfree (hashcat_status);
|
|
|
|
}
|
|
|
|
|
|
|
|
void status_progress (hashcat_ctx_t *hashcat_ctx)
|
|
|
|
{
|
|
|
|
const user_options_t *user_options = hashcat_ctx->user_options;
|
|
|
|
|
|
|
|
if (user_options->machine_readable == true)
|
|
|
|
{
|
|
|
|
status_progress_machine_readable (hashcat_ctx);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
|
|
|
|
|
|
|
|
const int rc_status = hashcat_get_status (hashcat_ctx, hashcat_status);
|
|
|
|
|
|
|
|
if (rc_status == -1)
|
|
|
|
{
|
|
|
|
hcfree (hashcat_status);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
|
|
|
|
{
|
|
|
|
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
|
|
|
|
|
|
|
if (device_info->skipped_dev == true) continue;
|
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Progress.Dev.#%d..: %d", device_id + 1,
|
2016-12-09 22:44:43 +00:00
|
|
|
device_info->progress_dev);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
|
|
|
|
{
|
|
|
|
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
|
|
|
|
|
|
|
if (device_info->skipped_dev == true) continue;
|
|
|
|
|
|
|
|
event_log_info (hashcat_ctx,
|
2017-03-25 15:11:01 +00:00
|
|
|
"Runtime.Dev.#%d...: %0.2fms", device_id + 1,
|
2016-12-09 22:44:43 +00:00
|
|
|
device_info->runtime_msec_dev);
|
|
|
|
}
|
|
|
|
|
|
|
|
hcfree (hashcat_status);
|
|
|
|
}
|