hashview / hashview/hashview

Cracked-hash import rejects hashcat $HEX[...] plaintexts

Open
#355 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
399
Forks
52
Avg merge
21h 39m
Merged PRs (30d)
79

Description

Summary

POST /v1/hashes/import/<type> rejects legitimate hashcat output when the recovered plaintext is wrapped in hashcat's $HEX[...] encoding.

Details

hashcat emits $HEX[...] for any recovered password containing bytes that are ambiguous in the plain outfile — leading/trailing whitespace, delimiters, or non-UTF-8 bytes. The crack-import verifiers (hashview/utils/utils.py, e.g. _verify_ntlm) hash the submitted plaintext literally, so they compute the digest of the string "$HEX[2057...]" instead of the bytes it encodes. The digest never matches, and because the import is atomic, a single such line rolls back the whole batch with:

Plaintext for hash <hash>, was found to be invalid.
Reproduction

Import an NTLM (1000) crack whose password has a trailing space, e.g. a hash whose real plaintext is "%032023RC$ "; hashcat writes it as <hash>:$HEX[2530333230323352432420]. The import fails with the error above even though the plaintext is correct.

Expected

The verifiers should decode $HEX[...] to the raw candidate bytes and hash those, per hash family (raw bytes for MD5/SHA*/MD4-900/MySQL; zero-extended → UTF-16LE for the NTLM/MSSQL2012 families), matching hashcat exactly.

Fix

PR incoming against v0.8.3-dev.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in hashview/utils/utils.py with the crack-import verifiers, including _verify_ntlm, and trace the POST /v1/hashes/import/ path. Reproduce the NTLM case using the supplied $HEX[...] plaintext, then check each listed hash family against hashcat's byte and UTF-16LE rules. Done means encoded plaintexts import successfully without breaking ordinary plaintext validation or atomic batch behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.