【问题标题】:How to send UDP packet to specific UDP dst port in scapy?如何将UDP数据包发送到scapy中的特定UDP dst端口?
【发布时间】:2015-04-20 07:44:51
【问题描述】:

我想将我的数据包发送到一个 UDP dst 端口号并通过 eth0 接口发送(如果 scapy 直接处理我的 layer2,那么 eth0 不需要作为参数给出)

【问题讨论】:

    标签: scapy


    【解决方案1】:

    使用 scapy documentation,我们看到发送 UDP 数据包很简单:

    send(IP(dst="127.0.0.1")/UDP(dport=123)/Raw(load="abc"))
    

    【讨论】:

    • 也许其他人正在寻找它:使用sport=RandShort() 作为随机源端口。
    猜你喜欢
    • 1970-01-01
    • 2011-06-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-06
    • 2013-06-24
    • 1970-01-01
    • 2018-06-26
    相关资源
    最近更新 更多