From 51a0682ec6fdd9df47817375048177dda5b3c8fd Mon Sep 17 00:00:00 2001 From: creinky Date: Sun, 22 Nov 2026 22:41:09 -0700 Subject: [PATCH] Add cross-compilation instructions for building Windows binaries from Linux --- README.md | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9825fb6..754b4fa 100755 --- a/README.md +++ b/README.md @@ -170,6 +170,8 @@ For post-exploitation scenarios where the target machine runs `host.exe` and con ``` The client will prompt for the passphrase interactively. + > **Internet access requires an open port:** If connecting over the internet (not LAN), you must forward port `47812` on your router to the machine running the listener. Use a dynamic DNS service or static IP if your public IP changes. + 4. **Target connects back automatically** — no firewall rules needed on the target side, and it works across different networks (LAN or internet) 5. **Certificate trust is automatic** — the host embeds its certificate fingerprint at build time; the client auto-trusts it without interactive prompts @@ -180,6 +182,12 @@ For post-exploitation scenarios where the target machine runs `host.exe` and con ## Building +**Platform note:** Both `client.exe` and `host.exe` only run on Windows. +They use Win32 APIs for screen capture (`BitBlt`), input injection +(`SendInput`), and window management. However, you can compile them from +Linux using Go's built-in cross-compilation support — no Windows machine +or toolchain required. + Requires Go 1.21+ (uses the builtin `min`/`max`). No cgo, no extra system dependencies. @@ -187,7 +195,33 @@ dependencies. go build -o client.exe ./cmd/client ``` -For the host, you have two options: +### Cross-Compiling from Linux + +To build Windows executables on a Linux machine: + +```bash +# Install Go on Debian/Ubuntu if needed: +sudo apt update && sudo apt install golang-go + +# Verify installation: +go version # should show go1.21 or newer + +# Build client for Windows: +GOOS=windows GOARCH=amd64 go build -o lanrdp_client.exe ./cmd/client + +# Build host for Windows (plain, no baked-in password): +GOOS=windows GOARCH=amd64 go build -o lanrdp_host.exe ./cmd/host +``` + +The resulting `.exe` files are fully functional Windows binaries that can be +deployed to any Windows machine. For a host with an embedded password and +callback address, use `build-host.ps1` on a Windows machine or set the +appropriate `-ldflags` manually during cross-compilation. + +> **Recommendation:** Compile both client and host binaries on your build +> machine (Linux or Windows) before deployment. This ensures you have clean, +> tested executables ready to distribute without needing to compile on the +> target systems. **Plain build** — passphrase is set interactively the first time you run `host.exe`, and stored (as an Argon2id hash, never in plaintext) in