Loading

scapy 查找自己的网卡(默认网卡)

def GetInterface():
    from scapy.config import conf
    from scapy.route import Route

    conf.route.resync()
    return  conf.route.route('0.0.0.0')[0]

if __name__ == '__main__':
    print(GetInterface())

  

posted @ 2021-01-24 13:20  上官飞鸿  阅读(738)  评论(0)    收藏  举报