【发布时间】:2018-08-11 09:27:45
【问题描述】:
我想向我的路由器发送一个简单的 SYN 请求以获得 ACK 响应,以便使用 python 和 scapy 学习网络 (TCP/IP)。
但是 scapy 需要很长时间才能得到任何答案。
脚本-
#!/usr/bin/env python
from scapy.all import *
pack=TCP(sport=22,dport=80,flags='S')/IP(src="192.168.0.13",dst="192.168.0.1")
# tried with retry and timeout options using both sr() and sr1()
# but it comes with no answer from the router.
# ran this with sudo and iptables policy is default [ACCEPT]
ans = sr1(pack)
解决办法是什么?
【问题讨论】:
-
嗯,我从未听说过 TCP 层之上的 IP 层:/ 你确定你正确地构建了数据包吗? (应该是相反的)
-
从概念 tcp/ip :/
-
你应该这样做
IP(stuff)/TCP(stuff) -
成功了。但想了解更多详情。
-
在下面查看我的答案