在 Linux 中安装 zip2john 工具

在 Linux 中安装 zip2john 工具

如何在不安装 John 包的情况下安装 Zip2john 工具?

我已经拥有除 Zip2John 之外的所有 John 工具。我只想将其添加到包中。

zip2john.cGithub 仓库并对其进行了编译。但它有一些未满足的依赖关系。

C 编译错误:

C 编译错误

我如何安装它?

注意:我不想再次安装整个 JohnTheRipper 包。

错误:

zip2john.c:121:10: fatal error: arch.h: No such file or directory 
121 | #include "arch.h"
    |
compilation terminated.

答案1

zip2john.c不是一个独立的文件,因此不是一个独立的实用程序;它是整个(巨型) JtR 的一个组成部分。john它本身会检查它是如何被调用的,zip2john如果它被调用为,则运行zip2john

因此,要构建zip2john,您需要构建完整的巨无霸john

$ git clone https://github.com/openwall/john
$ cd john/src
$ ./configure && make

如果成功完成,它将生成一个john二进制文件john/run和一个zip2john指向它的符号链接。

代码非常复杂,没有简单的方法可以仅构建zip2john其依赖项。

如果你已经有一个 jumbo john,你可以对其进行符号链接而不需要重建任何东西:

ln -s john zip2john

确保结果符合预期:

$ ./zip2john
Usage: ./zip2john [options] [zip file(s)]
 -s Scan archive from the beginning, looking for local file headers. This
    is less reliable than going by the central index, but might work better
    with corrupted or split archives.
Options for 'old' PKZIP encrypted files only:
 -a <filename>   This is a 'known' ASCII file. This can be faster, IF all
    files are larger, and you KNOW that at least one of them starts out as
    'pure' ASCII data.
 -o <filename>   Only use this file from the .zip file.
 -c This will create a 'checksum only' hash.  If there are many encrypted
    files in the .zip file, then this may be an option, and there will be
    enough data that false positives will not be seen.  Up to 8 files are
    supported. These hashes do not reveal actual file data.
 -m Use "file magic" as known-plain if applicable. This can be faster but
    not 100% safe in all situations.

NOTE: By default it is assumed that all files in each archive have the same
password. If that's not the case, the produced hash may be uncrackable.
To avoid this, use -o option to pick a file at a time.

如果您的john二进制文件不支持这种操作模式,那么您只会得到通常的使用输出:

$ ./zip2john
John the Ripper 1.9.0-jumbo-1+bleeding-c80015001 2022-07-21 20:14:47 +0200 OMP [linux-gnu 64-bit x86_64 AVX2 AC]
Copyright (c) 1996-2022 by Solar Designer and others
Homepage: https://www.openwall.com/john/

Usage: zip2john [OPTIONS] [PASSWORD-FILES]

Use --help to list all available options.

相关内容