ecapture README

The project's README from github.com/gojue/ecapture. As one markdown file: README.md.

eCapture Logo

汉字 | English

GitHub stars GitHub forks CI Github Version

eCapture(旁观者): capture SSL/TLS text content without a CA certificate using eBPF.

[!IMPORTANT]
Supports Linux/Android on x86_64 (kernel 4.18+) and aarch64 (kernel 5.5+). Kernel version requirements apply per CPU architecture for both Linux and Android. Need ROOT permission or specific Linux capabilities. Does not support Windows and macOS system.


Introduction

Getting started

Download

ELF binary file

[!TIP] support Linux/Android x86_64/aarch64.

Download ELF zip file release , unzip and use by command sudo ecapture --help.

Docker image

[!TIP] Linux only.

# pull docker image
docker pull gojue/ecapture:latest
# run
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, consider specific capabilities instead. See Minimum Privileges Guide.

see Docker Hub for more information.

Capture openssl text content.

sudo ecapture tls

eCapture will automatically detect the system's OpenSSL library and start capturing plaintext. When you make an HTTPS request (e.g., curl https://google.com), the captured request and response will be displayed:

...
INF module started successfully. moduleName=EBPFProbeOPENSSL
??? UUID:233851_233851_curl_5_1_172.16.71.1:51837, Name:HTTP2Request, Type:2, Length:304
header field ":method" = "GET"
header field ":path" = "/"
header field ":authority" = "google.com"
...

📄 For complete output examples, see docs/example-outputs.md.

Modules

The eCapture tool comprises 8 modules that respectively support plaintext capture for TLS/SSL encryption libraries like OpenSSL, GnuTLS, NSPR, BoringSSL, and GoTLS. Additionally, it facilitates software audits for Bash, MySQL, and PostgreSQL applications.

OpenSSL Module

eCapture search /etc/ld.so.conf file default, to search load directories of SO file, and search openssl shard libraries location. or you can use --libssl flag to set shard library path.

If target program is compile statically, you can set program path as --libssl flag value directly。

The OpenSSL module supports three capture modes:

Pcap Mode

Supported TLS encrypted http 1.0/1.1/2.0 over TCP, and http3 QUIC protocol over UDP. You can specify -m pcap or -m pcapng and use it in conjunction with --pcapfile and -i parameters. The default value for --pcapfile is ecapture_openssl.pcapng.

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

This command saves captured plaintext data packets as a pcapng file, which can be viewed using Wireshark.

📄 For complete pcapng mode output, see docs/example-outputs.md.

Keylog Mode

You can specify -m keylog or -m key and use it in conjunction with the --keylogfile parameter, which defaults to ecapture_masterkey.log.

The captured OpenSSL TLS Master Secret information is saved to --keylogfile. You can also enable tcpdump packet capture and then use Wireshark to open the file and set the Master Secret path to view plaintext data packets.

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

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

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

Text Mode

sudo ecapture tls -m text will output all plaintext data packets. (Starting from v0.7.0, it no longer captures SSLKEYLOG information.)

GoTLS Module

Similar to the OpenSSL module.

gotls command

capture tls text context.

Step 1:

sudo ecapture gotls --elfpath=/home/cfc4n/go_https_client --hex

Step 2:

/home/cfc4n/go_https_client

more help

sudo ecapture gotls -h

Other Modules

such as bash\mysqld\postgres modules, you can use ecapture -h to view the list of subcommands.

Videos

eCaptureQ GUI Application

eCaptureQ is a cross-platform graphical user interface client for eCapture, visualizing eBPF TLS capture capabilities. Built using the Rust + Tauri + React technology stack, it provides a real-time, responsive interface, enabling easy analysis of encrypted traffic without the need for CA certificates. It simplifies complex eBPF capture techniques, making them easy to use. Supports two modes:

Event Forwarding

Event Forwarding Projects

Video Demonstration

https://github.com/user-attachments/assets/c8b7a84d-58eb-4fdb-9843-f775c97bdbfb

🔗 GitHub Repository

Protobuf Protocols

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

Stargazers over time

Stargazers over time

Security & Operations

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 offset address for uprobe to support statically compiled OpenSSL libraries. Refer to the compilation guide for compilation instructions.

Configurations Remote Update

After eCapture is running, you can dynamically modify the 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.

ecapture (gojue/ecapture)

Searching Database…

15.5K ·GitHub
这是什么东西?一个开源的命令行安全工具,利用 eBPF 直接捕获 SSL/TLS 流量的明文内容,无需安装 CA 证书,也不用 MITM 代理。它还能审计主机上的 shell 命令和数据库查询。
它是加到我代码里的库,还是一个独立的工具?是一个独立的命令行工具,用 sudo 在你想监控的机器上运行,不是库。另外还有一个独立的跨平台图形界面客户端 eCaptureQ,用 Rust、Tauri 和 React 开发。
怎么把它跑起来?从 GitHub Releases 下载对应架构的 ELF zip 包,解压后运行 'sudo ecapture --help'。在 Linux 上也可以使用 Docker 镜像;工具会自动检测系统的 OpenSSL 库,然后开始捕获明文。
运行它需要 root 权限或什么证书吗?需要 root 权限——要么是 ROOT 权限,要么是特定的 Linux capabilities,文档里有一份最小权限指南介绍最低权限的配置方式。不需要安装任何证书:开箱即支持 OpenSSL、LibreSSL、BoringSSL、GnuTLS、NSS/NSPR 和 Go 的 TLS 库。
上手前有哪些最大的坑?不支持 Windows 和 macOS,Docker 镜像只能在 Linux 上运行——它以特权模式运行,README 里特别标注了这一安全提示。对于静态编译链接 OpenSSL 的程序,需要通过 --libssl 参数传入二进制文件路径。
它能在哪些系统上运行?Linux 和 Android,支持 x86_64(内核 4.18 或更新)和 aarch64/arm64(内核 5.5 或更新);不同 CPU 架构对内核版本的要求不一样。
除了 HTTPS 流量,它还能抓什么?总共有八个模块。除了各种 TLS 库(OpenSSL、GnuTLS、NSS、Go TLS)之外,它还能出于主机安全审计的目的记录 bash 和 zsh 命令,并捕获 mysqld 5.6/5.7/8.0、MariaDB 以及 PostgreSQL 10+ 的 SQL 查询。
抓到的数据怎么导出?OpenSSL 模块有三种模式:text 模式把明文输出到终端或文件;pcap/pcapng 模式保存 pcapng 文件,可以用 Wireshark 打开(支持 HTTP/1.x、基于 TCP 的 HTTP/2 和基于 UDP 的 HTTP/3 QUIC);keylog 模式写出 TLS 主密钥,供 Wireshark 或 tshark 解密用。事件还可以转发给 Burp Suite 之类的工具。
有图形界面吗,还是只能在终端里用?有一个叫 eCaptureQ 的跨平台图形界面客户端,用 Rust + Tauri + React 编写。集成模式运行在 Linux/Android 上,远程模式则让 Windows、macOS 或 Linux 客户端连接到别处运行的 eCapture 服务。
不用 CA 证书它是怎么解密 TLS 的?它不去拦截网络流量,而是通过 eBPF uprobes 挂到目标进程内部的 SSL/TLS 库函数上,直接读取明文和 TLS 密钥,所以不存在需要客户端信任的证书。uprobe 偏移量还可以手动设置,以支持静态编译的 OpenSSL。
Creator
gojue
Size
17 MB
Stars
15.5K
Age
4y
Commits · 90 Days