libpcap and python

gashero harry.python at gmail.com
Tue Feb 2 21:42:05 EST 2010


On 2月1日, 下午8时47分, Mag Gam <magaw... at gmail.com> wrote:
> Hello All,
>
> I used tcpdump to capture data on my network. I would like to analyze
> the data using python -- currently using ethereal and wireshark.
>
> I would like to get certain type of packets (I can get the hex code
> for them), what is the best way to do this? Lets say I want to capture
> all events of `ping localhost`
>
> TIA

You need python module "pypcap" or "pcapy" to capture the packet, and
the you can use Python to analyze it.
To decode the internet packet you can use "dpkt".

Good Luck!



More information about the Python-list mailing list