Giter Site home page Giter Site logo

durdur's Introduction

Durdur ๐Ÿ

Build Status Go Report Card codecov LICENSE

Durdur is a CLI tool for Linux implementing L3/L4 packet dropping with eBPF/Go.

example

How to use

Durdur is easy to use with these commands: attach, detach, drop, undrop, and list.
All commands should be run with root privileges.

Attach

attach installs Durdur on the system for a specific interface.

durdur attach --interface eth0

Detach

detach uninstalls Durdur from the system.

durdur detach

Drop and Undrop

drop and undrop checks all (ingress) L3 and L4 packets in the system and either block or allow them.
Both commands support the following flags:

  • src for the source address value of an IPv4 packet.
  • dns for the domain value of a DNS packet.

Example usage for drop;

durdur drop --src "192.0.1.1"
durdur drop --dns "example.com"

Example usage for undrop;

durdur undrop --src "192.0.1.1"
durdur undrop --dns "example.com"

List

list writes all entires of the maps to the stdout. It has 3 subcommands; src, dns, and all.

Example usage for list;

durdur list src
durdur list dns
durdur list all

How to install

From source;

Build and use build/durdur binary.

make build

From Docker image;

Build the image.

make build-docker

Run the container with privileges.

Example usage;

docker run --rm -i -t --net="host" --privileged -v /sys/fs/bpf:/sys/fs/bpf durdur -- attach -i eth0
docker run --rm -i -t --net="host" --privileged -v /sys/fs/bpf:/sys/fs/bpf durdur -- drop --dns "example"

PS: You don't need to use --net="host" if you don't want to access host's interfaces.

TODO

  • Egress support.
  • Wildcard support to DNS.
  • IPv6 support.
  • Multiple interfaces support.
  • Port support.

Copyright

GPL-3.0 license,
Copyright 2022-2023 Bora Tanrikulu <[email protected]>

durdur's People

Contributors

boratanrikulu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

kshvakov

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.