You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/_docs/user-guide/eldritch.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -459,6 +459,37 @@ The **assets.read** method returns a UTF-8 string representation of the asset fi
459
459
460
460
---
461
461
462
+
## Chain
463
+
464
+
The `chain` library enables multi-agent chaining by allowing one agent (Agent A) to proxy C2 traffic for another agent (Agent B). This is useful for establishing communication through intermediary agents in restricted networks.
465
+
466
+
### chain.tcp
467
+
468
+
`chain.tcp(addr: str) -> int`
469
+
470
+
The **chain.tcp** method establishes a chain proxy over TCP, allowing Agent A to forward C2 messages to/from Agent B. Agent A connects to Agent B's bind TCP transport listener at the specified address and proxies gRPC traffic over HTTP/2.
471
+
472
+
**Parameters:**
473
+
-`addr`: The address and port where Agent B is listening for chain connections (e.g., `"192.168.1.100:8443"`)
474
+
475
+
**Returns:**
476
+
-`0` on successful initialization (the proxy runs asynchronously in the background)
477
+
478
+
**Example:**
479
+
480
+
```python
481
+
# Agent A connects to Agent B's bind TCP listener and starts proxying traffic
482
+
chain.tcp("192.168.1.100:8443")
483
+
484
+
# Now Agent B's C2 messages flow through Agent A to Tavern
485
+
```
486
+
487
+
**Usage Pattern:**
488
+
489
+
Agent A must have one of the standard transports (grpc, http1, dns) configured for its upstream connection to Tavern. Agent B is configured with a TCP bind transport to accept connections from Agent A on a TCP port.
490
+
491
+
---
492
+
462
493
## Crypto
463
494
464
495
The `crypto` library offers functionalities to encrypt, decrypt, and hash data. It includes support for algorithms like AES, MD5, SHA1, and SHA256, as well as helpers for base64 encoding and JSON parsing.
Copy file name to clipboardExpand all lines: docs/_docs/user-guide/imix.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -211,6 +211,37 @@ This transport doesn't support eldritch functions that require bi-directional st
211
211
212
212
*Note*: TXT records provide the best performance.
213
213
214
+
### tcp_bind
215
+
216
+
The TCP Bind transport inverts the traditional C2 communication model: instead of the agent connecting outbound to the server, the agent binds to a local TCP port and waits for an upstream agent (or redirector) to connect inward.
217
+
218
+
**Use Cases:**
219
+
- Agent chaining: An upstream agent (Agent A) connects to a downstream agent's (Agent B) TCP bind port to proxy its C2 traffic
220
+
- Network egress restrictions: When agents can't initiate outbound connections but can receive inbound connections
221
+
- Multi-stage deployments: Establishing secure communication tunnels between agent stages
222
+
223
+
**Configuration:**
224
+
225
+
```yaml
226
+
transports:
227
+
- type: tcp_bind
228
+
uri: tcp://0.0.0.0:8443 # Bind address and port
229
+
```
230
+
231
+
**Parameters:**
232
+
- `uri`: The local address and port to bind on (e.g., `tcp://0.0.0.0:8443`). Use `0.0.0.0` to listen on all interfaces, or specify a specific IP for local-only binding.
233
+
234
+
**Important Notes:**
235
+
236
+
- **Inverted Nature**: The agent binds and listens; upstream agents or redirectors must initiate the connection. This reverses the typical agent-to-server model.
237
+
- **Secure Channel**: TCP Bind is treated as a trusted local channel. Messages are sent as plain protobuf over the TCP connection; encryption (ChaCha20) is applied by the upstream agent when forwarding to Tavern.
238
+
- **Agent Chaining**: Use with `chain.tcp()` in Eldritch to have one agent proxy traffic for another. For example:
239
+
- Agent B binds on `tcp://0.0.0.0:8443` with TCP Bind transport
240
+
- Agent A uses Eldritch to call `chain.tcp("192.168.1.100:8443")` to connect to Agent B
241
+
- Agent A proxies all of Agent B's C2 traffic upstream to Tavern
242
+
- **Connection Persistence**: The TCP connection is maintained and reused across multiple C2 cycles. If the connection drops, a new upstream connection must be initiated.
243
+
- **Not Suitable for Wide-Area Networks**: This transport is designed for local or trusted network chaining. For remote communication, use standard grpc, http1, or dns transports.
244
+
214
245
## Logging
215
246
216
247
At runtime, you may use the `IMIX_LOG` environment variable to control log levels and verbosity. See [these docs](https://docs.rs/pretty_env_logger/latest/pretty_env_logger/) for more information. **When building a release version of imix, logging is disabled** and is not included in the released binary.
0 commit comments