Giter VIP home page Giter VIP logo

nfqueue_tamper's Introduction

NFQueue Tamper

A tool to help in testing client/server robustness in the presence of malformed data.

Supported protocols:

  • IPv4
    • UDP
    • TCP

Building

Requirements:

Build with make

Usage

nfqueue_tamer -q <queue> -t "method1;opt1;opt2" -t "method2;opt1"

Queue number defaults to 0. Must be run as root.

To create a queue:

iptables -A <chain> [filter criteria] -j NFQUEUE --queue-num <queue>

For example, to trap all outbound UDP traffic coming from port 63:

iptables -A OUTPUT -p udp --sport 63 -J NFQUEUE --queue-num 0

Available methods and associated options:

  • rand - Randomly tamper with data
    • off - Offset, or offset range, at which to apply randomization
      • Defaults to 0:-1 (0 - end)
    • con - If offset is a range, whether or not modified bytes must be consecutive
      • Defaults to 0 (non-consecutive allowed)
      • NOT CURRENTLY SUPPORTED
    • sz - Number of bytes to modify, can be a range
      • Defaults to 1
  • fixed - Overwrite region of data with supplied values
    • off - Offset at which to apply data
      • Cannot be a range
    • data - Hex data
  • replace - Replace bytes within matching sequence
    • off - Offset into sequence to start replacing
      • Cannot be a range
      • Can be negative
    • seq - Hex sequence to search for
    • data - Replacement data
    • multi - Whether to allow multiple replacements
      • NOTE: Previously matching sequence is currently skipped

Global options:

  • chance - How likely the tamper method is to be used on a given packet
    • Probability value between 0 and 1
    • Defaults to 1

Example:

nfqueue_tamper -q 0 -t "rand;chance=.5;off=0:4;sz=1:2" -t "fixed;chance=0.1;off=16;data=0FEA0011"

This will have a 50% chance on every packet of replacing one or two of the first five bytes in the payload (application-layer data) with a random value, and a 10% chance of replacing data at offset 16-19 with 0F,EA,00,11.

nfqueue_tamper's People

Contributors

farlepet avatar

Stargazers

 avatar

Watchers

 avatar  avatar

nfqueue_tamper's Issues

IP/TCP/UDP Header Mangling Support

Low priority

Support modification of protocol headers rather than restricting modifications to the data payload. More care would have to be taken here, and possibly a flag to disable checksum re-calculation if desired.

Make exit cleaner

Add explicit handler to exit on Ctrl-C to ensure program exits cleanly

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.