public
Description: QueRub embeds a ruby interpreter into a libnetfilter_queue C program for inline fuzzing and reversing of network protocols
Homepage: http://www.matasano.com
Clone URL: git://github.com/struct/querub.git
querub /
name age message
file Makefile Fri May 08 19:00:30 -0700 2009 various cleanups [struct]
file README Thu May 14 22:00:14 -0700 2009 typo [struct]
file cksum.c Fri May 01 08:57:01 -0700 2009 first commit [struct]
file querub.c Thu May 14 21:58:18 -0700 2009 code cleanups! use rb_eval_string_protect to ca... [struct]
file querub.h Thu May 14 21:58:18 -0700 2009 code cleanups! use rb_eval_string_protect to ca... [struct]
directory scripts/ Thu May 14 21:58:45 -0700 2009 some new additions and cleanups and an example ... [struct]
README
Matasano Security 2009
Chris@Matasano.com

Description

QueRub is a program that calls the netfilter queue library in order to pass
network packets transparently to a Ruby script you provide for fuzzing, reverse
engineering or modification. QueRub is for Linux only.

For those Debian/Ubuntu users out there you can install the needed libraries
by running:

apt-get install libnetfilter-queue1 libnetfilter-queue-dev

Compile QueRub by typing 'make' in the directory. Then you want an IPTables
rule to hijack traffic for you, heres an example:

iptables -A INPUT -p tcp --dport 9191 -j QUEUE

This will queue all inbound TCP traffic with a destination port of 9191 for
QueRub to pass to the querub.rb Ruby script. Now all you have to do is add
your fuzzing or inspecting code to querub.rb and run querub with your script

$ make
gcc -pipe -ggdb -Wall -I/usr/lib/ruby/1.8/i486-linux/   -c -o querub.o querub.c
gcc -pipe -ggdb -Wall -I/usr/lib/ruby/1.8/i486-linux/   -c -o cksum.o cksum.c

$ ./querub querub.rb querub_main

Where querub.rb is your script and querub_main is the method you want called
when a packet is received. (QueRub will not check if querub_main exists)

QueRub will automatically call an *optional* method in every script you give it.
The name of this optional method is 'querub_setup'. See scripts/*.rb for examples!