在Windows上编译最新版本的Hashcat

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

在Windows上编译最新版本的Hashcat 最新版本V5.0.0下载地址:
开发版:
GPU驱动要求:
AMD GPUs on Linux require “RadeonOpenCompute (ROCm)” Software Platform (1.6.180 or later)
AMD GPUs on Windows require “AMD Radeon Software Crimson Edition” (15.12 or later)
Intel CPUs require “OpenCL Runtime for Intel Core and Intel Xeon Processors” (16.1.1 or later)
Intel GPUs on Linux require “OpenCL 2.0 GPU Driver Package for Linux” (2.0 or later)
Intel GPUs on Windows require “OpenCL Driver for Intel Iris and Intel HD Graphics”
NVIDIA GPUs require “NVIDIA Driver” (367.x or later)
新特性(官⽅加粗显⽰突出特性)
World’s fastest password cracker
World’s first and only in-kernel rule engine
Free (软件可以免费使⽤)
Open-Source (MIT License) (程序源代码公开)
Multi-OS (Linux, Windows and macOS)
Multi-Platform (CPU, GPU, DSP, FPGA, etc., everything that comes with an OpenCL runtime)
Multi-Hash (Cracking multiple hashes at the same time)
Multi-Devices (Utilizing multiple devices in same system)
Multi-Device-Types (Utilizing mixed device types in same system)
Supports password candidate brain functionality
Supports distributed cracking networks (using overlay) (⽀持分布式⽹络离散破解)
Supports interactive pause / resume (交互式的暂停和重启)
Supports sessions
Supports restore
Supports reading password candidates from file and stdin
Supports hex-salt and hex-charset
Supports automatic performance tuning (⾃动化的性能调优)
Supports automatic keyspace ordering markov-chains
Built-in benchmarking system
Integrated thermal watchdog (完整的⽇志输出流)
implemented with performance in mind
… and much more
或者git clone /hashcat/hashcat 下载源代码。

⼀、下载编译软件Msys2
配置软件软件源。

32位软件安装源头:配置⽂件D:\msys64\etc\pacman.d\mirrorlist.mingw32内容如下:
##
## 32-bit Mingw-w64 repository mirrorlist
##
64位软件安装源头:配置⽂件D:\msys64\etc\pacman.d\mirrorlist.mingw64内容如下:
##
## 64-bit Mingw-w64 repository mirrorlist
##
系统软件安装源:配置⽂件D:\msys64\etc\pacman.d\mirrorlist.mingw内容如下:
##
## MSYS2 repository mirrorlist
##
打开 mingw32.exe ,运⾏以下命令。

pacman -Syu
pacman -S mingw-w64-i686-gcc
pacman -S make git patch
pacman -S mingw-w64-i686-cmake
pacman -S mingw-w64-i686-pkg-config
打开mingw64.exe,运⾏以下命令。

pacman -Syu
pacman -S mingw-w64-x86_64-gcc
pacman -S mingw-w64-x86_64-cmake
pacman -S mingw-w64-x86_64-pkg-config
⼆、编译win-iconv
打开mingw32.exe,(编译32位程序)
在hashcat\tools⽬录下有两个补丁⽂件win-iconv-32.diff和win-iconv-64.diff,分别对应patch相对应的32位和64位的Makefile。

#cd win-iconv
#patch <../hashcat/tools/win-iconv-32.diff
#make -j4
报错信息如下:
make:i686-w64-mingw32-ar:命令未找到
make: *** [Makefile:40:libiconv.a] 错误 127
这是因为在msys2中i686-w64-mingw32-ar这个命令不存在,正确的命令应该是
i686-w64-mingw32-gcc-ar,
将makefile中的i686-w64-mingw32-ar改成i686-w64-mingw32-gcc-ar。

将i686-w64-mingw32-ranlib改成i686-w64-mingw32-gcc-ranlib。

i686-w64-mingw32-dlltool这个程序也不存在,我们可以通过Pacman的搜索功能来过滤这个程序所在的软件包binutils,查看⽬前需要的32位版本是否安装。

$ pacman -Ss binutils
mingw32/mingw-w64-i686-binutils 2.30-5 (mingw-w64-i686-toolchain) [已安装: 2.31.1-2]
A set of programs to assemble and manipulate binary and object files (mingw-w64)
mingw64/mingw-w64-x86_64-binutils 2.30-5 (mingw-w64-x86_64-toolchain) [已安装: 2.31.1-2]
A set of programs to assemble and manipulate binary and object files (mingw-w64)
msys/binutils 2.30-1 (msys2-devel)
A set of programs to assemble and manipulate binary and object files
msys/mingw-w64-cross-binutils 2.30-1 (mingw-w64-cross-toolchain mingw-w64-cross)
A set of programs to assemble and manipulate binary and object files
使⽤pacman -Ql mingw-w64-i686-binutils这个命令来查询软件包⽂件的路径。

将Makefile中的i686-w64-mingw32-dlltool改成/mingw32/i686-w64-mingw32/bin/dlltool.exe,
将Makefile中prefix ?= /usr/bin改成prefix ?= /opt/win-iconv-32。

重新Make,编译通过,然后使⽤make install命令安装程序到指定⽬录。

#cd ../hashcat
#make win32 编译32位版本的Hashcat,编译64位hashcat时请参考32编译流程,本⽂将不再赘述。

运⾏Hashcat使⽤GPU破解需要安装相应的显卡驱动程序。

Windows驱动下载地址:
(1)字典攻击
-a 0 password.lst
(2)1到8为数字掩码攻击
-a 3 --increment --increment-min 1--increment-max 8 ?d?d?d?d?d?d?d?d –O
hashcat64 -a 3 --increment --increment-min 1 --increment-max 8 password.txt ?d?d?d?d?d?d?d?d -O --show
hashcat64 -a 3 –increment –increment-min 4 –increment-max 8 -o result.txt 00c66aaf5f2c3f49946f15c1ad2ea0d3 ?d?d?d?d?d?d?d?d -O hashcat64 -a 3 –increment –increment-min 7 –increment-max 11 password.txt -o result.txt ?d?d?d?d?d?d?d?d?d?d?d?d -O
d代表数字,可以换成⼩写字母?l,⼤写字母?u,特殊字符?s,⼤⼩写字母+特殊字符?a,–O表⽰最优化破解模式,可以加该参数,也可以
不加该参数。

(3)8为数字攻击
-a 3 ?d?d?d?d?d?d?d?d
同理可以根据位数设置为字母⼤写、⼩写、特殊字符等模式。

(4)⾃定义字符
现在纯数字或者纯字母的密码是⽐较少见的,根据密码专家对泄漏密码的分析,90%的个⼈密码是字母和数字的组合,可以是⾃定义字符了来进⾏暴⼒破解,Hashcat⽀持4个⾃定义字符集,分别是 -1 -2 -3 -4。

定义时只需要这样-2 ?l?d ,然后就可以在后⾯指定?2,?2表⽰⼩写字母和数字。

这时候要破解⼀个8位混合的⼩写字母加数字:
Hashcat.exe -a 3 –force -2 ?l?d hassh值或者hash⽂件 ?2?2?2?2?2?2?2?2
例如破解dz⼩写字母+数字混合8位密码破解:
Hashcat -m 2611 -a 3 -2 ?l?d dz.hash ?2?2?2?2?2?2?2?2
(5)字典+掩码暴⼒破解
Hashcat还⽀持⼀种字典加暴⼒的破解⽅法,就是在字典前后再加上暴⼒的字符序列,⽐如在字典后⾯加上3为数字,这种密码是很常见的。

使⽤第六种攻击模式:
a-6 (Hybrid dict + mask)
如果是在字典前⾯加则使⽤第7中攻击模式也即( a-7 = Hybridmask + dict),下⾯对字典⽂件加数字123进⾏破解:
H.exe -a 6 ffe1cb31eb084cd7a8dd1228c23617c8 password.lst ?d?d?d
假如ffe1cb31eb084cd7a8dd1228c23617c8的密码为password123,则只要password.lst包含123即可。

(6)掩码+字典暴⼒破解
H.exe -a 7 ffe1cb31eb084cd7a8dd1228c23617c8 password.lst ?d?d?d
假如ffe1cb31eb084cd7a8dd1228c23617c8的密码为123password,则只要password.lst包含password即可。

(7)⼤⼩写转换攻击,对password.lst中的单词进⾏⼤⼩写转换攻击
H.exe-a 2 ffe1cb31eb084cd7a8dd1228c23617c8 password.lst。

相关文档
最新文档