> For the complete documentation index, see [llms.txt](https://book.turbosec.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.turbosec.net/post-exploitation/privilege-escalation/hashing-and-cracking.md).

# Hashing & Cracking

## What is hashing

Hashing is **simply passing some data through a formula that produces a result**, called a hash. That hash is usually a string of characters and the hashes generated by a formula are always the same length, regardless of how much data you feed into it. (SHA,MD5,MD4,GOST)

## Cracking hashes

### Using Hashcat

You can use the [list here ](https://hashcat.net/wiki/doku.php?id=example_hashes)which is a complete list of Hashcat supported hash types.&#x20;

```
hashcat -m <hash-type> -a 0 <hash> <wordlist>
```

### Using John

Sometimes you might have difficulties with Hashcat, try John

```
john <hash> --wordlist=/usr/share/wordlists/rockyou.txt
```

### HTTP Basic Authorization Header Brute Force

Basic authorization is..**basic**. A username and a password separated by a colon is then encoded in Base64. The screenshot below demonstrate the credentials admin:admin being sent through the Authorization header of an HTTP request.

![](/files/-MkXr148onxpziKddnkj)

```
hydra -l admin -P passwordlist -s <port> -f example.com http-get /api/v1/users -vV -t 64 
```

{% hint style="info" %}
**ProTip:** You can/should always test first by using a set of valid credentials and check if it returns it valid.&#x20;

```
hydra -l known_user -p known_password -s <port> -f example.com http-get /api/v1/users -vV 
```

{% endhint %}

### HTTP Post form Brute Force

Most of the time, authentication is made via a form posted to the web server. You can try to brute force it but watch out for **CSRF**. Try sending the same request twice using **burp.**&#x20;

```
hydra -l admin -P /usr/share/wordlists/rockyou.txt -s 31111 -f example.com http-post-form '/user/login:user_name=^USER^&password=^PASS^:Credz are incorrect.' -vV -t 64
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://book.turbosec.net/post-exploitation/privilege-escalation/hashing-and-cracking.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
