lemoer / bpfcountd Goto Github PK
View Code? Open in Web Editor NEWa small daemon to monitor network traffic using bpf (berkley packet filters)
License: MIT License
a small daemon to monitor network traffic using bpf (berkley packet filters)
License: MIT License
Can you think about what license you would like to use for this project?
I would like to use your project in a commercial project if your desired license allows that. In return I want to implement reloading the filter file using a signal.
Local user with access to the UNIX Socket can cause bpfcountd to exit with SIGPIPE simply by connecting to the socket and close it without reading any data causing local denial of service.
Tested on Arch Linux / x86-64.
(gdb) r -i wls1 -f ./filters.example
Starting program: [...]/git-github/bpfcountd/bpfcountd -i wls1 -f ./filters.example
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Device: wls1
id: arp-req; bpf: "arp[6:2] == 1";
id: arp-rep-norm; bpf: "not ether broadcast and arp[6:2] == 2";
id: arp-rep-grat; bpf: "ether broadcast and arp[6:2] == 2 and ether src 00:26:c6:12:6f:a4";
Program received signal SIGPIPE, Broken pipe.
0x00007ffff78d7c7d in send () from /usr/lib/libc.so.6
(gdb) bt
#0 0x00007ffff78d7c7d in send () from /usr/lib/libc.so.6
#1 0x00000000004019cb in usock_sendstr (client_sock=5, str=0x7fffffffe5a0 "arp-rep-grat:0:0\n") at usock.c:45
#2 0x000000000040178b in main (argc=5, argv=0x7fffffffeae8) at main.c:158
You can reproduce the bug with this code:
>> ./sock ../test.sock
prepare socket ... done
connecting to bpfcountd ... done
trigger SIGPIPE in bpfcountd ... done
testing if bpfcountd died ... yes rawr!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.