Hashcat

Posted by r3kind1e on July 10, 2022

Hashcat

Download

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
hashcat-6.2.5>hashcat.exe -h
Usage: hashcat [options]... hash|hashfile|hccapxfile [dictionary|mask|directory]...

- [ Options ] -

 Options Short / Long           | Type | Description                                          | Example
================================+======+======================================================+=======================
 -m, --hash-type                | Num  | Hash-type, references below (otherwise autodetect)   | -m 1000
 -a, --attack-mode              | Num  | Attack-mode, see references below                    | -a 3
 -o, --outfile                  | File | Define outfile for recovered hash                    | -o outfile.txt
     --outfile-format           | Str  | Outfile format to use, separated with commas         | --outfile-format=1,3
     --outfile-autohex-disable  |      | Disable the use of $HEX[] in output plains           |
     --outfile-check-timer      | Num  | Sets seconds between outfile checks to X             | --outfile-check=30
     --wordlist-autohex-disable |      | Disable the conversion of $HEX[] from the wordlist   |
 -b, --benchmark                |      | Run benchmark of selected hash-modes                 |
     --benchmark-all            |      | Run benchmark of all hash-modes (requires -b)        |
     --speed-only               |      | Return expected speed of the attack, then quit       |
     --progress-only            |      | Return ideal progress step size and time to process  |
 -d, --backend-devices          | Str  | Backend devices to use, separated with commas        | -d 1
 -O, --optimized-kernel-enable  |      | Enable optimized kernels (limits password length)    |

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
用法:hashcat [options]... hash|hashfile|hccapxfile [dictionary|mask|directory]...

- [ 选项 ] -

 选项短/长|类型 |说明 |例子
==================================+======+========= ==============================================+===== ===================
 -m,--hash-type |Num |哈希类型,参考如下(否则自动检测) | -m 1000
 -a,--attack-mode |Num |攻击模式,请参阅下面的参考资料 | -a 3
 -o, --outfile |File |为恢复的哈希定义输出文件 | -o 输出文件.txt
     --outfile-format |Str |要使用的输出文件格式,用逗号分隔 | --outfile-format=1,3
     --outfile-autohex-disable | |在输出中禁用 $HEX[] |
     --outfile-check-timer |Num |将输出文件检查之间的秒数设置为 X | --outfile-check=30
     --wordlist-autohex-disable | |禁用单词列表中 $HEX[] 的转换 |
 -b,--benchmark | |运行选定哈希模式的基准测试 |
     --benchmark-all | |运行所有哈希模式的基准测试(需要 -b)|
     --speed-only | |返回预期的攻击速度,然后退出 |
     --progress-only | |返回理想的进度步长和处理时间 |
 -d,--backend-devices |Str |要使用的后端设备,用逗号分隔 | -d 1
 -O, --optimized-kernel-enable | |启用优化内核(限制密码长度)|
1
hashcat.exe -b
1
type example.dict
1
hashcat.exe -m 0 -a 0 -D2 example0.hash example.dict
1
2
type hashcat.potfile
del hashcat.potfile

Rule-based Attack

Name Function Description Example Rule Input Word Output Word Note
Lowercase l Lowercase all letters l p@ssW0rd p@ssw0rd  
Uppercase u Uppercase all letters u p@ssW0rd P@SSW0RD  
Capitalize c Capitalize the first letter and lower the rest c p@ssW0rd P@ssw0rd  
Reverse r Reverse the entire word r p@ssW0rd dr0Wss@p  
Append Character $X Append character X to end $1$2 p@ssW0rd p@ssW0rd12  
Truncate left [ Delete first character [ p@ssW0rd @ssW0rd  
Truncate right ] Delete last character ] p@ssW0rd p@ssW0r  
Prepend Character ^X Prepend character X to front ^2^1 p@ssW0rd 12p@ssW0rd  
Duplicate d Duplicate entire word d p@ssW0rd p@ssW0rdp@ssW0rd  

hashcat-6.2.5\rules文件夹下新建custom.rule

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
l
u
c
r
$1
$2
$3
$4
$5
$6
$7
$8
$9
$0
[
]
^1
^a
^!
$!
d
1
hashcat.exe -m 0 -a 0 -D2 example0.hash example.dict -r rules\custom.rule
1
del hashcat.potfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
hashcat-6.2.5\rules>dir

hashcat-6.2.5\rules 的目录

2022/07/10  22:19    <DIR>          .
2022/07/10  22:19    <DIR>          ..
2021/11/21  23:43             1,035 best64.rule
2021/11/21  23:43               728 combinator.rule
2022/07/10  22:40                75 custom.rule
2021/11/21  23:43           234,289 d3ad0ne.rule
2021/11/21  23:43           887,155 dive.rule
2021/11/21  23:43            92,801 generated.rule
2021/11/21  23:43           548,542 generated2.rule
2021/11/21  23:43    <DIR>          hybrid
2021/11/21  23:43           324,926 Incisive-leetspeak.rule
2021/11/21  23:43            42,026 InsidePro-HashManager.rule
2021/11/21  23:43            22,732 InsidePro-PasswordsPro.rule
2021/11/21  23:43               327 leetspeak.rule
2021/11/21  23:43             1,536 oscommerce.rule
2021/11/21  23:43           331,161 rockyou-30000.rule
2021/11/21  23:43             1,774 specific.rule
2021/11/21  23:43            68,087 T0XlC-insert_00-99_1950-2050_toprules_0_F.rule
2021/11/21  23:43             2,510 T0XlC-insert_space_and_special_0_F.rule
2021/11/21  23:43            36,041 T0XlC-insert_top_100_passwords_1_G.rule
2021/11/21  23:43            38,901 T0XlC.rule
2021/11/21  23:43           116,137 T0XlCv1.rule
2021/11/21  23:43                60 toggles1.rule
2021/11/21  23:43               690 toggles2.rule
2021/11/21  23:43             4,330 toggles3.rule
2021/11/21  23:43            17,980 toggles4.rule
2021/11/21  23:43            54,016 toggles5.rule
2021/11/21  23:43            58,419 unix-ninja-leetspeak.rule
              25 个文件      2,886,278 字节
               3 个目录 191,363,375,104 可用字节
1
2
hashcat-6.2.5\rules>notepad best64.rule
hashcat-6.2.5\rules>cd ..

One Rule to Rule Them All

Mask Attack

1
2
3
hashcat.exe -m 0 -a 3 example0.hash ?l?l?l?l?l?l?l?l?a
del hashcat.potfile
hashcat.exe -m 0 -a 3 example0.hash ?a?a?a?a?a?a?a?a?a