GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - gojue/ecapture: Capture SSL/TLS plaintext with eBPF—no MITM proxy or custom CA installation. Supports Linux and Android on x86_64\arm64 and loong64.

BranchesTags
Open more actions menu

Latest commit

 

History

1,161 Commits
1,161 Commits

Folders and files

NameName
Last commit message
Last commit date
.devin
.devin
 
 
.github
.github
 
 
assets
assets
 
 
bin
bin
 
 
builder
builder
 
 
bytecode
bytecode
 
 
cli
cli
 
 
deps
deps
 
 
dist
dist
 
 
docs
docs
 
 
examples
examples
 
 
images
images
 
 
internal
internal
 
 
kern
kern
 
 
lib
lib
 
 
pkg
pkg
 
 
protobuf
protobuf
 
 
test
test
 
 
utils
utils
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
.golangci.yml
.golangci.yml
 
 
AGENTS.local.example.md
AGENTS.local.example.md
 
 
AGENTS.md
AGENTS.md
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CLAUDE.md
CLAUDE.md
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README-zh_Hans.md
README-zh_Hans.md
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
functions.mk
functions.mk
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
main.go
main.go
 
 
variables.mk
variables.mk
 
 

Repository files navigation

eCapture logo

eCapture (旁观者)
Capture SSL/TLS plaintext with eBPF—no MITM proxy or custom CA installation.

English · 汉字
CodeQL Latest release HomePage

Star History Rank GitHub Trending Repository of the Day

Important

Supports Linux on x86_64 (kernel 4.18+), aarch64 (kernel 5.5+), and LoongArch64 loong64 (kernel 6.6+). Android supports x86_64 and aarch64 with the existing kernel minimums. Capturing data requires root privileges or specific Linux capabilities. Does not support Windows or macOS.


  • Introduction
  • Getting started
    • Download
      • ELF binary file
      • Docker image
    • Capture OpenSSL plaintext data
    • Modules
      • OpenSSL module
      • GoTLS module
      • Other modules
    • Videos
  • Star History
  • Security & operations
  • Contributing
  • Compilation

Introduction

  • Captures TLS plaintext from applications using OpenSSL, BoringSSL, or GnuTLS, and data read or written through NSPR.
  • Supports plaintext capture for Go TLS programs, including HTTPS/TLS traffic in Go applications.
  • Captures commands entered in interactive Bash and Zsh sessions.
  • Audits MySQL queries and supports MySQL 5.6/5.7/8.0 and MariaDB.

Run ecapture --help to list commands and global options. Use ecapture tls --help or ecapture help tls for TLS options and examples. You can view help as a regular user.

Getting started

Download

ELF binary file

Tip

Supports Linux on x86_64, aarch64, and LoongArch64; Android supports x86_64 and aarch64.

Download the ELF binary package from the releases page, extract it, and run:

ecapture --help

Docker image

Tip

Linux only.

# Pull the Docker image
docker pull gojue/ecapture:latest

# Run it
docker run --rm --privileged=true --net=host -v ${HOST_PATH}:${CONTAINER_PATH} gojue/ecapture ARGS

⚠️ Security note: --privileged=true grants full host access. For production use, prefer specific capabilities instead. See the Minimum Privileges Guide.

See Docker Hub for more information.

Capture OpenSSL plaintext data

sudo ecapture tls

eCapture automatically detects the system's OpenSSL library and selects a capture interface: it prefers an up Ethernet interface on the lowest-metric IPv4/IPv6 default route, then falls back to interface traffic counters or an up interface. A startup warning names the selected interface and explains how to override it with -i eth0 or --ifname eth0. Only that interface is captured; use -i lo for loopback traffic. Generate an HTTPS request with an OpenSSL-linked client to see the reconstructed request and response. This synthetic HTTP/1.1 example illustrates the text format:

[2026-01-01T12:00:00.000000000Z] http/1.1 request 192.0.2.1:43210 -> 192.0.2.2:443 host="example.com" domain_source="Host" connection="17-4-client/192.0.2.1:43210--192.0.2.2:443/tcp#2"
GET / HTTP/1.1
Host: example.com

📄 For output formats and verification examples, see docs/example-outputs.md.

Modules

Linux builds include all eight modules below. Android builds include tls, gotls, and bash.

  • bash: captures bash commands
  • zsh: captures zsh commands
  • gnutls: captures plaintext from GnuTLS libraries without needing a CA certificate
  • gotls: captures plaintext communication from Go programs using TLS/HTTPS
  • mysqld: captures SQL queries from MySQL 5.6/5.7/8.0 and MariaDB
  • nspr (alias nss): captures data read and written through NSPR
  • postgres: captures SQL sent through the simple query protocol on PostgreSQL 10 and later
  • tls: captures TLS plaintext from applications using OpenSSL or BoringSSL

You can use ecapture -h to view the full list of subcommands.

OpenSSL module

eCapture searches standard library paths for libssl. Use --libssl to select a specific library.

If the target program is statically linked, you can set the program path directly as the value of the --libssl flag.

The OpenSSL module supports three output modes:

  • pcap/pcapng mode stores encrypted network packets and TLS secrets in pcap-NG format.
  • keylog/key mode saves TLS handshake keys to a file.
  • text mode defaults to --text-source=pcapng, reconstructing complete HTTP/1.1 and HTTP/2 messages from live pcapng and DSB data. The capture interface is selected automatically; use -i eth0 to override it. Use --text-source=hook to capture plaintext through function hooks instead (no interface required).

For OpenSSL, GoTLS, and GnuTLS, repeat --output to choose multiple destinations. The default is stdout; explicit destinations replace that default. stdout and stderr render readable records with log_type/module labels. In -m pcapng mode, the terminal shows only operational logs. Files and tcp://host:port use Protobuf v2 JSON Lines. In text mode they carry both operational logs and captured events; in keylog/pcapng mode an output file contains only operational logs, while TCP carries both record types. Use --keylogfile/--pcapfile for native artifacts, with explicit filenames required in the corresponding mode and no default native files.

--stream-listen ws://127.0.0.1:28257/ starts a separate Protobuf v2 subscription listener requiring the ecapture.v2 subprotocol. --config-listen 127.0.0.1:28256 starts the HTTP configuration service. Both listeners are disabled by default. The old --listen, --eventaddr, --logaddr, --ecaptureq and event rotation flags are removed without compatibility aliases. See the output API for the complete mode matrix and receiver migration.

Live decryption for text output

tls, gotls, and gnutls default to the pcapng text source and automatically select a capture interface when -i is omitted. All three accept --text-source hook for function-hook capture. GoTLS still requires --elfpath to identify the target binary.

Use -m text --text-source=pcapng with tls, gotls, or gnutls to reconstruct complete HTTP/1.1 and HTTP/2 messages from the captured network stream. Each message includes direction, timestamp, IP/port tuple, connection identity, and an HTTP/2 stream ID when applicable. host comes from the HTTP Host header or HTTP/2 :authority; domain_source="server_ip" marks a fallback to the server IP. Output goes to --output (stdout by default). Raw pcapng and a standalone keylog are disabled by default; specify --pcapfile or --keylogfile to save either artifact.

sudo ecapture tls -m text --text-source=pcapng -i eth0 --output stdout --output /tmp/http.jsonl 'tcp port 443'
sudo ecapture gotls -m text --text-source=pcapng --elfpath /path/to/go-client -i eth0 --pcapfile /tmp/raw.pcapng 'tcp port 443'
sudo ecapture gnutls -m text --text-source=pcapng --gnutls /path/to/libgnutls.so -i eth0 'tcp port 443'

The decryptor waits for TLS secrets that may appear in a DSB after the corresponding packets. HTTP/3 over QUIC v1/v2 has GoTLS test fixtures; support depends on the TLS backend supplying the required secrets. The following options require text mode with the pcapng source:

Option Output / selection
--text-raw Authenticated TLS/QUIC STREAM bytes and QUIC DATAGRAM messages
--text-http-events Incremental HTTP/1.x, HTTP/2, HTTP/3, SSE and HTTP/2 gRPC events
--text-max-decoded-body N Per-message gzip expansion limit in bytes; requires HTTP events; zero keeps content encoding
--text-protocol dot|doh|doq|mqtt|redis Explicit application parser; MQTT 3.1.1 and fixed-length RESP2/RESP3
--text-tls-upgrade smtp|imap|pop3|ldap|postgres|mysql|connect|https-connect One explicit STARTTLS/SSLRequest/CONNECT negotiation; HTTPS CONNECT includes one inner TLS layer
--text-udp-protocol dtls DTLS 1.2 ECDHE-RSA AES-128/256-GCM records; the default UDP protocol is QUIC

Structured events use lossless hex plus metadata JSON, preserving headers, trailers, message/stream IDs, early-data status and TLS depth, including events with no payload. Stream chunks carry offsets/end markers; datagrams retain message boundaries without invented stream offsets. Application selection is explicit, not automatic ALPN routing. Raw, HTTP-event and explicit application modes are mutually exclusive. HTTP reload uses the corresponding underscore JSON keys; omitted module options reset to their zero defaults. Mail/database upgrades negotiate TLS; use --text-raw for application bytes without a supported parser. gRPC events preserve schema-free Protobuf bytes. Operational logs contain payload-free diagnostics. ECH still requires ECH_SECRET/ECH_CONFIG material that current probes do not capture; upgrading the decryptor alone does not enable live ECH. DTLS/DATAGRAM do not imply WebRTC, WebTransport or MASQUE decoding. With v1.4.0, some zero-length-client-CID QUIC loopback captures still fail connection routing; the maintained DoQ/DATAGRAM baseline uses 8-byte client CIDs.

To verify the source independently, add --pcapfile /tmp/raw.pcapng to the capture command and send a request with a unique path or response token. After stopping eCapture, preload only its embedded secrets with Wireshark >= 4.4 to handle DSBs arriving after their packets, then compare TLS stream 0:

keys=$(mktemp)
editcap --extract-secrets /tmp/raw.pcapng - >"$keys"
tshark -n -r /tmp/raw.pcapng -o "tls.keylog_file:$keys" -q -z follow,tls,ascii,0
rm -f -- "$keys"

The optional file receives the same pcapng bytes as the live SDK stream.

Terminal records and JSON files distinguish operational logs from captured events. JSON and Protobuf share the v2 schema; receivers must preserve TEXT metadata and save native KEYLOG/PCAPNG bytes by format. Subscriptions receive future events; a late pcapng connection starts an independent fragment without historical packets or keys. See the v2 protocol and receiver example.

--output, --keylogfile and --pcapfile also accept FIFOs created with mkfifo -m 600 PATH. Open the reader before starting eCapture. Output remains v2 JSON Lines, raw NSS keylog, or raw pcapng respectively. A missing reader fails immediately; a broken pipe or a write taking over five seconds fails without reconnecting. Native FIFO consumers must handle EOF and keep a reader open across reload.

Pcap mode

Supports TLS-encrypted HTTP 1.0/1.1/2.0 over TCP and HTTP/3 (QUIC) over UDP.

Use -m pcapng (alias -m pcap) with --pcapfile to name the required local capture file. Use -i to override the automatically selected interface.

sudo ecapture tls -m pcap -i eth0 --pcapfile=ecapture.pcapng tcp port 443

This command saves captured network packets and TLS secrets in a pcapng file. Wireshark uses its embedded secrets to decrypt supported TLS traffic.

📄 For pcapng verification, see docs/example-outputs.md.

Keylog mode

You can specify -m keylog or -m key together with the --keylogfile option. --keylogfile must name an explicit local artifact file; there is no default filename.

The captured OpenSSL TLS master secret is saved to --keylogfile. You can also enable tcpdump capture and then open the file in Wireshark, setting the master secret path to view plaintext packets.

sudo ecapture tls -m keylog --keylogfile=openssl_keylog.log

You can also use tshark for real-time decryption and display:

tshark -o tls.keylog_file:openssl_keylog.log -Y http -T fields -e http.file_data -f "port 443" -i eth0

Text mode

sudo ecapture tls -m text

This reconstructs HTTP messages using the default pcapng text source. To capture plaintext bytes from TLS function hooks, use sudo ecapture tls -m text --text-source hook (no interface required).

GoTLS module

Similar to the OpenSSL module.

gotls command

Capture TLS plaintext data.

Step 1:

sudo ecapture gotls --elfpath=/path/to/go-client

Step 2:

/path/to/go-client

More help

ecapture gotls -h

Other modules

Modules such as bash, mysqld, and postgres can also be used. You can view the full list with ecapture -h.

Videos

  • YouTube video: How to use eCapture v0.1.0
  • eCapture: supports capturing plaintext of Go TLS/HTTPS traffic

eCaptureQ GUI application

eCaptureQ is a cross-platform graphical client for eCapture that visualizes eBPF-based TLS capture capabilities. It provides an interface for analyzing encrypted traffic without needing a CA certificate.

It supports two modes:

  • Integrated mode: unified Linux/Android execution
  • Remote mode: Windows/macOS/Linux clients connect to a remote eCapture service

This eCapture version requires a client with Protobuf v2 support and the ecapture.v2 WebSocket subprotocol. Check the selected client release against the receiver contract; older v1 clients cannot connect without an update.

Event forwarding

Event forwarding projects

Video demonstration

eCaptureQ.Demo.mp4

🔗 GitHub repository

Protobuf protocols

For details of the Protobuf log schema used by eCapture/eCaptureQ, see:

  • protobuf/PROTOCOLS.md

Star History

Star History Chart

Security & operations

  • Security policy — vulnerability reporting and supported versions
  • Minimum privileges — required Linux capabilities and least-privilege configuration
  • Defense & detection — how to detect and defend against unauthorized usage
  • Performance benchmarks — repeatable overhead and event-loss measurements
  • Release verification — how to verify the integrity of release artifacts

Contributing

See CONTRIBUTING for details on submitting patches and the contribution workflow.

Compilation

Custom compilation

You can customize the features you want, such as setting the uprobe offset address to support statically linked OpenSSL libraries. Refer to the compilation guide for detailed instructions.

Loong64 releases are cross-built on Ubuntu 24.04 x86_64 with LLVM 22.1.8. Use TARGET_ARCH=loong64; the sysroot, BTF, verification steps, and current runtime validation limits are documented in Loong64 build and validation.

Remote configuration updates

After eCapture is running, you can dynamically modify configurations through HTTP interfaces. Refer to the HTTP API documentation.

Event forwarding

eCapture supports multiple event-forwarding methods. You can forward events to packet capture software such as Burp Suite. For details, refer to the Event Forwarding API documentation.

About

Capture SSL/TLS plaintext with eBPF—no MITM proxy or custom CA installation. Supports Linux and Android on x86_64\arm64 and loong64.

ecapture.cc

Topics

androidboringsslebpfgnutlsgolanglinuxloong64network-analysisnetwork-securityobservabilityopensslpacket-capturepcapngsecurity-auditingssltlstls-decryptiouprobewireshark

Resources

Readme
Apache-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

15.6k stars

Watchers

97 watching

Forks

1.7k forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.