Q5-Deauth after auth response

  • In this section, you are going to learn

  • How to send de-authentication packet on reception of authentication response packet from AP

#

Version

Ubuntu

Ubuntu 22.04 64 bit

Linux Kernel

6.9.2

Supplicant

wpa_supplicant 2.10

  • Send De-Authentication packet on reception of Authentication response packet from AP

  • Add a configuration parameter called “deauth_on_auth_response_rx” in supplicant conf file

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

  • If “deauth_on_auth_response_rx=1”, then this feature is enabled

  • Call flow for send de-authentication packet on reception of authentication response packet from AP

nl80211_global_init ()
  wpa_driver_nl80211_init_nl_global ()                                          
    process_global_event ()                                        
      do_process_drv_event ()           
	send_scan_event ()                              
	  process_global_event ()
	    do_process_drv_event ()       
	      mlme_event ()             
		mlme_event_auth ()    
		  wpa_supplicant_event ()       
		    sme_event_auth ()
		      wpa_supplicant_deauthenticate ()

  • Download the below patch file

send_deauth_after_auth_res.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_deauth_after_auth_res.patch
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/events.c
patching file wpa_supplicant-2.10/wpa_supplicant/sme.c
patching file wpa_supplicant-2.10/wpa_supplicant/wpa_supplicant.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
deauth_on_auth_response_rx=1

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_deauth_after_auth_res.pcapng

  • Check for deauthentication packet

  • Check packet 74 and 75

  • Observe 74 is authentication response packet and 75 is deauthentication packet

Diagram