Ubuntu 安裝hashcat以及CPU驅動
hashcat參考地址
hashcat號稱世界上最快的密碼破解,世界上第一個和唯一的基於GPGPU規則引擎,免費多GPU(高達128個GPU),多哈希,多操作系統(Linux和Windows本地二進制文件),多平台(OpenCL和CUDA支持),多算法,資源利用率低,基於字典攻擊,支持分布式破解等等。hashcat目前支持各類公開算法高達247類,市面上面公開的密碼加密算法基本都支持!
hashcat系列軟件在硬件上支持使用CPU、NVIDIA GPU、ATI GPU來進行密碼破解。在操作系統上支持Windows、Linux平台,並且需要安裝官方指定版本的顯卡驅動程序,如果驅動程序版本不對,可能導致程序無法運行。
一、安裝hashcat
官網地址:https://hashcat.net/hashcat/
git倉庫:https://github.com/hashcat/hashcat
-
7z包安裝
wget https://hashcat.net/files/hashcat-6.1.1.7z apt-get install -y p7zip p7zip -d hashcat-5.0.0.7z cd hashcat-5.0.0/ cp hashcat32.bin /usr/bin/ ln -s /usr/bin/hashcat32.bin /usr/bin/hashcat cd /usr/bin/hashcat-6.1.1 # 目錄下包含BUILD.md、README.md、Makefile,BUILD文件中是hashcat的安裝命令,推薦大家作為參考。Makefile文件中是編譯代碼,包括引用的各各文件和數據庫路徑 make # 執行編譯 make install # 執行安裝 -
tar.gz包安裝
wget https://hashcat.net/files/hashcat-6.1.1.tar.gz tar -xzvf hashcat-6.1.1.tar.gz cp hashcat-6.1.1 /usr/bin cd /usr/bin/hashcat-6.1.1 # 目錄下包含BUILD.md、README.md、Makefile,BUILD文件中是hashcat的安裝命令,推薦大家作為參考。Makefile文件中是編譯代碼,包括引用的各各文件和數據庫路徑 make # 執行編譯 make install # 執行安裝 -
git源碼安裝
git clone https://github.com/hashcat/hashcat.git make make install
二、運行測試
-
安裝完成后,在hashcat包里有幾個example,可以執行
./example0.sh進行測試 -
運行hashcat需要
GPU驅動或者CPU驅動,本機沒有,所以報出一下錯誤

三、解決無驅動
這里由於顯卡性能不高,所以采用CPU來執行計算hashcat
-
下載intel opencl SDK: https://software.intel.com/en-us/intel-opencl




-
解壓壓縮包
tar -xzvf intel_sdk_for_opencl_applications_2020.2.487.tar.gz -
下載安裝
cd intel_sdk_for_opencl_applications_2020.2.487 ./install.shsudo apt-get install clinfo # 通過clinfo查看可用的openCL platforms和devices的信息clinfo
如果結果是
Number of platforms 0或者ICD loader reports no usable platforms,在保證intel opencl sdk安裝的情況下執行:sudo apt-get install beignet clinfo ocl-icd-opencl-dev opencl-headers ocl-icd-libopencl1 sudo apt-get install beignet-opencl-icd
四、執行破解命令

- 在hashcat文件中,提供能多個example,可通過執行
./example0.sh方式執行demo - 文件中,
example.dict是一個弱密碼字典example
如果執行命令后,出現如下圖問題:
在命令中加上--force

e.g.
sudo ./hashcat --force -t 32 -a 7 example0.hash ?a?a?a?a example.dict
