# Hashcat

## Usage

```bash
#https get - basic auth
hashcat -m 0 -a 0 /root/hashes/hashes.txt /root/rockyou.txt
hashcat64.exe -m 3200 -a 0 C:\Users\user1\Documents\hash.txt C:\Users\user1\Documents\rockyou.txt

#keepass 
Hashcat64.exe -m 13400 -a 0 /root/hashes/hashes.txt /root/rockyou.txt

# benchmark tests
hashcat -b

```

## &#x20;simple dictionary

```bash
# MD5, straight mode, simple dictonary attack
hashcat -m 0 -a 0 -D2 example.hash example.dict
```

## Rule-based attack

Specify certain habit or behavior when processing a wordlist. Can design rules.&#x20;

![](https://2057628634-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LzoLyb83qrgLVzBgfMJ%2F-MN9Sw6ObMrxG1L5pWs2%2F-MN9TSeEAlOpnw7JfHfb%2Fimage.png?alt=media\&token=7c68abc7-c033-496c-8a74-231e21111c6a)

```bash
# custom.rule
cat custom.rule
l
u
c
r
$1
$2
$3
[
]
^1


# providing custom rule
hashcat -m 0 -a 0 -D2 example.hash example.dict -r custom.rule
```

Statistics to show which rule is more effective when cracking against a leaked database of huge passwords.

{% embed url="<https://notsosecure.com/one-rule-to-rule-them-all>" %}

## Mask Attack

Try all combinations from a given keyspace just like brute-force attack, but more specific.

![](https://2057628634-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LzoLyb83qrgLVzBgfMJ%2F-MN9UaDXHvsAmO1KuRu4%2F-MN9VWydBlQ8ra3AMpjw%2Fimage.png?alt=media\&token=a38bc149-1279-4ca2-933d-7317c1ef8ade)

eg. if im cracking 5 letter password, I have to provide 5 masks

```bash
# use a mask of 8 lower case characters '?l' and finally from all character '?a'
hashcat -m 0 -a 3 example.hash ?l?l?l?l?l?l?l?a
```
