abid-sayyad / bpf_tracer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple HTTP traffic captures using BCC

This branch contains our implementation for the code in our article

Prerequisites

You can install those requirements on your local machine, or you can use a predefined docker! Note: The docker was tested on ubuntu 20.04 with kernel 5.11.0-43-generic. If you do have troubles with BCC from the docker, please install BCC and goland on your machine and don't use the docker.

docker pull gcr.io/seekret/ebpf-training-setup:latest

or

docker build -t gcr.io/seekret/ebpf-training-setup:latest .

Setting up the docker environment

The command lines below are equivalent, and sets up the setup you need for the workshop. In both cases we mount the local directory to the docker.

./setup_docker.sh

Running the demo server

cd demo-server
go run main.go

Running the sniffer

In the docker (./setup_docker.sh)

go run main.go ./sourcecode.c

On a local machine

cd capture-traffic
sudo go run main.go ./sourcecode.c

Running test client

./client/run.sh

Output

The entire HTTP payloads are written to the stdout of the sniffer every 10 seconds.

Demo

Run the client img.png

Output in the sniffer img_1.png

About


Languages

Language:Go 57.3%Language:C 40.5%Language:Dockerfile 1.4%Language:Shell 0.8%