legba
legba is a fast, multi-protocol credential bruteforcer, password sprayer, and enumerator written in Rust on top of the Tokio async runtime. It is a modern replacement for THC-Hydra, Medusa, Ncrack, and Patator — benchmarked at 4.5× faster on HTTP basic auth, 55× faster on SSH, 3.8× on MySQL vs. Hydra on identical hardware. It ships as a single static binary with no native dependencies and supports 30+ protocol plugins.
Full documentation: https://legba.evilsocket.net/
GitHub: https://github.com/evilsocket/legba
Installation
# Precompiled binary (Linux/macOS) — recommended
# Download the latest release from https://github.com/evilsocket/legba/releases
# Homebrew (macOS / Linux)
brew tap evilsocket/legba https://github.com/evilsocket/legba
brew install legba
# Cargo
cargo install legba
# Docker
docker run ghcr.io/evilsocket/legba [args]
Full install instructions: https://legba.evilsocket.net/install/
Core Concepts
Target Syntax
| Format |
Example |
| Single host |
192.168.1.1 |
| Hostname |
example.com |
| IP range |
192.168.1.1-192.168.1.254 |
| CIDR |
192.168.1.0/24 |
| IPv6 |
[::1] |
| File of targets |
@targets.txt |
| Comma-separated |
host1,host2,host3 |
Credential Expression Syntax
Credentials (username, password, payload) are flexible expressions, not just plain wordlist paths.
| Expression |
Meaning |
admin |
A single constant value |
@wordlist.txt |
One entry per line from a file |
@/path/to/*.txt |
Glob — load all matching files |
{user} |
Template — substitute the current username into the password expression |
[0-9999] |
Integer range, zero-padded automatically |
word#3 |
Permutations: word with all 3-character suffixes |
a,b,c |
Explicit comma-separated list |
Iteration Modes
By default legba iterates over passwords for each username. Change with --iterate (-I):
-I user # iterate over usernames for each password (password spray)
-I password # default: iterate over passwords for each username (brute-force)
Key CLI Options
| Flag |
Description |
--target |
Target host/expression (required) |
--username |
Username or credential expression |
--password |
Password or credential expression |
--concurrency |
Number of parallel workers (default: 10) |
--rate-limit |
Max requests per second (e.g. --rate-limit 5) |
--timeout |
Connection timeout in seconds |
--retry-times |
Number of retries on failure |
--jitter-min/max |
Add random delay (ms) between attempts |
--session |
Path to session file for save/resume |
--output |
Output file path |
--output-format |
text (default), csv, or jsonl |
--single-match |
Stop after the first successful credential |
--iterate / -I |
Iteration strategy: user or password |
--api |
Start REST API on host:port |
--mcp |
Start MCP server (host:port for SSE, stdio for stdio mode) |
Full usage reference: https://legba.evilsocket.net/usage/
Supported Plugins
Before generating a command for a specific plugin, fetch its documentation page to get the correct flags and examples.
| Plugin(s) |
Description |
Docs |
http, http.basic, http.form, http.ntlm1, http.ntlm2, http.enum, http.vhost |
HTTP auth (basic, form with CSRF, NTLMv1/v2), page enumeration, vhost enumeration |
https://legba.evilsocket.net/plugins/http/ |
ssh, sftp |
Password and private-key authentication |
https://legba.evilsocket.net/plugins/ssh_and_sftp/ |
ftp |
FTP password auth |
https://legba.evilsocket.net/plugins/ftp/ |
smtp |
SMTP auth (PLAIN, LOGIN, XOAUTH2, NTLM, NTLMv1); STARTTLS |
https://legba.evilsocket.net/plugins/smtp/ |
imap |
IMAP password auth |
https://legba.evilsocket.net/plugins/imap/ |
pop3 |
POP3 password auth, optional SSL |
https://legba.evilsocket.net/plugins/pop3/ |
rdp |
RDP password auth, NTLM hash, admin/auto-logon modes |
https://legba.evilsocket.net/plugins/rdp/ |
vnc |
VNC password auth |
https://legba.evilsocket.net/plugins/vnc/ |
smb, smb.shares |
SMB/Samba credential brute-force and share enumeration |
https://legba.evilsocket.net/plugins/samba/ |
ldap |
LDAP bind auth |
https://legba.evilsocket.net/plugins/ldap/ |
kerberos |
Kerberos 5 pre-auth brute-force and user enumeration |
https://legba.evilsocket.net/plugins/kerberos/ |
mysql |
MySQL auth |
https://legba.evilsocket.net/plugins/mysql/ |
pgsql |
PostgreSQL auth |
https://legba.evilsocket.net/plugins/postgresql/ |
mssql |
Microsoft SQL Server auth |
https://legba.evilsocket.net/plugins/mssql/ |
oracle |
Oracle DB auth (requires --features oracle at build time) |
https://legba.evilsocket.net/plugins/oracle/ |
mongodb |
MongoDB password auth |
https://legba.evilsocket.net/plugins/mongodb/ |
scylla |
ScyllaDB / Apache Cassandra auth |
https://legba.evilsocket.net/plugins/scylla/ |
redis |
Redis legacy and ACL auth, optional SSL |
https://legba.evilsocket.net/plugins/redis/ |
amqp |
AMQP brokers: ActiveMQ, RabbitMQ, Qpid, JORAM, Solace |
https://legba.evilsocket.net/plugins/amqp/ |
mqtt |
MQTT v3/v5, optional TLS |
https://legba.evilsocket.net/plugins/mqtt/ |
stomp |
STOMP brokers: ActiveMQ, RabbitMQ, HornetQ, OpenMQ |
https://legba.evilsocket.net/plugins/stomp/ |
snmp1, snmp2, snmp3 |
SNMP v1/v2 community string enum, v3 username/password enum, OID tree walking |
https://legba.evilsocket.net/plugins/snmp/ |
irc |
IRC password auth, optional TLS |
https://legba.evilsocket.net/plugins/irc/ |
telnet |
Telnet auth with configurable login/password/shell prompts |
https://legba.evilsocket.net/plugins/telnet/ |
dns |
DNS subdomain enumeration, custom resolvers, HTTPS cert fetch |
https://legba.evilsocket.net/plugins/dns/ |
port.scanner |
TCP/UDP port scanner with banner grabbing and HTTP/S header grabs |
https://legba.evilsocket.net/plugins/port_scanner/ |
socks5 |
SOCKS5 username/password auth |
https://legba.evilsocket.net/plugins/socks5/ |
cmd |
Wrap any external CLI tool; detect success via exit code or stdout pattern |
https://legba.evilsocket.net/plugins/custom_binary/ |
Recipe System
Recipes are YAML files that define reusable, parameterized attack configurations. They support variable substitution ({$var or default}) and resource embedding relative to the recipe path.
legba --recipe attack.yaml
# Override recipe variables at runtime:
legba --recipe attack.yaml --set target=192.168.1.1 --set wordlist=passwords.txt
Recipes are ideal for complex flows: CSRF token grabbing, multi-step auth, custom headers, or repeatable pentest engagements.
Full recipe reference and examples: https://legba.evilsocket.net/recipes/
REST API
Start an HTTP API alongside an attack session to query status, list running sessions, and stop them programmatically:
legba http.basic --target example.com --username admin --password @pass.txt --api 127.0.0.1:8080
Full REST API reference: https://legba.evilsocket.net/rest/
MCP Server
legba is the only credential bruteforcer with a built-in Model Context Protocol (MCP) server, allowing AI agents to drive it programmatically:
# SSE mode (Claude Desktop, Cline, etc.)
legba --mcp 127.0.0.1:9090
# stdio mode (local agent pipelines)
legba --mcp stdio
Full MCP setup and agent configuration snippets: https://legba.evilsocket.net/mcp/
Session Management
Save progress and resume interrupted attacks:
# Start with session tracking
legba ssh --target 10.0.0.1 --username root --password @pass.txt --session /tmp/my.session
# Resume later (same command, session file is detected automatically)
legba ssh --target 10.0.0.1 --username root --password @pass.txt --session /tmp/my.session
Where to Look for More
1---2name: legba3description: Use this skill when the user wants to brute-force credentials, spray passwords, or enumerate services/subdomains against any network protocol (HTTP, SSH, FTP, SMB, RDP, databases, mail protocols, DNS, etc.) using legba. Also use it when the user asks how to use legba, how to write a recipe, how to configure the REST API or MCP server, or asks for help constructing a legba command.4---56# legba78legba is a fast, multi-protocol credential bruteforcer, password sprayer, and enumerator written in Rust on top of the Tokio async runtime. It is a modern replacement for THC-Hydra, Medusa, Ncrack, and Patator — benchmarked at 4.5× faster on HTTP basic auth, 55× faster on SSH, 3.8× on MySQL vs. Hydra on identical hardware. It ships as a single static binary with no native dependencies and supports 30+ protocol plugins.910Full documentation: https://legba.evilsocket.net/11GitHub: https://github.com/evilsocket/legba1213## Installation1415```bash16# Precompiled binary (Linux/macOS) — recommended17# Download the latest release from https://github.com/evilsocket/legba/releases1819# Homebrew (macOS / Linux)20brew tap evilsocket/legba https://github.com/evilsocket/legba21brew install legba2223# Cargo24cargo install legba2526# Docker27docker run ghcr.io/evilsocket/legba [args]28```2930Full install instructions: https://legba.evilsocket.net/install/3132## Core Concepts3334### Target Syntax3536| Format | Example |37|---|---|38| Single host | `192.168.1.1` |39| Hostname | `example.com` |40| IP range | `192.168.1.1-192.168.1.254` |41| CIDR | `192.168.1.0/24` |42| IPv6 | `[::1]` |43| File of targets | `@targets.txt` |44| Comma-separated | `host1,host2,host3` |4546### Credential Expression Syntax4748Credentials (username, password, payload) are flexible expressions, not just plain wordlist paths.4950| Expression | Meaning |51|---|---|52| `admin` | A single constant value |53| `@wordlist.txt` | One entry per line from a file |54| `@/path/to/*.txt` | Glob — load all matching files |55| `{user}` | Template — substitute the current username into the password expression |56| `[0-9999]` | Integer range, zero-padded automatically |57| `word#3` | Permutations: `word` with all 3-character suffixes |58| `a,b,c` | Explicit comma-separated list |5960### Iteration Modes6162By default legba iterates over passwords for each username. Change with `--iterate` (`-I`):6364```bash65-I user # iterate over usernames for each password (password spray)66-I password # default: iterate over passwords for each username (brute-force)67```6869## Key CLI Options7071| Flag | Description |72|---|---|73| `--target` | Target host/expression (required) |74| `--username` | Username or credential expression |75| `--password` | Password or credential expression |76| `--concurrency` | Number of parallel workers (default: 10) |77| `--rate-limit` | Max requests per second (e.g. `--rate-limit 5`) |78| `--timeout` | Connection timeout in seconds |79| `--retry-times` | Number of retries on failure |80| `--jitter-min/max` | Add random delay (ms) between attempts |81| `--session` | Path to session file for save/resume |82| `--output` | Output file path |83| `--output-format` | `text` (default), `csv`, or `jsonl` |84| `--single-match` | Stop after the first successful credential |85| `--iterate` / `-I` | Iteration strategy: `user` or `password` |86| `--api` | Start REST API on `host:port` |87| `--mcp` | Start MCP server (`host:port` for SSE, `stdio` for stdio mode) |8889Full usage reference: https://legba.evilsocket.net/usage/9091## Supported Plugins9293**Before generating a command for a specific plugin, fetch its documentation page** to get the correct flags and examples.9495| Plugin(s) | Description | Docs |96|---|---|---|97| `http`, `http.basic`, `http.form`, `http.ntlm1`, `http.ntlm2`, `http.enum`, `http.vhost` | HTTP auth (basic, form with CSRF, NTLMv1/v2), page enumeration, vhost enumeration | https://legba.evilsocket.net/plugins/http/ |98| `ssh`, `sftp` | Password and private-key authentication | https://legba.evilsocket.net/plugins/ssh_and_sftp/ |99| `ftp` | FTP password auth | https://legba.evilsocket.net/plugins/ftp/ |100| `smtp` | SMTP auth (PLAIN, LOGIN, XOAUTH2, NTLM, NTLMv1); STARTTLS | https://legba.evilsocket.net/plugins/smtp/ |101| `imap` | IMAP password auth | https://legba.evilsocket.net/plugins/imap/ |102| `pop3` | POP3 password auth, optional SSL | https://legba.evilsocket.net/plugins/pop3/ |103| `rdp` | RDP password auth, NTLM hash, admin/auto-logon modes | https://legba.evilsocket.net/plugins/rdp/ |104| `vnc` | VNC password auth | https://legba.evilsocket.net/plugins/vnc/ |105| `smb`, `smb.shares` | SMB/Samba credential brute-force and share enumeration | https://legba.evilsocket.net/plugins/samba/ |106| `ldap` | LDAP bind auth | https://legba.evilsocket.net/plugins/ldap/ |107| `kerberos` | Kerberos 5 pre-auth brute-force and user enumeration | https://legba.evilsocket.net/plugins/kerberos/ |108| `mysql` | MySQL auth | https://legba.evilsocket.net/plugins/mysql/ |109| `pgsql` | PostgreSQL auth | https://legba.evilsocket.net/plugins/postgresql/ |110| `mssql` | Microsoft SQL Server auth | https://legba.evilsocket.net/plugins/mssql/ |111| `oracle` | Oracle DB auth (requires `--features oracle` at build time) | https://legba.evilsocket.net/plugins/oracle/ |112| `mongodb` | MongoDB password auth | https://legba.evilsocket.net/plugins/mongodb/ |113| `scylla` | ScyllaDB / Apache Cassandra auth | https://legba.evilsocket.net/plugins/scylla/ |114| `redis` | Redis legacy and ACL auth, optional SSL | https://legba.evilsocket.net/plugins/redis/ |115| `amqp` | AMQP brokers: ActiveMQ, RabbitMQ, Qpid, JORAM, Solace | https://legba.evilsocket.net/plugins/amqp/ |116| `mqtt` | MQTT v3/v5, optional TLS | https://legba.evilsocket.net/plugins/mqtt/ |117| `stomp` | STOMP brokers: ActiveMQ, RabbitMQ, HornetQ, OpenMQ | https://legba.evilsocket.net/plugins/stomp/ |118| `snmp1`, `snmp2`, `snmp3` | SNMP v1/v2 community string enum, v3 username/password enum, OID tree walking | https://legba.evilsocket.net/plugins/snmp/ |119| `irc` | IRC password auth, optional TLS | https://legba.evilsocket.net/plugins/irc/ |120| `telnet` | Telnet auth with configurable login/password/shell prompts | https://legba.evilsocket.net/plugins/telnet/ |121| `dns` | DNS subdomain enumeration, custom resolvers, HTTPS cert fetch | https://legba.evilsocket.net/plugins/dns/ |122| `port.scanner` | TCP/UDP port scanner with banner grabbing and HTTP/S header grabs | https://legba.evilsocket.net/plugins/port_scanner/ |123| `socks5` | SOCKS5 username/password auth | https://legba.evilsocket.net/plugins/socks5/ |124| `cmd` | Wrap any external CLI tool; detect success via exit code or stdout pattern | https://legba.evilsocket.net/plugins/custom_binary/ |125126## Recipe System127128Recipes are YAML files that define reusable, parameterized attack configurations. They support variable substitution (`{$var or default}`) and resource embedding relative to the recipe path.129130```bash131legba --recipe attack.yaml132# Override recipe variables at runtime:133legba --recipe attack.yaml --set target=192.168.1.1 --set wordlist=passwords.txt134```135136Recipes are ideal for complex flows: CSRF token grabbing, multi-step auth, custom headers, or repeatable pentest engagements.137138Full recipe reference and examples: https://legba.evilsocket.net/recipes/139140## REST API141142Start an HTTP API alongside an attack session to query status, list running sessions, and stop them programmatically:143144```bash145legba http.basic --target example.com --username admin --password @pass.txt --api 127.0.0.1:8080146```147148Full REST API reference: https://legba.evilsocket.net/rest/149150## MCP Server151152legba is the only credential bruteforcer with a built-in Model Context Protocol (MCP) server, allowing AI agents to drive it programmatically:153154```bash155# SSE mode (Claude Desktop, Cline, etc.)156legba --mcp 127.0.0.1:9090157158# stdio mode (local agent pipelines)159legba --mcp stdio160```161162Full MCP setup and agent configuration snippets: https://legba.evilsocket.net/mcp/163164## Session Management165166Save progress and resume interrupted attacks:167168```bash169# Start with session tracking170legba ssh --target 10.0.0.1 --username root --password @pass.txt --session /tmp/my.session171172# Resume later (same command, session file is detected automatically)173legba ssh --target 10.0.0.1 --username root --password @pass.txt --session /tmp/my.session174```175176## Where to Look for More177178- **FAQ and common attack recipes**: https://legba.evilsocket.net/faq/179- **Speed comparison vs. Hydra/Medusa/Ncrack**: https://legba.evilsocket.net/comparison/180- **Reproducible benchmarks**: https://legba.evilsocket.net/benchmark/181- **Full documentation index**: https://legba.evilsocket.net/