cmd_traceroute.py 文件源码

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

项目:habu 作者: portantier 项目源码 文件源码
def cmd_traceroute(ip, port, iface):

    conf.verb = False

    if iface:
        conf.iface = iface

    pkts = IP(dst=ip, ttl=(1, 16)) / TCP(dport=port)

    for pkt in pkts:

        ans = sr1(pkt, timeout=1, iface=conf.iface)

        if not ans:
            print('.')
            continue

        print(ans.summary())

        if TCP in ans and ans[TCP].flags == 18:
            break

    return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号