使用 Scapy 进行 TCP 空扫描
有人可以指导我如何在 Scapy 中将数据包发送到 IP 地址,并将 TCP 标头中的所有标志设置为 null 吗?到目前为止,我已经尝试发送数据包而不指定要设置哪些标志,但似乎每次发送数据包时都会设置 Syn 标志。
我想知道它,以便我可以了解有关 TCP 空扫描的更多信息。将不胜感激您的帮助和指导。
Can someone guide me on how to send packets in Scapy to an ip address, with all flags in the TCP header set to null ? I have so far tried sending packets without specifying which flags to set, but it seems to set the Syn flag everytime I send the packet.
I would like to know it so that I can learn more about TCP Null Scans. Would be grateful for ur help and guidance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我还没有使用过 Scapy,但是通过快速浏览文档,有一个在指定要设置的标志的同时创建 TCP 数据包的示例,在文档的此页面上:
也许您可以尝试这样的命令,使用空细绳 ””?即 TCP(dport=80,flags="") ?
I haven't used Scapy, but from a quick scan of the documentation there is an example of creating a TCP packet while specifying which flags to set, on this page of the docs:
Perhaps you could try a command like that, with an empty string ""? i.e. TCP(dport=80,flags="") ?
如果您不想实际发送 TCP 标头,最好只设置 IP 数据包的协议并在其顶部粘贴一串零。
编辑:我实际上对语法并不肯定,您可能必须使用协议号而不是“TCP”
If you don't want to actually send a TCP header, you'd be better off just setting the protocol of the IP packet and gluing a string of zeros on top of it.
Edit: I'm not actually positive on the syntax, you might have to use the protocol number instead of "TCP"
感谢 Andy 和 Jdizzle 的建议。
我尝试了安迪之前推荐的内容,但当我在wireshark上检查时,该数据包似乎设置了同步标志。
好消息是,我解决了这个问题,在创建要发送的数据包时,可以将标志设置为空。
创建一个数据包 --> a=TCP() 然后通过 --> 将标志设置为零a.flags=0
在准备通过网络发送数据包之前,您可以通过这种方式预设许多其他属性。您可以通过-->查看这些属性ls(a)
其中 a=数据包的名称。
这工作成功了!
Thank you Andy and Jdizzle for the suggestions.
I tried out what Andy Recommended earlier itself, but the packet somehow seemed to have the Syn Flag set, when i checked it on wireshark.
The good news is, i solved the problem, the flags can be set to null, at the instance when you create the packet to be sent.
create a packet --> a=TCP() and then setting the flag to zero by --> a.flags=0
there are many other attributes that you can preset in this manner before preparing the packet to be sent over the network. You can view these attributes by --> ls(a)
where a=the name of the packet.
This worked successfully !