2015-01-21 2 views
1

RADIUS 프로토콜을 구현하려고합니다. 인증 기 필드를 계산할 때 RFC 2866에 따라, RADIUS 회계를 들어, 다음 단계는 다음과 같습니다 회계 - 응답 패킷의 인증 프로그램 필드는 ​​응답 인증 자 라고RADIUS 메시지의 인증 자 필드를 계산하십시오.

및 단방향 MD5 해시를 포함 응답 코드, 식별자, 길이, 회신중인 Accounting-Request 패킷의 요청 인증 자 필드 및 응답 암호가있는 경우 으로 구성된 8 진수 스트림을 통해 계산 된 공유 암호 다음에 계산 된 입니다. 결과적으로 16 진수의 MD5 해시 값인 은 Accounting-Response 패킷의 Authenticator 필드에 저장됩니다.

내가 계산하려고 내가 올바른 값을 얻을 수 없습니다 코드 = 5 (0x05가) 1 바이트 식별자 : 134 (에는 0x86) 1 바이트 길이 : 20 (0x0014) 2 바이트 요청 인증 자 : bac85592365b2e786ad3095a1cf22646, 16 바이트 내 대답에 어떤 속성은 공유 비밀이 없습니다 : 63 21 6D 40 35 32 32 35 (! 5225 @ C m)

이 때문에 MD %의 해시에 대한 입력은 다음과 같습니다 05860014bac85592365b2e786ad3095a1cf2264663216d4035323235 : b7ac1e6909302b06bd021aede380dbc5이이 개 웹 사이트를 사용 : http://www.md5hashgenerator.com/http://www.miraclesalad.com/webtools/md5.php

실제 응답 내가 진짜 RADIUS 패킷을보고 비교하고 9629702dca9469714fb423ca7b1525bc 클라이언트/서버 및 I 보낸 일치하지 않습니다 계산하려면 인증 자에 의해 전송되는으로 인증 자이있다 서버에 의해. 어떤 아이디어가 될 수 있습니까?

The RFC 2865 at the end has a couple of examples. Example 1, using the shared 
secret "xyzzy5461" 



User Telnet to Specified Host 

The NAS at 192.168.1.16 sends an Access-Request UDP packet to the 
RADIUS Server for a user named nemo logging in on port 3 with 
password "arctangent". 

The Request Authenticator is a 16 octet random number generated by 
the NAS. 

The User-Password is 16 octets of password padded at end with nulls, 
XORed with MD5(shared secret|Request Authenticator). 

01 00 00 38 0f 40 3f 94 73 97 80 57 bd 83 d5 cb 
98 f4 22 7a 01 06 6e 65 6d 6f 02 12 0d be 70 8d 
93 d4 13 ce 31 96 e4 3f 78 2a 0a ee 04 06 c0 a8 
01 10 05 06 00 00 00 03 

1 Code = Access-Request (1) 
1 ID = 0 
2 Length = 56 
16 Request Authenticator 

Attributes: 

6 User-Name = "nemo" 
18 User-Password 
6 NAS-IP-Address = 192.168.1.16 
6 NAS-Port = 3 

The RADIUS server authenticates nemo, and sends an Access-Accept UDP 
packet to the NAS telling it to telnet nemo to host 192.168.1.3. 

The Response Authenticator is a 16-octet MD5 checksum of the code 
(2), id (0), Length (38), the Request Authenticator from above, the 
attributes in this reply, and the shared secret. 

02 00 00 26 86 fe 22 0e 76 24 ba 2a 10 05 f6 bf 
9b 55 e0 b2 06 06 00 00 00 01 0f 06 00 00 00 00 
0e 06 c0 a8 01 03 

1 Code = Access-Accept (2) 
1 ID = 0 (same as in Access-Request) 
2 Length = 38 
16 Response Authenticator 

Attributes: 

6 Service-Type (6) = Login (1) 
6 Login-Service (15) = Telnet (0) 
6 Login-IP-Host (14) = 192.168.1.3 
+0

또한 rfc 2865의 끝에서 예제를 테스트했는데 예제에서 얻은 것과 동일한 인증자를 얻을 수 없습니다 – user3196371

답변

1

문제가 해결되었습니다. 온라인 md5 도구는 문자열을 예상하므로 바이트 값을 전달하더라도 문자열로 처리되므로 잘못된 값으로 취급됩니다.

관련 문제