Skip to content

john fails to parse zip2john generated hash #5846

Description

@ganzm

In cases where a zip file contains a dubious file path, john would fail to parse the hash file generated by zip2john.

The hash output generated by zip2john does not appear to apply any kind of escaping. So it is not clear to me wether john fails to parse it properly or zip2john fails to escape it.

I created a poc as a bash script such that the issue can be reproduced.

My system:

Ubuntu 22.04.5 LTS

John the Ripper 1.9.0-jumbo-1+bleeding-67fcf9fe5a 2025-09-04 23:50:10 +0200 OMP [linux-gnu 64-bit x86_64 AVX AC]

Script to reproduce the issue

#!/bin/bash

# Create a file to zip with a dubious path
mkdir "test\" && C:"
echo 'hello world' > "test\" && C:/file.txt"

# embed it into an encrypted zip
zip -P abc123 archive.zip "test\" && C:/file.txt"

# extract hash
john/run/zip2john archive.zip > hash.txt

# running john now fails in the sense, that it can not find any password hash in the file
# even though there is one hash present
john/run/john hash.txt

cat hash.txt

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions