Expand description
Host-side HTTPS forensic inspection for unkernel-rs.
Provides two complementary, pure-Rust decryption engines:
-
Method 1 — Zero-Touch Host-Side VMI TLS Key Extraction (
VmiTlsInspector): Extracts live TLS 1.3 and TLS 1.2 session keys directly fromwasmtime::SharedMemorywithout injecting any CA certificate, modifying the guest filesystem, or breaking certificate pinning.- Pass 1 (
client_randomanchor): ScansSharedMemoryfor the exact 32-byteClientHello.randomobserved on the wire, then verifies candidatetraffic_secret(TLS 1.3) ormaster_secret(TLS 1.2) windows in the surrounding struct memory mathematically against the captured encrypted AEAD record (zero false positives). Optionally writes standard WiresharkSSLKEYLOGFILElines on the host. - Pass 2 (FindAES round-key schedule fallback): For runtimes that wipe
client_randomafter handshake, scansSharedMemoryfor algebraically valid AES-128 (176 B) / AES-256 (240 B) expanded round-key schedules and verifies nearby IV candidates against the captured GCM record.
- Pass 1 (
-
Method 2 — Opt-In Transparent Host TLS MITM Proxy (
MitmCa+MitmSession): Generates an ephemeral per-VM ECDSA P-256 Root CA (rcgen) and dynamically signs per-SNI leaf certificates, terminating guest TLS and re-encrypting upstream via Sans-I/Orustls::ServerConnection+rustls::ClientConnection. Works across every cipher and runtime (OpenSSL, Go, Rust, Python, Node) with zero scanning overhead.
Structs§
- MitmCa
- Ephemeral per-VM Root CA and leaf certificate cache for transparent host-side
--mitm-tls. - Mitm
Session - Sans-I/O transparent TLS MITM bridge (
guest <-> ServerConnection <-> ClientConnection <-> upstream). - Mitm
Step - Output produced by feeding one side of a
MitmSession. - Server
Hello Info - Parsed fields from a TLS
ServerHellohandshake message. - VmiTls
Context - Shared host context for Method 1 VMI
SharedMemoryTLS key extraction. - VmiTls
Inspector - Per-connection zero-touch VMI TLS passive decryptor.
Functions§
- extract_
client_ random - Extract the 32-byte
ClientHello.randomfrom a TLS ClientHello record. - find_
32byte_ matches - Find all byte offsets in
haystackequal to the 32-byteneedleusing a fast 8-byte prefilter. - looks_
like_ tls_ client_ hello - Check whether
datastarts with a TLS Handshake (0x16)ClientHello(0x01) record. - parse_
server_ hello_ handshake - Extract
server_random,cipher_suite, and TLS 1.3 version indicator from aServerHellohandshake message payload (starting at handshake header byte0x02). - scan_
aes_ key_ schedules - Scan a memory image for algebraically valid AES-128 (176-byte) or AES-256 (240-byte)
expanded round-key schedules (both big-endian and little-endian
u32word layouts, as used by OpenSSL, Go, andring). Returns(offset_in_mem, raw_key_bytes). - summarize_
tls_ plaintext - Format a compact HTTP summary (request line or status line) and sanitized lossy preview.