Skip to content

Broken task: send detailed cracker error msg on a 'failed keyspace' measure - #77

Open
thatux wants to merge 1 commit into
hashtopolis:masterfrom
thatux:cracker-error-detail
Open

thatux wants to merge 1 commit into
hashtopolis:masterfrom
thatux:cracker-error-detail

Conversation

@thatux

@thatux thatux commented Sep 25, 2026

Copy link
Copy Markdown

Companion to the broken-task feature (server PR
hashtopolis/server#2509, web UI PR
hashtopolis/web-ui#828): they surface this error as the
reason a task is broken, so it reads as the real cause instead of a bare
"Keyspace measure failed!".

A failed keyspace measure (and the PRINCE and preprocessor variants) sent the
server only "Keyspace measure failed!", so the web UI showed an agent error with
no reason. hashcat's own output, which names the cause, was logged locally and
dropped.

Reproduction

./hashcat --keyspace --quiet -a 3 '?9?9?9'
Syntax error in mask: ?9?9?9
rc=255

before: send_error -> 'Keyspace measure failed!'
after:  send_error -> 'Keyspace measure failed! Syntax error in mask: ?9?9?9\n\n0'

Changes

  • helpers.format_error_detail: decode bytes, strip ANSI, normalise newlines,
    keep the tail, cap at 2000 chars.
  • hashcat_cracker: the keyspace, PRINCE and preprocessor paths append the
    detail to the error they send (PRINCE and preprocessor now capture stderr).
  • tests/test_error_detail.py: unit tests for the helper and the keyspace
    failure path.

Testing

python -m pytest tests/test_error_detail.py   # 9 passed

A failed keyspace measure, and its PRINCE and preprocessor variants, sent the
server only "Keyspace measure failed!", so the web UI showed an agent error
with no reason. hashcat's own output, which names the actual problem, was
logged locally and then dropped.

Capture it and append it to the error sent to the server, ANSI stripped and
tail capped so it cannot overflow the error column. See issue 746.

    ./hashcat --keyspace --quiet -a 3 '?9?9?9'
    Syntax error in mask: ?9?9?9
    rc=255

Driving measure_keyspace with that real output as the failing subprocess:

    before: send_error -> 'Keyspace measure failed!'
    after:  send_error -> 'Keyspace measure failed! Syntax error in mask: ?9?9?9\n\n0'
@thatux thatux changed the title Send the cracker's output on a failed keyspace measure Broken task: send detailed cracker error msg on a 'failed keyspace' measure Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant