harrybrwn / RADIUS-EAP-MSCHAPv2-Python-client

RADIUS EAP-MSCHAPv2 Python 3 client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RADIUS EAP-MSCHAPv2 Client

A pure Python 3 RADIUS EAP-MSCHAPv2 client implementation.

Explanation

This project was developped because no RADIUS client library supports EAP-MSCHAPv2 (A ticket is open for the pyrad library, see here).

This library only supports EAP-MSCHAPv2. This code has been tested with Microsoft Windows Server 2016 Network Policy Server.

Installation

pip3 install radius-eap-mschapv2-client

Usage

from radius_eap_mschapv2 import RADIUS

radius_host = '10.1.2.3'
radius_secret = 'r4d!us_$3cr3t'
radius_nas_ip = '10.3.2.1'
radius_nas_id = 'mynas'
username = 'myuser'
password = 'mypassword!'

r = RADIUS(radius_host, radius_secret, radius_nas_ip, radius_nas_id)
print(r.is_credential_valid(username, password))

Requirements

This script has been written for Python 3.5 and newer.

You must install librairies with pip3 install -r requirements.txt.

Credits

To make this implementation, I used the daphp/radius PHP implementation.

The article Understanding PEAP In-Depth also helped me a lot.

Thanks to them.

About

RADIUS EAP-MSCHAPv2 Python 3 client

License:MIT License


Languages

Language:Python 100.0%