I have tried to run my program, and I have tried import scapy
then import scapy.all
but is will give me the same error. I am using kali-linux if that helps. The code that is causing the error is just from scapy.all import *
This is the full error output:
Traceback (most recent call last):
File "/home/bradz/test.py", line 24, in <module>
from scapy.all import send, IP, TCP, ARP
File "/usr/local/lib/python3.9/dist-packages/scapy/all.py", line 16, in <module>
from scapy.arch import *
File "/usr/local/lib/python3.9/dist-packages/scapy/arch/__init__.py", line 27, in <module>
from scapy.arch.bpf.core import get_if_raw_addr<br/>
File "/usr/local/lib/python3.9/dist-packages/scapy/arch/bpf/core.py", line 30, in <module>
LIBC = cdll.LoadLibrary(find_library("libc"))
File "/usr/lib/python3.9/ctypes/util.py", line 341, in find_library
_get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name))
File "/usr/lib/python3.9/ctypes/util.py", line 147, in _findLib_gcc
if not _is_elf(file):
File "/usr/lib/python3.9/ctypes/util.py", line 99, in _is_elf
with open(filename, 'br') as thefile:
FileNotFoundError: [Errno 2] No such file or directory: b'liblibc.a'
Fixed it. You need to go to:
/usr/lib/python3/dist-packages/scapy/arch/bpf/core.py
and edit the line
LIBC = cdll.LoadLibrary(find_library("libc"))
to
LIBC = cdll.LoadLibrary(find_library("c"))