telnet工作时无法接收SYN+ACK以响应使用scapy的SYN

2024-04-27 11:31:28 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用的是这个答案中提到的脚本:3 way handshake in Scapy-它是使用scapy框架构建的。这是该脚本的github要点:https://gist.github.com/tintinweb/8523a9a43a2fb61a6770

但是,我不确定为什么它不工作,而curltelnet命令用于相同的设置(网络流:tcp dst/src ip和dst/src端口),它可以正常工作。

我的设置:

netcat -l 5555 (TCP) <---------- 127.0.0.1 ---------< curl http://127.0.0.1:5555

脚本输出:

ubunt@ubunt-MS-7A94:~/Desktop$ sudo python TCP_scapy.py 
WARNING: No route found for IPv6 destination :: (no default route?)
DEBUG:__main__:init: ('127.0.0.1', 5555)
DEBUG:__main__:start
DEBUG:__main__:SND: SYN
DEBUG:__main__:RCV: None
DEBUG:__main__:RCV: None
None
DEBUG:__main__:SND: FIN
DEBUG:__main__:RCV: None

TCPDUMP输出:

^{pr2}$

我发现curl和scapy发送的包的两个不同点是:

  • 长度(卷曲:74,肩胛骨:54)
  • scapy发送广播@Layer 2:ffff:ffff:ffff,curl发送0000:0000:0000

Tags: debugsrcgithub脚本nonemaincurlroute
1条回答
网友
1楼 · 发布于 2024-04-27 11:31:28

环回接口(lo)非常特殊,并且诸如Scapy之类的注入工具可能无法在其上正常工作。您应该尝试连接到远程主机,而不是127.0.0.1。在

相关问题 更多 >