Ejemplo n.º 1
0
def scapy_iface(os_name):
    if platform.system() == "Linux":
        return os_name
    elif platform.system() == "Windows":
        for x, y in ifaces.items():
            if y.pcap_name is not None:
                if get_ifname(os_name) == ('{' + y.pcap_name.split('{')[1]):
                    return x
                else:
                    pass
Ejemplo n.º 2
0
def get_ipv6_address(ifname):
    return ifaddresses(get_ifname(ifname))[AF_INET6][0]['addr']
Ejemplo n.º 3
0
def get_mac_address(ifname):
    # print(netifaces.ifaddresses(get_ifname(ifname))[netifaces.AF_LINK])
    return netifaces.ifaddresses(
        get_ifname(ifname))[netifaces.AF_LINK][0]['addr']