EAP-TTLS-MSCHAPv2

What is Expansion of EAP-TTLS-MSCHAPv2?

Extensible Authentication Protocol - Tunneled Transport Layer Security - Microsoft Challenge Handshake Authentication Protocol version 2.

What is EAP-TTLS-MSCHAPv2?

EAP-TTLS-MSCHAPv2 is an authentication method where a secure TLS tunnel is established using EAP-TTLS, and within this tunnel, the MSCHAPv2 protocol is used for client authentication with username and password.

Why is EAP-TTLS-MSCHAPv2 useful?

  • It secures legacy password-based authentication by encapsulating MSCHAPv2 inside a TLS tunnel.

  • Protects user credentials against eavesdropping and man-in-the-middle attacks.

  • Provides mutual authentication if server certificates are validated.

  • Widely supported and easier to deploy in environments where client certificates are not feasible.

How it works?

  1. The client and authentication server establish a TLS tunnel using EAP-TTLS, where the server presents a certificate for authentication.

  2. Inside the encrypted tunnel, the client responds to MSCHAPv2 challenges with hashed password responses.

  3. The server verifies the responses and decides whether to grant access.

  4. After successful authentication, keys are derived for securing the wireless session.

Where is EAP-TTLS-MSCHAPv2 used?

  • Enterprise Wi-Fi networks for secure, password-based authentication.

  • Remote access VPNs that require secure user authentication without client certificates.

  • Networks transitioning from older protocols to more secure EAP methods.

Which OSI layer does this protocol belong to?

Application Layer (Layer 7).

Is EAP-TTLS-MSCHAPv2 windows specific?

No. While MSCHAPv2 was developed by Microsoft and is well-supported on Windows, EAP-TTLS-MSCHAPv2 is supported on multiple platforms, including Linux and macOS.

Is EAP-TTLS-MSCHAPv2 Linux Specific?

No. It is supported by Linux supplicants like wpa_supplicant and radius servers such as FreeRADIUS.

Which Transport Protocol is used by EAP-TTLS-MSCHAPv2?

  • EAP over LAN (EAPOL) between client (supplicant) and authenticator (e.g., AP).

  • RADIUS protocol over UDP between authenticator and authentication server.

Which Port is used by EAP-TTLS-MSCHAPv2?

UDP port 1812 (RADIUS authentication).

Is EAP-TTLS-MSCHAPv2 using Client server model?

Yes. It involves the client (supplicant), authenticator (AP or switch), and the authentication server.

Whether EAP-TTLS-MSCHAPv2 protocol uses certificates?

  • Server certificates are required for TLS tunnel establishment.

  • Client certificates are generally not used; authentication inside the tunnel is via MSCHAPv2.

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

Typically 20-30 EAPOL frames, including the TLS handshake and MSCHAPv2 challenge-response.

Whether EAP-TTLS-MSCHAPv2 Protocol uses client certificates?

No. Authentication uses MSCHAPv2 username/password inside the tunnel.

Whether EAP-TTLS-MSCHAPv2 Protocol uses Server Certificates?

Yes, for TLS tunnel setup.

Is EAP-TTLS-MSCHAPv2 Protocol depends on TCP?

Not directly. EAPOL is layer 2; TLS is tunneled inside EAP messages. RADIUS runs over UDP.

Is EAP-TTLS-MSCHAPv2 Protocol depends on UDP?

Yes, RADIUS communication between authenticator and server uses UDP.

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

  • Client/supplicant configured with MSCHAPv2 credentials.

  • Access Point or Network Access Server.

  • Authentication Server (e.g., FreeRADIUS) with MSCHAPv2 support.

  • Certificate Authority for issuing server certificates.

  • Network analysis tools like Wireshark.

Does EAP-TTLS-MSCHAPv2 Protocol work with free radius server on Linux?

Yes, FreeRADIUS supports EAP-TTLS with MSCHAPv2 authentication inside the tunnel.

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

Hostapd’s internal radius server has limited support; external RADIUS servers are preferred for full EAP-TTLS-MSCHAPv2 functionality.

What is the RFC version use for EAP-TTLS-MSCHAPv2 Protocol?

  • EAP-TTLS: RFC 5281.

  • MSCHAPv2: RFC 2759.

During Connection Procedure which EPoL Packets are encrypted?

  • All MSCHAPv2 authentication packets inside the TLS tunnel are encrypted.

  • TLS handshake packets are unencrypted until tunnel establishment.

Can you Explain different stages of Connection Procedure for EAP-TTLS-MSCHAPv2 Protocol?

  1. Client initiates EAP-TTLS authentication, authenticating the server via its certificate.

  2. TLS tunnel is established securely.

  3. Client performs MSCHAPv2 challenge-response inside the encrypted tunnel.

  4. Upon success, PMK is derived.

  5. The 4-way handshake is executed between client and AP using the PMK.

  6. Secure wireless session is established.

What is the final output of Connection Procedure?

  • Successful authentication.

  • Derivation of the Pairwise Master Key (PMK) for securing the wireless link.

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

A 256-bit Pairwise Master Key (PMK).

Where the use of PMK generated by the Connection Procedure?

The PMK is used in the 4-way handshake to generate the Pairwise Transient Key (PTK), which encrypts the wireless data between client and access point.

  • 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=ttls

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=TTLS
phase2="auth=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