Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Kali Linux: Wireless Penetration Testing Beginner's Guide, Second Edition
Kali Linux: Wireless Penetration Testing Beginner's Guide, Second Edition

Kali Linux: Wireless Penetration Testing Beginner's Guide, Second Edition: Master wireless testing techniques to survey and attack wireless networks with Kali Linux , Second Edition

Arrow left icon
Profile Icon Vivek Ramachandran Profile Icon Cameron Buchanan
Arrow right icon
€20.98 €29.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (44 Ratings)
eBook Mar 2015 214 pages 2nd Edition
eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Vivek Ramachandran Profile Icon Cameron Buchanan
Arrow right icon
€20.98 €29.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (44 Ratings)
eBook Mar 2015 214 pages 2nd Edition
eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Kali Linux: Wireless Penetration Testing Beginner's Guide, Second Edition

Chapter 2. WLAN and its Inherent Insecurities

 

"The loftier the building, the deeper the foundation must be laid."

 
 --Thomas Kempis

Nothing great can be built on a weak foundation, and in our context, nothing secure can be built on something that is inherently insecure.

WLANs, by design, have certain insecurities that are relatively easy to exploit, for example, by packet spoofing, packet injection, and sniffing (this could even happen from far away). We will explore these flaws in this chapter.

In this chapter, we shall look at the following:

  • Revisiting WLAN frames
  • Different frame types and subtypes
  • Using Wireshark to sniff management, control, and data frames
  • Sniffing data packets for a given wireless network
  • Injecting packets into a given wireless network

Let's get started!

Revisiting WLAN frames

As this book deals with the security aspects of wireless, we will assume that you already have a basic understanding of the protocol and the packet headers. If not, or if it's been some time since you worked on wireless, this would be a good time to revisit this topic again.

Let's now quickly review some basic concepts of WLANs that most of you may already be aware of. In WLANs, communication happens over frames. A frame would have the following header structure:

Revisiting WLAN frames

The Frame Control field itself has a more complex structure:

Revisiting WLAN frames

The Type field defines three types of WLAN frame:

  1. Management frames: Management frames are responsible for maintaining communication between access points and wireless clients. Management frames can have the following subtypes:
    • Authentication
    • Deauthentication
    • Association request
    • Association response
    • Reassociation request
    • Reassociation response
    • Disassociation
    • Beacon
    • Probe request
    • Probe response
  2. Control frames: Control frames are responsible for ensuring...

Time for action – creating a monitor mode interface

Let's now set our wireless adapter into monitor mode.

Follow these instructions to get started:

  1. Boot Kali with your adapter connected. Once you are within the console, enter iwconfig to confirm that your card has been detected and the driver has been loaded properly.
    Time for action – creating a monitor mode interface
  2. Use the ifconfig wlan1 up command to bring the card up (where wlan1 is your adapter). Verify whether the card is up by running ifconfig wlan1. You should see the word UP in the second line of the output as shown in the following screenshot:
    Time for action – creating a monitor mode interface
  3. To put our card into monitor mode, we will use the airmon-ng utility that is available by default on Kali. First run airmon-ng command to verify whether it detects the available cards. You should see the wlan0 interface listed in the output:
    Time for action – creating a monitor mode interface
  4. Now enter airmon-ng start wlan1 command to create a monitor mode interface corresponding to the wlan0 device. This new monitor mode interface will be named mon0. (You can verify if it has been...

Time for action – sniffing wireless packets

Follow the following instructions to begin sniffing packets:

  1. Power up the Access Point Wireless Lab that we configured in Chapter 1, Wireless Lab Setup.
  2. Start Wireshark by typing Wireshark & in the console. Once Wireshark is running, navigate to Capture | Interfaces.
    Time for action – sniffing wireless packets
  3. Select packet capture from the mon0 interface by clicking on the Start button to the right of the mon0 interface as shown in the previous screenshot. Wireshark will begin the capture, and now you should see packets within the Wireshark window.
    Time for action – sniffing wireless packets
  4. These are wireless packets that your wireless adapter is sniffing off the air. In order to view any packet, select it in the top window and the entire packet will be displayed in the middle window.
    Time for action – sniffing wireless packets

    Click on the triangle in front of IEEE 802.11 Wireless LAN management frame to expand and view additional information.

Look at the different header fields in the packet and correlate them with the WLAN frame types and sub-types you have learned...

Time for action – viewing management, control, and data frames

Now we will learn how to apply filters in Wireshark to look at Management, Control and Data Frames.

Please follow the below instructions step by step:

  1. To view all the Management frames in the packets being captured, enter the filter wlan.fc.type == 0 into the filter window and click Apply. You can stop the packet capture if you want to prevent the packets from scrolling down too fast.
    Time for action – viewing management, control, and data frames
  2. To view Control Frames, modify the filter expression to read wlan.fc.type == 1.
    Time for action – viewing management, control, and data frames
  3. To view data frames, modify the filter expression to wlan.fc.type == 2.
    Time for action – viewing management, control, and data frames
  4. To additionally select a sub-type, use the wlan.fc.subtype filter. For example, to view all the Beacon frames among all Management frames, use the following filter:
    (wlan.fc.type == 0) && (wlan.fc.subtype == 8).
    Time for action – viewing management, control, and data frames
  5. Alternately, you can right-click on any of the header fields in the middle window and then select Apply as Filter | Selected to add it as a filter.
    Time for action – viewing management, control, and data frames
  6. This will automatically add the...

Time for action – sniffing data packets for our network

In this exercise, we will learn how to sniff data packets for a given wireless network. For the sake of simplicity, we will look at packets without any encryption.

Follow these instructions to get started:

  1. Switch on the access point we named Wireless Lab. Let it remain configured to use no encryption.
  2. We will first need to find the channel on which the Wireless Lab access point is running. To do this, open a terminal and run airodump-ng --bssid <mac> mon0 where <mac>, which is the MAC address of our access point. Let the program run, and shortly you should see your access point shown on the screen along with the channel it is running on.
  3. We can see from the preceding screenshot that our access point Wireless Lab is running on Channel 11. Note that this may be different for your access point.

    In order to sniff data packets going to and fro from this access point, we need to lock our wireless card on the same channel, that...

Revisiting WLAN frames


As this book deals with the security aspects of wireless, we will assume that you already have a basic understanding of the protocol and the packet headers. If not, or if it's been some time since you worked on wireless, this would be a good time to revisit this topic again.

Let's now quickly review some basic concepts of WLANs that most of you may already be aware of. In WLANs, communication happens over frames. A frame would have the following header structure:

The Frame Control field itself has a more complex structure:

The Type field defines three types of WLAN frame:

  1. Management frames: Management frames are responsible for maintaining communication between access points and wireless clients. Management frames can have the following subtypes:

    • Authentication

    • Deauthentication

    • Association request

    • Association response

    • Reassociation request

    • Reassociation response

    • Disassociation

    • Beacon

    • Probe request

    • Probe response

  2. Control frames: Control frames are responsible for ensuring a proper...

Time for action – creating a monitor mode interface


Let's now set our wireless adapter into monitor mode.

Follow these instructions to get started:

  1. Boot Kali with your adapter connected. Once you are within the console, enter iwconfig to confirm that your card has been detected and the driver has been loaded properly.

  2. Use the ifconfig wlan1 up command to bring the card up (where wlan1 is your adapter). Verify whether the card is up by running ifconfig wlan1. You should see the word UP in the second line of the output as shown in the following screenshot:

  3. To put our card into monitor mode, we will use the airmon-ng utility that is available by default on Kali. First run airmon-ng command to verify whether it detects the available cards. You should see the wlan0 interface listed in the output:

  4. Now enter airmon-ng start wlan1 command to create a monitor mode interface corresponding to the wlan0 device. This new monitor mode interface will be named mon0. (You can verify if it has been created by...

Time for action – sniffing wireless packets


Follow the following instructions to begin sniffing packets:

  1. Power up the Access Point Wireless Lab that we configured in Chapter 1, Wireless Lab Setup.

  2. Start Wireshark by typing Wireshark & in the console. Once Wireshark is running, navigate to Capture | Interfaces.

  3. Select packet capture from the mon0 interface by clicking on the Start button to the right of the mon0 interface as shown in the previous screenshot. Wireshark will begin the capture, and now you should see packets within the Wireshark window.

  4. These are wireless packets that your wireless adapter is sniffing off the air. In order to view any packet, select it in the top window and the entire packet will be displayed in the middle window.

    Click on the triangle in front of IEEE 802.11 Wireless LAN management frame to expand and view additional information.

Look at the different header fields in the packet and correlate them with the WLAN frame types and sub-types you have learned earlier...

Time for action – viewing management, control, and data frames


Now we will learn how to apply filters in Wireshark to look at Management, Control and Data Frames.

Please follow the below instructions step by step:

  1. To view all the Management frames in the packets being captured, enter the filter wlan.fc.type == 0 into the filter window and click Apply. You can stop the packet capture if you want to prevent the packets from scrolling down too fast.

  2. To view Control Frames, modify the filter expression to read wlan.fc.type == 1.

  3. To view data frames, modify the filter expression to wlan.fc.type == 2.

  4. To additionally select a sub-type, use the wlan.fc.subtype filter. For example, to view all the Beacon frames among all Management frames, use the following filter:

    (wlan.fc.type == 0) && (wlan.fc.subtype == 8).
  5. Alternately, you can right-click on any of the header fields in the middle window and then select Apply as Filter | Selected to add it as a filter.

  6. This will automatically add the correct...

Time for action – sniffing data packets for our network


In this exercise, we will learn how to sniff data packets for a given wireless network. For the sake of simplicity, we will look at packets without any encryption.

Follow these instructions to get started:

  1. Switch on the access point we named Wireless Lab. Let it remain configured to use no encryption.

  2. We will first need to find the channel on which the Wireless Lab access point is running. To do this, open a terminal and run airodump-ng --bssid <mac> mon0 where <mac>, which is the MAC address of our access point. Let the program run, and shortly you should see your access point shown on the screen along with the channel it is running on.

  3. We can see from the preceding screenshot that our access point Wireless Lab is running on Channel 11. Note that this may be different for your access point.

    In order to sniff data packets going to and fro from this access point, we need to lock our wireless card on the same channel, that is channel...

Time for action – packet injection


We will be using the aireplay-ng tool, which is available in Kali, for this exercise.

Follow the instructions below carefully:

  1. In order to do an injection test, first start Wireshark and the filter expression (wlan.bssid == <mac>) && !(wlan.fc.type_subtype == 0x08). This will ensure that we only see non-beacon packets for our lab network.

  2. Now run the following command aireplay-ng -9 -e Wireless Lab -a <mac> mon0 on a terminal.

  3. Go back to Wireshark and you should see a lot of packets on the screen now. Some of these packets have been sent by aireplay-ng, which we launched, and others are from the access point Wireless Lab in response to the injected packets.

What just happened?

We just successfully injected packets into our test lab network using aireplay-ng. It is important to note that our card injected these arbitrary packets into the network without being actually connected to the access point Wireless Lab.

Have a go hero – installing...

Left arrow icon Right arrow icon
Download code icon Download Code

Description

If you are a security professional, pentester, or anyone interested in getting to grips with wireless penetration testing, this is the book for you. Some familiarity with Kali Linux and wireless concepts is beneficial.

What you will learn

  • Create a wireless lab for your experiments
  • Sniff out wireless packets and hidden networks
  • Capture and crack WPA2 keys
  • Discover hidden SSIDs
  • Explore the ins and outs of wireless technologies
  • Sniff probe requests and track users through SSID history
  • Attack radius authentication systems
  • Sniff wireless traffic and collect interesting data
  • Decrypt encrypted traffic with stolen keys

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 30, 2015
Length: 214 pages
Edition : 2nd
Language : English
ISBN-13 : 9781783280421
Category :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Mar 30, 2015
Length: 214 pages
Edition : 2nd
Language : English
ISBN-13 : 9781783280421
Category :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 115.97
Web Penetration Testing with Kali Linux 2.0, Second Edition
€41.99
Kali Linux: Wireless Penetration Testing Beginner's Guide, Second Edition
€36.99
Python Web Penetration Testing Cookbook
€36.99
Total 115.97 Stars icon
Banner background image

Table of Contents

12 Chapters
1. Wireless Lab Setup Chevron down icon Chevron up icon
2. WLAN and its Inherent Insecurities Chevron down icon Chevron up icon
3. Bypassing WLAN Authentication Chevron down icon Chevron up icon
4. WLAN Encryption Flaws Chevron down icon Chevron up icon
5. Attacks on the WLAN Infrastructure Chevron down icon Chevron up icon
6. Attacking the Client Chevron down icon Chevron up icon
7. Advanced WLAN Attacks Chevron down icon Chevron up icon
8. Attacking WPA-Enterprise and RADIUS Chevron down icon Chevron up icon
9. WLAN Penetration Testing Methodology Chevron down icon Chevron up icon
10. WPS and Probes Chevron down icon Chevron up icon
A. Pop Quiz Answers Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(44 Ratings)
5 star 75%
4 star 15.9%
3 star 2.3%
2 star 2.3%
1 star 4.5%
Filter icon Filter
Top Reviews

Filter reviews by




John Johnson Dec 06, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
learning a lot from this book
Amazon Verified review Amazon
Hacker-Inside Aug 19, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Excellent book , a must having book in your shelf if you are a Kali Linux user and interested in wireless penetration testing. I can crack any kind of WiFi security after reading this book and also this book changes the way of your's to see how hacking actually works that there's lots of way to hack or crack something , all depends on your brain. Must purchase this book.
Amazon Verified review Amazon
Pete Jan 17, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
As always, Vivek doesn't disappoint. This is a great primer/resource for OSWP and covers pretty much everything you need to know at a high level, you'll probably want to do some additional research to fill in the gaps.
Amazon Verified review Amazon
Amazon Customer Jan 10, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Covers a lot of material and is pretty easy to follow.
Amazon Verified review Amazon
Tony P Apr 17, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
As with most cookbooks, this one is a great example of how to do things correctly. Anyone can install an OS and since it boots, we believe that is running the properly. After I started to read the book, I noticed that I did not do nearly enough to hide / protect myself. This book with get you going from start to finish with what to do and more importantly why we should do it. I did learn a lot with this book and I would recommend it to anyone wanting to start-up with KALI Linux and grasp an fuller understanding of it.I have always enjoyed Packt Publishing book and this one is also a hit !
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.