python-3.x - Python3.6 Scapy 甚至从死主机接收 ICMP 响应
问题描述
得到了奇怪的东西。设置:VirtualBox + CentOs7 + python3.6 + scapy2.4.0
只有 4-5 个主机处于活动状态的网络:网关、VirtualBos 中的 CentO、运行 VirtualBox 的 PC 和其他东西。
试图做:
ans, unans = sr(IP(dst='10.10.10.1-100')/ICMP(), iface = 'enp0s3', retry=0, timeout=1)
Begin emission: ...
Received 1822 packets, got 99 answers, remaining 1 packets
ans
Results: TCP:0 UDP:0 ICMP:99 Other:0
unans
Unanswered: TCP:0 UDP:0 ICMP:1 Other:0
ans[x] - 是合法的 ICMP 回复数据包。
unans[0] - 没有来自 CentOs 虚拟机本身的 ICMP 回复
所以看起来一切都还活着,而不是实际上还活着的 4-5 个主机
可能的原因是什么?
解决方案
你想知道可能的原因,但 scapy 没有给你足够的细节。所以使用 tcpdump:
$ sudo tcpdump -e -c 200 icmp
在 tcpdump 运行时发送探测数据包,以查看地址和时间详细信息。您可能会看到许多完全正常的 ICMP,例如端口不可达或网络不可达。Tcpdump 将准确地告诉您通过网络接口发生了什么。
推荐阅读
- php - 使用 PHP 的简单 HTML 登录页面不起作用
- javascript - 如何在 laravel 和 vue js 中使用 2 个或更多条件进行过滤
- javascript - 类别较少时如何在高图中显示所有数据?
- angularjs - 如何将依赖项注入过滤器AngularJS以进行茉莉花测试
- javascript - AnguarJS中的鼠标单击/键盘按下事件
- vue.js - VueJS 如何通过选择不同的单选按钮来触发方法?
- oauth-2.0 - 无法使用邮递员的 Keycloak 执行身份验证请求
- ios - Swift CoreData:使用 NSSortDescriptor 按计算的即将到来的生日排序
- mongodb - 如何从客户端查询本地 MongoDB?
- javascript - CesiumJS - 使用带有广告牌的弹出窗口?