Giter Club home page Giter Club logo

ebpf-ids's Introduction

eBPF-IDS using ML and XDP Offload

This repository contains the source code and other materials for an Intrusion Detection System developed using the extended Berkeley Packet Filter. It uses Machine Learning, namely a Random Forest algorithm, for detection. Additionally, the solution can use a partial hardware offload using the XDP Offload mode. This solution is designed solely for the detection of Port Scans.

This work was developed in the context of the Thesis related to Masters in Informatics Security, presented to the Department of Informatics Engineering of the Faculty of Sciences and Technology of the University of Coimbra.

Contents

This repository contains:

  • A solution before XDP Offload was integrated, used for legacy purposes
  • Dataset processing and Machine Learning Training
  • The Source Code containing the final solution
  • The same IDS capabilities implemented totally in User Space using the Scapy Library

Requirements

For the correct functionality of this solution, the following are required:

  • Kernel 5.15.0 (or above)
  • Netronome SmartNIC
    • Agilio BPF Firmware
  • CPUs: 4
  • Python 3.10.12 (or above)
  • BCC Library

Usage

Usage: ebpfids_userspace.py [XDP MODE] <ifdev> [ML MODEL MODE] [DETECTION RESPONSE] [OUTPUT MODE] [OPTIONAL PARAMETERS]

XDP MODE:
      -S: use skb / generic mode
      -D: use driver / native mode
      -H: use hardware offload mode
ML MODEL MODE:
      -C: C compiled model mode
      -M: MAPs stored model mode
DETECTION RESPONSE:
      -P: Passive mode
      -A: Active mode
OUTPUT MODE:
      -Lv: Logs from Perf Output (Verbose)
      -Ls: Logs from Perf Output (Simple)
      -Up: Userspace mode showing Port Scan Table
      -Uf: Userspace mode showing Flows
      -K: Kernel mode showing bpf_trace_printk (for debugging ebpf code)
OPTIONAL:
      --scan_attempts: Number of scan attempts to infer a Port Scan (Default: 25)
      --scan_delay: Max Delay in seconds between scan attempts to infer Port Scan (Default: 1800 sec)

e.g.: ebpfids_userspace.py -S eth0 -C -P -Lv

ebpf-ids's People

Contributors

joaolopix 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.