如何计算Access-Request RADIUS数据包的加密密码值

时间:2016-03-25 03:40:19

标签: python-2.7 md5 xor freeradius

我正在努力找回我在FreeRadius设置中使用的密码明文

以下属性是我从pcap文件中获得的:

Plaintext password = "cisco123"
sharedkey = "sharedsecret"
Ciphertext password = "6ed3a35440abe69b2e8698109b809932" <-- plaintext password is cisco123
authenticator = "344c71c77a2b845b8856ffa968740b73"

基于研究@ http://www.untruth.org/~josh/security/radius/radius-auth.html,根据第2.1节导出加密密码的步骤在下面按照我的理解执行:

将sharedkey和authenticator连接起来并存储在变量中:

SharedKey + Authenticator:  sharedsecret344c71c77a2b845b8856ffa968740b73

MD5哈希连接值:

Md5(SharedKey+Authenticator):  46608024c8f48fd0977bb944ae0eb89a

使用MD5连接结果对明文密码进行异或,结果应与密文匹配

cisco12300000000 XOR 46608024c8f48fd0977bb944ae0eb89a

请参阅下面的我的代码调试结果(请注意我的c1与Captured Ciphertext匹配,但它不是):

Shared Key:  sharedsecret
Authenticator:  344c71c77a2b845b8856ffa968740b73
SharedKey + Authenticator:  sharedsecret344c71c77a2b845b8856ffa968740b73
Md5(SharedKey+Authenticator):  46608024c8f48fd0977bb944ae0eb89a
p1(ascii):  cisco123
p1(hex):  636973636f3132330000000000000000
b1:  46608024c8f48fd0977bb944ae0eb89a
c1(p1 XOR b1):  2509f347a7c5bde3977bb944ae0eb89a
Captured Ciphertext  6ed3a35440abe69b2e8698109b809932

我可以澄清我的步骤是否错误吗?

1 个答案:

答案 0 :(得分:0)

Radius密码使用Auth-Type加密 这取决于您的Auth-Type。如果设置为CHAP,则使用CHAP方法加密密码。对我来说,我无法解密它。

您可能需要将Auth-Type设置为PAP以获取明文密码。

相关问题