我是网络新手( 我正在尝试为ICMP启动环回接口以及我得到的内容:
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from scapy.all import *
WARNING: No route found for IPv6 destination :: (no default route?)
>>> conf.L3socket
<L3dnetSocket: read/write packets at layer 3 using libdnet and libpcap>
>>> conf.L3socket=L3RawSocket
>>> sr1(IP(dst="127.0.0.1")/ICMP())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python25\lib\site-packages\scapy\sendrecv.py", line 334, in sr1
s=conf.L3socket(filter=filter, nofilter=nofilter, iface=iface)
File "C:\Python25\lib\site-packages\scapy\supersocket.py", line 63, in __init_
_
self.outs = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_RA
W)
File "c:\Python25\lib\socket.py", line 159, in __init__
_sock = _realsocket(family, type, proto)
socket.error: (10013, 'Permission denied')
我做错了什么?
答案 0 :(得分:0)
您需要以root身份启动scapy才能使用原始套接字发送消息。
由于您运行的是Windows,因此需要了解如何以管理员身份启动scapy。