# Archivo passwd y shadow

## John the Ripper

### Copiar archivos passwd y shadow

```shell
cp /etc/passwd /<path>/passwd.txt
cp /etc/shadow /<path>/shadow.txt
```

### Unificar archivos passwd y shadow

```shell
unshadow passwd.txt shadow.txt > passwords.txt
```

### Cracking de contraseñas

```shell
john passwords.txt --wordlist=<path-wordlist> --format=md5crypt
john passwords.txt --wordlist=<path-wordlist> --format=md5crypt-long
```

* \<path-wordlist> = ruta de wordlist.

## Hashcat

```shell
hashcat -a 0 -m 500 hashes.hash <path-wordlist> -o outfile.txt
hashcat -a 0 -m 1800 hashes.hash <path-wordlist> -o outfile.txt
```

* -a = modo de ataque.
  * 0 = wordlist.
* -m = tipo de hash.
  * 500 = md5crypt, MD5 (Unix), Cisco-IOS $1$ (MD5).
  * 1800 = sha512crypt $6$, SHA512 (Unix).
* \<path-wordlist> = ruta de wordlist.
* -o = el archivo de salida para el hash recuperado.


---

# 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://pentesting.mrw0l05zyn.cl/explotacion/ataques-de-contrasenas/fuera-de-linea-offline/archivo-passwd-y-shadow.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.
