I am trying to sniff some packets in python 3.4 in scapy
.
I am using Windows 8.1, and I know that the socket
module does not have a PF_PACKET
or something like on Windows to sniff packets, so i used the scapy.sniff
function. I have already installed WinPcap 4.1.3 .
I tried to sniff and was surprised that it only sniffs packets from the wireless network that I am connected to right now, so if i am not connected to any network it will not sniff anything (I have been waiting for 10 mins, and it didn't print anything). The code:
from scapy.all import sniff, tshark
pkts = sniff(count=30) # iface does not work
tshark
is the same as sniff
, gives the same results.
I have an ALFA wireless realtek interface card, it supports monitor mode.
Is there a solution here? Does wspy
(wireshark in python) work in Windows? Does it support WiFi monitor mode?