基于Scapy开发的网络扫描器仅扫描自身问题求助
Hey there! As someone who’s messed around with Scapy on Windows before, I totally get how frustrating it is when your scanner only picks up your own IP—especially when you know other hosts are on the network. Let’s walk through some common reasons this happens, even with an external WiFi adapter and monitor mode enabled:
Wrong Interface Selection: Scapy might default to your built-in network adapter instead of the external WiFi one. Make sure you’re explicitly specifying the correct interface in your code using
iface="your_adapter_name". You can list all available interfaces withscapy.get_if_list()to find the right name.Incorrect Target Subnet: Double-check that you’re sending ARP requests to the entire subnet, not just your own IP. For example, if your IP is
192.168.1.100, your target range should be something like192.168.1.0/24instead of a single IP address.Windows Firewall Blocking: Windows Firewall might be blocking incoming ARP responses or outgoing scan packets. Try temporarily disabling it (or adding an exception for your Python script) to rule this out.
Monitor Mode Compatibility: Monitor mode on Windows can be finicky—some adapters don’t fully support it, or you might need to use WinPcap (instead of Npcap) for better Scapy compatibility. Scapy relies on these libraries to capture packets correctly.
Flawed Response Handling: If your code isn’t properly waiting for responses or filtering ARP replies, it might miss packets from other hosts. Make sure you’re using
scapy.srp()(which sends packets and waits for responses) instead ofsend(), and that your packet filter is set to capture ARP responses.
To pinpoint the exact issue, could you share a snippet of your code? Specifically, the parts where you:
- Define the target IP range
- Craft and send ARP requests
- Capture and process incoming responses
That way, we can spot any syntax or logical errors that might be causing the problem.
内容的提问来源于stack exchange,提问作者Kunal Sikri

