ddptr.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:ddptr 作者: NullHypothesis 项目源码 文件源码
def asns_in_traceroute(traceroute, asndb):
    """
    Extract ASNs of hops in traceroute and return them as list.
    """

    asns = []

    for sent, recvd in traceroute:

        # Is the response an ICMP TTL Exceeded packet?

        if recvd.haslayer(scapy.ICMP) and recvd.payload.type == 11:
            asn, _ = asndb.lookup(recvd.src)
            if asn is not None:
                asns.append(asn)

    return asns
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号