Code Monkey home page Code Monkey logo

ecapture's Introduction

ecapture 介绍

eBPF HOOK uprobe实现的各种用户态进程的数据捕获,无需改动原程序。

  • SSL/HTTPS数据导出功能,针对HTTPS的数据包抓取,不需要导入CA证书。
  • bash的命令捕获,HIDS的bash命令监控解决方案。
  • mysql query等数据库的数据库审计解决方案。

原理

eBPF技术

参考ebpf官网的介绍

uprobe HOOK

https的ssl hook

本项目hook了/lib/x86_64-linux-gnu/libssl.so.1.1SSL_writeSSL_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",
    },
    /**/
},

bash的readline hook

hook了/bin/bashreadline函数。

使用方法

安装使用,可以选择编译,也可以直接下载二进制包。 笔者环境ubuntu 21.04, linux kernel 5.10以上通用。

编译

git clone [email protected]:ehids/ecapture.git
cd ecapture
make
bin/ecapture

使用

https的无证书抓包 ssldump

执行任意https网络请求即可使用。

wget https://www.qq.com

演示

https://v.qq.com/txp/iframe/player.html?vid=m33278fdqt8

bash的shell捕获

ps -ef|grep foo

ecapture's People

Contributors

cfc4n avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.