Bootstrap

Ubuntu安装John教程以及找不到zip2john/rar2john解决方法

1.直接安装

正常来说可以直接通过安装

sudo apt install john

但是这样出来,无法找到zip2john/rar2john两个命令,具体解决方法并没有找到,知道的可以评论一下

之后采用源文件编译安装来获取zip2john/rar2john

2.编译安装

打开官网

John the Ripper password cracker

官网可以看到这些,linux选择对应的tar.gz就好

我们这里选择增强版的

wget https://www.openwall.com/john/k/john-1.9.0-jumbo-1.tar.gz
tar -xvf john-1.9.0-jumbo-1.tar.gz
cd john-1.9.0-jumbo-1/src
问题:之后这里大部分教程直接编译或者直接
./configure && make -sj4

编译出现一大堆输出,并且最后显示完成,但是其实john可能并没有安装成功

参考:https://github.com/openwall/john/issues/3266https://github.com/openwall/john/issues/4506这个都是这样

具体原因:缺少库

解决方法:找到/doc/INSTALL-UBUNTU,里面具体不同安装需求的命令,注意不是/doc/INSTALL,具体系统不一样,文档内容不一致

具体实用的代码有

sudo apt-get -y install build-essential libssl-dev git zlib1g-dev
sudo apt-get -y install yasm libgmp-dev libpcap-dev pkg-config libbz2-dev
下面根据使用的CPU/GPU选择
==== If you have an NVIDIA GPU (OpenCL support)

    sudo apt-get -y install nvidia-opencl-dev

==== If you have an AMD GPU (OpenCL support)

    - If you have a recent GPU card (see [1]), the amdgpu-pro graphics stack
      should be used.

      - Ubuntu Xenial 16.04 LTS and above:
        To install it, follow the instructions at [2]. The fglrx driver is not
        supported in 16.04 (XServer 1.18 is not supported). Canonical and AMD
        decided to use the new hybrid driver stack for 16.04. OpenCL users
        should stay on a supported release until the hybrid stack is available.

      - Ubuntu up to and including 15.10:
        sudo apt-get -y install ocl-icd-opencl-dev opencl-headers fglrx-dev

==== If you want a CPU device for OpenCL (OpenCL support)

    sudo apt-get -y install ocl-icd-opencl-dev opencl-headers pocl-opencl-icd


最后
./configure && make -s clean && make -sj4

其他可选的功能和代码还有很多,自行查看

之后可能运行./rar2john时候还会报错

error while loading shared libraries: libcrypto.so.3: cannot open shared object file: No such file or directory

  原因:找不到libcrypto.so.3,路径不对,参考openssl: error while loading shared libraries: libcrypto.so.3: cannot open shared object file: No su-CSDN博客

cd /etc/ld.so.conf.d
vi libc.conf

添加

/usr/local/lib64

:wq退出后

/sbin/ldconfig -v

更新一下,如果还不行,可能和openssl安装有关系,重新安装

;