I tried do build a program that pings a website and print the answer. I expected that it'll ping google.com, but instead in the 1st line I get Attribute Error.
Traceback (most recent call last):
File "d:\Magshimim\Networks Programming\Lesson 06\Homework\Solution\code.py", line 1, in <module>
from scapy.all import *
File "C:\Python38\lib\site-packages\scapy\all.py", line 35, in <module>
from scapy.autorun import *
File "C:\Python38\lib\site-packages\scapy\autorun.py", line 29, in <module>
class ScapyAutorunInterpreter(code.InteractiveInterpreter):
AttributeError: module 'code' has no attribute 'InteractiveInterpreter'
So far, I tried to import the scapy module using: from scapy.all import *
, import scapy
and from scapy import *
My code:
from scapy.all import *
fullmsg = Ether() / IP(dst='google.com') / ICMP()
ans = srp1(fullmsg, verbose=0)
print(ans.show())