pcapy
Pcapy is a Python extension module that interfaces with the libpcap packet capture library.
Windows install 32 bit
Pcapy requires python 2.5.
Python 32 bit: http://www.python.org/ftp/python/2.5.4/python-2.5.4.msi
winpcap: http://www.winpcap.org/install/bin/WinPcap_4_1_3.exe
Install python to C:\Python25\.
Show packets in hex in windows
1 import pcapy
2
3 devs=pcapy.findalldevs()
4
5 for d in devs:
6 r = pcapy.open_live(d,8192,0,0)
7 if r.getnet()=="192.168.1.0":
8 print "Dev:%s Network:%s Subnet:%s %d"%(d, r.getnet() , r.getmask(),r.datalink() )
9 count=0
10
11 while count<7:
12 (header,data)=r.next()
13 ipPacket=data[14:]
14 datax='>>'
15 for c in ipPacket:
16 datax='%s%02X '%(datax,ord(c))
17 print datax
18 count=count+1