You are not logged in.
I think this may be some sort of packaging issue, but I have not yet gotten to the bottom of what is going on. Recently, scapy no longer imports, complaining that it cannot find liblibc.a:
$ ipython
Python 3.9.1 (default, Dec 13 2020, 11:55:53)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.19.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import scapy.all
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-1-4dfe6b759364> in <module>
----> 1 import scapy.all
/usr/lib/python3.9/site-packages/scapy/all.py in <module>
16 from scapy.error import *
17 from scapy.themes import *
---> 18 from scapy.arch import *
19
20 from scapy.plist import *
/usr/lib/python3.9/site-packages/scapy/arch/__init__.py in <module>
26 if not WINDOWS:
27 if not conf.use_pcap and not conf.use_dnet:
---> 28 from scapy.arch.bpf.core import get_if_raw_addr
29
30
/usr/lib/python3.9/site-packages/scapy/arch/bpf/core.py in <module>
29 # ctypes definitions
30
---> 31 LIBC = cdll.LoadLibrary(find_library("libc"))
32 LIBC.ioctl.argtypes = [c_int, c_ulong, c_char_p]
33 LIBC.ioctl.restype = c_int
/usr/lib/python3.9/ctypes/util.py in find_library(name)
328 # See issue #9998
329 return _findSoname_ldconfig(name) or \
--> 330 _get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name))
331
332 ################################################################
/usr/lib/python3.9/ctypes/util.py in _findLib_gcc(name)
145 # some files that are linker scripts and not actual
146 # shared objects. See bpo-41976 for more details
--> 147 if not _is_elf(file):
148 continue
149 return os.fsdecode(file)
/usr/lib/python3.9/ctypes/util.py in _is_elf(filename)
97 "Return True if the given file is an ELF file"
98 elf_header = b'\x7fELF'
---> 99 with open(filename, 'br') as thefile:
100 return thefile.read(4) == elf_header
101
FileNotFoundError: [Errno 2] No such file or directory: b'liblibc.a'
What package is supposed to provide 'liblibc.a'? I know glibc provides /usr/lib/libc.a, and if I link this to /usr/lib/liblibc.a, scapy works again. I'm not sure if the problem is python/scapy looking for the wrong file, or glibc or some other package missing a necessary file.
I found a recent reference to a similar issue here: https://github.com/P0cL4bs/wifipumpkin3/issues/115 Maybe it's as simple as the scapy packages need to be rebuilt?
Is anyone else seeing a similar issue?
Offline
it seems python's ctypes bug introduced in 3.9.
https://bugs.python.org/issue42580
Offline
Ah, that makes sense.
[2020-12-17T12:36:11-0800] [ALPM] upgraded python (3.9.0-1 -> 3.9.1-1)
Presumably this bug was introduced in python 3.9.1, then, since scapy was working fine a couple of days ago.
Offline