logo       

Re: py-libpcap vs MacOSX 10.4: msg#00009

security.scapy.general

Subject: Re: py-libpcap vs MacOSX 10.4


On Aug 28, 2005, at 11:42 AM, Olivier Warin wrote:

Hello,
I have got a problem when trying to use py-libpcap with MacOSX 10.4.2
pylibpcap does not compile with python2.4 from fink, whereas pylibpcap0.4 (not 0.5 !) works with the python2.3 from Apple.
I would appreciate that someone give me some advice on how to compile py-libpcap against python2.4 found in fink.
This way, it would be greatly easier and cleaner to use python modules like gnuplot etc... in the scripts.
Thanks
/Olivier

I finally got around to trying scapy on my powerbook. The dnet install went as advertised.

To get the pcap wrapper to work I had to do the following:
o Download pylibpcap from cvs. You need a few files that are not in the dist tarball. See their sourceforge page for instructions on how to get the cvs copy.
o Install swig from darwinports. port install swig.
o Edit pylibpcap's setup.py and change:

def swig_sources(self, sources):
to
def swig_sources(self, sources, extension=None):

From there a python setup.py build python setup.py install (insert your favorite --prefix or --home flags here), and the import pcap succeeds.

I also put in the sys.version fix mentioned here http:// www.secdev.org/projects/scapy/portability.html
Unfortunately I'm now getting this error:

sr(IP())
Begin emission:
Traceback (most recent call last):
File "<console>", line 1, in ?
WARNING: Unable to guess datalink type (interface=lo0 linktype=0). Using Ethernet
File "/Users/tdoan/prebin/scapy-1.0.0.47.py", line 7478, in sr
a,b,c=sndrcv(s,x,*args,**kargs)
File "/Users/tdoan/prebin/scapy-1.0.0.47.py", line 7363, in sndrcv
r = pks.nonblock_recv()
ERROR: --- Error in child 18810
Traceback (most recent call last):
File "/Users/tdoan/prebin/scapy-1.0.0.47.py", line 7329, in sndrcv
pks.send(p)
File "/Users/tdoan/prebin/scapy-1.0.0.47.py", line 7106, in send
ifs.send(str(Ether()/x))
File "/Users/tdoan/prebin/scapy-1.0.0.47.py", line 3647, in __str__
return self.__iter__().next().build()
File "/Users/tdoan/prebin/scapy-1.0.0.47.py", line 3676, in build
p = self.post_build(self.do_build())
File "/Users/tdoan/prebin/scapy-1.0.0.47.py", line 3668, in do_build
p = f.addfield(self, p, self.__getattr__(f))
File "/Users/tdoan/prebin/scapy-1.0.0.47.py", line 3585, in __getattr__
return i2h(self, fields[attr] )
File "/Users/tdoan/prebin/scapy-1.0.0.47.py", line 2661, in i2h
x=getmacbyip(dstip)
File "/Users/tdoan/prebin/scapy-1.0.0.47.py", line 1859, in getmacbyip
nofilter=1)
File "/Users/tdoan/prebin/scapy-1.0.0.47.py", line 7505, in srp1
a,b=srp(*args,**kargs)
File "/Users/tdoan/prebin/scap File "/Users/tdoan/prebin/ scapy-1.0.0.47.py", line 7129, in nonblock_recv
p = self.recv()
File "/Users/tdoan/prebin/scapy-1.0.0.47.py", line 7115, in recv
pkt = self.ins.next()[1]
TypeError: unsubscriptable object
>>> y-1.0.0.47.py", line 7500, in srp
a,b,c=sndrcv(conf.L2socket(iface=iface, filter=filter, nofilter=nofilter, type=type),x,*args,**kargs)
File "/Users/tdoan/prebin/scapy-1.0.0.47.py", line 7363, in sndrcv
r = pks.nonblock_recv()
File "/Users/tdoan/prebin/scapy-1.0.0.47.py", line 7191, in nonblock_recv
p = self.recv(MTU)
File "/Users/tdoan/prebin/scapy-1.0.0.47.py", line 7177, in recv
pkt = self.ins.next()[1]
TypeError: unsubscriptable object
INFO: more --- Error in child 18810

Anyone seen this before?

\T

---------------------------------------------------------------------
Desinscription: envoyez un message a: scapy.ml-unsubscribe@xxxxxxxxxx
Pour obtenir de l'aide, ecrivez a: scapy.ml-help@xxxxxxxxxx




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise