Packet Sniffing and Packet Injecting
Packet Sniffing with Wireshark
Open wireshark by navigating the application menu or by typing “wireshark” in the console.
Once WireShark is open, Click Interface List
(1). A second window will open with a list
of interfaces that can capture packets. Notice our monitor device
mon0 is there from when we set it earlier. Click on start
(2) and WireShark will begin to capture
packets and display them in the window. These are wireless packets which
your wireless card (in my case the Alfa One Adapter), are sniffing out
of the air.
Now lets sniff packets from our own access
point. To do this, we are going to use airodump-ng. Airodump-ng is used
to capture wireless packets which have WEP encryption with the idea that
you will use aircrack-ng (don’t worry, we’ll get to that soon). But for
this time around, lets turn off the encryption on our wireless access
point.
Now open up the terminal and type:
airodump-ng --bssid 5C:D9:98:6A:64:8A mon0
Note:
5C:D9:98:6A:64:8A
is the MAC address of my wireless access point.
To find yours, go to your wireless router web interface and look for
status. There you should find the wireless mac address of your router.
After airodump-ng finishes, you will see your access point with the channel it is running on.
Now we have to lock on to our access point by setting our wireless card to the channel of our access point. To do this, type:
iwconfig mon0 channel 6
(Where “6” is the channel of your access point.)
Now fire up wireshark, sniff for packet with your mon0 interface. Now type in the filter box:
(wlan.bssid == MAC ADDRESS HERE) && (wlan.fc.type_subtype == 0x20)
Now we will be sniffing only data packets from our access point.
Packet Injecting
First we want to see only non-beacon packets in wireshark. So open wireshark and type in your filter box:
bssid ==
5C:D9:98:6A:64:8A
) && !(wlan.fc.type_subtype == 0x08).
Note: Replace
5C:D9:98:6A:64:8A
with your own mac address.
Then open the terminal and type:
aireplay-ng -9 -e "wifi-name" -a 5C:D9:98:6A:64:8A mon0
Note: Replace wifi-name with the name of your SSID and
5C:D9:98:6A:64:8A
with your own mac address.
If
you go back to wireshark, you should see some packets that were
injected. These are just random packets that do not have any real
effect.
No comments:
Post a Comment