Bypassing MAC address filtering

A MAC address is the unique identity of the user who tries to authenticate over a wireless network. Often as a best practice users prefer to Mac-filter their networks to protect themselves from attackers; however it is very easy to change a Mac address and attack the network. In this recipe, we are going to see how one can change the Mac address of a wireless card.

Getting ready

A wireless card and a Kali machine are required to perform this exercise. In this recipe, we will scan the available network and the devices connected to it, after which we will change the Mac ID of the wireless card to that of the host connected to the network.

How to do it...

  1. Before we begin, ensure that you stop Monitor mode, enabled in the previous recipe, by issuing the stop monitor command on its interface:
          airmon-ng stop wlan0mon
    
  2. Let us check our MAC address for our device, using the following command:
          ifconfig wlan0
    

    The output will be as shown in the following screenshot:

    How to do it...

  3. Now we will disable the network interface using the following command:
          ifconfig wlan0 down
    
  4. We now select one of the Network device and use macchanger to change our Mac address. We will change it to a legitimate authenticated user's Mac, which can be found by running the airodump-ng command explained in the next recipe to see which Mac ID is connected to our target router:
          macchanger -m xx:xx:xx:xx:xx:xx wlan0
    

    The output will be as shown in the following screenshot:

    How to do it...

  5. In the absence of Mac filtering, if the user decides to maintain anonymity, a random Mac address can be obtained from:
          macchanger -r wlan0
    

    The output will be as shown in the following screenshot:

    How to do it...

  6. Now we can enable the wireless device using the following command:
          ifconfig wlan0 up
    

There's more...

This is the basic step before any pen testing activity begins, now we will look into cracking the wireless protocols.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.218.230