简单抓包分析:LDAP的MD5方式认证过程

客户端发送绑定请求程序员

图片描述

1.初始化认证阶段,客户端发送绑定请求算法

2.发送内容:服务器

  • 协议版本:3ui

  • 认证机制:sasl加密

  • 认证方式:md5spa

服务器响应绑定结果3d

图片描述

1.服务器返回一段由16进制加密的内容serverSaslCredsserver

2.the server requires the client to send a new bind request, with the same sasl mechanism, to continue the authentication process图片

3.解码后的内容以下:ip

  • 服务器支持的摘要认证的qop:auth,auth-int,auth-conf(可用在下文中客户端发送的response加密)

  • 服务器支持的加密方式cipher:3des,rc4

  • 服务器支持的加密算法algorithm:md5-sess

  • 服务器的验证时间戳nonce:一串随机数,用于防护 Replay attack(回放攻击)和 Chosen-plaintext attacks(选择明文攻击)

  • Charset字符格式:utf-8

  • Realm:xxx.com

客户端发送response,请求查询欲绑定的用户是否存在

图片描述
1.客户端返回一段由16进制加密的内容credentials

2.发送内容:

  • 请求查询的用户登陆名:test6

  • 查询的整个域realm:xxx.com

  • 服务端发来的nonce

  • 客户端的验证时间戳cnonce:客户端随机数,用于对称校验

  • 客户端发送的请求次数cn:00000001(表示只会发送一次请求)

  • 客户端要求使用的qop:auth-conf

  • 客户端要求使用的加密方式:rc4

  • 客户端支持的最大字节流长度:16777215

  • 本次请求的资源位置digest-uri

  • 最终的摘要response:是根据以上信息和密码,经过必定的规律计算出的一个md5码,规律由程序员自定

服务器返回查询结果

1.服务器会返回查询结果

2.绑定成功的结果图:

图片描述

3.解码后的内容以下:

图片描述

4.发送内容:

Rspauth(迷之数值)

5.绑定失败结果图

图片描述

6.发送内容:

  • 错误消息errorMessage

  • 8009030C: LdapErr: DSID-0C0904D1, comment: AcceptSecurityContext error, data 52e, v1772