Beispiel #1
0
                            a = a.contents.next
                            continue
                        addr = inet_ntop(family, bytes(bytearray(val)))
                        if addr != "0.0.0.0":
                            ips.append(addr)
                        a = a.contents.next
                    if_list[name] = (description, ips, flags)
                    p = p.contents.next
                conf.cache_iflist = if_list
            except Exception:
                raise
            finally:
                pcap_freealldevs(devs)

        # Detect Pcap version
        version = pcap_lib_version()
        if b"winpcap" in version.lower():
            if os.path.exists(NPCAP_PATH + "\\wpcap.dll"):
                warning("Winpcap is installed over Npcap. "
                        "Will use Winpcap (see 'Winpcap/Npcap conflicts' "
                        "in Scapy's docs)")
            elif platform.release() != "XP":
                warning("WinPcap is now deprecated (not maintained). "
                        "Please use Npcap instead")
        elif b"npcap" in version.lower():
            conf.use_npcap = True
            LOOPBACK_NAME = scapy.consts.LOOPBACK_NAME = "Npcap Loopback Adapter"  # noqa: E501
    except OSError:
        conf.use_winpcapy = False
        if conf.interactive:
            log_loading.critical(
Beispiel #2
0
                         # (AF_LINK isn't a thing on Windows)
                         a = a.contents.next
                         continue
                     addr = inet_ntop(family, bytes(bytearray(val)))
                     if addr != "0.0.0.0":
                         ips.append(addr)
                     a = a.contents.next
                 if_list[description] = (name, ips)
                 p = p.contents.next
             conf.cache_iflist = if_list
         except Exception:
             raise
         finally:
             pcap_freealldevs(devs)
     # Detect Pcap version
     version = pcap_lib_version()
     if b"winpcap" in version.lower():
         if os.path.exists(NPCAP_PATH + "\\wpcap.dll"):
             warning("Winpcap is installed over Npcap. "
                     "Will use Winpcap (see 'Winpcap/Npcap conflicts' "
                     "in Scapy's docs)")
         elif platform.release() != "XP":
             warning("WinPcap is now deprecated (not maintained). "
                     "Please use Npcap instead")
     elif b"npcap" in version.lower():
         conf.use_npcap = True
         LOOPBACK_NAME = scapy.consts.LOOPBACK_NAME = "Npcap Loopback Adapter"  # noqa: E501
 except OSError:
     conf.use_winpcapy = False
     if conf.interactive:
         log_loading.warning("wpcap.dll is not installed. "