Q4-Send-probe-request

  • In this section, you are going to learn

  • How to send a probe-request every 30 seconds

#

Version

Ubuntu

Ubuntu 22.04 64 bit

Linux Kernel

6.9.2

Supplicant

wpa_supplicant 2.10

  • Send a probe-request every 30 seconds

  • Add a configuration parameter called “periodic_probe=30” in supplicant conf file

  • If “periodic_probe=0”, then this feature is disabled

  • If “periodic_probe=5”, then probe is sent at every 5th second

  • Call flow for send a probe-request every 30 seconds

main ()
  wpa_supplicant_add_iface ()			      
     wpa_supplicant_init_iface () 
        wpa_supplicant_driver_init ()	     
	   wpa_supplicant_req_scan ()	
	    wpa_supplicant_scan ()	    
	       wpa_supplicant_trigger_scan ()
                  wpas_trigger_scan_cb ()
                    sta_send_probe ()
  • Download the below patch file

send_probe_req_every_30sec.patch

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

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

test:~$ mkdir supplicant
  • Change directory to supplicant

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

test:~$ pwd
/home/test/supplicant/
  • Extract wpa_supplicant

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

test:~$ patch -p1 < send_probe_req_every_30sec.patch
patching file wpa_supplicant-2.10/src/utils/os.h
patching file wpa_supplicant-2.10/src/utils/os_unix.c
patching file wpa_supplicant-2.10/wpa_supplicant/config_file.c
patching file wpa_supplicant-2.10/wpa_supplicant/config.h
patching file wpa_supplicant-2.10/wpa_supplicant/scan.c
  • Change directory to wpa_supplicant

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

  • Make sure your current working directory is wpa_supplicant

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

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

test:~$ sudo make
  • Create run_supplicant.conf

test:~$ sudo vim ./run_supplicant.conf

ctrl_interface=/run/wpa_supplicant
update_config=1
periodic_probe=30

network={
ssid="test_open"
key_mgmt=NONE
}
  • Run wpa_supplicant

test:~$ sudo ./wpa_supplicant -Dnl80211 -i wlan1 -c ./run_supplicant.conf
  • Download file to check wireshark output

send_probe_req_every_30sec.pcapng

  • Check for probe-request packet

  • Apply display filter

  • wlan.addr == 02:00:00:00:01:00 && wlan.fc.type_subtype == 4

Diagram
  • Observe the probe-request packets with 30 sec time interval

Diagram