Source: scapy
Version: 2.3.2-0.1
Severity: normal

Hi,

the following scapy 2.3.2 simple script:

=====================
#!/usr/bin/env python3

from scapy.all import *

pkt = IP()
pkt.ttl = 2

conf.L3socket = L3RawSocket
sr1(pkt)
=====================

Produces this in my debian system:

Begin emission:
ERROR: --- Error in child 3589
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/scapy/sendrecv.py", line 89, in sndrcv
    pks.send(p)
  File "/usr/lib/python3/dist-packages/scapy/supersocket.py", line 102, in send
    self.outs.sendto(sx,(x.dst,0))
TypeError: a bytes-like object is required, not 'IP'
Traceback (most recent call last):
  File "./scapy", line 9, in <module>
    sr1(pkt)
  File "/usr/lib/python3/dist-packages/scapy/sendrecv.py", line 345, in sr1
    a,b=sndrcv(s,x,*args,**kargs)
  File "/usr/lib/python3/dist-packages/scapy/sendrecv.py", line 133, in sndrcv
    r = pks.recv(MTU)
  File "/usr/lib/python3/dist-packages/scapy/supersocket.py", line 94, in recv
    from arch import get_last_packet_timestamp
ImportError: No module named 'arch'

I installed it from the debian archive:

% aptitude install python3-scapy

What is even more weird is that executing the same script steps in the
scapy CLI they work fine:

% sudo scapy
INFO: Can't import python gnuplot wrapper . Won't be able to plot.
INFO: Can't import PyX. Won't be able to use psdump() or pdfdump().
INFO: Can't import python Crypto lib. Won't be able to decrypt WEP.
INFO: Can't import python Crypto lib. Disabled certificate manipulation tools
Welcome to Scapy (2.3.2)
>>> pkt = IP()
>>> pkt.ttl = 2
>>> conf.L3socket = L3RawSocket
>>> sr1(pkt)
Begin emission:
Finished to send 1 packets.
*
Received 1 packets, got 1 answers, remaining 0 packets
<IP  version=4L ihl=5L tos=0x0 len=20 id=1 flags= frag=0L ttl=2
proto=hopopt chksum=0xbae7 src=127.0.0.1 dst=127.0.0.1 |>


-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.8.0+ (SMP w/8 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Reply via email to