Tuesday, September 29, 2020

Building wpa_supplicant application for Linux Platform


Building wpa_supplicant (Native Compilation)


Below are the Steps to build wpa_supplicant source code.

1. Download the wpa_supplicant latest release source code from below link

https://w1.fi/wpa_supplicant/

2. Extract the wpa_supplicant source code using below command

$tar -xzvf wpa_supplicant-2.9.tar.gz

3. install the dependent tools

Installing Net-link library

$sudo apt-get install libnl-genl-3-dev

Installing SSL library

$sudo apt-get install libssl-dev

Installing pip tool

$sudo apt install python-pip
$pip install --upgrade pip


Installing Dbus

$sudo apt install build-essential libdbus-glib-1-dev libgirepository1.0-dev
$pip install dbus-python



4. Build wpa_supplicant source code

$cd wpa_supplicant-2.9/wpa_supplicant

$cp defconfig .config

$cd ../


$make

Now you will be able to find out wpa_supplicant,wpa_supplicant_cli  and wpa_passphrase application binary 

Building hostapd application for Linux Platform

Building hostapd (Native Compilation)

Below are the Steps to build hostapd source code.

1. Download the hostapd latest release source code from below link 

https://w1.fi/hostapd/

2. Extract the hostapd source code using below command 

$tar -xzvf hostapd-2.9.tar.gz

3. install the dependent tools

Installing Net-link library

$sudo apt-get install libnl-genl-3-dev

Installing SSL library

$sudo apt-get install libssl-dev

4. Build hostapd source code 

$cd hostapd-2.9/hostapd

$cp defconfig .config

$cd ../

$make

 

Now you will be able to find out hostapd and hostapd_cli application binary 

Sunday, August 30, 2020

WiFi backports Driver

 WiFi backports Driver (Open Source Driver for WiFi)


Here we are going to learn Building backports driver for ath10k.backports  is open source driver which have many WiFi chip-set support with basic WiFi functionality. 

1. Download the backport using below link base on your kernel version:(Get kernel version using "uname -a" command)
https://mirrors.edge.kernel.org/pub/linux/kernel/projects/backports/stable/

2. Extract driver using below command: 
tar -xzvf backports-5.8-rc2-1.tar.gz

3. Go inside the directory
cd backports-5.8-rc2-1

4. Execute below command to hceck supported chipset by this driver 
make defconfig-help

5. Configure the driver for ath10k.
make defconfig-ath10k

6. Build driver using below command.
make

7. Now you can fine driver module using "find . -name *.ko" command.

NOTE:
Make sure backport driver version always greater than or equal to kernel version.
  

 

Saturday, August 29, 2020

Wireshark Filters Commands

      Wireshark Tool Common 802.11 Filters Commands

Filters using MAC address 

Ex: wlan.addr == 11:22:33:44:55:66

Ex: wlan.ta == 11:22:33:44:55:66

Ex: wlan.ra == 11:22:33:44:55:66

Ex: wlan.sa == 11:22:33:44:55:66

Ex: wlan.da == 11:22:33:44:55:66

Ex: wlan.bssid == 11:22:33:44:55:66

Ex: wlan_mgt.ssid == “Test”


Filter 802.11 Management Frames

Filter for all management frames: 

wlan.fc.type == 0

Filter for Association Requests:  

wlan.fc.type_subtype == 0

Filter for Association Responses: 

wlan.fc.type_subtype == 1

Filter for Reassociation Requests: 

wlan.fc.type_subtype == 2

Filter for Resssociation Responses: 

wlan.fc.type_subtype == 3

Filter for Probe Requests: 

wlan.fc.type_subtype == 4

Filter for Probe Responses: 

wlan.fc.type_subtype == 5

Filter for Beacons:

wlan.fc.type_subtype == 8

Filter for ATIMs: 

wlan.fc.type_subtype == 9

Filter for Disassociations: 

wlan.fc.type_subtype == 10

Filter for Authentications: 

wlan.fc.type_subtype == 11

Filter for Deauthentications: 

wlan.fc.type_subtype == 12

Filter for Actions: 

wlan.fc.type_subtype == 13


Filter 802.11 Control Frames

Filter for all control frames: 

wlan.fc.type == 1

Filter for Block ACK Requests: 

wlan.fc.type_subtype == 24

Filter for Block ACKs: 

wlan.fc.type_subtype == 25

Filter for PS-Polls: 

wlan.fc.type_subtype == 26

Filter for Ready To Sends: 

wlan.fc.type_subtype == 27

Filter for Clear To Sends: 

wlan.fc.type_subtype == 28

Filter for ACKs: 

wlan.fc.type_subtype == 29

Filter for CF-Ends: 

wlan.fc.type_subtype == 30

Filter for CF-Ends/CF-Acks: 

wlan.fc.type_subtype == 31


Filter 802.11 Data Frames

Filter for all data frames: 

wlan.fc.type == 2

Filter for Data: 

wlan.fc.type_subtype == 32

Filter for Data+CF-Ack: 

wlan.fc.type_subtype == 33

Filter for Data+CF-Poll: 

wlan.fc.type_subtype == 34

Filter for Data+CF-Ack+CF-Poll: 

wlan.fc.type_subtype == 35

Filter for Null: 

wlan.fc.type_subtype == 36

Filter for CF-Ack: 

wlan.fc.type_subtype == 37

Filter for CF-Poll: 

wlan.fc.type_subtype == 38

Filter for CF-Ack+CF-Poll: 

wlan.fc.type_subtype == 39

Filter for QoS Data: 

wlan.fc.type_subtype == 40

Filter for QoS Data+CF-Ack: 

wlan.fc.type_subtype == 41

Filter for QoS Data+CF-Poll: 

wlan.fc.type_subtype == 42

Filter for QoS Data+CF-Ack+CF-Poll: 

wlan.fc.type_subtype == 43

Filter for QoS Null: 

wlan.fc.type_subtype == 44

Filter for QoS CF-Poll: 

wlan.fc.type_subtype == 46

Filter for QoS CF-Ack+CF-Poll: 

wlan.fc.type_subtype == 47


RadioTap Header Information

Ex: radiotap.channel.freq == 5240

Ex: radiotap.datarate <= 6

Ex: radiotap.dbm_antsignal >= -60


Filter for WLCCP packets along with address and data frame

Ex: (wlan.addr == 00:03:7f:c2:00:43 && wlan.fc.subtype==2 ) || wlccp