You will need to set your network interface into monitor mode to be able to sniff all traffic on the wireless network. So, before starting up tcpdump
, do the following:
sudo ifconfig wlan0 down
sudo iwconfig wlan0 mode Monitor
sudo ifconfig wlan0 up
This will simply turn off your interface, enable monitor mode and turn it on again. Note that not all network interface cards support monitor mode.
To reset your NIC back to normal, issue the same commands, but with mode Managed
.
On a side note, the traffic on your sniffer will most likely not look how you will expect it to look, due to any encryption schemes your router uses. Considering that you are sniffing your own network, you will be able to decrypt the traffic in most cases though.
Here is a short overview on how to do it on Wireshark
, an alternative to tcpdump
that also features a graphical user interface. If you prefer to keep tcpdump
for capturing, you can also use its -w
option to dump traffic to a .pcap
file and later open that file in Wireshark (or any other packet analyzer).
Note that if your network uses WPA or WPA2 encryption, you will need to capture the respective handshakes between router and each device you want to monitor. The Wireshark wiki article I linked explains how to do so:
WPA and WPA2 use keys derived from an EAPOL handshake, which occurs when a machine joins a Wi-Fi network, to encrypt traffic. Unless all four handshake packets are present for the session you're trying to decrypt, Wireshark won't be able to decrypt the traffic. You can use the display filter eapol to locate EAPOL packets in your capture.
In order to capture the handshake for a machine, you will need to
force the machine to (re-)join the network while the capture is in
progress.
dst
mean to tcpdump?dst
mean that I'm listening only the packets for which thedestination
field is10.0.0.7
hear
them although I'm not the recipient.10.0.0.7
is the ip address of the computer I want to sniff, and10.0.0.8
is my ip address.