Giter VIP home page Giter VIP logo

sdp-filter's Introduction

A lightweight SDP Filter

© by Moritz Blanke

Description:

SDP-Filter provies an easy way to filter SDP (Session Description Protocol) packets

License:

GPLv3, see LICENSE File.

Dependencies:

  • libnetfilter-queue
  • linux-kernel >= 2.6.14

Usage:

SDP-Filter needs to be fed the packets via the NFQUEUE of iptables, for example:

iptables -t mangle -A POSTROUTING -p udp --dport 9875 -j NFQUEUE --queue-num 42

Kernel module nfnetlink_queue needs to be loaded. Since UDP:9875 is the standard port for SDP, any packets which may be fed into the queue (e.g. through misconfiguration of iptables) and are NOT SDP packets on UDP:9875 are being forwarded as further specified by iptables.

Configuration:

SDP-Filter provides harcoded configuration through the file config.h

[1] #define QUEUE 42
[2] #define BLACKLIST true
[3] #define RULESC 2
[4] #define RULES\
[5]	{<verdict>,<attribute>,<filter>,<string>}, \
[6]	{<verdict>,<attribute>,<filter>,<string>}, \
[7]

[1] QUEUE defines the netfilter-queue, as specified above by iptables

[2] BLACKLIST defines the default behaviour of SDP-Filter:

  • true: blacklist - all packets, except for those denied by the rules are forwarded
  • false: whitelist - all packets, except for those allowed by the rules are dropped

[3] RULESC defines the number of rules specified in 4-6]...

[4-6] RULES defines the rules by which SDP-Filter filters

  • verdict: ALLOW || DISALLOW specifies which action has to be taken if a rule matches
  • attribute: "string" specifies the attribute which is to be tested. e.g. "a=x-plgroup", "s=" or "m=video". See RFC4566 (or use Wireshark) for a list of viable attributes
  • filter: IS || BEGINS_WITH || ENDS_WITH || CONTAINS string operator which is used to compare string to the value of the attribute.
  • string: "string" specifies the value which is compared by above operators against the specified attribute

[7] The C-Preprocessor dictates: if the last rule 6] ends with \ an empty line has to follow

Example:

{ALLOW,"s=",BEGINS_WITH,"[Radio] "}, \

sdp-filter's People

Contributors

m-blanke avatar

Watchers

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