Giter VIP home page Giter VIP logo

radius_server_python's Introduction

Radius Server (Python)

This Raidus Server is writtten by Python, and is used to Authentication, Authorization, Accounting for WLAN user or PPPoE user. Test authorization through supplicant on Windows10, Android 4.4.4 and iOS 13.

Support authenticate method:

Support Dynamic Authorization Extensions:

  • Disconnect Messages
  • Change-of-Authorization (CoA) Messages

Pull submodule src code

git submodule update --init --recursive  # pull

Installation and Usage

  • Setup mysql

    start mysql: docker-compose -f docker-compose.yml up mysql

    init mysql database and table data with mysql_insert.sql

  • For authenticate

    Build the docker image

    docker-compose build auth

    Run the docker container

    docker-compose up auth

  • For accouting

    similiar with authenticate, but reaplce auth with acct

Build

lib libhostapd.so

cd third_party/hostapd-2.10/hostapd/
cat README.md

simulator eapol_test

cd third_party/wpa_supplicant-2.5/wpa_supplicant/
cat README.md

simulator radclient

cd third_party/freeradius-3.0.21/
cat README.md

Send authenticate request with simulator

authenticate: CHAP

enter into authenticate container: docker-compose exec auth bash

run simulator in container:

radclient -D /app/tools/simulator/etc/dictionary -d /app/etc/dictionary 127.0.0.1:1812  auth  'testing123'  < /app/tools/simulator/radius_test/auth/chap.conf

authenticate: PAP

enter into authenticate container: docker-compose exec auth bash

run simulator in container:

radclient -D /app/tools/simulator/etc/dictionary -d /app/etc/dictionary 127.0.0.1:1812  auth  'testing123'  < /app/tools/simulator/radius_test/auth/pap.conf

authenticate: MSCHAPv2

  1. docker-compose up -d auth_test, listen on port 2812

  2. Access Controller route traffic to 2812

authenticate: EAP-GTC

add USE_GTC=1 in .env and restart docker container

enter into authenticate container: docker-compose exec auth bash

run simulator in container:

./eapol_test -c /app/tools/simulator/eap_test/eapol_test.conf.peapv1.gtc -a 127.0.0.1 -p 1812 -s testing123 -r 0 -N 30:s:FF-FF-FF-FF-FF-FF -N 32:s:AC

authenticate: EAP-MSCHAPv2

remove USE_GTC=0 in .env and restart docker container

enter into authenticate container: docker-compose exec auth bash

run simulator in container:

./eapol_test -c /app/tools/simulator/eap_test/eapol_test.conf.peapv1.mschapv2 -a 127.0.0.1 -p 1812 -s testing123 -r 0 -N 30:s:FF-FF-FF-FF-FF-FF -N 32:s:AC

Send authenticate request with simulator

enter into accounting container: docker-compose exec acct bash

run simulator in container:

./radclient -D /app/tools/simulator/etc/dictionary -d /app/etc/dictionary 127.0.0.1:1813  acct  'testing123'  < /app/tools/simulator/radius_test/acct/i.conf

./radclient -D /app/tools/simulator/etc/dictionary -d /app/etc/dictionary 127.0.0.1:1813  acct  'testing123'  < /app/tools/simulator/radius_test/acct/u.conf

./radclient -D /app/tools/simulator/etc/dictionary -d /app/etc/dictionary 127.0.0.1:1813  acct  'testing123'  < /app/tools/simulator/radius_test/acct/t.conf

Send Dynamic Authorization Extensions request with simulator

disconnect

enter into accounting container: docker-compose exec dae bash

run simulator in container:

./radclient -D /app/tools/simulator/etc/dictionary -d /app/etc/dictionary 127.0.0.1:3799  disconnect  'testing123'  < /app/tools/simulator/radius_test/dae/disconnect.conf

gdb core

gdb /root/.pyenv/shims/python -c core.1 

gdb segmentation fault

ENTRYPOINT="tail -f /dev/null" docker-compose up -d auth_test

apt-get install gdb

./bin/gdb.sh    # gdb python3

(gdb) run /app/src/processor/auth_processor.py

# wait for segfault ##

(gdb) backtrace

# stack trace of the c code

radius_server_python's People

Contributors

dependabot[bot] avatar zeroleo12345 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.