更新时间:2023-11-01 09:17:22
Scapy 需要稍微不同的配置才能在 Loopback 接口上工作,请参阅 http://www.secdev.org/projects/scapy/doc/troubleshooting.html 在标题我无法 ping 127.0.0.1. Scapy 不适用于 127.0.0.1 或环回接口"
Scapy needs to be configured slightly differently to work on the Loopback interface, see http://www.secdev.org/projects/scapy/doc/troubleshooting.html under the heading "I can’t ping 127.0.0.1. Scapy does not work with 127.0.0.1 or on the loopback interface"
我使用了那里给出的代码并发送了一个收到 C 套接字的 scapy 数据包,具体是:
I used the code given there and sent a scapy packet which was received a C Socket, this was specifically:
from scapy.all import *
conf.L3socket=L3RawSocket
packet=IP()/UDP(dport=32000)/"HELLO WORLD"
send(packet)
然后在绑定到端口 32000 上的 lo 的 UDP C 套接字上收到此消息(Scapy 默认通过环回接口发送 IP 数据包).
This was then received on a UDP C Socket bound to lo on port 32000 (Scapy defaults to sending IP packets over the loopback interface).