# Hashcat

## Basics

**Installation:**&#x20;

You can download Hashcat from <https://hashcat.net/hashcat/>.&#x20;

**Example:**&#x20;

`hashcat64.exe -a 0 -m 0 example0.hash example.dict -r rules/best64.rule`&#x20;

Dictionary Attack:&#x20;

`hashcat64.exe -a 0 -m 0 example_md5_hashes.txt combined_seclists_password_list.txt -O`&#x20;

Note: Consider using `-w 4` for workload optimized&#x20;

## Mask attack&#x20;

```
?l = abcdefghijklmnopqrstuvwxyz 
?u = ABCDEFGHIJKLMNOPQRSTUVWXYZ 
?d = 0123456789 
?h = 0123456789abcdef 
?H = 0123456789ABCDEF 
?s = «space»!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ 
?a = ?l?u?d?s 
?b = 0x00 - 0xff 
```

example:&#x20;

`root@attackdefense:~# hashcat -m 10400 -a 3 pdfnew ?d?d?d?d198?d?u --force`&#x20;

## Using different charset:&#x20;

hashcat -m 0 -a 3 -1 ?l?d hash2 ?1?1?1?1 --force&#x20;

* -m 0 = hash type = md5&#x20;
* -a 3 = mode = brute-force&#x20;
* -1 ?l?d= -1  charset  = use charset of ?l (lower alpha) and ?d numbers&#x20;
* Hash2 = hash file &#x20;
* ?1?1?1?1 = the length of the password, use the charset we created  (-1)&#x20;
* \--force = use cpu&#x20;

## Hash examples

<https://hashcat.net/wiki/doku.php?id=example_hashes>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://infra.newerasec.com/infrastructure-testing/password-cracking/hashcat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
