EAP-MSCHAPv2

What is Expansion of EAP-MSCHAPv2?

EAP-MSCHAPv2 stands for Extensible Authentication Protocol - Microsoft Challenge Handshake Authentication Protocol version 2. It is a two-way authentication protocol commonly used for wireless networking and Virtual Private Networks (VPNs).

What is EAP-MSCHAPv2?

EAP-MSCHAPv2 is an authentication protocol that allows mutual authentication between the client and the server. It is used in EAP to provide secure authentication, using a challenge-response method to verify the client and server identities.

Why is EAP-MSCHAPv2 useful?

  • Provides secure mutual authentication between client and server.

  • Widely used in enterprise Wi-Fi (WPA2 Enterprise) and VPN systems.

  • Prevents replay attacks through challenge-response encryption.

  • Ensures confidentiality during the authentication process by hashing sensitive information.

How it works?

  1. The client sends an authentication request to the server.

  2. The server responds with a challenge (a random number).

  3. The client hashes the challenge with its password and sends the hash back to the server.

  4. The server checks if the hash is correct and authenticates the client if it matches.

Where is EAP-MSCHAPv2 used?

  • WPA2 Enterprise for secure Wi-Fi authentication.

  • VPNs for secure remote access.

  • RADIUS-based authentication in enterprise networks.

  • Windows authentication systems for client verification.

Which OSI layer does this protocol belong to?

  • EAP-MSCHAPv2 operates at the Application Layer (Layer 7) of the OSI model.

  • It uses transport layers (TCP/UDP) for data transfer but operates at a higher level to perform authentication.

Is EAP-MSCHAPv2 Windows specific?

No, EAP-MSCHAPv2 is not Windows-specific. It is supported across multiple platforms, including Linux, macOS, and other operating systems, for use in wireless and VPN authentication.

Is EAP-MSCHAPv2 Linux Specific?

No, EAP-MSCHAPv2 is not Linux-specific. It is cross-platform and supported by Windows, Linux, macOS, and other operating systems.

Which Transport Protocol is used by EAP-MSCHAPv2?

EAP-MSCHAPv2 typically uses UDP as the transport protocol, especially when integrated with RADIUS for authentication purposes.

Which Port is used by EAP-MSCHAPv2?

EAP-MSCHAPv2, when used with RADIUS, typically operates on UDP port 1812 for authentication.

Is EAP-MSCHAPv2 using Client-server model?

Yes, EAP-MSCHAPv2 operates in a client-server model, where the client sends authentication requests to a server (typically a RADIUS server) for verification.

Does EAP-MSCHAPv2 protocol use certificates?

No, EAP-MSCHAPv2 does not rely on certificates. It uses a password-based challenge-response mechanism for authentication.

How many frame exchanges are seen during connection for EAP-MSCHAPv2 protocol?

There are four frame exchanges during the connection procedure: 1. The client sends an authentication request. 2. The server issues a challenge to the client. 3. The client responds with a hashed response. 4. The server verifies the response and completes authentication.

Does EAP-MSCHAPv2 Protocol use client certificates?

No, EAP-MSCHAPv2 does not use client certificates. Authentication is based on password hashing and challenge-response.

Does EAP-MSCHAPv2 Protocol use Server Certificates?

No, EAP-MSCHAPv2 does not use server certificates. It relies on challenge-response mechanisms instead.

Does EAP-MSCHAPv2 Protocol depend on TCP?

No, EAP-MSCHAPv2 typically operates over UDP, particularly when used with RADIUS for authentication.

Does EAP-MSCHAPv2 Protocol depend on UDP?

Yes, EAP-MSCHAPv2 generally operates over UDP, especially when integrated with RADIUS authentication.

What are the roles involved when testing EAP-MSCHAPv2 Protocol?

  • Client: Initiates the authentication request and responds to challenges.

  • Server: Sends challenges, verifies responses, and authenticates the client.

  • Administrator: Configures the RADIUS server and manages user authentication policies.

Does EAP-MSCHAPv2 Protocol work with FreeRADIUS server on Linux?

Yes, EAP-MSCHAPv2 is fully supported by FreeRADIUS on Linux and is commonly used for secure wireless and VPN authentication.

Does EAP-MSCHAPv2 Protocol work with Internal RADIUS server of hostapd?

Yes, EAP-MSCHAPv2 can work with the internal RADIUS server of hostapd for wireless network authentication.

What is the RFC version used for EAP-MSCHAPv2 Protocol?

EAP-MSCHAPv2 is defined in RFC 2759 (Microsoft Challenge Handshake Authentication Protocol Version 2).

During Connection Procedure which EAP packets are encrypted?

The challenge-response packets are encrypted in EAP-MSCHAPv2. This ensures that the authentication process is secure even if the communication is intercepted.

Can you explain the different stages of Connection Procedure for EAP-MSCHAPv2 Protocol?

  1. Authentication Request: The client sends an EAP authentication request to the server.

  2. Challenge: The server responds with a challenge (random number).

  3. Response: The client computes a hash of the challenge and its password and sends it to the server.

  4. Verification: The server verifies the response and authenticates the client if the response is correct.

What is the final output of Connection Procedure?

The final output is a successful or failed authentication of the client based on whether the server’s verification of the response is correct.

What is the format of the key generated after the connection procedure?

After the connection procedure, the Pairwise Master Key (PMK) is generated. This key is used for encrypting data in the wireless network.

Where is the use of PMK generated by the Connection Procedure?

The Pairwise Master Key (PMK) generated during authentication is used for encrypting the data traffic between the client and the server, ensuring secure communication during the session.

  • In this section, you are going to learn

  • Terminology

  • Version Info

  • rfc details

  • Run Free RADIUS

FreeRADIUS: Download latest freeradius source code

Note

  • Make sure internet is available in laptop to download freeradius package

test:~$ wget https://github.com/FreeRADIUS/freeradius-server/archive/v3.0.x.tar.gz

FreeRADIUS: Extract freeradius

test:~$ tar -zvf v3.0.x.tar.gz

FreeRADIUS: Change directory to Radius server

test:~$ cd freeradius-server-3.0/

FreeRADIUS: Check the current working directory using pwd command

Note

  • Make sure your current working directory is freeradius-server-3.0

test:~$ pwd
/home/test/freeradius-server-3.0

FreeRADIUS: Open debian/rules and add this line –without-rml_sql_iodbc above –without-rlm_eap_ikev2

test:~$ vim debian/rules
--without-rml_sql_iodbc \
--without-rlm_eap_ikev2 \

FreeRADIUS: Configure for Compilation

test:~$ ./configure

FreeRADIUS: Build the Radius server

test:~$ make

FreeRADIUS: Go to raddb folder (all radius server/client files and certificates and keys will be generated here)

test:~$ cd /usr/local/etc/raddb

FreeRADIUS: Open clients.conf file and verify localhost client is present else add your own client like below

test:~$ sudo vi clients.conf

client 192.168.56.10{
ipaddr = 192.168.56.10
secret = testing123
}  

FreeRADIUS: Open users file and uncomment below two lines or add

test:~$ sudo vi users

bob 	Cleartext-Password := "testing123"
 	Reply-Message := "Hello, %{User-Name}"

FreeRADIUS: Set default_eap_type=tls in eap file located in /usr/local/etc/raddb/mods-enabled

test:~$ sudo vi /usr/local/etc/raddb/mods-enabled/eap

default_eap_type=mschapv2

FreeRADIUS: Start radius server

test:~$ sudo radiusd -X
  • Run AP mode operation with hostapd

AP : Download hostapd

Note

  • Make sure internet is available in laptop to download hostapd package

test:~$ wget http://w1.fi/releases/hostapd-2.9.tar.gz

AP: Install required packages

test:~$ sudo apt install libnl-genl-3-dev libnl-3-dev libdbus-glib-1-dev

AP : Extract hostapd

test:~$ tar -xzvf hostapd-2.9.tar.gz

AP : Change directory to hostapd

test:~$ cd hostapd-2.9/hostapd/

AP : Check the current working directory using pwd command

Note

  • Make sure your current working directory is hostapd

test:~$ pwd
/home/test/hostapd-2.9/hostapd

AP : Copy the contents of defconfig file to .config file

Note

  • .config file is required for make to start compilation of hostapd

test:~$ sudo cp defconfig .config

AP : Complile hostapd

Note

  • Compile hostapd by running make command

test:~$ make

AP : Check for the binaries created

Note

  • Make sure hostapd and hostapd_cli are present

test:~$ ls
hostapd
hostapd_cli

AP : Create a hostapd.conf file in /etc/hostapd folder with below content

test:~$ sudo vim /etc/hostapd/hostapd.conf

ctrl_interface=/var/run/hostapd
interface=enp0s8
driver=wired
logger_stdout=1
logger_stdout_level=1
debug=2
ieee8021x=1
eap_server=0
eap_user_file=/etc/hostapd/eap_user
eap_reauth_period=3600
use_pae_group_addr=1
auth_algs=1
auth_server_addr=127.0.0.1
auth_server_port=1812
auth_server_shared_secret=testing123
acct_server_addr=127.0.0.1
acct_server_port=1812
acct_server_shared_secret=testing123
macaddr_acl=0
ca_cert=/usr/local/etc/raddb/certs/ca.pem
server_cert=/usr/local/etc/raddb/certs/server.crt
private_key=/usr/local/etc/raddb/certs/server.p12
private_key_passwd=whatever 

AP : Create a file eap_user in /etc/hostapd/ folder with below content

test:~$ sudo vim /etc/hostapd/eap_user

AP : Run hostapd

test:~$ sudo ./hostapd /etc/hostapd/hostapd.conf
enp0s8: interface state UNINITIALIZED->ENABLED
enp0s8: AP-ENABLED

STA : Download wpa_supplicant

Note

  • Make sure internet is available in laptop to download supplicant package

test:~$ wget https://w1.fi/releases/wpa_supplicant-2.9.tar.gz

STA: Install required packages

test:~$ sudo apt install libnl-genl-3-dev libnl-3-dev libdbus-glib-1-dev

STA : Extract wpa_supplicant

test:~$ tar -xvf wpa_supplicant-2.9.tar.gz

STA : Change directory to wpa_supplicant

test:~$ cd wpa_supplicant-2.9/wpa_supplicant/

STA : Check the current working directory using pwd command

Note

  • Make sure your current working directory is wpa_supplicant

test:~$ pwd
/home/test/wpa_supplicant-2.9/wpa_supplicant

STA : Copy the contents of defconfig file to .config file

Note

  • .config file is required for make to start compilation of supplicant

test:~$ cp defconfig .config

STA : Compile wpa_supplicant

Note

  • Compile supplicant by running make command.

test:~$ make

STA: You might get errors while make regarding openssl headers in that case install the openssl headers and then do make clean and then do make again.

test:~$ sudo apt install libssl-dev
test:~$ make clean
test:~$ make

STA : Check for the binaries created

Note

  • Make sure wpa_supplicant and wpa_cli are present

test:~$ ls
wpa_supplicant
wpa_cli

STA: Copy required certificates from hostapd to wpa_supplicant

STA : Create wpa_supplicant.conf

test:~$ sudo vim wpa_supplicant.conf

ctrl_interface=/run/wpa_supplicant
update_config=1
network={
key_mgmt=WPA-EAP
eap=MSCHAPV2
identity="bob"
password="testing123"
}

STA : Run wpa_supplicant

test:~$ sudo ./wpa_supplicant -D wired -i enp0s8 -c wpa_supplicant.conf
enp0s8: CTRL-EVENT-EAP-SUCCESS EAP authentication completed successfully

STA: Test

test:sudo ./wpa_cli -i enp0s8
> status
  • setup

  • setup

  • packet details

  • usecases

  • features

  • Reference links