Hashcat Blasting Method


Introduction

Hashcat claims to be the world's fastest password recovery tool. It had a proprietary code base until 2015, but is now released as free software. Versions for Linux, OS X, and Windows can use CPU-based or GPU-based variants. Hash algorithms that support Hashcat include Microsoft LM hash, MD4, MD5, SHA series, Unix encryption format, MySQL and Cisco PIX

github add:https://github.com/hashcat/hashcat

Actual use

Basic parameters

-r      使用自定义破解规则
-a  		指定要使用的破解模式,其值参考后面对参数。“-a 0”字典攻击,“-a 1” 组合攻击;“-a 3”掩码攻击。
-m  		指定要破解的hash类型,如果不指定类型,则默认是MD5
-o  		指定破解成功后的hash及所对应的明文密码的存放位置,可以用它把破解成功的hash写到指定的文件中
--force 忽略破解过程中的警告信息,跑单条hash可能需要加上此选项
--show  显示已经破解的hash及该hash所对应的明文
--increment  			启用增量破解模式,你可以利用此模式让hashcat在指定的密码长度范围内执行破解过程
--increment-min  	密码最小长度,后面直接等于一个整数即可,配置increment模式一起使用
--increment-max 	密码最大长度,同上
--outfile-format 	指定破解结果的输出格式id,默认是3
--username   			忽略hash文件中的指定的用户名,在破解linux系统用户密码hash可能会用到
--remove     			删除已被破解成功的hash

-a Attack mode

0 | Straight(字段破解)
1 | Combination(组合破解)
3 | Brute-force(掩码暴力破解)
6 | Hybrid Wordlist + Mask(字典+掩码破解)
7 | Hybrid Mask + Wordlist(掩码+字典破解

-D Choose your CPU type

1 | CPU
2 | GPU
3 | FPGA, DSP, Co-Processor

OUTput

1 = hash[:salt]
2 = plain
3 = hash[:salt]:plain
4 = hex_plain
5 = hash[:salt]:hex_plain
6 = plain:hex_plain
7 = hash[:salt]:plain:hex_plain
8 = crackpos
9 = hash[:salt]:crackpos
10 = plain:crackpos
11 = hash[:salt]:plain:crackpos
12 = hex_plain:crackpos
13 = hash[:salt]:hex_plain:crackpos
14 = plain:hex_plain:crackpos
15 = hash[:salt]:plain:hex_plain:crackpos

Mask set

l | abcdefghijklmnopqrstuvwxyz          纯小写字母
u | ABCDEFGHIJKLMNOPQRSTUVWXYZ          纯大写字母
d | 0123456789                  				纯数字
h | 0123456789abcdef                		小写字母和数字
H | 0123456789ABCDEF                   	大写字母和数字
s |  !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~   特殊字符
a | ?l?u?d?s                    				键盘上所有可见的字符
b | 0x00 - 0xff                 				匹配空格密码
Basic case
八位数字密码:?d?d?d?d?d?d?d?d
八位未知密码:?a?a?a?a?a?a?a?a
前四位为大写字母,后面四位为数字:?u?u?u?u?d?d?d?d
前四位为数字或者是小写字母,后四位为大写字母或者数字:?h?h?h?h?H?H?H?H
前三个字符未知,中间为admin,后三位未知:?a?a?aadmin?a?a?a
6-8位数字密码:--increment --increment-min 6 --increment-max 8 ?l?l?l?l?l?l?l?l
6-8位数字+小写字母密码:--increment --increment-min 6 --increment-max 8 ?h?h?h?h?h?h?h?h

另外
--custom-charset1 [chars]等价于 -1
--custom-charset2 [chars]等价于 -2
--custom-charset3 [chars]等价于 -3
--custom-charset4 [chars]等价于 -4
在掩码中用?1、?2、?3、?4来表示,意思就是说
--custom-charset1 yangsir1234567890  可以直接用?1来表示
--custom-charset2 ?d?d							 可以直接用?2来表示
-1 ?d?l?u 	 ?1就表示大小写字母+数字
-3 qaz -4 123456  ?3?3?3?3?4?4?4?4就表示前面四位可能是qaz后面四位可能是123456

Common cracking cases

MD5

8位数字
hashcat -a 3 --force ac57c8b0fd67b6083a4d9851d6f6659b ?d?d?d?d?d?d?d?d

4小写+数字
hashcat -a 3 --force 1e6041b9b99ba99d14982a0c17a22ca9 -1 ?l?d ?1?1?1?1

1-8小写字母+数字
hashcat -a 3 -m 0 -D 1 --force 1e6041b9b99ba99d14982a0c17a22ca9 --increment --increment-min 1 --increment-max 8 ?h?h?h?h?h?h?h?h

指定字符串
hashcat -a 3 -1 12345abc a906449d5769fa7361d7ecc6aa3f6d28 ?1?1?1?1?1?1

字典破解
hashcat -a 0 a906449d5769fa7361d7ecc6aa3f6d28 password.txt

字典批量破解
hashcat -a 0 tarhash.txt password.txt

多字典组合
hashcat -a 1 a906449d5769fa7361d7ecc6aa3f6d28 password1.txt password2.txt

MYSQL

select authentication_string from mysql.user; 可得hash

hashcat -a 3 -m 300 --force 6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 ?d?d?d?d?d?d

sha512crypt $6$, SHA512 (Unix)

cat /etc/shadow 可获取
hashcat -a 3 -m 1800 --force '$6$mxuA5cdy$XZRk0CvnPFqOgVopqiPEFAFK72SogKVwwwp7gWaUOb7b6tVwfCpcSUsCEk64ktLLYmzyew/xd0O0hPG/yrm2X.' ?l?l?l?l

不删除用户名
hashcat -a 3 -m 1800 --force 'qiyou:$6$QDq75ki3$jsKm7qTDHz/xBob0kF1Lp170Cgg0i5Tslf3JW/sm9k9Q916mBTyilU3PoOsbRdxV8TAmzvdgNjrCuhfg3jKMY1' ?l?l?l?l?l --username

NTLM

hashcat -a 3 -m 1000 209C6174DA490CAEB422F3FA5A7AE634 ?l?l?l?l?l

NETNTLM

hashcat -a 3 -m 5500 xxx.wang::::3ab413d5b170c792b5dc00cc8d95349c0bbxxxxxx2e42:xxxx04e957f0cf -1 ?l?u   ?1?1?1?1?d?d?d?d  --force

Other note

如果已经破解了的,hashcat hash --show 查看节课
cat ~/.hashcat/hashcat.potfile   查看破解结果

使用GPU模式进行破解时,-O参数自动进行优化
--gpu-accel 160		 让GPU发挥最大性能
--gpu-loops 1024	 让GPU发挥最大性能
--segment-size 512 提高大字典爆破速度

Author: Yangsir
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint policy. If reproduced, please indicate source Yangsir !
  TOC