gencfg, a trafgen config generation and syntax testing script

115 views
Skip to first unread message

Jon Schipp

unread,
May 26, 2013, 2:44:21 PM5/26/13
to netsn...@googlegroups.com
This incomplete, but working, shell script may prove useful to some of you.

It serves two purposes:
1.) Generate usable packet configurations for trafgen quickly.
      Right now, supports generation of beacon frames and syslog packets
2.) Format the output in specific ways to test trafgen's syntax e.g. white space or comma separation.
     Used to quickly test configs after commit changes to the lex parser

Examples:

# Read in exported C array from Wireshark and generate. Separate bytes by comma.
./gencfg -c array.txt -S comma | trafgen --in - --out eth0 --num 100

# Generate a syslog message with source IP, destination IP, and destination MAC address.
./gencfg -G syslog -s 192.168.1.254 -d 192.168.1.20 -M 00:0c:29:8d:4d:a2

# Create a beacon frame with SSID "FreeWifi" and set the source MAC address. Write to file called beacon.cfg
./gencfg -G beacon -T "FreeWifi" -m de:ad:be:ef:00:00 -o beacon.cfg
trafgen --in beacon.cfg --out wlan --rfraw --num 1000

If you have example configs that you would like me to include let me know.

https://github.com/jonschipp/gencfg

Thanks
Jon

Daniel Borkmann

unread,
May 27, 2013, 7:42:08 AM5/27/13
to netsn...@googlegroups.com
Thanks for the good work! That's awesome! I.e. I like the one with the SSID! :-)
Reply all
Reply to author
Forward
0 new messages