|
Description:
目前市面上有支援 802.1x 認證的無線網路 AP 動則上萬元,小弟因為於這學期修了網路安全的課所以研究了無線網路快速換手認證 ( Fast Hand off Authentication ) 在這同時也於 FreeBSD 上將 802.1x + FreeRadius Server 環境架設起來,FreeRadius 上有支援的 802.1x EAP ( Extensible Authentication Protocol ) 標準協定包括了 EAP-MD5、EAP-LEAP、EAP-TLS、EAP-TTLS、EAP-PEAP 等多種我們常看見的認證協定。
EAP-MD5 為最基本的認證協定,但使用上缺乏 ( Mutual Authentication ) 相互認證,安全上為 EAP 中最弱的因此於 EAP 中已經少被使用,LEAP 是 Cisco 大廠所推的標準,只要是 Cisco 設備都會支援,無需使用憑證即可做相互認證 ( Mutual Authentication ),EAP-TLS 為最安全的 EAP 協定不過最安全未必是最實用的,因為最安全所要花費的經費最高,需要建置 PKI 有效憑證管理每一個 Server 及 Client 維護成本極高,目前比較讓業界接受的即為 EAP-TTLS 跟 PEAP 兩者都有支援雙相驗證同時也只需要具備 Radius Server 的憑證即可達到安全的資料加密傳送驗證。
| |
EAP-MD5 |
LEAP |
EAP-TLS |
EAP-TTLS |
PEAP |
|
Server Authentication |
None |
Password Hash |
Public Key (Certificate) |
Public Key (Certificate) |
Public Key (Certificate) |
|
Supplicant Authentication |
Password Hash |
Password Hash |
Public Key (Certificate or Smart Card) |
CHAP, PAP, MS-CHAP(v2), EAP |
Any EAP, like EAP-MS-CHAPv2 or Public Key |
| Authentication Attributes |
One -Way Authentication |
Mutual Authentication |
Mutual Authentication |
Mutual Authentication |
Mutual Authentication |
|
Dynamic Key Delivery |
No |
Yes |
Yes |
Yes |
Yes |
| Deployment Difficulty |
Easy |
Moderrate |
Hard |
Moderrate |
Moderrate |
|
Security Risks |
Identity exposed, Dictionary attack, Man-in-the-Middle (MitM) attack, Session hijacking |
Identity exposed, Dictionary attack |
Identity exposed |
MitM attack |
MitM attack; Identity hidden in Phase 2 but potential exposure in Phase 1 |
Fig 1. 各式 EAP ( Extensible Authentication Protocol ) 加密協定差異比較表
本次的測試以 EAP-TTLS 為實驗方向,我的 Client 是 Windows XP 使用的無線網卡也有支援 802.1x 恰好也支援 EAP-TTLS,AP 部份使用 d-link PCI 介面的網卡 ( 愛用國貨 ),型號為 DWL-G520 晶片是 Atheros 的,因為是 FreeBSD 有支援 Atheros 的 AR5212 chips,Radius Server 使用 FreeRadius 這套 OpenSource 軟體獨立架設在另一台 FreeBSD 上。
Environment :
硬體:i386 PC x2 Intel P3 500 記憶體:各 256M RAM 網卡:FreeBSD-AP 2 片網卡 ( 一片一般 100M 網卡 + 一片 D-Link DWL-G520 54G無線網卡 ) 、FreeBSD-Radius 一片網卡 100M 作業系統:FreeBSD 6.0 Release FreeBSD-AP: Wireless LAN IP:10.66.66.254 General WAN IP:88.88.88.77 FreeBSD-Radius:IP:88.88.88.88
Fig 2. 環境設備架構圖
Setp 1.
架設 FreeBSD-AP ( AccessPoint ) 的架設 請先參我我之前寫過的 FreeBSD 架設無線 AP 方式 #vi /etc/hostapd.conf # 設定 hostapd.conf 的相關 AP 參數
interface=ath0 driver=bsd logger_syslog=-1 logger_syslog_level=0 logger_stdout=-1 logger_stdout_level=0 debug=4 dump_file=/tmp/hostapd.dump ctrl_interface=/var/run/hostapd ctrl_interface_group=wheel ssid=bsdap ieee8021x=1 own_ip_addr=88.88.88.77 auth_server_addr=88.88.88.88 auth_server_port=1812 auth_server_shared_secret=1234 wpa=1 wpa_key_mgmt=WPA-EAP wpa_pairwise=CCMP TKIP
Setp 2.
架設 FreeBSD-Radius 的架設我們安裝的是 FreeRadius 這套 OpenSource 的 Radius 軟體
#cd /usr/ports/net/freeradius #make install
#cd /usr/local/etc/raddb/ #cp acct_users.sample acct_users #cp clients.conf.sample clients.conf #cp dictionary.sample dictionary #cp eap.conf.sample eap.conf #cp hints.sample hints #cp huntgroups.sample huntgroups #cp preproxy_users.sample preproxy_users #cp proxy.conf.sample proxy.conf #cp radiusd.conf.sample radiusd.conf #cp snmp.conf.sample snmp.conf #cp sql.conf.sample sql.conf #cp users.sample users
#vi clients.conf # 加入可以跟 client 的 AP 認證碼我們用 1234 , 我們允許 88.88.88.0/24 整個網段的 IP 對 radius 查詢
client 88.88.88.0/24 { secret = 1234 shortname = freebsd-ap }
#vi users # 因為我們只做測試沒跟後端的資料庫或是 LDAP 結合所以我們建立一個 test 帳號密碼為 test
DEFAULT Auth-Type = System Fall-Through = 1 "test" User-Password == "test"
#vi eap.conf # 這邊要有 radius 的憑證所以記得必須要先把 Server 的憑證產生下面的設定才有意義
eap { default_eap_type = ttls timer_expire = 60 ignore_unknown_eap_types = no cisco_accounting_username_bug = no md5 { } leap { } gtc { auth_type = PAP } tls { private_key_password = freebsdmallserver private_key_file = /home/jim/radius/serverkey.pem certificate_file = /home/jim/radius/servercert.pem CA_file = /home/jim/radius/CA_nlab/cacert.pem dh_file = ${raddbdir}/certs/dh random_file = /dev/urandom fragment_size = 1024 } ttls { default_eap_type = md5 } mschapv2 { } }
#vi /etc/rc.conf
radiusd_enable="YES"
#reboot # 重開 radius server 讓 radisu 啟動
#netstat -na |grep udp # 查看 udp 的 1813 跟 1812 port 有無打開 udp4 0 0 *.1813 *.* udp4 0 0 *.1812 *.*
#radiusd -X # 可測試 radius 有無啟動 Starting - reading configuration files ... reread_config: reading radiusd.conf ' 中間略 ..... ' There appears to be another RADIUS server running on the authentication port 1812
#radtest test test localhost 0 1234 # 也可測試 test/test 帳號跟密碼是否有通過 radius 驗證 Sending Access-Request of id 241 to 127.0.0.1 port 1812 User-Name = "test" User-Password = "test" NAS-IP-Address = 255.255.255.255 NAS-Port = 0 Re-sending Access-Request of id 241 to 127.0.0.1 port 1812 User-Name = "test" User-Password = "test" NAS-IP-Address = 255.255.255.255 NAS-Port = 0 rad_recv: Access-Accept packet from host 127.0.0.1:1812, id=192, length=38 Service-Type = Framed-User Framed-IP-Address = 255.255.255.254 Framed-IP-Netmask = 255.255.255.0
Setp 3.
ZD1211 無線網卡在 Windows XP 端的連線設定 我的 Wireless 網卡有支援 EAP-TTLS 是 ZyDAS 1211 晶片去官網更新驅動韌體後就支援 TTLS
更多的設定 : 設定認證模式 ( WAP ) > 網路加密模式 ( TKIP )
WAP 加密設定 : 認證協定 ( TTLS ) > 第二階段認證 ( MSCHAPv2 ) > 使用者名稱 ( test ) > 使用者密碼 ( test )
Conclusion.
Radius 的功能強大還有許多的參數未去研究,還有 Radius 的 proxy 部分也挺有意思的,Radius proxy 它是應用在漫遊認證部份,待以後有需要使用到時再好好的研究把。
References.
http://www.freebsdmall.com/~loader/en_US.ISO8859-1/articles/wireless/article.html
|