phaethon/kamene

I encounter an error when I use the scapy-python3 in PyCharm(Windows)

Opened this issue · 3 comments

Code here :
from scapy.all import rdpcap
p = rdpcap('pcap/arp.pcap')
print(p)

error:
Traceback (most recent call last):
File "F:/PyCharmWorkSpace/Test/testrdpcap.py", line 1, in
from scapy.all import rdpcap
File "F:\PyCharmWorkSpace\Test\venv\lib\site-packages\scapy\all.py", line 16, in
from .arch import *
File "F:\PyCharmWorkSpace\Test\venv\lib\site-packages\scapy\arch_init_.py", line 95, in
from .windows import *
File "F:\PyCharmWorkSpace\Test\venv\lib\site-packages\scapy\arch\windows_init_.py", line 212, in
ifaces.load_from_powershell()
File "F:\PyCharmWorkSpace\Test\venv\lib\site-packages\scapy\arch\windows_init_.py", line 163, in load_from_powershell
for i in get_windows_if_list():
File "F:\PyCharmWorkSpace\Test\venv\lib\site-packages\scapy\arch\windows_init_.py", line 78, in get_windows_if_list
stdout, stdin = ps.communicate(timeout = 10)
File "D:\python3.6.5\lib\subprocess.py", line 843, in communicate
stdout, stderr = self.communicate(input, endtime, timeout)
File "D:\python3.6.5\lib\subprocess.py", line 1094, in communicate
raise TimeoutExpired(self.args, orig_timeout)
subprocess.TimeoutExpired: Command '['powershell', '-NoProfile', 'Get-WMIObject -class Win32_NetworkAdapter', '|', 'select Name, @{Name="InterfaceIndex";Expression={$
.InterfaceIndex}}, @{Name="InterfaceDescription";Expression={$
.Description}},@{Name="InterfaceGuid";Expression={$.GUID}}, @{Name="MacAddress";Expression={$.MacAddress.Replace(":","-")}} | where InterfaceGuid -ne $null', '|', 'fl']' timed out after 10 seconds

when I use it in Linux or using the scapy-python2, it's no problem

Windows 7

scapy3k is designed for Windows 10. It is not thoroughly tested for Windows 7. There are some users who made it work and some patches were integrated in the repo, but it is not supported.