diff --git a/common/queue/queue.go b/common/queue/queue.go index b591d1a..8031ab4 100644 --- a/common/queue/queue.go +++ b/common/queue/queue.go @@ -974,6 +974,12 @@ func (q *Queue) updateQueue() { "JobID": retJob.UUID, "PurgeTime": retJob.PurgeTime, }).Debug("Updated PurgeTime value") + + err := q.pool[jobs[i].ResAssigned].Client.Call("Queue.TaskDone", jobStatus, &retJob) + // we care about the errors, but only from a logging perspective + if err != nil { + log.WithField("rpc error", err.Error()).Error("Error during RPC call.") + } } err = q.db.UpdateJob(retJob) diff --git a/plugins/tools/hashcat5/output-parse.go b/plugins/tools/hashcat5/output-parse.go index 3b72b4a..0116d1b 100644 --- a/plugins/tools/hashcat5/output-parse.go +++ b/plugins/tools/hashcat5/output-parse.go @@ -50,7 +50,7 @@ var StatusTable = map[string]string{ // ParseMachineOutput returns a Status for a given status line func ParseMachineOutput(out string) (Status, error) { - log.WithField("status2Parse", out).Debug("Parsing machine output") + //log.WithField("status2Parse", out).Debug("Parsing machine output") if len(out) < 6 { // Empty stdout so return empty status diff --git a/plugins/tools/hashcat5/tasker.go b/plugins/tools/hashcat5/tasker.go index 80709eb..c8ccf66 100644 --- a/plugins/tools/hashcat5/tasker.go +++ b/plugins/tools/hashcat5/tasker.go @@ -119,7 +119,9 @@ func (t *Tasker) Status() common.Job { t.job.PerformanceData[fmt.Sprintf("%d", time.Now().Unix())] = fmt.Sprintf("%f", totalSpeed/t.speedMag) - t.job.CrackedHashes = status.RecoveredHashes + if status.RecoveredHashes > t.job.CrackedHashes { + t.job.CrackedHashes = status.RecoveredHashes + } t.job.TotalHashes = status.TotalHashes } else { log.Debug(err.Error()) @@ -222,8 +224,13 @@ func (t *Tasker) Run() error { t.job.TotalHashes = leftCount + potCount t.job.CrackedHashes = potCount + // We need to check for a restore file. If it does not exist we have to start over and not give the --restore command + hashcatBinFolder := filepath.Dir(config.BinPath) + _, err = os.Stat(filepath.Join(hashcatBinFolder, t.job.UUID+".restore")) + log.WithField("error", err).Debug("Stat of restore file returned error") + // Set commands for restore or start - if t.job.Status == common.STATUS_CREATED { + if t.job.Status == common.STATUS_CREATED || os.IsNotExist(err) { t.exec = *exec.Command(config.BinPath, t.start...) } else { t.exec = *exec.Command(config.BinPath, t.resume...) @@ -288,13 +295,8 @@ func (t *Tasker) Run() error { t.job.Status = common.STATUS_QUIT } - //log.WithField("task", t.job.UUID).Debug("Unlocked job after setting done.") - - // Get the status now because we need the last output of hashes - //log.WithField("task", t.job.UUID).Debug("Calling final status call for the job.") - //t.Status() + t.returnStatus = "" - //log.WithField("task", t.job.UUID).Debug("Releasing wait group.") t.doneWG.Done() t.mux.Unlock() }()