Skip to content

Commit 12111cc

Browse files
committed
docs: several fixes to the documentation
1 parent b6d1c15 commit 12111cc

File tree

5 files changed

+25
-20
lines changed

5 files changed

+25
-20
lines changed

docs/plugins/custom_binary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The command (cmd) plugin allows legba to interact with a custom executable and u
55
| Name | Description |
66
| ---- | ----------- |
77
| `--cmd-binary <CMD_BINARY>` | Command binary [default: not set] |
8-
| `--cmd-args <CMD_ARGS>` | Command arguments. {USERNAME}, {PASSWORD}, {TARGET} and {PORT} can be used as placeholders [default: not set] |
8+
| `--cmd-args <CMD_ARGS>` | Command arguments. {USERNAME}, {PASSWORD}, {TARGET} can be used as placeholders [default: not set] |
99
| `--cmd-success-exit-code <CMD_SUCCESS_EXIT_CODE>` | Process exit code to be considered as a positive match [default: `0`] |
1010
| `--cmd-success-match <CMD_SUCCESS_MATCH>` | String to look for in the process standard output to be considered as a positive match |
1111

docs/plugins/dns.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ DNS subdomain enumeration.
77
| `--dns-resolvers <DNS_RESOLVERS>` | Comma separatd list of DNS resolvers to use instead of the system one. |
88
| `--dns-port <DNS_PORT>` | Resolver(s) port [default: `53`] |
99
| `--dns-attempts <DNS_ATTEMPTS>` | Number of retries after lookup failure before giving up [default: `1`] |
10+
| `--dns-ip-lookup` | Perform ip to hostname lookup. |
11+
| `--dns-max-positives <DNS_MAX_POSITIVES>` | If more than this amount of sequential DNS resolutions point to the same IP, add that IP to an ignore list [default: `10`] |
12+
| `--dns-no-https` | Do not fetch HTTPS certificates for new domains. |
1013

1114
## Examples
1215

docs/plugins/http.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A set of plugins supporting http basic authentication, NTLMv1, NTLMv2, multipart
1515
| Name | Description |
1616
| ---- | ----------- |
1717
| `--http-success <EXPRESSION>` | Boolean expression to evaluate in order to recognize a succesful attempt [default: "status == 200"] |
18-
| `--http-random-ua` | Randomize requests User-Agent |
18+
| `--http-ua <HTTP_UA>` | Set a fixed User-Agent (random by default if not set) |
1919
| `--http-follow-redirects` | Follow HTTP redirects |
2020
| `--http-method <HTTP_METHOD>` | Request method for HTTP based plugins [default: `GET`] |
2121
| `--http-headers <HTTP_HEADERS>...` | Request headers for HTTP based plugins |
@@ -118,8 +118,8 @@ HTTP Request with NTLMv1 Authentication:
118118

119119
```sh
120120
legba http.ntlm1 \
121-
--domain example.org \
122-
--workstation client \
121+
--http-ntlm-domain example.org \
122+
--http-ntlm-workstation client \
123123
--username admin \
124124
--password wordlists/passwords.txt \
125125
--target https://localhost:8888/
@@ -129,8 +129,8 @@ HTTP Request with NTLMv2 Authentication:
129129

130130
```sh
131131
legba http.ntlm2 \
132-
--domain example.org \
133-
--workstation client \
132+
--http-ntlm-domain example.org \
133+
--http-ntlm-workstation client \
134134
--username admin \
135135
--password wordlists/passwords.txt \
136136
--target https://localhost:8888/

docs/recipes.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ plugin: http
1111
args:
1212
target: "{$schema or https}://{$host}:{$port or 443}/owa/auth.owa"
1313
http-method: POST
14-
http-success-codes: 302
15-
http-success-string: set-cookie
14+
http-success: "status == 302 && set_cookie != \"\""
1615
http-payload: destination={$schema or https}://{$host}:{$port or 443}/&flags=4&username={USERNAME}&password={PASSWORD}
1716
```
1817
@@ -51,8 +50,7 @@ plugin: http.enum
5150
args:
5251
target: "{$schema or https}://{$host}:{$port or 443}{$path or /}"
5352
payloads: "{$recipe.path}/payloads.txt"
54-
http-success-codes: "{$success_code or 200}"
55-
http-success-string: "Destination host"
53+
http-success: "status == {$success_code or 200} && contains(body, \"Destination host\")"
5654
http-method: POST
5755
```
5856
@@ -65,6 +63,5 @@ plugin: http.enum
6563
args:
6664
target: "{$schema or https}://{$host}:{$port or 443}{$path or /}"
6765
payloads: "{$recipe.path}/dictionary.txt"
68-
http-success-codes: "{$success_code or 200}"
69-
http-success-string: "root:"
66+
http-success: "status == {$success_code or 200} && contains(body, \"root:\")"
7067
```

docs/usage.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ For plugins that accept a single payload, like subdomain enumeration:
1919

2020
```bash
2121
legba dns \
22-
--payload /path/to/subdomains.txt \
22+
--payloads /path/to/subdomains.txt \
2323
--target example.com
2424
```
2525

@@ -36,6 +36,7 @@ The `--target/-T` argument supports one or multiple targets expressed as one of
3636
* `--target 192.168.1.1-10`, `--target 192.168.1.1-10:22` IP range (with or without port).
3737
* `--target 192.168.1.0/24`, `--target 192.168.1.0/24:22` CIDR (with or without port).
3838
* `--target 10.0.0.1, 172.0.0.1:2222, @other-targets.txt, 192.168.1.1-10` any comma separated combination of them.
39+
* IPv6 CIDR is also supported, with port specified as `:[port]`, e.g. `--target 2001:db8::/126:[443]`.
3940

4041
## Providing Credentials
4142

@@ -52,12 +53,16 @@ For instance:
5253

5354
* `legba <plugin name> --username admin --password data/passwords.txt` will always use `admin` as username while loading the passwords from a wordlist.
5455
* `legba <plugin name> --username data/users.txt --password data/passwords.txt` will load both from wordlists and use all combinations.
55-
* `legba <plugin name> --username admin` will always use `admin` as username and attempt all permutations of the default printable ASCII charset between 4 and 8 characters (this is the default behaviour when a value is not passed).
56+
* `legba <plugin name> --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).
5657
* `legba <plugin name> --username data/users.txt --password '@/some/path/*.key'` will load users from a wordlist while testing all key files inside `/some/path`.
5758
* `legba <plugin name> --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.
5859
* `legba <plugin name> --username data/users.txt --password '[10-999]'` will load users from a wordlist while testing all numbers from 10 to 999.
5960
* `legba <plugin name> --username data/users.txt --password '[1, 2, 3, 4]'` will load users from a wordlist while testing the numbers 1, 2, 3 and 4.
6061

62+
Notes:
63+
- Multiple expressions can be combined with commas (e.g., `1,[3-5],9`) and will be expanded in order.
64+
- In passwords, `{user}` is replaced with the current username (e.g., `--password '{user}123'`).
65+
6166
### Iteration Logic
6267

6368
Iteration over these credentials can be controlled by the `-I, --iterate-by <ITERATE_BY>` argument. The `-I user` (the default) will iterate like this:
@@ -95,20 +100,20 @@ Another option is using the `-C, --combinations <FILENAME>` argument, this will
95100
| `-L, --list-plugins` | | List all available protocol plugins and exit. |
96101
| `-R, --recipe <RECIPE>` | | Load a recipe from this YAML file. |
97102
| `-T, --target <TARGET>` | | Single target host, url or IP address, IP range, CIDR, @filename or comma separated combination of them. |
98-
| `-U, --payloads, --username <USERNAME>` | `#4-8` | Constant, filename, glob expression as `@/some/path/*.txt`, permutations as `#min-max:charset` / `#min-max` or range as `[min-max`] / `[n, n, n]`. |
99-
| `-P, --key, --password <PASSWORD>` | `#4-8` | Constant, filename, glob expression as `@/some/path/*.txt`, permutations as `#min-max:charset` / `#min-max` or range as `[min-max`] / `[n, n, n]`. |
103+
| `-U, --payloads, --username <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]`. |
104+
| `-P, --key, --password <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]`. |
100105
| `-C, --combinations <COMBINATIONS>` | | Load `username:password` combinations from this file. |
101106
| `--separator <SEPARATOR>` | `:` | Separator if using the --combinations/-C argument. |
102107
| `-I, --iterate-by <ITERATE_BY>` | `user` | Whether to iterate by user or by password [possible values: `user`, `password`] |
103108
| `-S, --session <FILENAME>` | | Save and restore session information from this file. |
104109
| `-O, --output <OUTPUT>` | | Save results to this file. |
105110
| `--output-format <FORMAT>` | `text` | Output file format [possible values: text, csv, jsonl] |
106-
| `--timeout <TIMEOUT>` | `10000` | Connection timeout in milliseconds. |
107-
| `--retries <RETRIES>` | `5` | Number of attempts if a request fails. |
111+
| `--timeout <TIMEOUT>` | `1000` | Connection timeout in milliseconds. |
112+
| `--retries <RETRIES>` | `1` | Number of attempts if a request fails. |
108113
| `--retry-time <TIME>` | `1000` | Delay in milliseconds to wait before a retry. |
109114
| `--single-match` | | Exit after the first positive match is found. |
110115
| `--ulimit <ULIMIT>` | `10000` | Value for ulimit (max open file descriptors). |
111-
| `--concurrency <VALUE>` | `10` | Number of concurrent workers. |
116+
| `--concurrency <VALUE>` | logical CPUs | Number of concurrent workers. |
112117
| `--rate-limit <LIMIT>` | `0` | Limit the number of requests per second. |
113118
| `-W, --wait <WAIT>` | `0` | Wait time in milliseconds per login attempt. |
114119
| `--jitter-min <VALUE>` | `0` | Minimum number of milliseconds for random request jittering. |
@@ -124,7 +129,7 @@ For the full list of arguments including plugin specific ones run `legba --help`
124129

125130
The `--session` option allows saving and restoring session state, which is useful for resuming interrupted scans. When a session file is specified, legba will:
126131

127-
* Save the current progress to the file every second during execution
132+
* Save the current progress to the file every `report_time` milliseconds (default 5000 ms) during execution
128133
* Automatically restore from the file if it exists when starting
129134
* Preserve the position in the credential space, allowing you to continue exactly where you left off
130135
* Save all discovered credentials to the session file

0 commit comments

Comments
 (0)