# 02 - Crack hash

### Выбор инструмента

Для начала нам нужно определить тип хэша, для этого нам поможет программа [hash-identifier](https://github.com/blackploit/hash-identifier)<br>

<figure><img src="/files/dq3MpC1FHBJMd8FI8cds" alt=""><figcaption><p>Вставляем хэш и получаем ответ</p></figcaption></figure>

Отлично, теперь можно приступить к крэку хэша, в этом нам поможет программа [john the ripper](https://github.com/openwall/john)\
Это продвинутый автономный взломщик паролей, который поддерживает сотни типов хэшей и шифров.\
Для начала создадим текстовый файл (hash.txt)и запишем в него одной строкой username:HASH через двоеточие, после чего можно натравиливтаь джона

```bash
// создаем файл username+hash
echo 'steven:$P$Bk3VD9jsxx/loJoqNsURgHiaB23j7W/' > hash.txt
// запускам джона на крэк хэша
sudo john hash.txt --wordlist=/usr/share/wordlists/rockyou.txt
```

<figure><img src="/files/9hCBxSQaD2beYMjjc8X3" alt=""><figcaption><p>В итоге мы получили пароль пользователя steven</p></figcaption></figure>

Теперь когда у нас есть пароль пользователя steven, мы можем попытаться использовать его для входа по ssh и сразу проверить уровень привелегий его учетной записи.


---

# 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://reeves0x0.gitbook.io/linux-under-attack/privilege-escalation/02-crack-hash.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.
