Note
Supports Linux/Android kernel versions x86_64 4.18 and above, aarch64 5.5 and above. Does not support Windows and macOS system.
Download ELF zip file release , unzip and use by
command ./ecapture --help
.
Note
Need ROOT permission.
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。
./ecapture tls -i eth0 -w pcapng -p 443
capture plaintext packets save as pcapng file, use Wireshark
read it
directly.
./ecapture tls
will capture all plaintext context ,output to console, and capture Master Secret
of openssl TLS
save to ecapture_masterkey.log
. You can also use tcpdump
to capture raw packet,and use Wireshark
to read them
with Master Secret
settings.
cfc4n@vm-server:~$# uname -r
4.18.0-305.3.1.el8.x86_64
cfc4n@vm-server:~$# cat /boot/config-`uname -r` | grep CONFIG_DEBUG_INFO_BTF
CONFIG_DEBUG_INFO_BTF=y
capture tls text context. Step 1:
./ecapture tls --hex
Step 2:
curl https://github.com
# for installed libressl, libssl.so.52 is the dynamic ssl lib
vm@vm-server:~$ ldd /usr/local/bin/openssl
linux-vdso.so.1 (0x00007ffc82985000)
libssl.so.52 => /usr/local/lib/libssl.so.52 (0x00007f1730f9f000)
libcrypto.so.49 => /usr/local/lib/libcrypto.so.49 (0x00007f1730d8a000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1730b62000)
/lib64/ld-linux-x86-64.so.2 (0x00007f17310b2000)
# use the libssl to config the libssl.so path
vm@vm-server:~$ sudo ./ecapture tls --libssl="/usr/local/lib/libssl.so.52" --hex
# in another terminal, use the command, then type some string, watch the output of ecapture
vm@vm-server:~$ /usr/local/bin/openssl s_client -connect github.com:443
# for installed boringssl, usage is the same
/path/to/bin/bssl s_client -connect github.com:443
capture bash command.
ps -ef | grep foo
Linux Kernel: >= 4.18.
If you are using Ubuntu 20.04 or later versions, you can use a single command to complete the initialization of the compilation environment.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/gojue/ecapture/master/builder/init_env.sh)"
In addition to the software listed in the 'Toolchain Version' section above, the following software is also required for the compilation environment. Please install it yourself.
Clone the repository code and compile it
git clone [email protected]:gojue/ecapture.git
cd ecapture
make
bin/ecapture
eCapture support BTF disabled with command make nocore
to compile at 2022/04/17. It can work normally even on Linux systems that do not support BTF.
make nocore
bin/ecapture --help
See CONTRIBUTING for details on submitting patches and the contribution workflow.