tags:

views:

26

answers:

1

i am trying to filter some headers off my pcap stream using python. is there a particular module to do this. help with any or suggestion would be well appreciated

A: 

I have been using python-libpcap http://sourceforge.net/projects/pylibpcap/

If I am not mistaken, it is just a wrapper to the C libpcap. It doesn't feel very Pythonic, but it gets the job done.

Edit: However, this will just let you separate the packets. There isn't much parsing of the headers. I failed to find any sort of good module that did this for me, so I wrote my own script to parse them. Message me if you would like for me to send it to you.

orangeoctopus
i will really appreciate it if you could send me the script. how do we do that cos i'm new here? thanks
hollandspur
i guess pcap is not part of python standard library modules. "no module pcap".. also in your script, what did u use as the file name?...thanks
hollandspur
In my original post I linked to the python library you need. As for the file name, you should check out some of the tutorials or online documentation on how to open files. In the one I provided, it is '/data/dontest2.pcap', but obviously the file path for you is going to be different....
orangeoctopus