# Online

Unlike offline cracking, the online attack must take into consideration:

<table data-header-hidden><thead><tr><th width="277"></th><th></th></tr></thead><tbody><tr><td><strong>Lockout threshold</strong></td><td>Possible attempts before being blocked</td></tr><tr><td><strong>Lockout duration</strong></td><td>Duration of the block</td></tr><tr><td><strong>Lockout observation window</strong></td><td>After how long does the reset of attempts occur</td></tr></tbody></table>

## [Hydra](https://github.com/vanhauser-thc/thc-hydra)

{% code overflow="wrap" %}

```bash
hydra -L <USERS.list> -P <PASS.list> [-s <PORT>] <IP> <SERVICE>
hydra -L <USERS.list> -P <PASS.list> <SERVICE>://<IP>:<PORT>
```

{% endcode %}

Proxy:  `export HYDRA_PROXY_HTTP="http://127.0.0.1:8080/"`

{% code overflow="wrap" %}

```bash
-C <USER:PASS.list>
-l <SINGLE_USER>
-p <SINGLE_PASS>
-U <SERVICE> # Service info
-e nsr # try NoPass, SameUser and ReverseUser as password
-u # Try all users on passwords instead of trying all passwords on users
-f # Ends on the first success
```

{% endcode %}

### Website

{% code overflow="wrap" %}

```bash
hydra -U http-post-form
```

{% endcode %}

{% code overflow="wrap" %}

```bash
http-post-form "/index.php:usr=^USER^&pas=^PASS^:Login failed. Invalid"
http-post-form "/index.php:usr=^USER^&pas=^PASS^:F=403"
http-post-form "/index.php:usr=^USER64^&pas=^PASS64^:F=403"
```

{% endcode %}

*Get the data (index.php, usr, pas, and “Login failed. Invalid”) by analyzing the http request.*

To **find usernames** take into consideration:

* Login form
* Registration form\
  \&#xNAN;*(to use the same email: **dot s.t.u.d.e.n.t**@gmail.com, **tag** studen&#x74;**+htb**@gmail.com)*
* Password reset form
* Check cookie\
  \&#xNAN;*(ex. cookie named “failed\_login” only when the user name is valid.)*
* Response time (use long password)
* Status codes
* Error messages
* Blocking of attempts only if made on an existing username

## [Netexec](https://www.netexec.wiki/)

{% code overflow="wrap" %}

```bash
nxc [smb/winrm/mssql/ssh/ftp/rdp/wmi] <IP> -u <USERS.list> -p <PASS.list>
```

{% endcode %}

{% code overflow="wrap" %}

```bash
--continue-on-success
--no-bruteforce # Try all users on passwords instead of trying all passwords on users
```

{% endcode %}

## Bypass Account Locking

* Search for headers that bypass IP blocking (ex. `X-Forwarded-For`)
* Try a correct login on your account to reset attempts (with macro in Burp set max 1 concurrent requests)


---

# 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://ivalexev.gitbook.io/rednote/pentesting-process/password-cracking/online.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.
