游子的博客
慈母手中线,游子身上衣, 临行密密缝,意恐迟迟归, 谁言寸草心,报得三春晖。 数据读取中,请稍候......
posts - 337,  comments - 546,  trackbacks - 0
共5页: 1 2 3 4 5 
收“游子”也能找到我的博客----但不在第一条
re: >算法的力量(李开复) 游子 2007-04-24 09:02
@野骆驼
数据挖掘对算法的要求比较高吧?
re: MSN、QQ、IG通吃 游子 2007-04-24 09:01
@inbest(许华军)
是啊,我现在也发现登录不了。
去年看到腾讯要推出WEB版QQ,这将是我们上班族的福音啊。
re: PSI解复用原理----转载 游子 2007-04-21 17:26
Table 2-29 -- Transport Stream program map section
Syntax No. of bits Mnemonic
TS_program_map_section() {
table_id 8 uimsbf
section_syntax_indicator 1 bslbf
'0' 1 bslbf
reserved 2 bslbf
section_length 12 uimsbf
program_number 16 uimsbf
reserved 2 bslbf
version_number 5 uimsbf
current_next_indicator 1 bslbf
section_number 8 uimsbf
last_section_number 8 uimsbf
reserved 3 bslbf
PCR_PID 13 uimsbf
reserved 4 bslbf
program_info_length 12 uimsbf
for (i=0; i<N; i++) {
descriptor()
}
for (i=0;i<N1;i++) {
stream_type 8 uimsbf
reserved 3 bslbf
elementary_PID 13 uimsnf
reserved 4 bslbf
ES_info_length 12 uimsbf
for (i=0; i<N2; i++) {
descriptor()
}
}
CRC_32 32 rpchof
}
不知道为什么,表中的字段都要2位,4位的紧凑在一起?单独用若干字节不是很方便吗?难道一定要这么节约?
@456
你没留下你的博客地址,怎么交换啊?
re: 从第一次拉手到结婚! 游子 2007-04-16 16:42
有意思。
真的不错。
不过没有讲在WINDOWS下,用TOMCAT的多域名服务器配置方法。
需要的可以到我的博客里找找:
re: Visual C++编程窃取QQ密码 游子 2007-04-14 13:38
牛人不少。
re: 100MB和100Mbps[未登录] 游子 2007-04-12 13:03
写得很好。
re: jsp+tomcat+mysql论坛 游子 2007-04-02 21:45
上传文件失败:是因为上传的目录不对,在file_upload.jsp中设置
下载文件失败:是因为下载的目录不对,在file_download.jsp中设置
re: 诺顿Ghost克隆参数应用 游子 2007-04-02 21:41
顶,这是个高效,也是高风险的操作。
re: 域名问题 游子 2007-04-02 11:38
我在想,能不能先让他用PPPOE拨号上网后,再改成静态IP来使用。不知道行不行?
re: 我是在挣扎吗 游子 2007-03-30 13:24
把游戏删除了,离开电脑!
re: 域名问题 游子 2007-03-30 12:28
@火狐
用花生壳可以解决一个域名的问题,另外的域名不在花生壳网站注册的,怎么办呢?
re: 笑话 游子 2007-03-24 17:04
你太有才了
re: 人这一辈子真难 游子 2007-03-24 17:02
你是男的女的?
也喜欢计算机?
有意思,
居然也叫青?
不知道青什么?
re: 人这一辈子真难 游子 2007-03-24 17:02
怎么你的日志都往右边去了?
re: 网上邻居经常无法访问 游子 2007-03-24 16:59
不太懂,
因为5046同学录而搜到了这里,哈哈。
re: EOC 游子 2007-03-18 23:47
@13312996323c@gmail.com
应该是思科研发的吧?不过我在网上看到许多厂商在卖。
你用百度搜索一下。
这是一个深圳的易物网:
http://www.sosoqu.com/szone.asp?username=liaoqs
我还有其它许多小东东,可以跟你交换,如:锅,市话通,雨伞,书等。
请到
http://www.comhuan.com/Products/Remarks.aspx?BartererID=261030
查询。

谢谢!
把你做的工具和源代码放上来嘛。
re: 告诉你怎么做网站 游子 2007-02-26 16:38
牛!
re: 当好老公的17条注意事项 游子 2007-02-26 16:35
为什么没有
当好老婆的18条注意事项?让女人们看看?
re: 网络故障诊断的原则 游子 2007-02-22 17:06
过年还这么勤奋?
看的人还不少!
呵呵。
re: 终于可以回深圳了 游子 2007-02-13 01:22
@happybear
呵呵,大年三十火车上有晚会的。
祝好运!
re: 各地月薪参考 游子 2007-02-12 11:55
前几天看了报到说,普通员工,深圳,上海,北京相差不大。
不过高管相差就大了,北京平均60万,深圳只有50万。
re: 转载----搜索引擎 游子 2007-02-12 11:52
@philonis
是啊,内容较少。
我研究了一阵子,写了一个蜘蛛,不过还没有完工。
没有时间:(
re: 年夜饭不知何菜 游子 2007-02-12 11:48
我做技术的,还好啦
不过我看我们公司销售部的,也不怎么喝酒的
好东东啊。
照单收下
re: C#实现木马程序! 游子 2007-01-12 22:50
可不可以把源代码做成附件放上来?
呵呵。
re: TCP Socket编程的几点问题 游子 2007-01-07 18:14
为什么windows要限制端口为5000以下?
端口为16位数,可以达到65535个的啊?
留下那些做何用?
好东东,等我有了扣肉2,我就装个VISTA.
re: 传输层安全协议详解 游子 2007-01-05 09:32
收下了。
re: 果然到了第10名 游子 2006-12-29 14:43
经过1个多月的努力,终于由第10上升到了第9,如今每提前一名都不容易啊。

积分与排名
积分 - 19636
排名 - 9

而最终由第2变成第1会需要多久呢?半年还是一年?抑或不可能?
re: ADSL远程盗号竟如此简单 游子 2006-12-29 14:02
知道这么多种方法了,可是我一种都不会:(
re: 漏洞分类及发掘讲座 游子 2006-12-29 13:51
牛人
3389是怎么用的?
请教。
@anfengmin
好象是这么回事。
另外,在同一局域网中也可以有同时存在多台DHCP服务器,让他们协同工作。
re: "神奇"的圣诞礼物 游子 2006-12-25 15:05
不明白你写什么?
很牛啊。
学习。
re: 临近前十? 游子 2006-12-22 12:31
无欲则刚。

因为我有欲,所以我不刚。
Introduction
MSN messenger is a well known program. It lets you communicate with other users through Instant Messaging. Some people like to write their own MSN messenger, so that they can make some own adjustments and cool features. I have written, together with another student, our own MSN client in C#. Recently Microsoft no longer supported protocols below MSNP 8. So I had to adjust our program to use MSNP9 (it used MSNP7).

With this little article I would like to explain how you can connect to MSN again with use of the MSNP9 protocol. Note this article only describes how you can get a valid TicketId. The rest of the connection is another part. If somebody is interested in that part, email me so that I post that information right here.

Generating a Client Ticket
There are two functions that I have used to write this. You can do this in one function. But the function GetLoginServerAddres() is actually an optional function, because the addresses do not change often. First we define some variables, to make it a bit easier. We could use a IDictionary here to get a Key Mapping. But the response is a static response so we could leave it like this.

public int DARREALM = 0;
public int DALOGIN = 1;
public int DAREG = 2;
public int PROPERTIES = 3;
public int GENERALDIR = 4;
public int HELP = 5;
public int CONFIGVERSION = 6;

public ArrayList PassportUrls;

Now we can start getting the ClientTicket.

First you call the function GetClientTicket() with 3 parameters, first the password, second a valid username and last a valid ChallengeString (you get a valid challengestring while connecting to a MSN server, after that you have to send a clienticket to a MSN server to get authenticated)

public string GetClientTicket(string Password, string Username,
string ChallengeString)

First thing that the function GetClientTicket() does is to call the GetLoginServerAdress() function.

This function does not need any parameters. Lets look at this function. First it connects to the nexus server.

HttpWebRequest ServerRequest = (HttpWebRequest)WebRequest.Create(
"https://nexus.passport.com/rdr/pprdr.asp");
HttpWebResponse ServerResponse = (HttpWebResponse)ServerRequest.GetResponse();

If all succeeds, the response will look like this

HTTP/1.1 200 OK \r\n
Server: Microsoft-IIS/5.0\r\n
Date: Mon, 28 Okt 2003 11:57:47 GMT\r\n
Connection: close\r\n
PassportURLs:
DARealm=Passport.Net,DALogin=login.passport.com/login2.srf,
DAReg=http://register.passport.net/uixpwiz.srf,
Properties=https://register.passport.net/editprof.srf,
Privacy=http://www.passport.com/consumer/privacypolicy.asp,
GeneralRedir=http://nexusrdr.passport.com/redir.asp,
Help=http://memberservices.passport.net/memberservice.srf,
ConfigVersion=11\r\n
Content-Length: 0\r\n
Content-Type: text/html\r\n
Cache-control: private\r\n
\r\n

If the result is OK

if (ServerResponse.StatusCode == HttpStatusCode.OK)

Then pick up the result

string retrieveddata = ServerResponse.Headers.ToString();
Get the line for PassportURLs and last split it and put it in the ArrayList

PassportUrls = new ArrayList();
string[] result = ServerResponse.Headers.Get("PassportURLs").Split(',');
foreach (string s in result)
{
// The actual adres is provided behind the '=' sign
PassportUrls.Add(s.Substring(s.IndexOf('=') + 1));
}

If the GetLoginServerAdress() is ready, return to the GetClientTicket()

Now we have a valid address on the DALOGIN position


string uri = "https://" + PassportUrls[DALOGIN];

HttpWebRequest ServerRequest;
HttpWebResponse ServerResponse;
try
{

The login can be redirected to another server. Because you can not predict the amount of attempts that you will need for login, so put this step in an endless loop.


while( true )
{

Make a new request, and set some properties. (protocol 1.0 works better that 1.1)

ServerRequest = (HttpWebRequest)HttpWebRequest.Create(uri);
ServerRequest.AllowAutoRedirect = false;
ServerRequest.Pipelined = false;
ServerRequest.KeepAlive = false;
ServerRequest.ProtocolVersion = new Version(1,0);

Build the authentication header, this will be sent to the TicketServer. And get the response.

ServerRequest.Headers.Add("Authorization",
"Passport1.4 OrgVerb=GET,OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom,sign-in="
+ Username.Replace("@", "%40") + ",pwd=" + Password + ","
+ ChallengeString + "\n");
ServerResponse = (HttpWebResponse)ServerRequest.GetResponse();

Know we look at the status-code of the response. If it is OK then we have to parse the Authentication-Info

if (ServerResponse.StatusCode == HttpStatusCode.OK)
{
// Pick up the information of the authentications
string AuthenticationInfo = ServerResponse.Headers.Get(
"Authentication-Info");
// Get the startposition of the ticket id (note it is between two quotes)
int startposition = AuthenticationInfo.IndexOf('\'');
// Get the endposition
int endposition = AuthenticationInfo.LastIndexOf('\'');
// Substract the startposition of the endposition
endposition = endposition - startposition ;

// Close connection
ServerResponse.Close();

// Generate a new substring and return it
return AuthenticationInfo.Substring(startposition + 1, endposition -1 );

}

Here is a OK response from the MSN server, in the Authentication-Info line you see between two quotes a valid clientticket (start from "from-PP=").

Collapse
HTTP/1.1 200 OK \r\n
Server: Microsoft-IIS/5.0\r\n
Date: Mon, 28 Okt 2003 11:57:49 GMT\r\n
PPServer: H: LAWPPIIS6B061\r\n
Connection: close\r\n
Content-Type: text/html\r\n
Expires: Mon, 02 Jun 2003 11:58:00 GMT\r\n
Cache-Control: no-cache\r\n
cachecontrol: no-store\r\n
Pragma: no-cache\r\n
P3P: CP="DSP CUR OTPi IND OTRi ONL FIN"\r\n
Set-Cookie:
MSPSec1= ; expires=Thu, 30-Oct-1980 16:00:00 GMT;
domain=.passport.com;path=/;HTTPOnly=;version=1 \r\n
Set-Cookie:
MSPSec=5Cdd1SshOELpwqafsSuYSiDEuEtP1PUaX99YOZca
oJP3vkIn7DXozt868I7eJNjcWG;
HTTPOnly= ; domain=.passport.com;path=/;secure=\r\n
Set-Cookie:
MSPAuth=5yDBU0BqvDa7UiY9W9nVEncRXCLD4gjLmtEr2XkunnafkOgdgG5x
*CEpqe7MyZEOir*EiA1PbwLKzqCGO671TeTQ$$;S
HTTPOnly= ; domain=.passport.com;path=/\r\n
Set-Cookie:
MSPProf=5a0mKE6PKDsxz!*4apQt0amnQOGLYqcCm78ie! MmHq0KnA
iIJM0z0Zajs8NL7ux7Ae0hnH5AAoB!zXIZ9
jTA2rcQttC*RKKRsc9k7JflwThB!H0Qa*6ipGcdj5co6taPir;
HTTPOnly= ; domain=.passport.com;path=/\r\n
Set-Cookie:
MSPVis=507;domain=.passport.com;path=/\r\n
Set-Cookie: MSPPre=esqkk@hotmail.com;
HTTPOnly= ; domain=.passport.com;path=/;
Expires=Wed, 30-Dec-2037 16:00:00 GMT \r\n
Set-Cookie: MSPShared= ;
HTTPOnly= ; domain=.passport.com;path=/;
Expires=Thu, 30-Oct-1980 16:00:00 GMT\r\n
Authentication-Info:
Passport1.4
da-status=success,tname=MSPAuth,tname=MSPProf,tname=MSPSec,
from-PP='t=53*1hAu8ADuD3TEwdXoOMi08sD*2!cMrntTw
VMTjoB3p6stWTqzbkKZPVQzA5NOt19SLI60PY!b8K4YhC!Ooo5ug$$&
p=5eKBBC!yBH6ex5mftp!a9DrSb0B3hU8aqAWpaPn07iCGBw5akemi
WSd7t2ot!okPvIR!Wqk
!MKvi1IMpxfhkao9wpxlMWYAZ!DqRfACmyQGG112Bp9xrk04!BVBUa9
*H9mJLoWw39m63YQRE1yHnYNv08nyz43D3OnMcaCoe
SaEHVM7LpR*LWDme29qq2X3j8N'
,ru=http://messenger.msn.com\r\n
Content-Length: 0\r\n
\r\n
If the statuscode is 302, then there is a redirect, read the new address and connect again (we are still in the while loop)
else if (ServerResponse.StatusCode == HttpStatusCode.Found)
{
uri = ServerResponse.Headers.Get("Location");
}

Here is a redirect response from the server. You see in the location part that there is a new login address.

HTTP/1.1 302 Found\r\n
Date: Mon, 28 Okt 2003 11:57:48 GMT\r\n
PPServer: H: LAWPPLOG5C006\r\n
Connection: close\r\n
Content-Type: text/html\r\n
Expires: Mon, 02 Jun 2003 11:57:32 GMT\r\n
Cache-Control: no-cache\r\n
cachecontrol: no-store\r\n
Pragma: no-cache\r\n
P3P: CP="DSP CUR OTPi IND OTRi ONL FIN"\r\n
Authentication-Info: Passport1.4 da-status=redir\r\n
Location: https://loginnet.passport.com/login2.srf?lc=1033\r\n
\r\n

A last we have some error handling. If your credentials where not correct you get a 401 error. Give back the error to the calling function so that the can warn the user for instance.

catch (WebException e)
{
if (e.Status == WebExceptionStatus.ProtocolError)
{
return "401";
}
else
{
return "0";
}
}

A last here is a 401 response. The official MSN client uses the "WWW-Authenticate" part to give back a nice error message.

Collapse
HTTP/1.1 401 Unauthorized\r\n
Server: Microsoft-IIS/5.0\r\n
Date: Mon, 28 Okt 2003 11:58.03 GMT\r\n
PPServer: H: LAWPPIIS6B077\r\n
Connection: close\r\n
Content-Type: text/html\r\n
Expires: Mon, 15 Sep 2003 07:57:14 GMT\r\n
Cache-Control: no-cache\r\n
cachecontrol: no-store\r\n
Pragma: no-cache\r\n
P3P: CP="DSP CUR OTPi IND OTRi ONL FIN"\r\n
PassportConfig: ConfigVersion=11\r\nWWW-Authenticate: Passport1.4
da-status=failed,srealm=Passport.NET,ts=-3,prompt,
cburl=http://www.passportimages.com/XPPassportLogo.gif,
cbtxt=Type%20your%20e-mail%20address%20and%20password
%20correctly.%20If%20you%20haven%E2%80%99t%20registered%20
with%20.NET%20Passport%2C%20click%20the%20Get%20a
%20.NET%20Passport%20link.\r\n
Content-Length: 390\r\n\r\n
Points of Interest
I noticed that this code won't work when you are trying to connect multiple times. I'm still finding what is causing the error. (I there is a delay in connecting another account it works quit well)

Conclusion
So now you have read this article you can make your own program that connects to the MSN server. I'm currently expanding our MSN client, maybe some day it will be freeware. If you want some more explanation or have some comments, Email me

About Paul Wijntjes (dominion99)

I am 24 year old student and live in the Netherlands. I have graduated in 2004, for the study Computer Science. After my study I have start working as a Technical Consultant in the Identity & Access management branch.

I have aquired my MCSE and MCSD certification. Currently I developing a lot of cool things in .NET & Java.

I am the main programmer for the tool that we are developing within our company. This tool lets users work with MIIS (Microsoft Identity Integration Server).

You can reach me at pwijntjes@home.nl



请看上一篇
MSN协议
共5页: 1 2 3 4 5 

欢迎大家扔鸡蛋!送鲜花!

博客可以收入过千吗?

<2007年1月>
日一二三四五六311234
567891011121314151617181920212223242526272829303112345678910

常用链接

留言簿(8)

随笔分类(314)

随笔档案(337)

文章分类(7)

文章档案(10)

相册

收藏夹(1)

其它

友情链接

数字电视

生活、旅游

自己的链接

计算机

搜索

  •  

积分与排名

  • 积分 - 404519
  • 排名 - 9

最新评论

阅读排行榜

评论排行榜