Cái YMSG protocol mà mình giới thiệu ở phần trước, từ mấy tháng nay đã không authenticating thành công tới server csc.msg.yahoo.com nữa, nhiều bạn thắc mắc điều này nhưng mình không có time để xem lại. Đợt này bỗng nhiên phong trào tìm hiểu ymsg lại lên cao, qua việc các bạn sv add nick hỏi mình rất nhiều, và cũng có dự án liên quan đến vấn đề này nên mình cũng tiếp tục soi xét cái ymsg này hehe.
Nguyên nhân đơn giản là Yahoo đã thay đổi hàm authentication, việc đơn giản nhất là ta chỉ cần đổi kết nối server tới cn.csc.msg.yahoo.com [do server này vẫn sử dụng thuật toán cũ]
Riêng với các đường kết nối qua đường httpweb (hầu như) vẫn không thay đổi,
Giới thiệu qua một vài cách Authenticate với các máy chủ Y!Messenger
- YMSG 16
Cách xác định một tài khoản đúng cùng với chuỗi Challenge String trả về được thực hiện bằng cách truy vấn url tới
https://login.yahoo.com/config/pwtoken_get?src=ymsgr&ts=&login=USERNAME&passwd=PASSWORD&chal=CHALLENGESTRING
Với các mã trả về (int)
- 0 : Thành công (Đúng ID & Pass)
- 1212: Không thành công (Sai ID || Pass)
[
100 - if username or password is missing.
1013 - username contains @yahoo.com or similar which needs removing.
1212 - is the username or password is incorrect.
1213 - is a security lock from to many failed login attempts
1214 - is a security lock
1218 - if the account has been deactivated by Yahoo
1235 - if the username does not exist.
1236 - locked due to to many login attempts
]
Kèm theo một chuỗi ymsgr=<OURTOKEN>
OURTOKEN chính là giá trị token mà máy chủ web trả về cho phiên giao dịch hiện tại, tiếp tục truy vấn đến:
https://login.yahoo.com/config/pwtoken_login?src=ymsgr&ts=&token=OURTOKEN
Ta sẽ nhận được 3 tham số quan trọng (nếu quá trình kết nối không bị lỗi)
- crumb=OURCRUMB Chính là một giá trị cần để hash kiểu YahooBase64()
- Y=MMM Cookie
- T= KKK Cookie
— Đây là một bước mà YMSG version 0×10(16) [Yahoo 9] sử dụng trong thuật toán đăng nhập.
Lưu ý các packet login đến server16 (vd: scs1.msg.yahoo.com) không được server này *lắng nghe*.
- Cách sử dụng Cookie giống như quá trình đăng nhập trên webbrowser.
Cách thức này đỡ phức tạp hơn rất nhiều vì không dùng trực tiếp các thuật toán phức tạp (miễn là phù hợp với những ràng buộc với cookie/ session thực hiện), rồi truy vấn tới server mailchat của yahoo webcs[xxx].msg.[xx].yahoo.com
(Tương tự như module chat bắt gặp được khi duyệt webmail của yahoo: http://mail.yahoo.com) – Khi ta login để check mail, đồng nghĩa với việc ta cũng được login vào dịch vụ chatmail (trên browser) – Sử dụng một HTTPRequest bất kỳ để lấy đúng cookie, tuy nhiên cách này hạn chế một số chức năng so với các cách khác (webcam, enviroment…).
- Sử dụng Yahoo API
Bắt chước Google/ facebook (có lẽ vậy) Yahoo cũng đã dành cho các developer các thư viện API để giao tiếp với dịch vụ !Messenger. Tuy nhiên mỗi ứng dụng của bạn đều phải đăng ký với Yahoo & phải dùng các mã chứng thực do họ cung cấp.
http://developer.yahoo.com/dotnet/
Và còn rất nhiều cách khác như: Qua hãng thứ 3, qua đường Wap (Wireless Application Protocol)
Trên đây là những cách Authenticate mà mình tổng hợp được, mong là sẽ tiếp tục trao đổi về các vấn đề này. Hy vọng sẽ có nội dung chi tiết về source-code ở các bài sau.
—-
The YMSG protocol that I introduced in the previous section, some months ago was not successful authenticating to server csc.msg.yahoo.com.
Simply cause Yahoo has changed their authentication function, the easiest way is navigation connect to server cn.csc.msg.yahoo.com [this server is still using the old algorithm]
Some connection via httpweb (almost) has not changed
Introduced through several ways Authenticate with server Y! Messenger
* YMSG 16
To detect true account after get the correct Challenge-String returns, take query to this url
https://login.yahoo.com/config/pwtoken_get?src=ymsgr&ts=&login=USERNAME&passwd=PASSWORD&chal=CHALLENGESTRING
With the return code (int)
- 0: Success (Correct ID & Pass)
- 1212: No successful (Wrong ID | | Pass)
…
Accompanied by a series ymsgr = <OURTOKEN>
OURTOKEN is the token value that the Web server returns as current session, to continue, query:
https://login.yahoo.com/config/pwtoken_login?src=ymsgr&ts=&token=OURTOKEN
We will get three important parameters (If connection is not faulty)
- Crumb = OURCRUMB This is a string value needs to hashed by YahooBase64 () function.
- Y = MMM Cookie
- T = KKK Cookie
- This is a step that YMSG version 0×10 (16) [Yahoo 9] algorithm used to login.
Note that any login packets push to server16 (eg scs1.msg.yahoo.com) is not *listened* by.
* Use cookie- like the way WebBrowser login.
Here is the simple way to login in, because it’s not used directly for complex algorithms (exemption is consistent with the binding to the cookie /session made), then query to yahoo mailchat server: webcs[xxx].msg.[xx].yahoo.com
(Similar to the chat module is encountered while browsing yahoo webmail: http://mail.yahoo.com) – When we login to check mail, means we are also logining to the service chatmail (at browser) — We can using any HttpRequest function to get a right cookie, but is limited by a number of IM’s functions compared to other (webcam, Environment …).
* Use Yahoo API
Mimic Google / facebook (maybe so) Yahoo also offers developers the API library to communicate with !Messenger service. However, each application must be registered with Yahoo and add authentication code provided by them.
http://developer.yahoo.com/dotnet/
And many other ways such as through a 3rd party, via WAP (Wireless Application Protocol)
Hopefully there will be more detail of content on source-code in my next articles.
Chào anh vietfov


em search gooogle đc 1 số bài viết rất hay về yahoo protocol này
em đang muốn nghiên cứu về vấn đề này
tuy nhiên các tài liệu trên mạng hơi ít + sơ sài
em mới làm việc đc trên PHP, em muốn tìm hiểu để viết đc 1 tool gửi Mess + Scan invisible
mà chưa biết làm thế nào
nếu có thể mong anh giúp em với
thanks anh