Introduction
I'm going to write a backend for packet manipulation tool. There is a lot of practicable for manipulation of packets. It's really important for administrators, hackers etc. If you want to research a network and how it works, sometimes you have to send some specific packets.
There are some applications like hping or scapy which give you some hand with it. Some of them are really poor, some have disgusting architecture or do not have any ;-) So the fact is, there isn't any solid, easy to use and useful application which help you control you packets over network.
Project details
I'm going to write a solid library which provide every features for packet manipulation. There will be well-thought-out API to easy link library with any frontend.
The main module which I will use is 'socket' from standard library. My idea about backend is to make it plugable. There should be some posibilites (depends on level of manipulation):
- manipulate every bit (low level)
- manipulate with using plugins (high level)
When I mean to manipulate every bit it means to get posibilites of change/set every bit in packet.
High level. I'm planning to deliver an interface to easy manipulate on every layers of OSI model. It should be pluggable with good API to make new plugs. I will write the most common and important plugins like ARP, IP, ICMP, TCP, UDP and one from the higher layer (as an example). So, user should get interface to easy modify all fields of those protocols. It should be possible to modify some of them (and rest required by protocols should be autogenerate). Also, any fields which could be auto-generatre should have this as an option (e.g. Total Length, Checksum or padding). There will be possible to add a "blank protocol". The field where user could type rest of interesting data from a scratch (if needed module isn't available).
I'm going to write generators for frames (it could be done with pcap_dispatch() from libpcap). There should be available template system to easy set up batch of packets. A template feature will be iterating values, conditions etc. Template should use files, editor should be available in GUI.
Another feature will be auto-designer for new protocols. If there isn't available module for a protocol, user should be able to design it in easy way. Like set lenght of all fields etc. It will be more promitive than predefined protocols but still better to have this than nothing.
Sniffing
I will add sniffing ethernet feature to get sent and answered for us packets. It will be done with libpcap, propably with pylibpcap[1] wrapper for Python. Output will be store in tcpdump format (to easy use anywhere).
There will be action-reaction support. Add active listen of packets and generate answers for them. User could set some behaviours to take better reaction system.
Also filter mechanism will be provided. For dropping uninteresting packets when capturing is on (lipcap supports it).
Front-end
There will be simple application with CLI. I will add optparse support. But it's not a main goal of project.
Summary
Here is a list of features which should be done during GSoC:
- manipulate bits in packets
- manipulate fields in protocols
- auto-filling fields in protocols
- template system/auto generate values in packets
- sniffing support w/action-reaction and filtering system
- auto-designer protocols
Cross-platforming and I18N
'socket' module from standard library is support by Unix systems, Windows, MacOS, BeOS, OS/2, and probably additional platforms[2]. I will do my best to keep my project cross-platfoming and international friendly.
Project Schedule
I am able to spend 15-20 hours/week starting from May until the mid of June (end of semester in Poland). During the summer I am able to spend up to 40 hours/week working on a project.
- May, June - I will design API and general architecture of library. I will start write bit manipulation, core of protocols plugins and those plugins (ARP, IP, TCP, UDP, ICMP).
- July - I would go on with missing features of backend. Write template system for generators and auto-filling system. Support for capturing packets via libpcap.
- August - I will finish sniffing features - action-reaction feature, filtering. And focus on auto-designer feature. After mid of a month, I will test and fix known bugs in existing code. I will write simple CLI application for provided library. Also extend documentation. If all will go fine I will end up with complete project before 20th of August, although some restrictions are possible.
