windows 的 Wifi 接口

Wifi interface for windows

这个ARP欺骗脚本摘自Justin Seitz (2014)的书《Black hat python》。因为它是为 Linux 编写的,如果你要在 Windows 上使用它,你怎么能找到正确的接口?

from scapy.all import *
import os, sys, threading, signal

interface = "wlan0"

(...)

# set our interface
conf.iface = interface

# turn off output
conf.verb = 0

print(("[*] Setting up %s" % interface))

(...)

try:
    print(("[*] Starting program for %d packets" % packet_count))
    bpf_filter = "ip host %s" % target_ip
    packets = sniff(count=packet_count, filter=bpf_filter, iface=interface)

谢谢:)

在 windows,scapy 库会检测您的界面并将它们存储在 IFACES 变量中。

拥有installed/downloaded scapy后,启动scapy shell(命令:scapy如果您手动下载,run_scapy.bat)并输入IFACES

它将为您提供已安装接口的列表。然后您可以使用

  • interface = "[The full interface name as shown in scapy]"
  • interface = IFACES.dev_from_index([the index of the interface as shown by scapy])

如果你除了WiFi没有其他接口,你甚至可以使用interface = conf.iface