# legba β€” full documentation Single-file concatenation of every page under https://legba.evilsocket.net/, intended for ingestion by LLMs and AI agents. Source: https://github.com/evilsocket/legba/tree/main/docs Generated: 2026-05-20T11:58:14Z --- ## Source: https://legba.evilsocket.net/ --- title: Multi-protocol credential bruteforcing tool in Rust description: Open-source multi-protocol credential bruteforcing and password spraying tool in Rust for penetration testing. 1.5x to 55x faster than hydra. --- # legba Legba is a multiprotocol credentials bruteforcer / password sprayer and enumerator built with Rust and the Tokio asynchronous runtime in order to achieve better performances and stability while consuming less resources than similar tools (see the [benchmark](benchmark.md) page). Browse the sidebar for installation instructions, usage, recipes, the REST and MCP APIs, and per-protocol plugin documentation.

legba logo

--- ## Source: https://legba.evilsocket.net/install/ --- title: Install legba on Linux, macOS, Windows description: How to install legba on Linux, macOS, and Windows. Precompiled binaries, Homebrew, building from source, and the official Docker image. --- # Installation ## Binaries Download one of the precompiled binaries from the [project latest release page](https://github.com/evilsocket/legba/releases/latest). ## Cargo Legba is published as a binary crate on [crates.io](https://crates.io/crates/legba), if you have [Cargo installed](https://rustup.rs/) you can: ```sh cargo install legba ``` This will compile its sources and install the binary in `$HOME/.cargo/bin/legba`. ## Homebrew If you're a **Homebrew** user, you can install Legba with a custom tap: ```bash brew tap evilsocket/legba https://github.com/evilsocket/legba brew install evilsocket/legba/legba ``` ## Docker For any OS supporting docker, an image is available on [Docker Hub](https://hub.docker.com/r/evilsocket/legba): ```sh docker run -it evilsocket/legba -h ``` When using wordlist files, remember to share them via a docker volume. Moreover you'll want to use the host network in order to reach the target, for instance: ```sh docker run \ -v $(pwd):/data \ #Β shared the current directory as /data inside the container --network host \ # docker will use the same network of the host -it evilsocket/legba:latest \ ssh --username root --password /data/your-wordlist.txt --target 192.168.1.1 ``` ## AI Agent Skill If you use an AI coding agent (Claude Code, Cursor, Copilot, OpenCode, and [many others](https://skills.sh)), you can install the legba skill to give it full knowledge of the tool - target syntax, credential expressions, plugins, recipes, REST API, and MCP server: ```bash npx skills add https://github.com/evilsocket/legba --skill legba ``` Once installed, your agent will be able to construct legba commands, write recipes, and configure the REST API or MCP server without needing to look things up manually. ## Building ### Sources Building the project from sources requires [Rust to be installed](https://rustup.rs/). After cloning this repository you can build it with: ```sh cargo build --release ``` The binary will be compiled inside the `./target/release` folder. ### Docker Image Alternatively it is possible to build a Docker container: ```sh docker build -t legba . ``` --- ## Source: https://legba.evilsocket.net/usage/ --- title: legba usage and CLI reference description: "Complete legba CLI reference: target syntax, credential expressions, iteration strategies, rate limiting, sessions, and output formats." --- # Usage In order to use this tool, you'll need to provide: 1. A plugin name, depending on which protocol you are attacking. 2. A `--target` argument specifying the ip, hostname and (optionally) the port of the target 3. depending on the selected plugin, a pair of `--username` and `--password` arguments , a single `--payloads` argument (like in the case of the `dns.enum` plugin which requires a single enumeration element) or a single `-C/--combinations` argument. For instance, to perform a simple HTTP basic authentication wordlist attack: ```bash legba http.basic \ --username admin \ --password /path/to/wordlists.txt \ --target https://example.com/ ``` For plugins that accept a single payload, like subdomain enumeration: ```bash legba dns \ --payloads /path/to/subdomains.txt \ --target example.com ``` And so on. ## Selecting One or More Targets The `--target/-T` argument supports one or multiple targets expressed as one of the following, or a comma separated list of the following: * `--target 127.0.0.1`, `--target www.google.com`, ... single target. * `--target 127.0.0.1:22` single target with port. * `--target 127.0.0.1, 192.168.1.1:80` comma separated list of targets. * `--target @targets.txt` load a list of targets from a file. * `--target 192.168.1.1-10`, `--target 192.168.1.1-10:22` IP range (with or without port). * `--target 192.168.1.0/24`, `--target 192.168.1.0/24:22` CIDR (with or without port). * `--target 10.0.0.1, 172.0.0.1:2222, @other-targets.txt, 192.168.1.1-10` any comma separated combination of them. * IPv6 CIDR is also supported, with port specified as `:[port]`, e.g. `--target 2001:db8::/126:[443]`. ## Providing Credentials The `--username`/`--payloads` and `--password`/`--key` arguments all support the same logic depending on the value passed to them: * If the value provided is an existing file name, it'll be loaded as a wordlist. * If the value provided is in the form of `@/some/path/*.txt` it'll be used as a [glob expression](https://docs.rs/glob/latest/glob/) to iterate matching files. * If the value provided is in the form of `#-:`, it'll be used to generate all possible permutations of the given charset (or the default one if not provided) and of the given length. For instance: `#1-3` will generate all permutations from 1 to 3 characters using the default ASCII printable charset, while `#4-5:0123456789` will generate all permutations of digits of 4 and 5 characters. * If the value provided is in the form of `[-]`, it'll be used as an integer range. * If the value provided is in the form of `[, , ]`, it'll be used as comma separated list of integers. * Anything else will be considered as a constant string. For instance: * `legba --username admin --password data/passwords.txt` will always use `admin` as username while loading the passwords from a wordlist. * `legba --username data/users.txt --password data/passwords.txt` will load both from wordlists and use all combinations. * `legba --username admin` will always use `admin` as username and attempt all permutations of the default alphanumeric lowercase charset between 3 and 5 characters (this is the default behaviour when a value is not passed). * `legba --username data/users.txt --password '@/some/path/*.key'` will load users from a wordlist while testing all key files inside `/some/path`. * `legba --username data/users.txt --password '#4-5:abcdef'` will load users from a wordlist while testing all permutations of the charaters `abcdef` 4 and 5 characters long. * `legba --username data/users.txt --password '[10-999]'` will load users from a wordlist while testing all numbers from 10 to 999. * `legba --username data/users.txt --password '[1, 2, 3, 4]'` will load users from a wordlist while testing the numbers 1, 2, 3 and 4. Notes: - Multiple expressions can be combined with commas (e.g., `1,[3-5],9`) and will be expanded in order. - In passwords, `{user}` is replaced with the current username (e.g., `--password '{user}123'`). ### Iteration Logic Iteration over these credentials can be controlled by the `-I, --iterate-by ` argument. The `-I user` (the default) will iterate like this: ``` for user in usernames { for password in passwords { // rate limiting and delays happen here plugin.login(user, password) } } ``` While `-I password` will invert the loop: ``` for password in passwords { for user in usernames { // rate limiting and delays happen here plugin.login(user, password) } } ``` While both strategies will eventually produce the same results, using a different approach can be useful in [cases like this one](https://github.com/evilsocket/legba/issues/7), especially when using `--rate-limit` or `--wait` delays. ### Predefined Combinations Another option is using the `-C, --combinations ` argument, this will load a predefined set of `username:password` combinations from the given filename. ## Main Options | Option | Default | Description | | ------ | ------- | ----------- | | `-L, --list-plugins` | | List all available protocol plugins and exit. | | `-R, --recipe ` | | Load a recipe from this YAML file. | | `-T, --target ` | | Single target host, url or IP address, IP range, CIDR, @filename or comma separated combination of them. | | `-U, --payloads, --username ` | `#3-5` | Constant, filename, glob expression as `@/some/path/*.txt`, permutations as `#min-max:charset` / `#min-max` (default charset `abcdefghijklmnopqrstuvwxyz0123456789`) or range as `[min-max`] / `[n, n, n]`. | | `-P, --key, --password ` | `#3-5` | Constant, filename, glob expression as `@/some/path/*.txt`, permutations as `#min-max:charset` / `#min-max` (default charset `abcdefghijklmnopqrstuvwxyz0123456789`) or range as `[min-max`] / `[n, n, n]`. | | `-C, --combinations ` | | Load `username:password` combinations from this file. | | `--separator ` | `:` | Separator if using the --combinations/-C argument. | | `-I, --iterate-by ` | `user` | Whether to iterate by user or by password [possible values: `user`, `password`] | | `-S, --session ` | | Save and restore session information from this file. | | `-O, --output ` | | Save results to this file. | | `--output-format ` | `text` | Output file format [possible values: text, csv, jsonl] | | `--timeout ` | `1000` | Connection timeout in milliseconds. | | `--retries ` | `1` | Number of attempts if a request fails. | | `--retry-time