模拟实现msn登陆过程(MSNP15)

本文详细介绍了模拟实现MSN登陆过程,包括与DS服务器的交互,获取ticket和BinarySecret,以及后续与NS服务器的通信,登录认证和验证请求的处理。涉及到的关键步骤包括VER、CVR、USR指令的使用,并提供了BinarySecret和Nonce生成算法的链接。
摘要由CSDN通过智能技术生成

这几天了解了一下msn协议的登陆部分,凑了几段代码实现了,有资料的话没什么难度,主要是了解一下相关的过程和机制。下面模拟的是msn 8.5.1238 版本(实际上就是抓包然后填到程序里)

废话少说,直接开始吧(细节不说了,自己补课)

首先登陆DS服务器:messenger.hotmail.com:1863

VER 1 MSNP15 MSNP14 MSNP13 CVR0
VER 1 MSNP15 MSNP14 MSNP13 CVR0
CVR 2 0x0804 winnt 5.1 i386 MSG80BETA 8.5.1238 msmsgs test@hotmail.com
USR 3 SSO I test@hotmail.com
CVR 2 8.1.0178 8.1.0178 8.1.0178 http://msgruser.dlservice.microsoft.com/download/B/D/3/BD343317-2DBF-48FE-8BD9-9E3212D65E6A/Install_Messenger.exe http://get.live.com/cn
XFR 3 NS 207.46.108.67:1863 U D

获得NS服务器的地址:207.46.108.67:1863,后面要用;使用https进行Passport的验证过程,获得登陆必需的ticket和BinarySecret。msnp15采用了SSO的方式进行认证。SSO,Single Sign-On,我的理解就是一次验证便可获取对应不同服务的ticket。访问https://login.live.com/RST.srf,并且POST下列xml内容
 
 
<? xml version="1.0" encoding="UTF-8"  ?>  
< Envelope  xmlns ="http://schemas.xmlsoap.org/soap/envelope/"  xmlns:wsse ="http://schemas.xmlsoap.org/ws/2003/06/secext"  xmlns:saml ="urn:oasis:names:tc:SAML:1.0:assertion"  xmlns:wsp ="http://schemas.xmlsoap.org/ws/2002/12/policy"  xmlns:wsu ="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"  xmlns:wsa ="http://schemas.xmlsoap.org/ws/2004/03/addressing"  xmlns:wssc ="http://schemas.xmlsoap.org/ws/2004/04/sc"  xmlns:wst ="http://schemas.xmlsoap.org/ws/2004/04/trust" >
< Header >
< ps:AuthInfo  xmlns:ps ="http://schemas.microsoft.com/Passport/SoapServices/PPCRL"  Id ="PPAuthInfo" >
  
< ps:HostingApp > {7108E71A-9926-4FCB-BCC9-9A9D3F32E423} </ ps:HostingApp >  
  
< ps:BinaryVersion > 4 </ ps:BinaryVersion >  
  
< ps:UIVersion > 1 </ ps:UIVersion >  
  
< ps:Cookies  />  
  
< ps:RequestParams > AQAAAAIAAABsYwQAAAAyMDUy </ ps:RequestParams >  
  
</ ps:AuthInfo >
< wsse:Security >
< wsse:UsernameToken  Id ="user" >
  
< wsse:Username > test@hotmail.com </ wsse:Username >  
  
< wsse:Password > test </ wsse:Password >  
  
</ wsse:UsernameToken >
  
</ wsse:Security >
  
</ Header >
< Body >
< ps:RequestMultipleSecurityTokens  xmlns:ps ="http://schemas.microsoft.com/Passport/SoapServices/PPCRL"  Id ="RSTS" >
< wst:RequestSecurityToken  Id ="RST0" >
  
< wst:RequestType > http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue </ wst:RequestType >  
< wsp:AppliesTo >
< wsa:EndpointReference >
  
< wsa:Address > http://Passport.NET/tb </ wsa:Address >  
  
</ wsa:EndpointReference >
  
</ wsp:AppliesTo >
  
</ wst:RequestSecurityToken >
< wst:RequestSecurityToken  Id ="RST1" >
  
< wst:RequestType > http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue </ wst:RequestType >  
< wsp:AppliesTo >
< wsa:EndpointReference >
  
< wsa:Address > messengerclear.live.com </ wsa:Address >  
  
</ wsa:EndpointReference >
  
</ wsp:AppliesTo >
  
< wsse:PolicyReference  URI ="MBI_KEY_OLD"   />  
  
</ wst:RequestSecurityToken >
< wst:RequestSecurityToken  Id ="RST2" >
  
< wst:RequestType > http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue </ wst:RequestType >  
< wsp:AppliesTo >
< wsa:EndpointReference >
  
< wsa:Address > messenger.msn.com </ wsa:Address >  
  
</ wsa:EndpointReference >
  
</ wsp:AppliesTo >
  
< wsse:PolicyReference  URI ="?id=507"   />  
  
</ wst:RequestSecurityToken >
< wst:RequestSecurityToken  Id ="RST3" >
  
< wst:RequestType > http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue </ wst:RequestType >  
< wsp:AppliesTo >
< wsa:EndpointReference >
  
< wsa:Address > contacts.msn.com </ wsa:Address >  
  
</ wsa:EndpointReference >
  
</ wsp:AppliesTo >
  
< wsse:PolicyReference  URI ="MBI"   />  
  
</ wst:RequestSecurityToken >
< wst:RequestSecurityToken  Id ="RST4" >
  
< wst:RequestType > http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue </ wst:RequestType >  
< wsp:AppliesTo >
< wsa:EndpointReference >
  
< wsa:Address > messengersecure.live.com </ wsa:Address >  
  
</ wsa:EndpointReference >
  
</ wsp:AppliesTo >
  
< wsse:PolicyReference  URI ="MBI_SSL"   />  
  
</ wst:RequestSecurityToken >
< wst:RequestSecurityToken  Id ="RST5" >
  
< wst:RequestType > http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue </ wst:RequestType >  
< wsp:AppliesTo >
< wsa:EndpointReference >
  
< wsa:Address > spaces.live.com </ wsa:Address >  
  
</ wsa:EndpointReference >
  
</ wsp:AppliesTo >
  
< wsse:PolicyReference  URI ="MBI"   />  
  
</ wst:RequestSecurityToken >
< wst:RequestSecurityToken  Id ="RST6" >
  
< wst:RequestType > http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue </ wst:RequestType >  
< wsp:AppliesTo >
< wsa:EndpointReference >
  
< wsa:Address > storage.msn.com </ wsa:Address >  
  
</ wsa:EndpointReference >
  
</ wsp:AppliesTo >
  
< wsse:PolicyReference  URI ="MBI"   />  
  
</ wst:RequestSecurityToken >
  
</ ps:RequestMultipleSecurityTokens >
  
</ Body >
  
</ Envelope >
  注意其中的 
< wst:RequestSecurityToken  Id ="RST#" >
  
< wst:RequestType > http://schemas.xmlsoap.org/... </ wst:RequestType
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值