Q2-Add SSID IE

  • In this section, you are going to learn

  • How to add multiple SSID IE elements in Beacons

#

Version

Ubuntu

Ubuntu 22.04 64 bit

Linux Kernel

6.9.2

Hostapd

hostapd 2.10

  • Add multiple SSID IE elements in Beacons

  • Call flow for add multiple ssid ie in Beacons

main ()
   hostapd_setup_interface ()
     setup_interface ()
       setup_interface2 ()
	 hostapd_setup_interface_complete ()
	   hostapd_setup_interface_complete_sync ()
	     hostapd_setup_bss ()
	      ieee802_11_set_beacon ()
		__ieee802_11_set_beacon ()
		    ieee802_11_build_ap_params ()
		       ap_add_multiple_ssid_ie ()
  • Download the below patch file

add_multiple_ssid_ie_beacons.patch

test:~$ pwd
/home/test
  • Make sure internet is available in laptop to download hostapd package

test:~$ sudo wget http://w1.fi/releases/hostapd-2.10.tar.gz
  • Create a directory

test:~$ mkdir hostapd
  • Change directory to hostapd

test:~$ cd hostapd
  • Note : Your present working directory should be hostapd

test:~$ pwd
/home/test/hostapd/
  • Extract hostapd

test:~$ sudo tar -xvf ~/hostapd-2.10.tar.gz
  • Run the below command to apply patch

test:~$ patch -p1 < add_multiple_ssid_ie_beacons.patch
patching file hostapd-2.10/src/ap/beacon.c
patching file hostapd-2.10/src/ap/ieee802_11.h
patching file hostapd-2.10/src/ap/ieee802_11_shared.c
  • Change directory to hostapd

test:~$ cd hostapd-2.10/hostapd/
  • Check the current working directory using pwd command

  • Make sure your current working directory is hostapd

test:~$ pwd
/home/test/hostapd/hostapd-2.10/hostapd/
  • Copy the contents of defconfig file to .config file

test:~$ sudo cp defconfig .config
  • Compile hostapd

test:~$ sudo make
  • Create run_hostapd.conf

test:~$ sudo vim ./run_hostapd.conf

ctrl_interface=/run/hostapd
interface=wlan0
driver=nl80211
ssid=test_open
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
  • Run hostapd

test:~$ sudo ./hostapd ./run_hostapd.conf
  • Download file to check wireshark output

add_multiple_ssid_ie_beacons.pcapng

  • Check for beacon packet

  • Click on packet No.2 as shown in the image below

Diagram
  • Click on IEEE 802.11 Wireless Management

  • Click on Tagged parameters

  • Click on Tag: SSID parameter set: Undecoded

Diagram