【问题标题】:how to ping broadcast mac address with specific interface using scapy?如何使用 scapy ping 具有特定接口的广播 MAC 地址?
【发布时间】:2021-12-05 07:42:47
【问题描述】:

我想在发送广播 MAC 时使用 scapy ping 特定接口。

请帮帮我

>>>ans, unans = srp1(Ether(dst="ff:ff:ff:ff:ff:ff")/IP(dst="192.168.1.0/24")/ICMP(),timeout=2)

得到

Received 1186 packets, got 1 answers, remaining 255 packets
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ValueError: not enough values to unpack (expected 2, got 1)

然后运行

>>>ans.summary(lambda s,r: r.sprintf("%Ether.src% %ARP.psrc%") )

【问题讨论】:

    标签: python macos interface ping scapy


    【解决方案1】:

    srp1只返回第一个答案

    ans = srp1(Ether(dst="ff:ff:ff:ff:ff:ff")/IP(dst="192.168.1.0/24")/ICMP(),timeout=2)
    

    【讨论】:

      猜你喜欢
      • 2011-06-18
      • 1970-01-01
      • 2013-09-08
      • 1970-01-01
      • 2013-01-14
      • 1970-01-01
      • 1970-01-01
      • 2022-01-11
      • 1970-01-01
      相关资源
      最近更新 更多