diff --git a/doc/changelog.md b/doc/changelog.md index 182ebba60..75dda419d 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -4,6 +4,7 @@ ## Enhancements - Use utf8mb4 as default encoding in order to support the full unicode range +- Log hashes when they are skipped. This way the administrator can detect when Hashcat rebuilds the hashes incorrectly ## Bugfixes diff --git a/src/inc/api/APISendProgress.class.php b/src/inc/api/APISendProgress.class.php index fdcf762b5..0f5311cf8 100644 --- a/src/inc/api/APISendProgress.class.php +++ b/src/inc/api/APISendProgress.class.php @@ -229,6 +229,14 @@ public function execute($QUERY = array()) { $qF3 = new QueryFilter(Hash::IS_CRACKED, 0, "="); $hashes = Factory::getHashFactory()->filter([Factory::FILTER => [$qF1, $qF2, $qF3]]); if (sizeof($hashes) == 0) { + //This can happen if agent rebuild the hash incorrectly + //Log the skipped hash so that admin can spot this false negative + $logMessage = "Hash has been cracked but skipped! This happened while cracking hashlist with ID: " + . $hashlist->getId() . " during chunk with ID: " . $chunk->getId() . " This happens when the agent returns + a cracked hash that does not exist in the database. This can happen when hashcat malforms the hash."; + Util::createLogEntry(DLogEntryIssuer::API, $this->agent->getToken(), DLogEntry::FATAL, $logMessage); + DServerLog::log(DServerLog::FATAL, $logMessage); + $skipped++; break; }