Fuzzing is a software testing technique where unexpected input is passed to a software. This project aims to test packet encoding of NDN/CCN implemenations. Supported packet formats are NDN Packet Format and CCNx. This software runs on Python 3.6+ and is able to test packet decoding of CCN-lite, PiCN and PyCN-lite.
- Clone the Repository
git clone https://github.com/cn-uofbasel/CCN-PacketFuzzing.git
- Run setup.py
cd CCN-PacketFuzzing
python3.6 setup.py install
To test one of the supported parsers, you have to have it on your machine. Infos for Installation can be found here:
- CCN-lite: https://github.com/cn-uofbasel/ccn-lite/blob/master/doc/README-unix.md
- PiCN: https://github.com/cn-uofbasel/PiCN
- PyCN-lite: https://github.com/cn-uofbasel/PyCN-lite
python3.6 Packet_Fuzzing.py 'parser' 'path'
Parser: This indicates the program that should be tested.
Path: The relative or absolute path to the main folder of the parser.
Examples
python3.6 Packet_Fuzzing.py picn ../PiCN
python3.6 Packet_Fuzzing ccn ~/MyTestfile/ccn-lite
The CCN-PacketFuzzer brings some command line options. For a quick help run the program with argument -h
or --help
-f
or --fuzziness
- 0: All length values are correct
- 1: The length values at deepest recursion level in the TLV's are wrong
- 2: All Length values are wrong
The default is 0
-s
or --sleep
This sets the timer between to packages in Milliseconds. It accepts values between 100 and 2000 both included. Default value is 100
Per default the Fuzzer is running until the parser crashes or it is interrupted.
This can be changed with -c
or --counter
. It declares how many packets should be send and accepts any positive number in integer range. If the parser crashes, the program is still stopped.
After all optional arguments there can be a protocol field.
NDN
or CCNx
. For command line help type:
python3 Packet_Fuzzing.py 'parser' 'path' 'protocoll' -h
This specifies the packet type the fuzzer is using. Default is NDN.
The protocols themselves have the option to specify which packet types should be send with -p
or --protocoll
. These are for
NDN:
- l: LinkObject
- i: Interest
- d: Data
CCNx:
- i: Interest
- c: ContentObject
All packet types can be combined. Examples: NDN packages without LinkObject.
python3.6 Packet_Fuzzing.py ccn ../ccn-lite NDN -p i d
There is the possibility to give offline
as parser. This means no connection will be established and the fuzzer runs on its own. This is for debugging purpose