HASH暴力破解工具-Hashcat

时间:2023-12-20 20:23:20

乌云网看到一篇文章讲述hashcat的使用简介(戳这里),对使用字典破解MD5内容

简单在kali上尝试了一下。

(1)首先查看了下hashcat的帮助文档,简单截取了其中的部分常用说明。

hashcat, advanced password recovery
Usage: hashcat [options] hashfile [mask|wordfiles|directories]
=======
Options
=======
* General:
  -m,  --hash-type=NUM               Hash-type, see references below
  -a,  --attack-mode=NUM             Attack-mode, see references below
  -V,  --version                     Print version
  -h,  --help                        Print help
       --quiet                       Suppress output
* Attack modes:
    0 = Straight(字典破解)
    1 = Combination
    2 = Toggle-Case
    3 = Brute-force
    4 = Permutation
    5 = Table-Lookup
    8 = Prince
* Hash types:
     0 = MD5
    10 = md5($pass.$salt)
    20 = md5($salt.$pass)
    30 = md5(unicode($pass).$salt)
    40 = md5($salt.unicode($pass))
    50 = HMAC-MD5 (key = $pass)
    60 = HMAC-MD5 (key = $salt)
    ...

(2)参考上述命令格式,输入以下内容

root@kali2:~/Desktop# hashcat -a  -m  test.txt superdict.txt

其中

  • -a 0 代表使用字典破解模式;
  • -m 0代表Hash Type为md5;
  • test.txt里保存要破解的Hash值;
root@kali2:~/Desktop# cat test.txt
CCFF985ACBE948354486FE49BD91C2EB
cf7be73c856c99c0fe02a78a562375c5
  • superdict.txt代表字典文件
root@kali2:~/Desktop# head superdict.txt
feitong!@#
abc123!@#
sh%#!
nl123456
sy8106237
%null%
admin
administrator
administrators

(3)开始破解,以下红体加粗的一行数据说明已经被成功破解,值为wolegequ

root@kali2:~/Desktop# hashcat -a  -m  test.txt superdict.txt
Initializing hashcat v2. with threads and 32mb segment-size... Added hashes from file test.txt: ( salts) cf7be73c856c99c0fe02a78a562375c5:wolegequ
[s]tatus [p]ause [r]esume [b]ypass [q]uit => Input.Mode: Dict (superdict.txt)
Index.....: / (segment), (words), (bytes)
Recovered.: / hashes, / salts
Speed/sec.: 4.54M plains, 4.54M words
Progress..: / (100.00%)
Running...: --:--:--:--
Estimated.: --:--:--:-- Started: Fri Jun ::
Stopped: Fri Jun ::

(4)注意事项

  • 指定保存hash文件还有字典文件的时候,linux环境下不要忘记文件路径
  • 破解成功的概率取决于你的字典是否给力,因此选个给力的字典很有必要。