Add cross-compilation instructions for building Windows binaries from Linux
This commit is contained in:
1 parent
c4adcbbe0f
commit
51a0682ec6
1 file changed
+35
-1
@@ -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.
|
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)
|
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
|
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
|
## 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
|
Requires Go 1.21+ (uses the builtin `min`/`max`). No cgo, no extra system
|
||||||
dependencies.
|
dependencies.
|
||||||
|
|
||||||
@@ -187,7 +195,33 @@ dependencies.
|
|||||||
go build -o client.exe ./cmd/client
|
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
|
**Plain build** — passphrase is set interactively the first time you run
|
||||||
`host.exe`, and stored (as an Argon2id hash, never in plaintext) in
|
`host.exe`, and stored (as an Argon2id hash, never in plaintext) in
|
||||||
|
|||||||
Reference in new issue
Block a user