Giter Club home page Giter Club logo

iptables-ext-dns's Introduction

iptables-ext-dns

Administration tool for IPv4/IPv6 TCP/UDP packet filtering.

##build & install see https://github.com/mimuret/iptables-ext-dns/wiki/install

Usage

dns match options:
[!] --qr match when response
[!] --opcode match
      (Flags QUERY,IQUERY,STATUS,NOTIFY,UPDATE)
[!] --aa match when Authoritative Answer
[!] --tc match when Truncated Response
[!] --rd match when Recursion Desired
[!] --ra match when Recursion Available
[!] --ad match when Authentic Data
[!] --cd match when checking Disabled
[!] --qname
[!] --qtype
    (Flags ex. A,AAAA,MX,NS,TXT,SOA... )
        see. http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml
[!] --reverse-match --rmatch reverse matching flag
[!] --maxsize qname max size 

qname size

Qname size is not domain string length. For example "www.example.jp." string length is 15, but qname size is 16. For more information, see RFC1035.

Example

Ex. accept example.jp request.

qname option default match mode is exact match.

This sample matches 'example.jp', but not matches 'hogehoge.example.jp'.

iptables -A INPUT  -m dns --qname example.jp -j ACCEPT
ip6tables -A INPUT  -m dns --qname example.jp -j ACCEPT

Ex. drop ${random}.example.jp. request.

rmatch option changes match mode to reverse match.

This sample matches 'example.jp' and 'hogehoge.example.jp,'.

iptables -A INPUT  -m dns --rmatch --qname example.jp -j DROP
ip6tables -A INPUT  -m dns --rmatch --qname example.jp -j DROP

Ex. drop ${random}.example.jp. request qname size > 64 .

maxsize option provide qname size filtering.

This sample not matches 'example.jp.' and 'hogehoge.example.jp.'.

but 'OJcoaTh297tDwtkNCAV2vtLwh3P0S6Ldce6Oas0Sug6YJGCniluVLoEPBBIOTEr.example.jp.' is matched

iptables -A INPUT  -m dns --rmatch --qname example.jp ! --maxsize 64 -j DROP
ip6tables -A INPUT  -m dns --rmatch --qname example.jp ! --maxsize 64 -j DROP

Ex. drop qtype ANY

'qtype' option provide qtype filter.

This sample is drop query when type is ANY.

iptables -A INPUT -m dns --qtype ANY -j DROP
ip6tables -A INPUT -m dns --qtype ANY -j DROP

iptables-ext-dns's People

Contributors

kidmin avatar mimuret avatar t0r0t0r0 avatar

Watchers

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