Hacking Notes logo Hacking Notes

It’s an introduction of hacking WiFi, I recollected from the community including others blogs for my own and guides to pass OSWP certificate.

Hardware required:

An antena that could configure to monitor mode:

Software required:

There are some linux distributions like wifislax that could be useful to us, but I used Parrot OS distribution and Kali Linux which have almost all the programs used in that notes, if not install it with apk install

Introduction

Wi-Fi allows networking of computers and digital devices without the need for wires. Data is transferred over radio frequencies, allowing Wi-Fi capable devices to receive and transmit data when they are in range of a Wi-Fi network.

Wi-Fi uses a radio technology known as 802.11, which can transmit data over short distances using high frequencies. 802.11 operates on either 2.4GHz or 5GHz depending on its type.

To understand how to attack WLAN, we need first to understand how it works. Take a look in detail from networking basis.

OSI Model

The OSI Model (Open Systems Interconnection Model) is a conceptual framework used to describe the functions of a networking system.

The OSI model characterizes computing functions into a universal set of rules and requirements in order to support interoperability between different products and software. In the OSI reference model, the communications between a computing system are split into seven different abstraction layers: Physical, Data Link, Network, Transport, Session, Presentation, and Application.

OSI Model

We are going to see Physical Layer and deep on Data link Layer.

Physical Layer

The physical layer is the lowest layer of the OSI Model and is concerned about how it is transmitted, via electricity, via optical or via radiofrecuence. Contain raw unstructured data bits across the network from the physical layer of the sending device to the physical layer receiving device. In case of WiFi it is transmitted via radiofrecuence.

At the data link layer, directly connected nodes are used to perform node-to-node data transfer where data is packaged into frames. The data link layer corrects error that may have occurred at the physical layer.

Its main functions are Data Link Control and Multiple Access Control.

The Data Link Control is responsible for reliable transmissions of messages over transmission channel by using techniques like framing, error control and flow control. For Data Link Control refer to Stop and Wait ARQ.

Stop and Wait ARQ is a protocol that consist of send a packet and stop sending until we received a confirmation of received or acknowledge (ACK).

Multiple Access Control

If there is a dedicated link between the sender and the receiver such as a Ethernet wire between two devices then data link control is sufficient, however if there is no dedicated link present then multiple stations can access the channel simultaneously which is the case of Wi-Fi, where all clients try to send in the same medium (air).

Then multiple access protocols are required to decrease collisions and avoid cross-talk. Multiple access protocols are divided in:

Random Access Protocols

In these types of protocols, all stations have the same priority and any station can send data depending on medium’s state, idle or busy.

It has two features:

ALOHA, CSMA, CSMA/CD and CSMA/CA are random access protocols.

Controlled Access Protocols

In these types of protocols, the data is sent by a selection which is approved by all other stations. Here appears the significant of “Token”.

Reservation, Polling and Token Passing are some of the controlled access protocols.

Channelization Protocols

Finally, the last type are channelization protocols, where the available bandwidth of the link is shared in time, frequency and code to multiple stations to access channel simultaneously.

Introduction to CSMA/CA

This method was developed to decrease the chances of collisions when two or more stations start sending their signals over the data-link layer. Carrier Sense multiple Access requires that each station check the state of the medium before sending. This protocol is used in 802.11 (WLAN).

The basic idea behind CSMA/CA is that the station should be able to receive while transmitting to detect a collision from different stations. In wired networks, if a collision occurs then the energy of received signal almost doubles and the station can sense the possibility of collision. In case of wireless networks, most of the energy is used for transmission and the energy of received signal increases by only 5-10% if a collision occurs so it can not be used by the station to sense collision.

Therefore CSMA/CA has been specially designed for wireless networks because will try to avoid these collisions.

There are three types of strategies:

CSMA / CA

802.11 Frame Types and Formats

There are three types of 802.11 frames, which are management, control and data.

Management Frames

Management frames are used to manage the base station. This includes probing, associating, roaming and disconnecting clients from the base station.

Control Frames

Control frames are used to control access to the medium and are used for frame acknowledgement.

Wi-Fi Attacks

Now that we look how Wi-Fi is working we will try to attack it. Exists some differents attacks to do in Wi-Fi environments:

Now that we look how Wi-Fi works we will try to attack it.

References: