hashcat

https://github.com/hashcat/hashcat

https://github.com/Trisia/randomness

 

https://www.patenthub.cn/

 

 

 

 

 

 

image

 

显卡驱动

nvidiahttps://www.nvidia.cn/Download/index.aspx?lang=cn
amdhttps://www.amd.com/zh-hans/support

john(使用xx2john获取文件hash)

johnhttps://www.openwall.com/john/

具体使用

攻击模式

#Mode解释
-a 0 Dictionary attack trying all words in a list; also called “straight” mode
-a 1 Combination attack concatenating words from multiple wordlists (-a 1)
-a 3 Brute-force attack and Mask attack trying all characters from given charsets, per position
-a 6 Hybrid attack combining wordlists+masks
-a 7 Hybrid attack combining masks+wordlists; can also be done with rules
-a 9 Association attack use an username, a filename, a hint, or any other pieces of information which could have had an influence in the password generation to attack one specific hash

Mask attack

内置字符集与使用例:

  • ?l = abcdefghijklmnopqrstuvwxyz
  • ?u = ABCDEFGHIJKLMNOPQRSTUVWXYZ
  • ?d = 0123456789
  • ?h = 0123456789abcdef
  • ?H = 0123456789ABCDEF
  • ?s = «space»!"#$%&'()*+,-./:;<=>?@[]^_`{|}~
  • ?a = ?l?u?d?s
  • ?b = 0x00 - 0xff
commandkeyspace
-a 3 ?l?l?l?l?l?l?l?l aaaaaaaa - zzzzzzzz
-a 3 -1 ?l?d ?1?1?1?1?1 aaaaa - 99999
-a 3 password?d password0 - password9
-a 3 -1 ?l?u ?1?l?l?l?l?l19?d?d aaaaaa1900 - Zzzzzz1999
-a 3 -1 ?dabcdef -2 ?l?u ?1?1?2?2?2?2?2 00aaaaa - ffZZZZZ
-a 3 -1 efghijklmnop ?1?1?1 eee - ppp

下面以一个zip爆破为例:

zip2john 1.zip

获得如下输出:

ver 2.0 1.zip/1.7z PKZIP Encr: cmplen=414, decmplen=402, crc=B1541509
1.zip/1.7z:$pkzip2$112019e192b1541509022019eb1544ee1888df46af0d9690a0130da4a21cf4ef60525f742331c8ff38fd1cf45d5b094416f5859bb03c3d25609edc6d24db746caedc6148acdb168a90bef0f672fbabd8c1153db4ed2d334911ade4b1e9ab30c03f485c072aaeee1139d95c7272ab832c7791a71bfa4b99237fd8015ef9612e19840cd064759756b778e55c5d349eafafcd575a7461457323021d5f68b20303efe2b91a50ad72272773020b45266c0e325b696e016b0c075ef180550fbfbcb8f60243b3506edca79794cc4427d86788f32a7a1723a127d8d217839218b7d2272ddabcefee6a03db77d1fddba58e5847dd34f9b28341a20d234c8dd739b9f4b8c5b0e1d19f0b36df18924afc4df59a569ed917b22f69ec6de7adb720cee79b77a9d8f151d9a7f3120dd00880f0afb623e3764a95f50990c8120b9f23576155100c41148e65a79a8ed64094f34616e1ddd3a7409f2b40c0e27d483c719c28b1e70de363aa269ef26238f19f80fa5e348b018333a487de1b95d397e1d8bc9b4d63e20195b96b60ad10b3e84ad778478a0081ad29561e5e8a3bf1d82c5e3ad17c090dc6d60c82d2844e4f27034e203aa16$/pkzip2$:1.7z:1.zip::1.zip

 

将第一个$ 到最后一个$ 之间的内容保存到文件(包含$,如1.txt)。然后:hashcat -a 3 -m 17225 1.txt ?h?h?h?h?h?h?h?h -d 1

    • -a 指定破解模式,3代表掩码破解。
    • -m 指定hash类型,17225代表一般是由上面提示的$pkzip2$,,在hashcat -h或在此处查得。
    • 随后是文件和掩码/字典。此掩码表示8位16进制数。掩码具体用法参考原wiki。
    • -d 指定1号显卡。使用hashcat --benchmark跑分可查看显卡及编号。
    • hashcat -m 17200 "g:/1.txt" -a 3 ?a?a?a?a?a?a?a?a -d 1 -w 3 -o "g:/r.txt"

    • hashcat -m 17220  "g:/1.txt"  -a 3 --custom-charset2=abcdefghijklmnopqrstuvwxyz0123456789.@/ ?2?2?2?2?2?2?2?2?2?2?2?2?2?2  --increment --increment-min 9 --increment-max 14  -d 1  -w 3   -o "g:/r.txt" --self-test-disable

 

HashCat内置字符集,自定义密码组合字典

 

参数说明

https://www.cnblogs.com/wutou/p/17672213.html


官方说明

https://hashcat.net/wiki/doku.php?id=mask_attack


以下示例说明

示例主要演示 生成密码组合
为了命令完整性,加上 -m -a 等参数


一、纯数字 0123456789

1.生成6位数字

生成示例:
000000 - 999999

  hashcat.exe -m 2500 -a 3 test.hccapx ?d?d?d?d?d?d --self-test-disable

--self-test-disable:忽略错误提示


2.生成 6 到 8位数字

未知长度时,设置一个范围

  hashcat.exe -m 2500 -a 3 test.hccapx --increment --increment-min 8 --increment-max 9 ?d?d?d?d?d?d?d?d?d --self-test-disable

?d 的个数要跟 --increment-max 最大值一样长,8位
--increment-max 值的是整个密码值最长长度。比如:预计密码长度可能是 8-10位,那 max 值是10

-m 参数指定不同加密模式,要求的最小和最大密码长度也不一样,密码长度不符合会提示Invalid mask
例如:-m 2500 --increment-min 8 最小值只能写8; 但是 -m 0 --increment-min 1 最小值就可以写1,因为某些加密时就限制了最短长度


二、纯小写字母组合

1.生成6位小写字母

生成示例:
aaaaaa - zzzzz

  hashcat.exe -m 2500 -a 3 test.hccapx ?l?l?l?l?l?l --self-test-disable

2.生成 6 到 8位小写字母

未知长度时,设置一个范围

  hashcat.exe -m 2500 -a 3 test.hccapx --increment --increment-min 8 --increment-max 9 ?l?l?l?l?l?l?l?l?l --self-test-disable

?l 的个数要跟 --increment-max 最大值一样长,8位


三、纯大写字母组合

1.生成6位大写字母

生成示例:
AAAAAA - ZZZZZZ

  hashcat.exe -m 2500 -a 3 test.hccapx ?u?u?u?u?u?u--self-test-disable

2.生成 6 到 8位大写字母

未知长度时,设置一个范围

  hashcat.exe -m 2500 -a 3 test.hccapx --increment --increment-min 8 --increment-max 9 ?u?u?u?u?u?u?u?u?u --self-test-disable

?l 的个数要跟 --increment-max 最大值一样长,8位


四、4数字+2小写字母 组合

生成示例:
0000aa - 9999zz

  hashcat.exe -m 2500 -a 3 test.hccapx ?d?d?d?d?l?l --self-test-disable

五、4数字+2大写字母 组合

生成示例:
0000AA - 9999ZZ

  hashcat.exe -m 2500 -a 3 test.hccapx ?d?d?d?d?u?u--self-test-disable

六、4数字+2大小写字母 组合

生成示例:
0000aa - 9999zz
0000AA - 9999ZZ

  hashcat.exe -m 2500 -a 3 test.hccapx --custom-charset1=?l?u ?d?d?d?d?1?1--self-test-disable

--custom-charset1=?l?u 也可以写成 --custom-charset1 ?l?u (等号用空格代替)


七、数字+大小写字母 组合

生成示例:
000000 - 999999
aaaaaa - zzzzzz
AAAAAA - ZZZZZZ

  hashcat.exe -m 2500 -a 3 test.hccapx --custom-charset1=?d?l?u ?1?1?1?1?1?1--self-test-disable

八、数字+大小写字母+特殊字符 组合

生成示例:
000000 - 999999
aaaaaa - zzzzzz
AAAAAA - ZZZZZZ
!”#$%&’()*+,-./:;<=>?@[\]^_`{|}~

  hashcat.exe -m 2500 -a 3 test.hccapx --custom-charset1=?d?l?u?s ?1?1?1?1?1?1--self-test-disable
 
  hashcat.exe -m 2500 -a 3 test.hccapx ?a?a?a?a?a?a?a--self-test-disable

九、指定字符 组合

生成示例:
把 "x "i" "a" "o" "1" "0" "6" "3" "4" "7" 分别组合

  hashcat test.txt -m 2500 -a 3 test.hccapx --custom-charset2=xiao106347 ?2?2?2?2?2?2

十、已知部分密码

1.假设:密码总共是4位,第一位:9,其他位不知道

生成示例:
9000 -9999

  hashcat.exe -m 0 -a 3 e10adc3949ba59abbe56e057f20f883e 9?d?d?d --self-test-disable

2.假设:密码总共是6位,知道2-5位,是werner,其他位不知道

生成示例:
awerner0
awerner1
...
zwerner9

  hashcat.exe -m 0 -a 3 e10adc3949ba59abbe56e057f20f883e ?lwerner?d --self-test-disable

十一、破解带盐discuz密码

  Hashcat64.exe-a 3 --force -m 2611 ffe1cb31eb084cd7a8dd1228c23617c8:f56463 ?d?d?d?d?d?d?d?d

一百、

   

分享几个大字典下载地址

https://crackstation.net/buy-crackstation-wordlist-password-cracking-dictionary.htm
https://weakpass.com/download
http://contest-2010.korelogic.com/wordlists.html
https://wiki.skullsecurity.org/index.php/Passwords#Password_dictionaries



免责声明:本号所涉及内容仅供安全研究与教学使用,如出现其他风险,后果自负。




参考、来源:
https://www.cnblogs.com/-wenli/p/9928448.html
https://www.xjx100.cn/news/296471.html?action=onClick
https://www.rstk.cn/news/617129.html?action=onClick
https://zhuanlan.zhihu.com/p/35661801/?utm_id=0 (大字典)
https://blog.werner.wiki/hashcat-attack-modes/

 

posted @ 2025-06-06 11:04  zJanly  阅读(46)  评论(0)    收藏  举报