mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-21 23:58:07 +00:00
Added command prompt [f]inish to instruct hashcat to finish the current attack and quit afterwards
This commit is contained in:
parent
7baad686fa
commit
32b40d5c53
@ -20,6 +20,8 @@
|
||||
- Added hash-mode: RAR3-p (Compressed)
|
||||
- Added hash-mode: RAR3-p (Uncompressed)
|
||||
- Added hash-mode: RSA/DSA/EC/OPENSSH Private Keys
|
||||
- Added hash-mode: SolarWinds Orion v2
|
||||
- Added hash-mode: SolarWinds Serv-U
|
||||
- Added hash-mode: SQLCipher
|
||||
- Added hash-mode: Stargazer Stellar Wallet XLM
|
||||
- Added hash-mode: Stuffit5
|
||||
@ -27,13 +29,12 @@
|
||||
- Added hash-mode: Umbraco HMAC-SHA1
|
||||
- Added hash-mode: sha1($salt.sha1($pass.$salt))
|
||||
- Added hash-mode: sha1(sha1($pass).$salt)
|
||||
- Added hash-mode: SolarWinds Orion v2
|
||||
- Added hash-mode: SolarWinds Serv-U
|
||||
|
||||
##
|
||||
## Features
|
||||
##
|
||||
|
||||
- Added command prompt [f]inish to instruct hashcat to finish the current attack and quit afterwards
|
||||
- Added support for true UTF8 to UTF16 conversion in kernel crypto library
|
||||
- Added option --hash-info to show generic information for each hash-mode
|
||||
- Removed option --example-hashes, now is an alias of --hash-info
|
||||
|
@ -15,6 +15,7 @@ int hashcat_session_pause (hashcat_ctx_t *hashcat_ctx);
|
||||
int hashcat_session_resume (hashcat_ctx_t *hashcat_ctx);
|
||||
int hashcat_session_bypass (hashcat_ctx_t *hashcat_ctx);
|
||||
int hashcat_session_checkpoint (hashcat_ctx_t *hashcat_ctx);
|
||||
int hashcat_session_finish (hashcat_ctx_t *hashcat_ctx);
|
||||
int hashcat_session_quit (hashcat_ctx_t *hashcat_ctx);
|
||||
int hashcat_session_destroy (hashcat_ctx_t *hashcat_ctx);
|
||||
|
||||
|
@ -77,11 +77,13 @@ void hc_signal (void (callback) (int));
|
||||
int mycracked (hashcat_ctx_t *hashcat_ctx);
|
||||
int myabort_runtime (hashcat_ctx_t *hashcat_ctx);
|
||||
int myabort_checkpoint (hashcat_ctx_t *hashcat_ctx);
|
||||
int myabort_finish (hashcat_ctx_t *hashcat_ctx);
|
||||
int myabort (hashcat_ctx_t *hashcat_ctx);
|
||||
int myquit (hashcat_ctx_t *hashcat_ctx);
|
||||
int bypass (hashcat_ctx_t *hashcat_ctx);
|
||||
int SuspendThreads (hashcat_ctx_t *hashcat_ctx);
|
||||
int ResumeThreads (hashcat_ctx_t *hashcat_ctx);
|
||||
int stop_at_checkpoint (hashcat_ctx_t *hashcat_ctx);
|
||||
int finish_after_attack (hashcat_ctx_t *hashcat_ctx);
|
||||
|
||||
#endif // _THREAD_H
|
||||
|
@ -209,6 +209,7 @@ typedef enum status_rc
|
||||
STATUS_ABORTED_CHECKPOINT = 10,
|
||||
STATUS_ABORTED_RUNTIME = 11,
|
||||
STATUS_ERROR = 13,
|
||||
STATUS_ABORTED_FINISH = 14,
|
||||
|
||||
} status_rc_t;
|
||||
|
||||
@ -2348,6 +2349,7 @@ typedef struct status_ctx
|
||||
bool shutdown_outer;
|
||||
|
||||
bool checkpoint_shutdown;
|
||||
bool finish_shutdown;
|
||||
|
||||
hc_thread_mutex_t mux_dispatcher;
|
||||
hc_thread_mutex_t mux_counter;
|
||||
|
@ -270,10 +270,16 @@ static int inner2_loop (hashcat_ctx_t *hashcat_ctx)
|
||||
myabort_checkpoint (hashcat_ctx);
|
||||
}
|
||||
|
||||
if ((status_ctx->devices_status == STATUS_RUNNING) && (status_ctx->finish_shutdown == true))
|
||||
{
|
||||
myabort_finish (hashcat_ctx);
|
||||
}
|
||||
|
||||
if ((status_ctx->devices_status != STATUS_CRACKED)
|
||||
&& (status_ctx->devices_status != STATUS_ERROR)
|
||||
&& (status_ctx->devices_status != STATUS_ABORTED)
|
||||
&& (status_ctx->devices_status != STATUS_ABORTED_CHECKPOINT)
|
||||
&& (status_ctx->devices_status != STATUS_ABORTED_FINISH)
|
||||
&& (status_ctx->devices_status != STATUS_ABORTED_RUNTIME)
|
||||
&& (status_ctx->devices_status != STATUS_QUIT)
|
||||
&& (status_ctx->devices_status != STATUS_BYPASS))
|
||||
@ -1234,6 +1240,7 @@ int hashcat_session_execute (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
if (rc_final == 0)
|
||||
{
|
||||
if (status_ctx->devices_status == STATUS_ABORTED_FINISH) rc_final = 5;
|
||||
if (status_ctx->devices_status == STATUS_ABORTED_RUNTIME) rc_final = 4;
|
||||
if (status_ctx->devices_status == STATUS_ABORTED_CHECKPOINT) rc_final = 3;
|
||||
if (status_ctx->devices_status == STATUS_ABORTED) rc_final = 2;
|
||||
@ -1278,6 +1285,11 @@ int hashcat_session_checkpoint (hashcat_ctx_t *hashcat_ctx)
|
||||
return stop_at_checkpoint (hashcat_ctx);
|
||||
}
|
||||
|
||||
int hashcat_session_finish (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
return finish_after_attack (hashcat_ctx);
|
||||
}
|
||||
|
||||
int hashcat_session_quit (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
return myabort (hashcat_ctx);
|
||||
|
@ -32,6 +32,8 @@ static const char *ST_0010 = "Aborted (Checkpoint)";
|
||||
static const char *ST_0011 = "Aborted (Runtime)";
|
||||
static const char *ST_0012 = "Running (Checkpoint Quit requested)";
|
||||
static const char *ST_0013 = "Error";
|
||||
static const char *ST_0014 = "Aborted (Finish)";
|
||||
static const char *ST_0015 = "Running (Quit after attack requested)";
|
||||
static const char *ST_9999 = "Unknown! Bug!";
|
||||
|
||||
static const char UNITS[7] = { ' ', 'k', 'M', 'G', 'T', 'P', 'E' };
|
||||
@ -267,6 +269,11 @@ const char *status_get_status_string (const hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
return ST_0012;
|
||||
}
|
||||
|
||||
if (status_ctx->finish_shutdown == true)
|
||||
{
|
||||
return ST_0015;
|
||||
}
|
||||
}
|
||||
|
||||
switch (devices_status)
|
||||
@ -284,6 +291,7 @@ const char *status_get_status_string (const hashcat_ctx_t *hashcat_ctx)
|
||||
case STATUS_ABORTED_CHECKPOINT: return ST_0010;
|
||||
case STATUS_ABORTED_RUNTIME: return ST_0011;
|
||||
case STATUS_ERROR: return ST_0013;
|
||||
case STATUS_ABORTED_FINISH: return ST_0014;
|
||||
}
|
||||
|
||||
return ST_9999;
|
||||
@ -2197,6 +2205,7 @@ int status_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
status_ctx->shutdown_outer = false;
|
||||
|
||||
status_ctx->checkpoint_shutdown = false;
|
||||
status_ctx->finish_shutdown = false;
|
||||
|
||||
status_ctx->hashcat_status_final = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
|
||||
static const size_t TERMINAL_LINE_LENGTH = 79;
|
||||
|
||||
static const char *PROMPT_ACTIVE = "[s]tatus [p]ause [b]ypass [c]heckpoint [q]uit => ";
|
||||
static const char *PROMPT_PAUSED = "[s]tatus [r]esume [b]ypass [c]heckpoint [q]uit => ";
|
||||
static const char *PROMPT_ACTIVE = "[s]tatus [p]ause [b]ypass [c]heckpoint [f]inish [q]uit => ";
|
||||
static const char *PROMPT_PAUSED = "[s]tatus [r]esume [b]ypass [c]heckpoint [f]inish [q]uit => ";
|
||||
|
||||
void welcome_screen (hashcat_ctx_t *hashcat_ctx, const char *version_tag)
|
||||
{
|
||||
@ -292,6 +292,27 @@ static void keypress (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
|
||||
event_log_info (hashcat_ctx, NULL);
|
||||
|
||||
finish_after_attack (hashcat_ctx);
|
||||
|
||||
if (status_ctx->finish_shutdown == true)
|
||||
{
|
||||
event_log_info (hashcat_ctx, "Finish enabled. Will quit after this attack.");
|
||||
}
|
||||
else
|
||||
{
|
||||
event_log_info (hashcat_ctx, "Finish disabled. Will continue after this attack.");
|
||||
}
|
||||
|
||||
event_log_info (hashcat_ctx, NULL);
|
||||
|
||||
if (quiet == false) send_prompt (hashcat_ctx);
|
||||
|
||||
break;
|
||||
|
||||
case 'q':
|
||||
|
||||
event_log_info (hashcat_ctx, NULL);
|
||||
|
52
src/thread.c
52
src/thread.c
@ -144,6 +144,21 @@ int myabort_checkpoint (hashcat_ctx_t *hashcat_ctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int myabort_finish (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
|
||||
|
||||
status_ctx->devices_status = STATUS_ABORTED_FINISH;
|
||||
|
||||
status_ctx->run_main_level1 = false;
|
||||
status_ctx->run_main_level2 = false;
|
||||
status_ctx->run_main_level3 = false;
|
||||
status_ctx->run_thread_level1 = false;
|
||||
status_ctx->run_thread_level2 = false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int myabort_runtime (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
|
||||
@ -209,6 +224,9 @@ int bypass (hashcat_ctx_t *hashcat_ctx)
|
||||
status_ctx->run_thread_level1 = false;
|
||||
status_ctx->run_thread_level2 = false;
|
||||
|
||||
status_ctx->checkpoint_shutdown = false;
|
||||
status_ctx->finish_shutdown = false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -242,7 +260,7 @@ int ResumeThreads (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
int stop_at_checkpoint (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
|
||||
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
|
||||
|
||||
if (status_ctx->devices_status != STATUS_RUNNING) return -1;
|
||||
|
||||
@ -282,3 +300,35 @@ int stop_at_checkpoint (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int finish_after_attack (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
|
||||
|
||||
if (status_ctx->devices_status != STATUS_RUNNING) return -1;
|
||||
|
||||
// Enable or Disable
|
||||
|
||||
if (status_ctx->finish_shutdown == false)
|
||||
{
|
||||
status_ctx->finish_shutdown = true;
|
||||
|
||||
status_ctx->run_main_level1 = false;
|
||||
status_ctx->run_main_level2 = false;
|
||||
status_ctx->run_main_level3 = false;
|
||||
status_ctx->run_thread_level1 = true;
|
||||
status_ctx->run_thread_level2 = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
status_ctx->finish_shutdown = false;
|
||||
|
||||
status_ctx->run_main_level1 = true;
|
||||
status_ctx->run_main_level2 = true;
|
||||
status_ctx->run_main_level3 = true;
|
||||
status_ctx->run_thread_level1 = true;
|
||||
status_ctx->run_thread_level2 = true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user