eBPF HOOK uprobe实现的各种用户态进程的数据捕获,无需改动原程序。
- SSL/HTTPS数据导出功能,针对HTTPS的数据包抓取,不需要导入CA证书。
- bash的命令捕获,HIDS的bash命令监控解决方案。
- mysql query等数据库的数据库审计解决方案。
参考ebpf官网的介绍
本项目hook了/lib/x86_64-linux-gnu/libssl.so.1.1
的SSL_write
、SSL_read
函数的返回值,拿到明文信息,通过ebpf map传递给用户进程。
Probes: []*manager.Probe{
{
Section: "uprobe/SSL_write",
EbpfFuncName: "probe_entry_SSL_write",
AttachToFuncName: "SSL_write",
//UprobeOffset: 0x386B0,
BinaryPath: "/lib/x86_64-linux-gnu/libssl.so.1.1",
},
{
Section: "uretprobe/SSL_write",
EbpfFuncName: "probe_ret_SSL_write",
AttachToFuncName: "SSL_write",
//UprobeOffset: 0x386B0,
BinaryPath: "/lib/x86_64-linux-gnu/libssl.so.1.1",
},
{
Section: "uprobe/SSL_read",
EbpfFuncName: "probe_entry_SSL_read",
AttachToFuncName: "SSL_read",
//UprobeOffset: 0x38380,
BinaryPath: "/lib/x86_64-linux-gnu/libssl.so.1.1",
},
{
Section: "uretprobe/SSL_read",
EbpfFuncName: "probe_ret_SSL_read",
AttachToFuncName: "SSL_read",
//UprobeOffset: 0x38380,
BinaryPath: "/lib/x86_64-linux-gnu/libssl.so.1.1",
},
/**/
},
hook了/bin/bash
的readline
函数。
安装使用,可以选择编译,也可以直接下载二进制包。
笔者环境ubuntu 21.04
, linux kernel 5.10以上通用。
git clone git@github.com:ehids/ecapture.git
cd ecapture
make
bin/ecapture
执行任意https网络请求即可使用。
wget https://www.qq.com
https://v.qq.com/txp/iframe/player.html?vid=m33278fdqt8
ps -ef|grep foo